|
1 /* |
|
2 * Copyright (c) 2006 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: BTEng server header definition |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef BTENGCLIENT_H |
|
21 #define BTENGCLIENT_H |
|
22 |
|
23 |
|
24 #include <bt_sock.h> |
|
25 |
|
26 #include "btengdomaincrkeys.h" |
|
27 #include "btengclientserver.h" |
|
28 #include "btengconstants.h" |
|
29 |
|
30 |
|
31 /** |
|
32 * Class RBTEng |
|
33 * |
|
34 * ?more_complete_description |
|
35 * |
|
36 * @lib bteng*.lib |
|
37 * @since S60 v3.2 |
|
38 */ |
|
39 NONSHARABLE_CLASS( RBTEng ) : public RSessionBase |
|
40 { |
|
41 |
|
42 public: |
|
43 |
|
44 /** |
|
45 * Constructor. |
|
46 * |
|
47 * @since S60 v3.2 |
|
48 */ |
|
49 RBTEng(); |
|
50 |
|
51 /** |
|
52 * ?description |
|
53 * |
|
54 * @since S60 v3.2 |
|
55 */ |
|
56 TInt Connect(); |
|
57 |
|
58 /** |
|
59 * Get the version information about the client. |
|
60 * |
|
61 * @since S60 v3.2 |
|
62 * @return ?description |
|
63 */ |
|
64 TVersion Version(); |
|
65 |
|
66 /** |
|
67 * Set Bluetooth power state. |
|
68 * |
|
69 * @since S60 v3.2 |
|
70 * @param aState The new power state. |
|
71 * @param aTemp Turn BT off after use (ETrue) or not (EFalse). |
|
72 * @return ?description |
|
73 */ |
|
74 TInt SetPowerState( const TBTPowerStateValue aState, const TBool aTemp ); |
|
75 |
|
76 /** |
|
77 * Set Bluetooth power state. |
|
78 * |
|
79 * @since S60 v3.2 |
|
80 * @param ?arg1 ?description |
|
81 * @return ?description |
|
82 */ |
|
83 TInt SetVisibilityMode( const TBTVisibilityMode aMode, const TInt aTime ); |
|
84 |
|
85 /** |
|
86 * ?description |
|
87 * |
|
88 * @since S60 v3.2 |
|
89 * @param aAddr ?description |
|
90 * @return ?description |
|
91 */ |
|
92 TInt ConnectDevice( const TBTDevAddr& aAddr, |
|
93 const TBTDeviceClass& aDeviceClass ); |
|
94 |
|
95 /** |
|
96 * ?description |
|
97 * |
|
98 * @since S60 v3.2 |
|
99 * @param aAddr ?description |
|
100 * @return ?description |
|
101 */ |
|
102 TInt CancelConnectDevice( const TBTDevAddr& aAddr ); |
|
103 |
|
104 /** |
|
105 * ?description |
|
106 * |
|
107 * @since S60 v3.2 |
|
108 * @param aAddr ?description |
|
109 * @return ?description |
|
110 */ |
|
111 TInt DisconnectDevice( const TBTDevAddr& aAddr, TBTDisconnectType aDiscType ); |
|
112 |
|
113 /** |
|
114 * ?description |
|
115 * |
|
116 * @since S60 v3.2 |
|
117 * @param aAddr ?description |
|
118 * @param ?arg2 ?description |
|
119 * @return ?description |
|
120 */ |
|
121 TInt IsDeviceConnected( const TBTDevAddr& aAddr, |
|
122 TBTEngConnectionStatus& aConnected ); |
|
123 |
|
124 /** |
|
125 * ?description |
|
126 * |
|
127 * @since S60 v5.1 |
|
128 * @param aAddr ?description |
|
129 * @param ?arg2 ?description |
|
130 * @return ?description |
|
131 */ |
|
132 TInt IsDeviceConnectable( const TBTDevAddr& aAddr, |
|
133 const TBTDeviceClass& aDeviceClass, TBool& aConnectable ); |
|
134 |
|
135 /** |
|
136 * ?description |
|
137 * |
|
138 * @since S60 v3.2 |
|
139 * @param aAddr ?description |
|
140 * @return ?description |
|
141 */ |
|
142 TInt GetConnectedAddresses( TDes8& aArrayPkg, TBTEngParamPkg& aProfilePkg ); |
|
143 |
|
144 /** |
|
145 * ?description |
|
146 * |
|
147 * @since S60 v3.2 |
|
148 * @param aEvent ?description |
|
149 * @return ?description |
|
150 */ |
|
151 TInt NotifyConnectionEvents( TDes8& aEvent, TRequestStatus& aStatus ); |
|
152 |
|
153 /** |
|
154 * ?description |
|
155 * |
|
156 * @since S60 v3.2 |
|
157 * @param aEvent ?description |
|
158 * @return ?description |
|
159 */ |
|
160 TInt CancelNotifyConnectionEvents(); |
|
161 |
|
162 /** |
|
163 * Set a pairing observer in BTEngine. |
|
164 * |
|
165 * @since S60 v3.2 |
|
166 * @param aAddr The address of the remote device that is being paired. |
|
167 * @param aActivate If ETrue, the observer will be activated, otherwise |
|
168 * the observer will be removed. |
|
169 * @return KErrNone on success, otherwise a system-wide error code. |
|
170 */ |
|
171 TInt SetPairingObserver( const TBTDevAddr& aAddr, TBool aActivate ); |
|
172 |
|
173 /** |
|
174 * ?description |
|
175 * |
|
176 * @since S60 v3.2 |
|
177 * @return ?description |
|
178 */ |
|
179 TInt PrepareDiscovery(); |
|
180 |
|
181 /** |
|
182 * Pair a device. |
|
183 * @param aAddr The address of the remote device to be paired. |
|
184 * @param aDeviceClass the CoD of the device to be paired. |
|
185 * @param aStatus contains the pair result at request completion. |
|
186 */ |
|
187 void PairDevice( const TBTDevAddrPckgBuf& aAddr, |
|
188 const TUint32& aDeviceClass, |
|
189 TRequestStatus& aStatus ); |
|
190 |
|
191 /** |
|
192 * Cancels an outstanding pair request |
|
193 */ |
|
194 void CancelPairDevice(); |
|
195 |
|
196 }; |
|
197 |
|
198 |
|
199 #endif // BTENGCLIENT_H |