williamr@2
|
1 |
// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@4
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@4
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
// BT protocol wide types
|
williamr@2
|
15 |
//
|
williamr@2
|
16 |
//
|
williamr@2
|
17 |
|
williamr@2
|
18 |
#ifndef _BTTYPES_H
|
williamr@2
|
19 |
#define _BTTYPES_H
|
williamr@2
|
20 |
|
williamr@4
|
21 |
#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
|
williamr@4
|
22 |
#include <bttypespartner.h>
|
williamr@4
|
23 |
#endif
|
williamr@4
|
24 |
|
williamr@2
|
25 |
#include <e32std.h>
|
williamr@2
|
26 |
#include <bluetooth/eirdatacodec.h>
|
williamr@2
|
27 |
|
williamr@2
|
28 |
/**
|
williamr@2
|
29 |
@publishedAll
|
williamr@2
|
30 |
@released
|
williamr@2
|
31 |
|
williamr@2
|
32 |
Minimum eSCO connection latency in milliseconds. Attempts to specify less than this will be silently
|
williamr@2
|
33 |
increased to this level.
|
williamr@2
|
34 |
*/
|
williamr@2
|
35 |
static const TInt KMinESCOLatency = 4;
|
williamr@2
|
36 |
|
williamr@2
|
37 |
/**
|
williamr@2
|
38 |
@publishedAll
|
williamr@2
|
39 |
@released
|
williamr@2
|
40 |
|
williamr@2
|
41 |
Typedef to represent a HCI connection handle.
|
williamr@2
|
42 |
*/
|
williamr@2
|
43 |
typedef TUint16 THCIConnHandle;
|
williamr@2
|
44 |
|
williamr@2
|
45 |
/**
|
williamr@2
|
46 |
@publishedAll
|
williamr@2
|
47 |
@released
|
williamr@2
|
48 |
|
williamr@2
|
49 |
Bluetooth SIG specified values for specification of (piconet) role.
|
williamr@2
|
50 |
*/
|
williamr@2
|
51 |
enum TBTBasebandRole
|
williamr@2
|
52 |
{
|
williamr@2
|
53 |
EMaster = 0x00, /*!< Master role */
|
williamr@2
|
54 |
ESlave = 0x01, /*!< Slave role */
|
williamr@2
|
55 |
ERoleUnknown, /*!< Unknown role */
|
williamr@2
|
56 |
};
|
williamr@2
|
57 |
|
williamr@2
|
58 |
/**
|
williamr@2
|
59 |
@publishedAll
|
williamr@2
|
60 |
@released
|
williamr@2
|
61 |
|
williamr@2
|
62 |
Bluetooth SIG specified values for indicating link modes.
|
williamr@2
|
63 |
*/
|
williamr@2
|
64 |
enum TBTLinkMode
|
williamr@2
|
65 |
{
|
williamr@2
|
66 |
EActiveMode = 0x00, /*!< Active mode */
|
williamr@2
|
67 |
EHoldMode = 0x01, /*!< Hold mode */
|
williamr@2
|
68 |
ESniffMode = 0x02, /*!< Sniff mode */
|
williamr@2
|
69 |
EParkMode = 0x04, /*!< Park mode */
|
williamr@2
|
70 |
EScatterMode = 0x08, /*!< Scatter mode */
|
williamr@2
|
71 |
};
|
williamr@2
|
72 |
|
williamr@2
|
73 |
/**
|
williamr@2
|
74 |
@publishedAll
|
williamr@2
|
75 |
@released
|
williamr@2
|
76 |
|
williamr@2
|
77 |
Typedef to represent a union of TBTLinkMode values.
|
williamr@2
|
78 |
*/
|
williamr@2
|
79 |
typedef TUint32 TBTLinkModeSet;
|
williamr@2
|
80 |
|
williamr@2
|
81 |
/**
|
williamr@2
|
82 |
@publishedAll
|
williamr@2
|
83 |
@released
|
williamr@2
|
84 |
|
williamr@2
|
85 |
Bitmask values to help request combinations of link modes.
|
williamr@2
|
86 |
@see TBTLinkMode
|
williamr@2
|
87 |
*/
|
williamr@2
|
88 |
enum TBTLinkModeCombinations
|
williamr@2
|
89 |
{
|
williamr@2
|
90 |
EAnyLowPowerMode = (EHoldMode | ESniffMode | EParkMode | EScatterMode) /*!< Any low power mode */
|
williamr@2
|
91 |
};
|
williamr@2
|
92 |
|
williamr@2
|
93 |
/**
|
williamr@2
|
94 |
@publishedAll
|
williamr@2
|
95 |
@released
|
williamr@2
|
96 |
|
williamr@2
|
97 |
Bluetooth SIG specified values for indicating packet types.
|
williamr@2
|
98 |
|
williamr@2
|
99 |
DM1, DH1, DM3, DH3, DM5, DH5 are ACL packet types
|
williamr@2
|
100 |
HV1, HV2, HV3 are SCO (synchronous link) packet types
|
williamr@2
|
101 |
*/
|
williamr@2
|
102 |
enum TBTPacketType
|
williamr@2
|
103 |
{
|
williamr@2
|
104 |
EPacketsDM1 = 0x0008, /*!< DM1 ACL packet type */
|
williamr@2
|
105 |
EPacketsDH1 = 0x0010, /*!< DH1 ACL packet type */
|
williamr@2
|
106 |
EPacketsDM3 = 0x0400, /*!< DM3 ACL packet type */
|
williamr@2
|
107 |
EPacketsDH3 = 0x0800, /*!< DH3 ACL packet type */
|
williamr@2
|
108 |
EPacketsDM5 = 0x4000, /*!< DM5 ACL packet type */
|
williamr@2
|
109 |
EPacketsDH5 = 0x8000, /*!< DH5 ACL packet type */
|
williamr@2
|
110 |
|
williamr@2
|
111 |
EPackets2_DH1 = 0x0002, /*!< 2-DH1 ACL packet type */
|
williamr@2
|
112 |
EPackets3_DH1 = 0x0004, /*!< 3-DH1 ACL packet type */
|
williamr@2
|
113 |
EPackets2_DH3 = 0x0100, /*!< 2-DH3 ACL packet type */
|
williamr@2
|
114 |
EPackets3_DH3 = 0x0200, /*!< 3-DH3 ACL packet type */
|
williamr@2
|
115 |
EPackets2_DH5 = 0x1000, /*!< 2-DH5 ACL packet type */
|
williamr@2
|
116 |
EPackets3_DH5 = 0x2000, /*!< 3-DH5 ACL packet type */
|
williamr@2
|
117 |
|
williamr@2
|
118 |
EPacketsHV1 = 0x0020, /*!< HV1 SCO packet type */
|
williamr@2
|
119 |
EPacketsHV2 = 0x0040, /*!< HV2 SCO packet type */
|
williamr@2
|
120 |
EPacketsHV3 = 0x0080, /*!< HV3 SCO packet type */
|
williamr@2
|
121 |
};
|
williamr@2
|
122 |
|
williamr@2
|
123 |
/**
|
williamr@2
|
124 |
@publishedAll
|
williamr@2
|
125 |
@released
|
williamr@2
|
126 |
|
williamr@2
|
127 |
Typedef to represent a set of SCO packet types.
|
williamr@2
|
128 |
*/
|
williamr@2
|
129 |
typedef TUint16 TBTSCOPackets;
|
williamr@2
|
130 |
|
williamr@2
|
131 |
/**
|
williamr@2
|
132 |
@publishedAll
|
williamr@2
|
133 |
@released
|
williamr@2
|
134 |
|
williamr@2
|
135 |
Typedef to represent a set of ACL packet types.
|
williamr@2
|
136 |
*/
|
williamr@2
|
137 |
typedef TUint16 TBTACLPackets;
|
williamr@2
|
138 |
|
williamr@2
|
139 |
/**
|
williamr@2
|
140 |
@publishedAll
|
williamr@2
|
141 |
@released
|
williamr@2
|
142 |
|
williamr@2
|
143 |
Bitmask values to help request combinations of packets.
|
williamr@2
|
144 |
@see TBTPacketType
|
williamr@2
|
145 |
*/
|
williamr@2
|
146 |
enum TBTPacketTypeCombinations
|
williamr@2
|
147 |
{
|
williamr@2
|
148 |
EAnyACLPacket = EPacketsDM1 | EPacketsDM3 | EPacketsDM5 | EPacketsDH1 | EPacketsDH3 | EPacketsDH5, /*!< Any ACL packet */
|
williamr@2
|
149 |
EAnyNonEdrACLPacket = EAnyACLPacket | EPackets2_DH1 | EPackets3_DH1 | EPackets2_DH3 | EPackets3_DH3 | EPackets2_DH5 | EPackets3_DH5, /*!< Any Non-EDR ACL packet */
|
williamr@2
|
150 |
EAnySCOPacket = EPacketsHV1 | EPacketsHV2 | EPacketsHV3, /*!< Any SCO packet */
|
williamr@2
|
151 |
EAnyPacket = EAnyACLPacket | EAnySCOPacket /*!< Any packet */
|
williamr@2
|
152 |
};
|
williamr@2
|
153 |
|
williamr@2
|
154 |
|
williamr@2
|
155 |
/**
|
williamr@2
|
156 |
@publishedAll
|
williamr@2
|
157 |
@released
|
williamr@2
|
158 |
|
williamr@2
|
159 |
Typedef to represent a set of synchronous packet types (SCO and eSCO on v1.2).
|
williamr@2
|
160 |
@see TBTSyncPackets::TSyncPackets
|
williamr@2
|
161 |
*/
|
williamr@2
|
162 |
typedef TUint32 TBTSyncPacketTypes;
|
williamr@2
|
163 |
|
williamr@2
|
164 |
/**
|
williamr@2
|
165 |
@publishedAll
|
williamr@2
|
166 |
@deprecated
|
williamr@2
|
167 |
|
williamr@2
|
168 |
This constant is no longer needed to translate the SCO mapping of HV packet types to Synchronous
|
williamr@2
|
169 |
because CBluetoothSynchronousLink::SetupConnection(const TBTDevAddr& aBDAddr, const TUint16 aPacketTypes)
|
williamr@2
|
170 |
adjusts aPacketTypes internally on behalf of clients.
|
williamr@2
|
171 |
*/
|
williamr@2
|
172 |
static const TInt KSCOvsSyncHVOffset = 5;
|
williamr@2
|
173 |
|
williamr@4
|
174 |
|
williamr@2
|
175 |
/**
|
williamr@2
|
176 |
@publishedAll
|
williamr@2
|
177 |
@released
|
williamr@2
|
178 |
|
williamr@2
|
179 |
Class to represent a set of synchronous packet types (SCO and eSCO on v1.2).
|
williamr@2
|
180 |
This differs from TBTSyncPacketTypes as it is the interface used by CBluetoothSynchronousLink
|
williamr@2
|
181 |
in order to detect the difference between a pre and post eSCO caller. This is necessary
|
williamr@2
|
182 |
as HV1 packets in the SCO numbering clash with EV5 packets in the sync numbering.
|
williamr@2
|
183 |
*/
|
williamr@2
|
184 |
NONSHARABLE_CLASS(TBTSyncPackets)
|
williamr@2
|
185 |
{
|
williamr@2
|
186 |
public:
|
williamr@2
|
187 |
/**
|
williamr@2
|
188 |
@publishedAll
|
williamr@2
|
189 |
@released
|
williamr@2
|
190 |
|
williamr@2
|
191 |
Individual synchronous packet types.
|
williamr@2
|
192 |
@see TBTSyncPacketTypes
|
williamr@2
|
193 |
*/
|
williamr@2
|
194 |
enum TSyncPackets
|
williamr@2
|
195 |
{
|
williamr@2
|
196 |
ESyncPacketsHV1 = 0x10001,
|
williamr@2
|
197 |
ESyncPacketsHV2 = 0x10002,
|
williamr@2
|
198 |
ESyncPacketsHV3 = 0x10004,
|
williamr@2
|
199 |
|
williamr@2
|
200 |
ESyncPacketsEV3 = 0x20008,
|
williamr@2
|
201 |
ESyncPacketsEV4 = 0x20010,
|
williamr@2
|
202 |
ESyncPacketsEV5 = 0x20020,
|
williamr@2
|
203 |
|
williamr@2
|
204 |
ESyncAnySCOPacket = ESyncPacketsHV1 | ESyncPacketsHV2 | ESyncPacketsHV3,
|
williamr@2
|
205 |
ESyncAnyESCOPacket = ESyncPacketsEV3 | ESyncPacketsEV4 | ESyncPacketsEV5
|
williamr@2
|
206 |
};
|
williamr@2
|
207 |
|
williamr@2
|
208 |
public:
|
williamr@2
|
209 |
IMPORT_C explicit TBTSyncPackets(TBTSyncPacketTypes aPackets);
|
williamr@2
|
210 |
IMPORT_C TBTSyncPacketTypes operator()() const;
|
williamr@2
|
211 |
|
williamr@2
|
212 |
private:
|
williamr@2
|
213 |
TUint32 iPacketTypes;
|
williamr@2
|
214 |
|
williamr@2
|
215 |
// This data padding has been added to help prevent future binary compatibility breaks
|
williamr@2
|
216 |
// Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
|
williamr@4
|
217 |
TUint32 iPadding1;
|
williamr@4
|
218 |
TUint32 iPadding2;
|
williamr@2
|
219 |
};
|
williamr@2
|
220 |
|
williamr@2
|
221 |
|
williamr@2
|
222 |
/**
|
williamr@2
|
223 |
@publishedAll
|
williamr@2
|
224 |
@released
|
williamr@2
|
225 |
|
williamr@2
|
226 |
eSCO links can have different retransmission options, optimised for link usage,
|
williamr@2
|
227 |
power or reliability.
|
williamr@2
|
228 |
|
williamr@2
|
229 |
@see CBluetoothSynchronousLink::SetRetransmissionEffort
|
williamr@2
|
230 |
*/
|
williamr@2
|
231 |
enum TBTeSCORetransmissionTypes
|
williamr@2
|
232 |
{
|
williamr@2
|
233 |
EeSCORetransmitNone = 0,
|
williamr@2
|
234 |
EeSCORetransmitPower = 1,
|
williamr@2
|
235 |
EeSCORetransmitReliability = 2,
|
williamr@2
|
236 |
EeSCORetransmitDontCare = 0xff
|
williamr@2
|
237 |
};
|
williamr@2
|
238 |
|
williamr@2
|
239 |
/**
|
williamr@2
|
240 |
@publishedAll
|
williamr@2
|
241 |
@released
|
williamr@2
|
242 |
|
williamr@2
|
243 |
eSCO unspecified bandwidth. This value can only be used by the accepting side
|
williamr@2
|
244 |
of an eSCO link, to allow any bandwidth to be specified by the initiator.
|
williamr@2
|
245 |
Otherwise both sides of the link must agree on the same bandwidth.
|
williamr@2
|
246 |
|
williamr@2
|
247 |
@see CBluetoothSynchronousLink::SetBandwidth
|
williamr@2
|
248 |
@see CBluetoothSynchronousLink::AcceptConnection
|
williamr@2
|
249 |
*/
|
williamr@2
|
250 |
static const TUint32 KESCOBandwidthDontCare = KMaxTUint32;
|
williamr@2
|
251 |
|
williamr@2
|
252 |
/**
|
williamr@2
|
253 |
@publishedAll
|
williamr@2
|
254 |
@released
|
williamr@2
|
255 |
|
williamr@2
|
256 |
Bluetooth SIG specified values indicating whether a device
|
williamr@2
|
257 |
is physically able to support a baseband (or link manager protocol) feature
|
williamr@2
|
258 |
*/
|
williamr@2
|
259 |
enum TBTSupportedFeatures
|
williamr@2
|
260 |
{
|
williamr@2
|
261 |
ESupportedThreeSlotPackets = 1<<0, /*!< Three slot packets are supported */
|
williamr@2
|
262 |
ESupportedFiveSlotPackets = 1<<1, /*!< Five slot packets are supported */
|
williamr@2
|
263 |
ESupportedEncryption = 1<<2, /*!< Encryption is supported */
|
williamr@2
|
264 |
ESupportedSlotOffset = 1<<3, /*!< Slot offset is supported */
|
williamr@2
|
265 |
ESupportedTimingAccuracy = 1<<4, /*!< Timing accuracy is supported */
|
williamr@2
|
266 |
ESupportedSwitch = 1<<5, /*!< Role switch is supported */
|
williamr@2
|
267 |
ESupportedHoldMode = 1<<6, /*!< Hold mode is supported */
|
williamr@2
|
268 |
ESupportedSniffMode = 1<<7, /*!< Sniff mode is supported */
|
williamr@2
|
269 |
ESupportedParkMode = 1<<8, /*!< Park mode is supported */
|
williamr@2
|
270 |
ESupportedRSSI = 1<<9, /*!< Receive signal strength indication is supported */
|
williamr@2
|
271 |
ESupportedChannelQualityDrivenDataRate = 1<<10, /*!< Channel quality driven data rate is supported */
|
williamr@2
|
272 |
ESupportedSCOLink = 1<<11, /*!< SCO links are supported */
|
williamr@2
|
273 |
ESupportedHV2Packets = 1<<12, /*!< HV2 packets are supported */
|
williamr@2
|
274 |
ESupportedHV3Packets = 1<<13, /*!< HV3 packets are supported */
|
williamr@2
|
275 |
ESupportedu_lawLog = 1<<14, /*!< SCO u-law encoding is supported */
|
williamr@2
|
276 |
ESupportedA_lawLog = 1<<15, /*!< SCO A-law encoding is supported */
|
williamr@2
|
277 |
ESupportedCVSD = 1<<16, /*!< SCO Continuously variable slope delta modulation is supported */
|
williamr@2
|
278 |
ESupportedPagingScheme = 1<<17, /*!< Paging scheme is supported */
|
williamr@2
|
279 |
ESupportedPowerControl = 1<<18, /*!< Power control is supported */
|
williamr@2
|
280 |
ESupportedTransparentSCOData = 1<<19, /*!< Transparent SCO data is supported */
|
williamr@2
|
281 |
ESupportedFlowControlLagBit0 = 1<<20, /*!< Flow control lag bit 0 is supported */
|
williamr@2
|
282 |
ESupportedFlowControlLagBit1 = 1<<21, /*!< Flow control lag bit 1 is supported */
|
williamr@2
|
283 |
ESupportedFlowControlLagBit2 = 1<<22, /*!< Flow control lag bit 2 is supported */
|
williamr@2
|
284 |
};
|
williamr@2
|
285 |
|
williamr@2
|
286 |
/**
|
williamr@2
|
287 |
@publishedAll
|
williamr@2
|
288 |
@released
|
williamr@2
|
289 |
|
williamr@2
|
290 |
Bitmask values for notifying/requesting notification of the state of a physical link.
|
williamr@2
|
291 |
|
williamr@2
|
292 |
These values have a two fold purpose:
|
williamr@2
|
293 |
1) They can be used along with TBTPhysicalLinkStateNotifierCombinations to specify
|
williamr@2
|
294 |
a set of baseband change events for which notification is desired.
|
williamr@2
|
295 |
2) They can be used to notify the state of a physical link or a subset of that state.
|
williamr@2
|
296 |
For example if only mode change events are being monitored, then at each mode change event
|
williamr@2
|
297 |
only the bit reperesenting the new mode will be returned, however if the whole link state
|
williamr@2
|
298 |
is required, then a combination of bit values indicating that state will be returned.
|
williamr@2
|
299 |
|
williamr@2
|
300 |
THESE BIT VALUES MUST ONLY BE USED WHEN REQUESTING NOTIFICATION, OR WHEN PARSING THE
|
williamr@2
|
301 |
RESULTS OF A NOTIFICATION. All other baseband state activities should use one of the
|
williamr@2
|
302 |
appropriate Bluetooth SIG specified enums
|
williamr@2
|
303 |
@see TBTBasebandRole
|
williamr@2
|
304 |
@see TBTLinkMode
|
williamr@2
|
305 |
@see TBTLinkModeCombinations
|
williamr@2
|
306 |
@see TBTPacketType
|
williamr@2
|
307 |
@see TBTPacketTypeCombinations
|
williamr@2
|
308 |
*/
|
williamr@2
|
309 |
enum TBTPhysicalLinkStateNotifier
|
williamr@2
|
310 |
{
|
williamr@2
|
311 |
ENotifyMaster = 0x00000001, /*!< Master */
|
williamr@2
|
312 |
ENotifySlave = 0x00000002, /*!< Slave */
|
williamr@2
|
313 |
|
williamr@2
|
314 |
ENotifyActiveMode = 0x00000004, /*!< Active mode */
|
williamr@2
|
315 |
ENotifySniffMode = 0x00000008, /*!< Sniff mode */
|
williamr@2
|
316 |
ENotifyParkMode = 0x00000010, /*!< Park mode */
|
williamr@2
|
317 |
ENotifyHoldMode = 0x00000020, /*!< Hold mode */
|
williamr@2
|
318 |
|
williamr@2
|
319 |
ENotifyMaxSlots1 = 0x00000040, /*!< Max slots 1 */
|
williamr@2
|
320 |
ENotifyMaxSlots3 = 0x00000080, /*!< Max slots 3 */
|
williamr@2
|
321 |
ENotifyMaxSlots5 = 0x00000100, /*!< Max slots 5 */
|
williamr@2
|
322 |
|
williamr@2
|
323 |
ENotifyPacketsDM1 = 0x00000200, /*!< Packets DM1 */
|
williamr@2
|
324 |
ENotifyPacketsDH1 = 0x00000400, /*!< Packets DH1 */
|
williamr@2
|
325 |
ENotifyPacketsDM3 = 0x00000800, /*!< Packets DM3 */
|
williamr@2
|
326 |
ENotifyPacketsDH3 = 0x00001000, /*!< Packets DH3 */
|
williamr@2
|
327 |
ENotifyPacketsDM5 = 0x00002000, /*!< Packets DM5 */
|
williamr@2
|
328 |
ENotifyPacketsDH5 = 0x00004000, /*!< Packets DH5 */
|
williamr@2
|
329 |
|
williamr@2
|
330 |
ENotifyPacketsHV1 = 0x00008000, /*!< HV1 */
|
williamr@2
|
331 |
ENotifyPacketsHV2 = 0x00010000, /*!< HV2 */
|
williamr@2
|
332 |
ENotifyPacketsHV3 = 0x00020000, /*!< HV3 */
|
williamr@2
|
333 |
|
williamr@2
|
334 |
ENotifyAuthenticationComplete = 0x00040000, /*!< Authentication Complete */
|
williamr@2
|
335 |
ENotifyEncryptionChangeOn = 0x00080000, /*!< Encryption Change On */
|
williamr@2
|
336 |
ENotifyEncryptionChangeOff = 0x00100000, /*!< Encryption Change Off */
|
williamr@2
|
337 |
|
williamr@2
|
338 |
ENotifyPhysicalLinkUp = 0x00200000, /*!< Physical Link Up */
|
williamr@2
|
339 |
ENotifyPhysicalLinkDown = 0x00400000, /*!< Physical Link Down */
|
williamr@2
|
340 |
ENotifyPhysicalLinkError = 0x00800000, /*!< Physical Link Error */
|
williamr@2
|
341 |
|
williamr@2
|
342 |
ENotifySynchronousLinkUp = 0x01000000, /*!< Synchronous Link Up */
|
williamr@2
|
343 |
ENotifySynchronousLinkDown = 0x02000000, /*!< Synchronous Link Down */
|
williamr@2
|
344 |
ENotifySynchronousLinkError = 0x04000000, /*!< Synchronous Link Error */
|
williamr@2
|
345 |
|
williamr@4
|
346 |
|
williamr@2
|
347 |
/**
|
williamr@4
|
348 |
@deprecated This has been superseded by ENotifySynchronousLinkUp
|
williamr@4
|
349 |
@see ENotifySynchronousLinkUp
|
williamr@4
|
350 |
*/
|
williamr@4
|
351 |
ENotifySCOLinkUp = ENotifySynchronousLinkUp,
|
williamr@4
|
352 |
/**
|
williamr@4
|
353 |
@deprecated This has been superseded by ENotifySynchronousLinkDown
|
williamr@4
|
354 |
@see ENotifySynchronousLinkDown
|
williamr@4
|
355 |
*/
|
williamr@4
|
356 |
ENotifySCOLinkDown = ENotifySynchronousLinkDown,
|
williamr@4
|
357 |
/**
|
williamr@4
|
358 |
@deprecated This has been superseded by ENotifySynchronousLinkError
|
williamr@4
|
359 |
@see ENotifySynchronousLinkError
|
williamr@4
|
360 |
*/
|
williamr@4
|
361 |
ENotifySCOLinkError = ENotifySynchronousLinkError
|
williamr@2
|
362 |
|
williamr@2
|
363 |
};
|
williamr@2
|
364 |
|
williamr@2
|
365 |
/**
|
williamr@2
|
366 |
@publishedAll
|
williamr@2
|
367 |
@released
|
williamr@2
|
368 |
|
williamr@2
|
369 |
Bitmask values to help request notification of the state of a physical link.
|
williamr@2
|
370 |
@see TBTPhysicalLinkStateNotifier
|
williamr@2
|
371 |
*/
|
williamr@2
|
372 |
enum TBTPhysicalLinkStateNotifierCombinations
|
williamr@2
|
373 |
{
|
williamr@2
|
374 |
ENotifyAnyRole = ENotifyMaster | ENotifySlave,
|
williamr@2
|
375 |
ENotifyAnyLowPowerMode = ENotifySniffMode | ENotifyParkMode | ENotifyHoldMode,
|
williamr@2
|
376 |
ENotifyAnyPowerMode = ENotifyActiveMode | ENotifyAnyLowPowerMode,
|
williamr@2
|
377 |
ENotifyAnyMaxSlots = ENotifyMaxSlots1 | ENotifyMaxSlots3 | ENotifyMaxSlots5,
|
williamr@2
|
378 |
ENotifyAnyACLPacketType = ENotifyPacketsDM1 | ENotifyPacketsDH1 | ENotifyPacketsDM3 | EPacketsDH3 | EPacketsDM5 | EPacketsDH5,
|
williamr@2
|
379 |
ENotifyAnySCOPacketType = ENotifyPacketsHV1 | ENotifyPacketsHV2 | ENotifyPacketsHV3,
|
williamr@2
|
380 |
ENotifyAnyPacketType = ENotifyAnyACLPacketType | ENotifyAnySCOPacketType,
|
williamr@2
|
381 |
ENotifyAnyPhysicalLinkState = 0xffffffff,
|
williamr@2
|
382 |
};
|
williamr@2
|
383 |
|
williamr@2
|
384 |
/**
|
williamr@2
|
385 |
@publishedAll
|
williamr@2
|
386 |
@released
|
williamr@2
|
387 |
|
williamr@2
|
388 |
The maximum length of an SDP UUID.
|
williamr@2
|
389 |
*/
|
williamr@2
|
390 |
static const TInt KSdpUUIDMaxLength = 16;
|
williamr@2
|
391 |
|
williamr@2
|
392 |
/**
|
williamr@2
|
393 |
@publishedAll
|
williamr@2
|
394 |
@released
|
williamr@2
|
395 |
|
williamr@2
|
396 |
The size of a bluetooth device address in bytes.
|
williamr@2
|
397 |
*/
|
williamr@2
|
398 |
const TInt KBTDevAddrSize=0x06;
|
williamr@2
|
399 |
|
williamr@2
|
400 |
/**
|
williamr@2
|
401 |
@publishedAll
|
williamr@2
|
402 |
@released
|
williamr@2
|
403 |
|
williamr@2
|
404 |
The size of a bluetooth device address in bytes.
|
williamr@2
|
405 |
*/
|
williamr@2
|
406 |
const TInt KBTMaxDevAddrSize = KBTDevAddrSize;
|
williamr@2
|
407 |
|
williamr@2
|
408 |
/**
|
williamr@2
|
409 |
@publishedAll
|
williamr@2
|
410 |
@released
|
williamr@2
|
411 |
|
williamr@2
|
412 |
48-bit bluetooth device address.
|
williamr@2
|
413 |
Each bluetooth device has a unique address built into the hardware, which
|
williamr@2
|
414 |
is represented by this class. Used for identifying remote addresses.
|
williamr@2
|
415 |
The interface operates in a big-endian manner -- e.g. addr[0] refers
|
williamr@2
|
416 |
to the most significant byte of the address. This is the same ordering
|
williamr@2
|
417 |
as the addresses would naturally be written down on paper.
|
williamr@2
|
418 |
**/
|
williamr@2
|
419 |
NONSHARABLE_CLASS(TBTDevAddr)
|
williamr@4
|
420 |
{
|
williamr@2
|
421 |
public:
|
williamr@4
|
422 |
IMPORT_C TBTDevAddr();
|
williamr@4
|
423 |
IMPORT_C TBTDevAddr(const TInt64 &aInt);
|
williamr@4
|
424 |
IMPORT_C TBTDevAddr(const TDesC8 &aDes);
|
williamr@4
|
425 |
IMPORT_C TBool operator==(const TBTDevAddr& aAddr) const;
|
williamr@4
|
426 |
IMPORT_C TBool operator!=(const TBTDevAddr& aAddr) const;
|
williamr@2
|
427 |
IMPORT_C const TUint8 &operator[](TInt aIndex) const;
|
williamr@2
|
428 |
IMPORT_C TUint8 &operator[](TInt aIndex);
|
williamr@2
|
429 |
IMPORT_C void Reset();
|
williamr@2
|
430 |
IMPORT_C TPtr8 Des();
|
williamr@2
|
431 |
IMPORT_C const TPtrC8 Des() const;
|
williamr@2
|
432 |
IMPORT_C TInt SetReadable(const TDesC& aSource);
|
williamr@2
|
433 |
IMPORT_C void GetReadable(TDes& aDest) const;
|
williamr@2
|
434 |
IMPORT_C void GetReadable(TDes& aDest, const TDesC& aPrepend, const TDesC& aByteSeperator, const TDesC& aAppend) const;
|
williamr@4
|
435 |
IMPORT_C TBool operator<=(const TBTDevAddr& aAddr) const;
|
williamr@2
|
436 |
private:
|
williamr@2
|
437 |
TFixedArray<TUint8, KBTDevAddrSize> iAddr;
|
williamr@2
|
438 |
|
williamr@2
|
439 |
// This data padding has been added to help prevent future binary compatibility breaks
|
williamr@2
|
440 |
// iPadding hasn't been zero'd because it is currently not used
|
williamr@4
|
441 |
TUint16 iPadding;
|
williamr@2
|
442 |
};
|
williamr@2
|
443 |
|
williamr@4
|
444 |
/** Array of device addresses
|
williamr@4
|
445 |
@see Enumerate method
|
williamr@4
|
446 |
*/
|
williamr@4
|
447 |
typedef RArray<TBTDevAddr> RBTDevAddrArray;
|
williamr@4
|
448 |
|
williamr@2
|
449 |
/**
|
williamr@2
|
450 |
@publishedAll
|
williamr@2
|
451 |
@released
|
williamr@2
|
452 |
|
williamr@2
|
453 |
A Bluetooth Universally Unique Identifier.
|
williamr@2
|
454 |
|
williamr@2
|
455 |
This is a 128-bit quantity that can be created without a central registry
|
williamr@2
|
456 |
while still being globally unique.
|
williamr@2
|
457 |
UUIDs are always held in full 128 bit format, however they can be set from
|
williamr@2
|
458 |
BT SIG short form (16 or 32 bit) addresses, and returned as down to their
|
williamr@2
|
459 |
shortest form using ShortestForm().
|
williamr@2
|
460 |
**/
|
williamr@2
|
461 |
NONSHARABLE_CLASS(TUUID)
|
williamr@2
|
462 |
{
|
williamr@2
|
463 |
public:
|
williamr@2
|
464 |
IMPORT_C TUUID();
|
williamr@2
|
465 |
IMPORT_C TUUID(TUint32 aLong);
|
williamr@2
|
466 |
IMPORT_C TUUID(TUint32 aHH, TUint32 aHL, TUint32 aLH, TUint32 aLL);
|
williamr@2
|
467 |
IMPORT_C TUUID(const TUid& aUid);
|
williamr@2
|
468 |
IMPORT_C void SetL(const TDesC8& aDes);
|
williamr@2
|
469 |
IMPORT_C const TPtrC8 LongForm() const;
|
williamr@2
|
470 |
IMPORT_C const TPtrC8 ShortestForm() const;
|
williamr@2
|
471 |
IMPORT_C const TPtrC8 Des() const;
|
williamr@2
|
472 |
/**
|
williamr@2
|
473 |
@deprecated
|
williamr@2
|
474 |
Use SpecifiedLengthL(TInt aLength) instead
|
williamr@2
|
475 |
*/
|
williamr@2
|
476 |
IMPORT_C const TPtrC8 FixedLengthL(TInt aLength) const;
|
williamr@2
|
477 |
IMPORT_C TInt MinimumSize() const;
|
williamr@4
|
478 |
IMPORT_C TBool operator==(const TUUID& aUUID) const;
|
williamr@4
|
479 |
IMPORT_C TBool operator!=(const TUUID& aUUID) const;
|
williamr@2
|
480 |
IMPORT_C const TUint8 &operator[](TInt aIndex) const;
|
williamr@2
|
481 |
IMPORT_C TUint8 &operator[](TInt aIndex);
|
williamr@2
|
482 |
IMPORT_C const TPtrC8 SpecifiedLengthL(TInt aLength) const;
|
williamr@2
|
483 |
IMPORT_C void SetFromLittleEndianL(const TDesC8& aDes);
|
williamr@2
|
484 |
private:
|
williamr@2
|
485 |
TFixedArray<TUint8, KSdpUUIDMaxLength> iUUID;
|
williamr@2
|
486 |
|
williamr@2
|
487 |
// This data padding has been added to help prevent future binary compatibility breaks
|
williamr@2
|
488 |
// Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
|
williamr@2
|
489 |
TUint32 iPadding1;
|
williamr@2
|
490 |
TUint32 iPadding2;
|
williamr@2
|
491 |
};
|
williamr@2
|
492 |
|
williamr@2
|
493 |
|
williamr@2
|
494 |
/**
|
williamr@2
|
495 |
@publishedAll
|
williamr@2
|
496 |
@released
|
williamr@2
|
497 |
|
williamr@2
|
498 |
A UUID container class
|
williamr@2
|
499 |
*/
|
williamr@2
|
500 |
NONSHARABLE_CLASS(RUUIDContainer)
|
williamr@2
|
501 |
{
|
williamr@2
|
502 |
public:
|
williamr@2
|
503 |
IMPORT_C void Close();
|
williamr@2
|
504 |
IMPORT_C void Reset();
|
williamr@2
|
505 |
IMPORT_C TInt Count() const;
|
williamr@2
|
506 |
IMPORT_C TUUID& operator[](TInt aIndex);
|
williamr@2
|
507 |
IMPORT_C const TUUID& operator[](TInt aIndex) const;
|
williamr@2
|
508 |
IMPORT_C const TUUID& At(TInt aIndex) const;
|
williamr@2
|
509 |
IMPORT_C TBool IsPresent(const TUUID& aUuid) const;
|
williamr@2
|
510 |
IMPORT_C TInt Add(const TUUID& aUuid);
|
williamr@2
|
511 |
|
williamr@2
|
512 |
private:
|
williamr@2
|
513 |
RArray<TUUID> iUUIDs;
|
williamr@2
|
514 |
|
williamr@2
|
515 |
// This data padding has been added to help prevent future binary compatibility breaks
|
williamr@2
|
516 |
// Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
|
williamr@2
|
517 |
TUint32 iPadding1;
|
williamr@2
|
518 |
TUint32 iPadding2;
|
williamr@2
|
519 |
};
|
williamr@2
|
520 |
|
williamr@2
|
521 |
|
williamr@2
|
522 |
/**
|
williamr@2
|
523 |
@publishedAll
|
williamr@2
|
524 |
@released
|
williamr@2
|
525 |
|
williamr@2
|
526 |
An EIR UUID container class. Contains UUIDs and indications of data completeness
|
williamr@2
|
527 |
*/
|
williamr@2
|
528 |
NONSHARABLE_CLASS(RExtendedInquiryResponseUUIDContainer)
|
williamr@2
|
529 |
{
|
williamr@2
|
530 |
public:
|
williamr@2
|
531 |
enum TUUIDType
|
williamr@2
|
532 |
{
|
williamr@2
|
533 |
EUUID16 = 0x1,
|
williamr@2
|
534 |
EUUID32 = 0x2,
|
williamr@2
|
535 |
EUUID128 = 0x4,
|
williamr@2
|
536 |
};
|
williamr@2
|
537 |
|
williamr@2
|
538 |
public:
|
williamr@2
|
539 |
IMPORT_C void Close();
|
williamr@2
|
540 |
IMPORT_C RUUIDContainer& UUIDs();
|
williamr@2
|
541 |
IMPORT_C void SetCompleteness(TUUIDType aType, TBool aIsComplete);
|
williamr@2
|
542 |
IMPORT_C TBool GetCompleteness(TUUIDType aType) const;
|
williamr@2
|
543 |
|
williamr@2
|
544 |
private:
|
williamr@2
|
545 |
RUUIDContainer iUUIDs;
|
williamr@2
|
546 |
TInt iCompleteness;
|
williamr@2
|
547 |
|
williamr@2
|
548 |
// This data padding has been added to help prevent future binary compatibility breaks
|
williamr@2
|
549 |
// Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
|
williamr@2
|
550 |
TUint32 iPadding1;
|
williamr@2
|
551 |
TUint32 iPadding2;
|
williamr@2
|
552 |
};
|
williamr@2
|
553 |
|
williamr@2
|
554 |
/**
|
williamr@2
|
555 |
@publishedAll
|
williamr@2
|
556 |
@released
|
williamr@2
|
557 |
|
williamr@2
|
558 |
The size of a link key, in bytes.
|
williamr@2
|
559 |
*/
|
williamr@2
|
560 |
const TUint8 KHCILinkKeySize=16;
|
williamr@2
|
561 |
|
williamr@2
|
562 |
/**
|
williamr@2
|
563 |
@publishedAll
|
williamr@2
|
564 |
@released
|
williamr@2
|
565 |
|
williamr@2
|
566 |
The size of a pin code, in bytes.
|
williamr@2
|
567 |
*/
|
williamr@2
|
568 |
const TUint8 KHCIPINCodeSize=16;
|
williamr@2
|
569 |
|
williamr@2
|
570 |
/**
|
williamr@2
|
571 |
@publishedAll
|
williamr@2
|
572 |
@released
|
williamr@2
|
573 |
|
williamr@2
|
574 |
Link key structure.
|
williamr@2
|
575 |
*/
|
williamr@2
|
576 |
NONSHARABLE_CLASS(TLinkKeyV10)
|
williamr@4
|
577 |
{
|
williamr@2
|
578 |
public:
|
williamr@4
|
579 |
TUint8 iLinkKey[KHCILinkKeySize]; /*!< The link key */
|
williamr@4
|
580 |
};
|
williamr@2
|
581 |
|
williamr@2
|
582 |
/**
|
williamr@2
|
583 |
@publishedAll
|
williamr@2
|
584 |
@released
|
williamr@2
|
585 |
|
williamr@2
|
586 |
Typedef'ed TPckgBuf of the class TLinkKeyV10.
|
williamr@2
|
587 |
*/
|
williamr@2
|
588 |
typedef TPckgBuf<TLinkKeyV10> TBTLinkKey;
|
williamr@2
|
589 |
|
williamr@2
|
590 |
/**
|
williamr@2
|
591 |
The type of a link key with a remote device
|
williamr@2
|
592 |
@publishedAll
|
williamr@2
|
593 |
@released
|
williamr@2
|
594 |
*/
|
williamr@2
|
595 |
enum TBTLinkKeyType
|
williamr@2
|
596 |
{
|
williamr@2
|
597 |
ELinkKeyCombination, /*!< this key has been generated with pairing with pre-v2.1 Bluetooth devices. */
|
williamr@2
|
598 |
ELinkKeyUnauthenticatedUpgradable, /*!< this key hasn't yet been tried with MITM protection */
|
williamr@2
|
599 |
ELinkKeyUnauthenticatedNonUpgradable, /*!< this key tried MITM protection; remote device incapable */
|
williamr@2
|
600 |
ELinkKeyAuthenticated, /*!< this key authenticated with MITM protection */
|
williamr@2
|
601 |
ELinkKeyDebug /*!< this key has been generated when in simple pairing debug mode */
|
williamr@2
|
602 |
};
|
williamr@2
|
603 |
|
williamr@2
|
604 |
/**
|
williamr@2
|
605 |
@publishedAll
|
williamr@2
|
606 |
@released
|
williamr@2
|
607 |
|
williamr@2
|
608 |
Bluetooth PIN Code structure.
|
williamr@2
|
609 |
*/
|
williamr@2
|
610 |
NONSHARABLE_CLASS(TPINCodeV10)
|
williamr@4
|
611 |
{
|
williamr@2
|
612 |
public:
|
williamr@2
|
613 |
IMPORT_C TBool operator==(const TPINCodeV10& aTPINCodeV10) const;
|
williamr@2
|
614 |
|
williamr@2
|
615 |
public:
|
williamr@4
|
616 |
TUint8 iLength; /*!< The length of the pin key */
|
williamr@4
|
617 |
TUint8 iPIN[KHCIPINCodeSize]; /*!< The pin code */
|
williamr@4
|
618 |
};
|
williamr@2
|
619 |
|
williamr@2
|
620 |
/**
|
williamr@2
|
621 |
@publishedAll
|
williamr@2
|
622 |
@released
|
williamr@2
|
623 |
|
williamr@2
|
624 |
Typedef'ed TPckgBuf of the class TPINCodeV10.
|
williamr@2
|
625 |
*/
|
williamr@2
|
626 |
typedef TPckgBuf<TPINCodeV10> TBTPinCode;
|
williamr@2
|
627 |
|
williamr@2
|
628 |
|
williamr@2
|
629 |
/**
|
williamr@2
|
630 |
Extended Inquiry Response Class
|
williamr@2
|
631 |
This class takes a reference from inquiry result, which could hold both local name and Extended Inquiry Response.
|
williamr@2
|
632 |
It provides API to parse and return the local name and data for any Extended Inquiry Response tag.
|
williamr@2
|
633 |
To get Device Name, Manufacturer Specific Data or Flags, firstly getting length of the data,
|
williamr@2
|
634 |
and then allocating a suitable buffer, which is where the data will be placed.
|
williamr@2
|
635 |
*/
|
williamr@2
|
636 |
NONSHARABLE_CLASS(TBluetoothNameRecordWrapper)
|
williamr@2
|
637 |
{
|
williamr@2
|
638 |
public:
|
williamr@2
|
639 |
IMPORT_C explicit TBluetoothNameRecordWrapper(const TNameRecord& aNameRecord);
|
williamr@2
|
640 |
IMPORT_C TInt GetDeviceName(TDes16& aName, TBool& aIsComplete) const;
|
williamr@2
|
641 |
IMPORT_C TInt GetServiceClassUuids(RExtendedInquiryResponseUUIDContainer& aEIRContainer) const;
|
williamr@2
|
642 |
IMPORT_C TInt GetVendorSpecificData(TDes8& aDes) const;
|
williamr@2
|
643 |
IMPORT_C TInt GetTxPowerLevel(TInt8& aTxPowerLevel) const;
|
williamr@2
|
644 |
IMPORT_C TInt GetFlags(TDes8& aDes) const;
|
williamr@2
|
645 |
IMPORT_C TInt GetDeviceNameLength() const;
|
williamr@2
|
646 |
IMPORT_C TInt GetVendorSpecificDataLength() const;
|
williamr@2
|
647 |
IMPORT_C TInt GetFlagsLength() const;
|
williamr@2
|
648 |
|
williamr@2
|
649 |
private:
|
williamr@2
|
650 |
TInt AddUuids16(RExtendedInquiryResponseUUIDContainer& aEIRContainer, TPtrC8& aUuids) const;
|
williamr@2
|
651 |
TInt AddUuids128(RExtendedInquiryResponseUUIDContainer& aEIRContainer, TPtrC8& aUuids) const;
|
williamr@2
|
652 |
private:
|
williamr@2
|
653 |
TExtendedInquiryResponseDataCodec iEirCodec;
|
williamr@2
|
654 |
|
williamr@2
|
655 |
// This data padding has been added to help prevent future binary compatibility breaks
|
williamr@2
|
656 |
// Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
|
williamr@2
|
657 |
TUint32 iPadding1;
|
williamr@2
|
658 |
TUint32 iPadding2;
|
williamr@2
|
659 |
};
|
williamr@2
|
660 |
|
williamr@2
|
661 |
/**
|
williamr@2
|
662 |
@publishedAll
|
williamr@2
|
663 |
@released
|
williamr@2
|
664 |
|
williamr@2
|
665 |
Contains information resulting from a baseband notification.
|
williamr@2
|
666 |
*/
|
williamr@2
|
667 |
NONSHARABLE_CLASS(TBTBasebandEventNotification)
|
williamr@2
|
668 |
{
|
williamr@2
|
669 |
public:
|
williamr@2
|
670 |
/**
|
williamr@2
|
671 |
Constructor.
|
williamr@2
|
672 |
@param aEventType The type of event.
|
williamr@2
|
673 |
@param aErrorCode The error code.
|
williamr@2
|
674 |
*/
|
williamr@2
|
675 |
TBTBasebandEventNotification(TUint32 aEventType, TInt aErrorCode = KErrNone) : iEventType(aEventType), iErrorCode(aErrorCode) {};
|
williamr@2
|
676 |
|
williamr@2
|
677 |
/**
|
williamr@2
|
678 |
Default constructor.
|
williamr@2
|
679 |
*/
|
williamr@2
|
680 |
TBTBasebandEventNotification() : iEventType(0), iErrorCode(KErrNone) {};
|
williamr@2
|
681 |
|
williamr@2
|
682 |
/**
|
williamr@2
|
683 |
Copy constructor.
|
williamr@2
|
684 |
@param aEvent The event to copy.
|
williamr@2
|
685 |
*/
|
williamr@2
|
686 |
TBTBasebandEventNotification(const TBTBasebandEventNotification& aEvent) : iEventType(aEvent.iEventType), iErrorCode(aEvent.iErrorCode) {};
|
williamr@2
|
687 |
|
williamr@2
|
688 |
/**
|
williamr@2
|
689 |
The event type.
|
williamr@2
|
690 |
@return The event type.
|
williamr@2
|
691 |
*/
|
williamr@2
|
692 |
TUint32 EventType() const { return iEventType; };
|
williamr@2
|
693 |
|
williamr@2
|
694 |
/**
|
williamr@2
|
695 |
The Bluetooth SIG error code associated with the event.
|
williamr@2
|
696 |
@return The SIG error code.
|
williamr@2
|
697 |
*/
|
williamr@2
|
698 |
TInt ErrorCode() const { return iErrorCode; };
|
williamr@2
|
699 |
|
williamr@2
|
700 |
/**
|
williamr@2
|
701 |
The Symbian HCI error code associated with the event.
|
williamr@2
|
702 |
@return The Symbian error code.
|
williamr@2
|
703 |
*/
|
williamr@2
|
704 |
IMPORT_C TInt SymbianErrorCode() const;
|
williamr@2
|
705 |
|
williamr@2
|
706 |
/**
|
williamr@2
|
707 |
Set the event type.
|
williamr@2
|
708 |
@param aEventType The event type.
|
williamr@2
|
709 |
*/
|
williamr@2
|
710 |
void SetEventType(TUint32 aEventType) { iEventType = aEventType; };
|
williamr@2
|
711 |
|
williamr@2
|
712 |
/**
|
williamr@2
|
713 |
Set the error code.
|
williamr@2
|
714 |
@param aErrorCode The Bluetooth SIG error code.
|
williamr@2
|
715 |
*/
|
williamr@2
|
716 |
void SetErrorCode(TInt aErrorCode) { iErrorCode = aErrorCode; };
|
williamr@2
|
717 |
|
williamr@2
|
718 |
private:
|
williamr@2
|
719 |
TUint32 iEventType;
|
williamr@2
|
720 |
TInt iErrorCode;
|
williamr@2
|
721 |
};
|
williamr@2
|
722 |
|
williamr@2
|
723 |
/**
|
williamr@2
|
724 |
@publishedAll
|
williamr@2
|
725 |
@released
|
williamr@2
|
726 |
|
williamr@2
|
727 |
Typedef'ed pckgbuf of the class TBTBasebandEventNotification.
|
williamr@2
|
728 |
*/
|
williamr@2
|
729 |
typedef TPckgBuf<TBTBasebandEventNotification> TBTBasebandEvent;
|
williamr@2
|
730 |
|
williamr@2
|
731 |
/**
|
williamr@2
|
732 |
@publishedAll
|
williamr@2
|
733 |
@released
|
williamr@2
|
734 |
|
williamr@2
|
735 |
General Unlimited Inquiry Access Code
|
williamr@2
|
736 |
*/
|
williamr@2
|
737 |
const TUint KGIAC=0x9e8b33;
|
williamr@2
|
738 |
|
williamr@2
|
739 |
/**
|
williamr@2
|
740 |
@publishedAll
|
williamr@2
|
741 |
@released
|
williamr@2
|
742 |
|
williamr@2
|
743 |
Limited Inquiry Access Code
|
williamr@2
|
744 |
*/
|
williamr@2
|
745 |
const TUint KLIAC=0x9e8b00;
|
williamr@2
|
746 |
|
williamr@4
|
747 |
/**
|
williamr@4
|
748 |
L2CAP channel modes
|
williamr@4
|
749 |
@publishedAll
|
williamr@4
|
750 |
@released
|
williamr@4
|
751 |
*/
|
williamr@4
|
752 |
enum TL2CapChannelMode
|
williamr@4
|
753 |
{
|
williamr@4
|
754 |
EL2CAPBasicMode = 0x00,
|
williamr@4
|
755 |
EL2CAPRetransmissionMode = 0x01,
|
williamr@4
|
756 |
EL2CAPFlowControlMode = 0x02,
|
williamr@4
|
757 |
EL2CAPEnhancedRetransmissionMode = 0x03,
|
williamr@4
|
758 |
EL2CAPStreamingMode = 0x04,
|
williamr@4
|
759 |
};
|
williamr@2
|
760 |
|
williamr@2
|
761 |
/**
|
williamr@2
|
762 |
@publishedAll
|
williamr@2
|
763 |
@released
|
williamr@2
|
764 |
|
williamr@4
|
765 |
API class for setting up an L2Cap channel configuration.
|
williamr@2
|
766 |
|
williamr@4
|
767 |
This class may be used to set all or a subset of the following configuration
|
williamr@4
|
768 |
items:
|
williamr@2
|
769 |
Channel Reliability (and associated timer)
|
williamr@4
|
770 |
Maximum Transmission Unit (MTU) value preferred during MTU negotiation
|
williamr@4
|
771 |
Maximum Receive Unit (MRU) value preferred during MRU negotiation
|
williamr@4
|
772 |
Minimum MTU value acceptable during MTU negotiation
|
williamr@4
|
773 |
Minimum MRU value acceptable during MRU negotiation
|
williamr@2
|
774 |
Channel Priority
|
williamr@2
|
775 |
|
williamr@4
|
776 |
If a configuration item is to be set, then its 'Set' or 'Configure'
|
williamr@2
|
777 |
method should be called.
|
williamr@2
|
778 |
|
williamr@4
|
779 |
Once a TL2CapConfig object has been set up it can be used to configure a socket
|
williamr@4
|
780 |
using RSocket::SetOption or RSocket::Ioctl (or the CBluetoothSocket equivalents).
|
williamr@4
|
781 |
|
williamr@4
|
782 |
If the preferred Maximum Transmission Unit (MTU) value is specified but its
|
williamr@4
|
783 |
minimum acceptable value is not specified in the same object, then the minimum
|
williamr@4
|
784 |
acceptable value will be implicitly taken to be equal to the preferred MTU by
|
williamr@4
|
785 |
the L2CAP APIs processing the object. This means that only an MTU greater than or
|
williamr@4
|
786 |
equal to the preferred MTU will be accepted from the peer during negotiation.
|
williamr@4
|
787 |
|
williamr@4
|
788 |
If the Maximum Receive Unit (MRU) value is specified but its minimum acceptable
|
williamr@4
|
789 |
value is not, then the minimum acceptable value is implicitly taken to be equal
|
williamr@4
|
790 |
to the protocol minimum (48 bytes) by the L2CAP APIs processing the object.
|
williamr@4
|
791 |
|
williamr@4
|
792 |
Note that even though this API allows setting of Obsolescence timer, outgoing
|
williamr@4
|
793 |
packet flushing may not be supported on all hardware.
|
williamr@2
|
794 |
|
williamr@2
|
795 |
@see RSocket
|
williamr@2
|
796 |
@see CBluetoothSocket
|
williamr@2
|
797 |
*/
|
williamr@2
|
798 |
NONSHARABLE_CLASS(TL2CapConfig)
|
williamr@2
|
799 |
{
|
williamr@2
|
800 |
public:
|
williamr@2
|
801 |
/**
|
williamr@2
|
802 |
Priority required for data on L2Cap channel
|
williamr@2
|
803 |
*/
|
williamr@2
|
804 |
enum TChannelPriority
|
williamr@2
|
805 |
{
|
williamr@2
|
806 |
EHigh = 2,
|
williamr@2
|
807 |
EMedium = 1,
|
williamr@2
|
808 |
ELow = 0,
|
williamr@2
|
809 |
};
|
williamr@2
|
810 |
|
williamr@2
|
811 |
/**
|
williamr@4
|
812 |
Reliability of data transfer preferred for L2Cap channel.
|
williamr@2
|
813 |
*/
|
williamr@2
|
814 |
enum TChannelReliability
|
williamr@2
|
815 |
{
|
williamr@2
|
816 |
EReliableChannel,
|
williamr@2
|
817 |
EUnreliableChannel,
|
williamr@4
|
818 |
EUnreliableDesiredChannel
|
williamr@2
|
819 |
};
|
williamr@2
|
820 |
|
williamr@2
|
821 |
/**
|
williamr@2
|
822 |
Timer values in milliseconds for reliable and unreliable channels
|
williamr@2
|
823 |
*/
|
williamr@2
|
824 |
enum TL2CapConfigSpecifiedTimers
|
williamr@2
|
825 |
{
|
williamr@2
|
826 |
/**
|
williamr@4
|
827 |
This is a time in milliseconds. However 0xffff has been given a special
|
williamr@4
|
828 |
meaning in this interface. It means "Allow maximum possible number of
|
williamr@4
|
829 |
transmissions of a single packet before giving up and disconnecting the
|
williamr@4
|
830 |
L2Cap channel." This is the maximum number of transmissions effectively
|
williamr@4
|
831 |
allowed by the spec. It only applies to reliable modes and is 255 for
|
williamr@4
|
832 |
Retransmission Mode and Infinity for Enhanced Retransmission Mode.
|
williamr@2
|
833 |
*/
|
williamr@2
|
834 |
EDefaultRetransmission = 0xffff,
|
williamr@2
|
835 |
/**
|
williamr@2
|
836 |
Minimum data obsolescence timeout required because data packets
|
williamr@2
|
837 |
will not ever be sent if we flush them too quickly.
|
williamr@2
|
838 |
Speed of sending data depends on how many channels are open and channel priority.
|
williamr@4
|
839 |
Note that flushing of outgoing packets may not be implemented on all Symbian OS
|
williamr@4
|
840 |
platforms.
|
williamr@2
|
841 |
*/
|
williamr@2
|
842 |
EMinDataObsolescenceTimeout = 0x0a,
|
williamr@2
|
843 |
/**
|
williamr@2
|
844 |
This is translated to mean never flush (as per spec).
|
williamr@2
|
845 |
*/
|
williamr@2
|
846 |
EDefaultDataObsolescenceTimeout = 0xffff,
|
williamr@2
|
847 |
};
|
williamr@2
|
848 |
|
williamr@2
|
849 |
/**
|
williamr@2
|
850 |
Used to indicate which config options have been specified by the user
|
williamr@2
|
851 |
*/
|
williamr@2
|
852 |
enum TL2CapConfigSpecifiedMask
|
williamr@2
|
853 |
{
|
williamr@2
|
854 |
ENoConfigElementsSpecified = 0x0000,
|
williamr@2
|
855 |
EMTUSizeSpecifiedMask = 0x0001,
|
williamr@2
|
856 |
EMRUSizeSpecifiedMask = 0x0002,
|
williamr@2
|
857 |
EReliabilitySpecifiedMask = 0x0004,
|
williamr@2
|
858 |
EPrioritySpecifiedMask = 0x0008,
|
williamr@4
|
859 |
EMinMTUSizeSpecifiedMask = 0x0010,
|
williamr@4
|
860 |
EMinMRUSizeSpecifiedMask = 0x0020,
|
williamr@4
|
861 |
ELegacyModesDisallowedSpecifiedMask = 0x0040
|
williamr@2
|
862 |
};
|
williamr@2
|
863 |
|
williamr@2
|
864 |
IMPORT_C TL2CapConfig();
|
williamr@2
|
865 |
|
williamr@2
|
866 |
IMPORT_C TInt SetMaxTransmitUnitSize(TUint16 aSize = 0xffff);
|
williamr@2
|
867 |
IMPORT_C TUint16 MaxTransmitUnitSize(TBool& aIsSpecified) const;
|
williamr@2
|
868 |
IMPORT_C TInt SetMaxReceiveUnitSize(TUint16 aSize = 0xffff);
|
williamr@2
|
869 |
IMPORT_C TUint16 MaxReceiveUnitSize(TBool& aIsSpecified) const;
|
williamr@4
|
870 |
|
williamr@4
|
871 |
IMPORT_C TInt SetMinMTU(TUint16 aSize);
|
williamr@4
|
872 |
IMPORT_C TUint16 MinMTU(TBool& aIsSpecified) const;
|
williamr@4
|
873 |
|
williamr@4
|
874 |
IMPORT_C TInt SetMinMRU(TUint16 aSize);
|
williamr@4
|
875 |
IMPORT_C TUint16 MinMRU(TBool& aIsSpecified) const;
|
williamr@2
|
876 |
|
williamr@2
|
877 |
IMPORT_C TInt ConfigureReliableChannel(TUint16 aRetransmissionTimer);
|
williamr@2
|
878 |
IMPORT_C TInt ConfigureUnreliableChannel(TUint16 aObsolescenceTimer);
|
williamr@4
|
879 |
IMPORT_C TInt ConfigureUnreliableDesiredChannel(TUint16 aObsolescenceTimer, TUint16 aRetransmissionTimer);
|
williamr@4
|
880 |
IMPORT_C void SetLegacyModesDisallowed(TBool aDisallowed);
|
williamr@4
|
881 |
IMPORT_C TBool LegacyModesDisallowed() const;
|
williamr@4
|
882 |
|
williamr@2
|
883 |
IMPORT_C TChannelReliability ChannelReliability(TBool& aIsSpecified, TUint16& aAssociatedTimer) const;
|
williamr@4
|
884 |
|
williamr@4
|
885 |
IMPORT_C TChannelReliability ChannelReliability(TBool& aIsSpecified) const;
|
williamr@4
|
886 |
IMPORT_C TUint16 RetransmissionTimer(TBool& aIsSpecified) const;
|
williamr@4
|
887 |
IMPORT_C TUint16 ObsolescenceTimer(TBool& aIsSpecified) const;
|
williamr@2
|
888 |
|
williamr@2
|
889 |
IMPORT_C TInt ConfigureChannelPriority(TChannelPriority aPriority);
|
williamr@2
|
890 |
IMPORT_C TChannelPriority ChannelPriority(TBool& aIsSpecified) const;
|
williamr@4
|
891 |
|
williamr@2
|
892 |
/**
|
williamr@2
|
893 |
@deprecated
|
williamr@2
|
894 |
Use ConfigureReliableChannel(TUint16 aRetransmissionTimer) instead
|
williamr@2
|
895 |
*/
|
williamr@2
|
896 |
IMPORT_C TInt SetupReliableChannel(TUint16 aRetransmissionTimer = EDefaultRetransmission);
|
williamr@2
|
897 |
/**
|
williamr@2
|
898 |
@deprecated
|
williamr@2
|
899 |
Use ConfigureUnreliableChannel(TUint16 aObsolescenceTimer) instead
|
williamr@2
|
900 |
*/
|
williamr@2
|
901 |
IMPORT_C TInt SetupUnreliableChannel(TUint16 aObsolescenceTimer = EDefaultDataObsolescenceTimeout);
|
williamr@2
|
902 |
/**
|
williamr@2
|
903 |
@deprecated
|
williamr@2
|
904 |
Use ConfigureChannelPriority(TChannelPriority aPriority) instead
|
williamr@2
|
905 |
*/
|
williamr@2
|
906 |
IMPORT_C TInt SetChannelPriority(TChannelPriority aPriority = ELow);
|
williamr@4
|
907 |
|
williamr@2
|
908 |
private:
|
williamr@4
|
909 |
TUint16 iMTUSize;
|
williamr@4
|
910 |
TUint16 iMRUSize;
|
williamr@4
|
911 |
TChannelReliability iChannelReliability;
|
williamr@4
|
912 |
TUint16 iChannelReliabilityTimer; // see note below
|
williamr@4
|
913 |
TChannelPriority iChannelPriority;
|
williamr@4
|
914 |
TUint16 iSpecifiedMask;
|
williamr@4
|
915 |
TUint16 iMinMTUSize; // Minimum acceptable MTU.
|
williamr@4
|
916 |
TUint16 iMinMRUSize; // Minimum acceptable MRU.
|
williamr@4
|
917 |
TUint16 iAdditionalChannelReliabilityTimer; // see note below
|
williamr@4
|
918 |
// This data padding has been added to help prevent future binary compatibility breaks.
|
williamr@4
|
919 |
TUint16 iPadding;
|
williamr@2
|
920 |
|
williamr@4
|
921 |
// Note on the timer fields:
|
williamr@4
|
922 |
// iAdditionalChannelReliabilityTimer has been added when a need to pass two timers within
|
williamr@4
|
923 |
// one object arose. To maintain BC with existing clients of this class, when a single timer
|
williamr@4
|
924 |
// is passed, it's always stored in iChannelReliabilityTimer. Changing this to just having
|
williamr@4
|
925 |
// iRetransmissionTimer & iObsolescenceTimer would break BC.
|
williamr@4
|
926 |
// When both timers are stored, Flush timeout goes in iChannelReliabilityTimer and
|
williamr@4
|
927 |
// Retransmission timeout goes in iAdditionalChannelReliabilityTimer.
|
williamr@2
|
928 |
};
|
williamr@2
|
929 |
|
williamr@2
|
930 |
/**
|
williamr@2
|
931 |
@publishedAll
|
williamr@2
|
932 |
@released
|
williamr@2
|
933 |
|
williamr@2
|
934 |
Typedef to represent a L2CAP Config object.
|
williamr@2
|
935 |
*/
|
williamr@2
|
936 |
typedef TPckgBuf<TL2CapConfig> TL2CapConfigPkg;
|
williamr@2
|
937 |
|
williamr@2
|
938 |
|
williamr@2
|
939 |
enum TEirWrapperPanics
|
williamr@2
|
940 |
{
|
williamr@2
|
941 |
EEirBadUuid16List = 0,
|
williamr@2
|
942 |
EEirBadUuid128List = 1,
|
williamr@2
|
943 |
};
|
williamr@2
|
944 |
_LIT(KEirWrapperPanicName, "ExtendedInquiryResponseWrapper");
|
williamr@2
|
945 |
|
williamr@2
|
946 |
#endif //_BTTYPES_H
|