1 /* |
|
2 * Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: obexservicemanager client class definition |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef OBEXSMCLIENT_H |
|
20 #define OBEXSMCLIENT_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32std.h> |
|
24 #include <locodbearer.h> |
|
25 #include "usbobex.h" |
|
26 |
|
27 /// server name |
|
28 _LIT(KSrcsName,"obexserviceman"); |
|
29 |
|
30 // Server path |
|
31 |
|
32 _LIT(KSrcsImg,"z:\\sys\\bin\\obexserviceman.exe"); |
|
33 |
|
34 // A version must be specifyed when creating a session with the server |
|
35 const TUint KSrcsMajorVersionNumber=1; |
|
36 const TUint KSrcsMinorVersionNumber=0; |
|
37 const TUint KSrcsBuildVersionNumber=1; |
|
38 |
|
39 // SRCS Server Uid |
|
40 const TUid KSrcsUid={0x101F7C87}; |
|
41 |
|
42 // Opcodes used in message passing between client and server |
|
43 enum TSrcsServRequest |
|
44 { |
|
45 ESrcsBTServicesON, |
|
46 ESrcsBTServicesOFF, |
|
47 ESrcsStartUSB, |
|
48 ESrcsStopUSB, |
|
49 ESrcsIrDAServicesON, |
|
50 ESrcsIrDAServicesOFF, |
|
51 ESrcsCancelRequest |
|
52 }; |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 /** |
|
58 * Client side thread starting function |
|
59 * Start the server when client tries to contact it if it is not allready running |
|
60 */ |
|
61 TInt StartThread(); |
|
62 |
|
63 /** |
|
64 * The client class. An RSessionBase sends messages to the server with the function |
|
65 * RSessionBase::SendReceive(); specifying an opcode and and array of argument pointers. |
|
66 * Functions in derived classes, such as RSrcs::InitialiseServices(), are wrappers for different calls to |
|
67 * SendReceive(). |
|
68 */ |
|
69 NONSHARABLE_CLASS (RObexSMServer): public RSessionBase |
|
70 { |
|
71 public: // Constructor |
|
72 |
|
73 /** |
|
74 * C++ default constructor. |
|
75 */ |
|
76 RObexSMServer(); |
|
77 |
|
78 public: |
|
79 |
|
80 /** |
|
81 * Turns BT services ON/OFF depending on given parameter. |
|
82 * |
|
83 * @since S60 v3.2 |
|
84 * @param TBool aState Boolean value to toggle services. |
|
85 * @return TInt indicating the success of call. |
|
86 */ |
|
87 TInt ManageServices(TLocodBearer aBearer, TBool aBearStatus,TRequestStatus &aStatus ); |
|
88 |
|
89 |
|
90 public: // Functions from base classes |
|
91 |
|
92 /** |
|
93 * From RSessionBase informs current version |
|
94 * |
|
95 * @since S60 v3.2 |
|
96 * @return Version information about the server |
|
97 */ |
|
98 TVersion Version() const; |
|
99 |
|
100 /** |
|
101 * From RSessionBase connect to the server |
|
102 * |
|
103 * @since S60 v3.2 |
|
104 */ |
|
105 TInt Connect(); |
|
106 |
|
107 /** |
|
108 * Cancel pending request |
|
109 * |
|
110 * @since S60 v3.2 |
|
111 */ |
|
112 void CancelRequest(); |
|
113 |
|
114 |
|
115 private: // Data |
|
116 |
|
117 RProcess iProses; |
|
118 }; |
|
119 |
|
120 |
|
121 #endif // OBEXSMCLIENT_H |
|