1 /* |
1 /* |
2 * Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2005-2009 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> |
|
24 #include "acmserverclient.h" |
23 #include "acmserverclient.h" |
25 #include "acmserverconsts.h" |
24 #include "acmserverconsts.h" |
26 #include "OstTraceDefinitions.h" |
25 #include <usb/usblogger.h> |
27 #ifdef OST_TRACE_COMPILER_IN_USE |
26 #include <usb/acmserver.h> |
28 #include "acmserverclientTraces.h" |
27 |
|
28 #ifdef __FLOG_ACTIVE |
|
29 _LIT8(KLogComponent, "ACMSVRCLI"); |
29 #endif |
30 #endif |
30 |
31 |
31 /** Constructor */ |
32 /** Constructor */ |
32 RAcmServerClient::RAcmServerClient() |
33 RAcmServerClient::RAcmServerClient() |
33 { |
34 { |
34 OstTraceFunctionEntry0( RACMSERVERCLIENT_RACMSERVERCLIENT_CONS_ENTRY ); |
35 LOG_FUNC |
35 |
|
36 OstTraceFunctionExit0( RACMSERVERCLIENT_RACMSERVERCLIENT_CONS_EXIT ); |
|
37 } |
36 } |
38 |
37 |
39 /** Destructor */ |
38 /** Destructor */ |
40 RAcmServerClient::~RAcmServerClient() |
39 RAcmServerClient::~RAcmServerClient() |
41 { |
40 { |
42 OstTraceFunctionEntry0( RACMSERVERCLIENT_RACMSERVERCLIENT_DES_ENTRY); |
41 LOG_FUNC |
43 |
|
44 OstTraceFunctionExit0( RACMSERVERCLIENT_RACMSERVERCLIENT_ENTRY_DES_EXIT ); |
|
45 } |
42 } |
46 |
43 |
47 /** |
44 /** |
48 Getter for the version of the server. |
45 Getter for the version of the server. |
49 @return Version of the server |
46 @return Version of the server |
50 */ |
47 */ |
51 TVersion RAcmServerClient::Version() const |
48 TVersion RAcmServerClient::Version() const |
52 { |
49 { |
53 OstTraceFunctionEntry0( RACMSERVERCLIENT_VERSION_ENTRY ); |
50 LOG_FUNC |
54 |
|
55 |
51 |
56 return TVersion( KAcmSrvMajorVersionNumber, |
52 return TVersion( KAcmSrvMajorVersionNumber, |
57 KAcmSrvMinorVersionNumber, |
53 KAcmSrvMinorVersionNumber, |
58 KAcmSrvBuildNumber |
54 KAcmSrvBuildNumber |
59 ); |
55 ); |
64 Must be called before all other methods (except Version and Close). |
60 Must be called before all other methods (except Version and Close). |
65 @return Symbian error code |
61 @return Symbian error code |
66 */ |
62 */ |
67 TInt RAcmServerClient::Connect() |
63 TInt RAcmServerClient::Connect() |
68 { |
64 { |
69 OstTraceFunctionEntry0( RACMSERVERCLIENT_CONNECT_ENTRY ); |
65 LOG_FUNC |
70 |
|
71 |
66 |
72 return CreateSession(KAcmServerName, Version(), 1); |
67 return CreateSession(KAcmServerName, Version(), 1); |
73 } |
68 } |
74 |
69 |
75 TInt RAcmServerClient::CreateFunctions(const TUint aNoAcms, const TUint8 aProtocolNum, const TDesC& aAcmControlIfcName, const TDesC& aAcmDataIfcName) |
70 TInt RAcmServerClient::CreateFunctions(const TUint aNoAcms, const TUint8 aProtocolNum, const TDesC& aAcmControlIfcName, const TDesC& aAcmDataIfcName) |
76 { |
71 { |
77 OstTraceFunctionEntry0( RACMSERVERCLIENT_CREATEFUNCTIONS_ENTRY ); |
72 LOG_FUNC |
78 OstTraceExt4( TRACE_NORMAL, RACMSERVERCLIENT_CREATEFUNCTIONS, "RAcmServerClient::CreateFunctions;aNoAcms=%d;aProtocolNum=%d;aAcmControlIfcName=%S;aAcmDataIfcName=%S", aNoAcms, aProtocolNum, aAcmControlIfcName, aAcmDataIfcName ); |
73 LOGTEXT5(_L("\taNoAcms = %d, aProtocolNum = %d, Control Ifc Name = %S, Data Ifc Name = %S"), |
79 |
74 aNoAcms, aProtocolNum, &aAcmControlIfcName, &aAcmDataIfcName); |
|
75 |
80 TIpcArgs args; |
76 TIpcArgs args; |
81 args.Set(0, aNoAcms); |
77 args.Set(0, aNoAcms); |
82 args.Set(1, aProtocolNum); |
78 args.Set(1, aProtocolNum); |
83 args.Set(2, &aAcmControlIfcName); |
79 args.Set(2, &aAcmControlIfcName); |
84 args.Set(3, &aAcmDataIfcName); |
80 args.Set(3, &aAcmDataIfcName); |
85 return SendReceive(EAcmCreateAcmFunctions, args); |
81 return SendReceive(EAcmCreateAcmFunctions, args); |
86 } |
82 } |
87 |
83 |
88 TInt RAcmServerClient::DestroyFunctions(const TUint aNoAcms) |
84 TInt RAcmServerClient::DestroyFunctions(const TUint aNoAcms) |
89 { |
85 { |
90 OstTraceFunctionEntry0( RACMSERVERCLIENT_DESTROYFUNCTIONS_ENTRY ); |
86 LOG_FUNC |
91 OstTrace1( TRACE_NORMAL, RACMSERVERCLIENT_DESTROYFUNCTIONS, "RAcmServerClient::DestroyFunctions;aNoAcms=%d", aNoAcms ); |
87 LOGTEXT2(_L8("\taNoAcms = %d"), aNoAcms); |
|
88 |
92 return SendReceive(EAcmDestroyAcmFunctions, TIpcArgs(aNoAcms)); |
89 return SendReceive(EAcmDestroyAcmFunctions, TIpcArgs(aNoAcms)); |
93 } |
90 } |