usbmgmt/usbmgr/device/classdrivers/acm/classimplementation/acmserver/src/acmserverclient.cpp
changeset 29 59aa7d6e3e0f
parent 0 c9bc50fca66e
child 43 012cc2ee6408
equal deleted inserted replaced
28:f1fd07aa74c9 29:59aa7d6e3e0f
     1 /*
     1 /*
     2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    18 /**
    18 /**
    19  @file
    19  @file
    20 */
    20 */
    21 
    21 
    22 #include <e32base.h>
    22 #include <e32base.h>
       
    23 #include <usb/acmserver.h>
    23 #include "acmserverclient.h"
    24 #include "acmserverclient.h"
    24 #include "acmserverconsts.h"
    25 #include "acmserverconsts.h"
    25 #include <usb/usblogger.h>
    26 #include "OstTraceDefinitions.h"
    26 #include <usb/acmserver.h>
    27 #ifdef OST_TRACE_COMPILER_IN_USE
    27 
    28 #include "acmserverclientTraces.h"
    28 #ifdef __FLOG_ACTIVE
       
    29 _LIT8(KLogComponent, "ACMSVRCLI");
       
    30 #endif
    29 #endif
    31 
    30 
    32 /** Constructor */
    31 /** Constructor */
    33 RAcmServerClient::RAcmServerClient() 
    32 RAcmServerClient::RAcmServerClient() 
    34 	{
    33 	{
    35 	LOG_FUNC
    34 	OstTraceFunctionEntry0( RACMSERVERCLIENT_RACMSERVERCLIENT_CONS_ENTRY );
       
    35 	
       
    36 	OstTraceFunctionExit0( RACMSERVERCLIENT_RACMSERVERCLIENT_CONS_EXIT );
    36 	}
    37 	}
    37 	   
    38 	   
    38 /** Destructor */
    39 /** Destructor */
    39 RAcmServerClient::~RAcmServerClient()
    40 RAcmServerClient::~RAcmServerClient()
    40 	{
    41 	{
    41 	LOG_FUNC
    42 	OstTraceFunctionEntry0( RACMSERVERCLIENT_RACMSERVERCLIENT_DES_ENTRY);
       
    43 	
       
    44 	OstTraceFunctionExit0( RACMSERVERCLIENT_RACMSERVERCLIENT_ENTRY_DES_EXIT );
    42 	}
    45 	}
    43 
    46 
    44 /**
    47 /**
    45 Getter for the version of the server.
    48 Getter for the version of the server.
    46 @return Version of the server
    49 @return Version of the server
    47 */
    50 */
    48 TVersion RAcmServerClient::Version() const
    51 TVersion RAcmServerClient::Version() const
    49 	{
    52 	{
    50 	LOG_FUNC
    53 	OstTraceFunctionEntry0( RACMSERVERCLIENT_VERSION_ENTRY );
       
    54 	
    51 
    55 
    52 	return TVersion(	KAcmSrvMajorVersionNumber,
    56 	return TVersion(	KAcmSrvMajorVersionNumber,
    53 						KAcmSrvMinorVersionNumber,
    57 						KAcmSrvMinorVersionNumber,
    54 						KAcmSrvBuildNumber
    58 						KAcmSrvBuildNumber
    55 					);
    59 					);
    60 Must be called before all other methods (except Version and Close).
    64 Must be called before all other methods (except Version and Close).
    61 @return Symbian error code
    65 @return Symbian error code
    62 */
    66 */
    63 TInt RAcmServerClient::Connect()
    67 TInt RAcmServerClient::Connect()
    64 	{
    68 	{
    65 	LOG_FUNC
    69 	OstTraceFunctionEntry0( RACMSERVERCLIENT_CONNECT_ENTRY );
       
    70 	
    66 
    71 
    67 	return CreateSession(KAcmServerName, Version(), 1);
    72 	return CreateSession(KAcmServerName, Version(), 1);
    68 	}
    73 	}
    69 
    74 
    70 TInt RAcmServerClient::CreateFunctions(const TUint aNoAcms, const TUint8 aProtocolNum, const TDesC& aAcmControlIfcName, const TDesC& aAcmDataIfcName)
    75 TInt RAcmServerClient::CreateFunctions(const TUint aNoAcms, const TUint8 aProtocolNum, const TDesC& aAcmControlIfcName, const TDesC& aAcmDataIfcName)
    71 	{
    76 	{
    72 	LOG_FUNC
    77 	OstTraceFunctionEntry0( RACMSERVERCLIENT_CREATEFUNCTIONS_ENTRY );
    73 	LOGTEXT5(_L("\taNoAcms = %d, aProtocolNum = %d, Control Ifc Name = %S, Data Ifc Name = %S"),
    78 	OstTraceExt4( TRACE_NORMAL, RACMSERVERCLIENT_CREATEFUNCTIONS, "RAcmServerClient::CreateFunctions;aNoAcms=%d;aProtocolNum=%d;aAcmControlIfcName=%S;aAcmDataIfcName=%S", aNoAcms, aProtocolNum, aAcmControlIfcName, aAcmDataIfcName );
    74 			aNoAcms, aProtocolNum, &aAcmControlIfcName, &aAcmDataIfcName);
    79 	
    75 
       
    76 	TIpcArgs args;
    80 	TIpcArgs args;
    77 	args.Set(0, aNoAcms);
    81 	args.Set(0, aNoAcms);
    78 	args.Set(1, aProtocolNum);
    82 	args.Set(1, aProtocolNum);
    79 	args.Set(2, &aAcmControlIfcName);
    83 	args.Set(2, &aAcmControlIfcName);
    80 	args.Set(3, &aAcmDataIfcName);
    84 	args.Set(3, &aAcmDataIfcName);
    81 	return SendReceive(EAcmCreateAcmFunctions, args);
    85 	return SendReceive(EAcmCreateAcmFunctions, args);
    82 	}
    86 	}
    83 
    87 
    84 TInt RAcmServerClient::DestroyFunctions(const TUint aNoAcms)
    88 TInt RAcmServerClient::DestroyFunctions(const TUint aNoAcms)
    85 	{
    89 	{
    86 	LOG_FUNC
    90 	OstTraceFunctionEntry0( RACMSERVERCLIENT_DESTROYFUNCTIONS_ENTRY );
    87 	LOGTEXT2(_L8("\taNoAcms = %d"), aNoAcms);
    91 	OstTrace1( TRACE_NORMAL, RACMSERVERCLIENT_DESTROYFUNCTIONS, "RAcmServerClient::DestroyFunctions;aNoAcms=%d", aNoAcms );
    88 
       
    89 	return SendReceive(EAcmDestroyAcmFunctions, TIpcArgs(aNoAcms));
    92 	return SendReceive(EAcmDestroyAcmFunctions, TIpcArgs(aNoAcms));
    90 	}
    93 	}