|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @publishedPartner |
|
19 @released |
|
20 */ |
|
21 |
|
22 #ifndef PHYSICALLINKSSTATE_H |
|
23 #define PHYSICALLINKSSTATE_H |
|
24 |
|
25 #include <e32cmn.h> |
|
26 #include <bttypes.h> |
|
27 #include <bluetooth/hci/hcitypes.h> |
|
28 |
|
29 class TBTBasebandLinkState; |
|
30 class TBTFeatures; |
|
31 class TLinkPolicy; |
|
32 class TBTDevAddr; |
|
33 class TBTDeviceClass; |
|
34 |
|
35 typedef RArray<THCIConnHandle> RHCIConnHandleArray; |
|
36 |
|
37 class MPhysicalLinksState |
|
38 /** An implementation of this interface would present a snapshot of |
|
39 the current Physical, Asynchronous and Synchronous links |
|
40 associated with a Bluetooth device. |
|
41 |
|
42 It also provides information appertaining to a remote device at |
|
43 the other end of a physical link. |
|
44 |
|
45 It should be noted that the returned data are a snapshot of the |
|
46 current links associated with a Bluetooth device. They may become |
|
47 stale very quickly. |
|
48 |
|
49 Mixin class to be used as an interface to the stack. |
|
50 */ |
|
51 { |
|
52 public: |
|
53 /**Returns a list of 'connected' connection handles for all links |
|
54 of the specified type. Pending connection handles are not |
|
55 returned by this method. |
|
56 |
|
57 The returned data are a snapshot and will grow stale. They |
|
58 should therefore be used immediately (in the same call stack) |
|
59 or not at all. It would be wise to check whether the returned |
|
60 links are still connected. |
|
61 |
|
62 @see TInt BasebandLinkState(TBTBasebandLinkState& |
|
63 aBasebandLinkState, const TBTDevAddr& aBDAddr); |
|
64 |
|
65 @param aConnectionHandles A client supplied dynamic array that, |
|
66 on successful completion of this operation, will be populated |
|
67 with the requested connection handles. |
|
68 |
|
69 @param aLinkType Indicates the type of link handles to be |
|
70 returned. |
|
71 |
|
72 @return Status code. |
|
73 */ |
|
74 virtual TInt MplsGetConnectionHandles(RHCIConnHandleArray& aConnectionHandles, |
|
75 TLinkType aLinkType) const = 0; |
|
76 |
|
77 /**Returns the number of 'pending' connection handles for all |
|
78 links of the specified type. |
|
79 |
|
80 The returned data are a snapshot and will grow stale. They |
|
81 should therefore be used immediately (in the same call stack) |
|
82 or not at all. |
|
83 |
|
84 @param aConnectionHandles A client supplied TInt that, on |
|
85 successful completion of this operation, will be contain the |
|
86 number of pending connection handles. |
|
87 |
|
88 @param aLinkType Indicates the type of link handles to be |
|
89 returned. |
|
90 |
|
91 @return Status code. |
|
92 */ |
|
93 virtual TInt MplsGetNumPendingHandles(TInt& aConnectionHandles, |
|
94 TLinkType aLinkType) const = 0; |
|
95 |
|
96 /**Returns a list of 'connected' connection handles for all links |
|
97 of the specified type and Bluetooth device address. Pending |
|
98 connection handles are not returned by this method. |
|
99 |
|
100 The returned data are a snapshot and will grow stale. They |
|
101 should therefore be used immediately (in the same call stack) |
|
102 or not at all. It would be wise to check whether the returned |
|
103 links are still connected. |
|
104 |
|
105 @param aConnectionHandles A client supplied dynamic array that, |
|
106 on successful completion of this operation, will be populated |
|
107 with the requested connection handles. |
|
108 |
|
109 @param aLinkType Indicates the type of link handles to be |
|
110 returned. |
|
111 |
|
112 @param aBDAddr The client supplied Bluetooth device address of |
|
113 the remote device for which the list of links is required. |
|
114 |
|
115 @return Status code. |
|
116 */ |
|
117 virtual TInt MplsGetConnectionHandles(RHCIConnHandleArray& aConnectionHandles, |
|
118 TLinkType aLinkType, |
|
119 const TBTDevAddr& aBDAddr) const = 0; |
|
120 |
|
121 /**Returns the number of 'pending' connection handles for all |
|
122 links of the specified type and Bluetooth device |
|
123 address. |
|
124 |
|
125 The returned data are a snapshot and will grow stale. They |
|
126 should therefore be used immediately (in the same call stack) |
|
127 or not at all. |
|
128 |
|
129 @param aConnectionHandles A client supplied TInt that, on |
|
130 successful completion of this operation, will contain the |
|
131 number of pending connection handles.. |
|
132 |
|
133 @param aLinkType Indicates the type of link handles to be |
|
134 returned. |
|
135 |
|
136 @param aBDAddr The client supplied Bluetooth device address of |
|
137 the remote device for which the number of pending links is |
|
138 required. |
|
139 |
|
140 @return Status code. |
|
141 */ |
|
142 virtual TInt MplsGetNumPendingHandles(TInt& aConnectionHandles, |
|
143 TLinkType aLinkType, |
|
144 const TBTDevAddr& aBDAddr) const = 0; |
|
145 |
|
146 /**Returns the Bluetooth device address associated with the |
|
147 supplied connection handle. |
|
148 |
|
149 @param aBDAddr A client supplied variable that, on successful |
|
150 completion of this operation, will be populated with the |
|
151 required Bluetooth device address. |
|
152 |
|
153 @param aConnectionHandle A client supplied connection handle |
|
154 for which the device address is required. |
|
155 |
|
156 @return Status code. |
|
157 */ |
|
158 virtual TInt MplsGetRemoteAddress(TBTDevAddr& aBDAddr, |
|
159 THCIConnHandle aConnectionHandle) const = 0; |
|
160 |
|
161 |
|
162 /**Returns the remote device's class for the device specified by |
|
163 the Bluetooth device address. |
|
164 |
|
165 @param aDeviceClass A client supplied variable that, on |
|
166 successful completion of this operation, will be populated with |
|
167 the required Bluetooth device class. |
|
168 |
|
169 @param aBDAddr A client supplied Bluetooth device address for |
|
170 which the device class is required. |
|
171 |
|
172 @return Status code. |
|
173 */ |
|
174 virtual TInt MplsGetRemoteDeviceClass(TBTDeviceClass& aDeviceClass, |
|
175 const TBTDevAddr& aBDAddr) const = 0; |
|
176 |
|
177 |
|
178 /**Returns the Bluetooth capabilities of the remote device |
|
179 specified by the Bluetooth device address. |
|
180 |
|
181 @param aRemoteSupportedFeatures A client supplied variable |
|
182 that, on successful completion of this operation, will be |
|
183 populated with the required Bluetooth remote supported |
|
184 features. |
|
185 |
|
186 @param aBDAddr A client supplied Bluetooth device address for |
|
187 which the device class is required. |
|
188 |
|
189 @return Status code. |
|
190 */ |
|
191 virtual TInt MplsGetRemoteSupportedFeatures(TBTFeatures& aRemoteSupportedFeatures, |
|
192 const TBTDevAddr& aBDAddr) const = 0; |
|
193 |
|
194 |
|
195 /**Returns the link policy settings for the physical link with the |
|
196 remote device specified by the Bluetooth device address |
|
197 parameter |
|
198 |
|
199 @param aLinkPolicySettings A client supplied variable that, on |
|
200 successful completion of this operation, will be populated with |
|
201 the required Bluetooth link policy settings |
|
202 |
|
203 @param aBDAddr A client supplied Bluetooth device address for |
|
204 which the device class is required. |
|
205 |
|
206 @return Status code. |
|
207 */ |
|
208 virtual TInt MplsGetLinkPolicySettings(TLinkPolicy& aLinkPolicySettings, |
|
209 const TBTDevAddr& aBDAddr) const = 0; |
|
210 |
|
211 |
|
212 /**Returns the link state for the device specified by the |
|
213 Bluetooth device address. The state indicates whether the link |
|
214 is up, down or pending. If the link is up, the following |
|
215 information may be determined: the role (master or slave), |
|
216 power mode (link mode, e.g Sniff Mode), max slots (currently 1, |
|
217 3 or 5), whether the link is encrypted, and whether the link is |
|
218 authenticated. |
|
219 |
|
220 @see TBTBasebandLinkState |
|
221 |
|
222 @param aBasebandLinkState A client supplied variable that, on |
|
223 successful completion of this operation, will be populated with |
|
224 the required Bluetooth link state. |
|
225 |
|
226 @param aBDAddr A client supplied Bluetooth device address for |
|
227 which the device class is required. |
|
228 |
|
229 @return Status code. |
|
230 */ |
|
231 virtual TInt MplsGetBasebandLinkState(TBTBasebandLinkState& aBasebandLinkState, |
|
232 const TBTDevAddr& aBDAddr) const = 0; |
|
233 }; |
|
234 |
|
235 |
|
236 #endif //PHYSICALLINKSSTATE_H |