1 | /*␊ |
2 | ␉File:␉␉Bluetooth.h␊ |
3 | ␉Contains:␉Public interfaces for Bluetooth technology.␊ |
4 | ␉Copyright:␉(c) 2002-2007 by Apple Inc. All rights reserved.␊ |
5 | */␊ |
6 | ␊ |
7 | #pragma once␊ |
8 | ␊ |
9 | #ifdef KERNEL␊ |
10 | #include␉<IOKit/bluetooth/BluetoothAssignedNumbers.h>␊ |
11 | #else␊ |
12 | #include ␉<CoreFoundation/CFBase.h>␊ |
13 | #include␉<IOBluetooth/BluetoothAssignedNumbers.h>␊ |
14 | #endif␊ |
15 | ␊ |
16 | #include <IOKit/IOTypes.h>␊ |
17 | #include <libkern/OSByteOrder.h>␊ |
18 | ␊ |
19 | //---------------------------------------------------------------------------------------------------------------------------␊ |
20 | /*!␉@header␉␉Bluetooth␊ |
21 | ␉Bluetooth wireless technology␊ |
22 | */␊ |
23 | ␊ |
24 | #ifdef␉__cplusplus␊ |
25 | ␉extern "C" {␊ |
26 | #endif␊ |
27 | ␊ |
28 | ␊ |
29 | #if 0␊ |
30 | ␊ |
31 | #pragma mark === Baseband ===␊ |
32 | #endif␊ |
33 | ␊ |
34 | //===========================================================================================================================␊ |
35 | //␉Baseband␊ |
36 | //===========================================================================================================================␊ |
37 | ␊ |
38 | typedef UInt16␉␉BluetoothConnectionHandle;␉␉// Upper 4 bits are reserved.␊ |
39 | typedef uint8_t␉␉BluetoothLMPHandle;␊ |
40 | enum␊ |
41 | {␊ |
42 | kBluetoothConnectionHandleNone␉= 0xffff␊ |
43 | };␊ |
44 | ␊ |
45 | typedef UInt8␉␉BluetoothReasonCode;␊ |
46 | typedef UInt8␉␉BluetoothEncryptionEnable;␊ |
47 | enum␊ |
48 | {␊ |
49 | ␉kBluetoothEncryptionEnableOff ␉= 0x00, ␊ |
50 | ␉kBluetoothEncryptionEnableOn␉= 0x01␊ |
51 | };␊ |
52 | ␊ |
53 | typedef UInt8␉␉BluetoothKeyFlag;␊ |
54 | enum␊ |
55 | {␊ |
56 | ␉kBluetoothKeyFlagSemiPermanent ␉= 0x00, ␊ |
57 | ␉kBluetoothKeyFlagTemporary ␉␉= 0x01␊ |
58 | };␊ |
59 | ␊ |
60 | typedef UInt8␉␉BluetoothKeyType;␊ |
61 | enum␊ |
62 | {␊ |
63 | ␉kBluetoothKeyTypeCombination␉␉␉␉␉= 0x00, ␊ |
64 | ␉kBluetoothKeyTypeLocalUnit␉␉␉␉␉␉= 0x01,␊ |
65 | ␉kBluetoothKeyTypeRemoteUnit␉␉␉␉␉␉= 0x02,␊ |
66 | ␉kBluetoothKeyTypeDebugCombination␉␉␉␉= 0x03,␊ |
67 | ␉kBluetoothKeyTypeUnauthenticatedCombination␉␉= 0x04,␊ |
68 | ␉kBluetoothKeyTypeAuthenticatedCombination␉␉= 0x05,␊ |
69 | ␉kBluetoothKeyTypeChangedCombination␉␉␉␉= 0x06,␊ |
70 | };␊ |
71 | ␊ |
72 | // Packet types (Bluetooth spec section 7.1.5 - Create Connection)␊ |
73 | ␊ |
74 | typedef UInt16␉␉BluetoothPacketType;␊ |
75 | enum␊ |
76 | {␊ |
77 | ␉kBluetoothPacketTypeReserved1␉= 0x0001, ␊ |
78 | ␉kBluetoothPacketType2DH1Omit␉= 0x0002,␉// Masks OUT this packet type␊ |
79 | ␉kBluetoothPacketType3DH1Omit␉= 0x0004,␉// Masks OUT this packet type␊ |
80 | ␊ |
81 | ␉kBluetoothPacketTypeDM1␉␉␉= 0x0008, ␊ |
82 | ␉kBluetoothPacketTypeDH1␉␉␉= 0x0010, ␊ |
83 | ␉kBluetoothPacketTypeHV1␉␉␉= 0x0020, ␉// Reserved␊ |
84 | ␉kBluetoothPacketTypeHV2␉␉␉= 0x0040, ␉// Reserved␊ |
85 | ␉kBluetoothPacketTypeHV3␉␉␉= 0x0080, ␉// Reserved␊ |
86 | ␉kBluetoothPacketTypeDV␉␉␉= 0x0100, ␉// Reserved␊ |
87 | ␉kBluetoothPacketType2DH3Omit␉= 0x0100,␉// Masks OUT this packet type␊ |
88 | ␉kBluetoothPacketType3DH3Omit␉= 0x0200,␉// Masks OUT this packet type␊ |
89 | ␉kBluetoothPacketTypeAUX␉␉␉= 0x0200,␉// Deprecated␊ |
90 | ␉␊ |
91 | ␉kBluetoothPacketTypeDM3␉␉␉= 0x0400, ␊ |
92 | ␉kBluetoothPacketTypeDH3␉␉␉= 0x0800,␊ |
93 | ␉␊ |
94 | ␉kBluetoothPacketType2DH5Omit␉= 0x1000,␉// Masks OUT this packet type␊ |
95 | ␉kBluetoothPacketType3DM5Omit␉= 0x2000,␉// Masks OUT this packet type ␊ |
96 | ␉␊ |
97 | ␉kBluetoothPacketTypeDM5␉␉␉= 0x4000, ␊ |
98 | ␉kBluetoothPacketTypeDH5␉␉␉= 0x8000, ␊ |
99 | ␉␊ |
100 | ␉kBluetoothPacketTypeEnd␊ |
101 | };␊ |
102 | ␊ |
103 | // Setup Synchronous Packet types (Bluetooth 2.1 spec section 7.1.26 - Setup Synchronous Command)␊ |
104 | ␊ |
105 | enum␊ |
106 | {␊ |
107 | ␉kBluetoothSynchronousConnectionPacketTypeHV1␉␉␉= 0x0001,␊ |
108 | ␉kBluetoothSynchronousConnectionPacketTypeHV2␉␉␉= 0x0002,␊ |
109 | ␉kBluetoothSynchronousConnectionPacketTypeHV3␉␉␉= 0x0004,␊ |
110 | ␉kBluetoothSynchronousConnectionPacketTypeEV3␉␉␉= 0x0008,␊ |
111 | ␉kBluetoothSynchronousConnectionPacketTypeEV4␉␉␉= 0x0010,␊ |
112 | ␉kBluetoothSynchronousConnectionPacketTypeEV5␉␉␉= 0x0020,␊ |
113 | ␊ |
114 | ␉// masking out certain types:␊ |
115 | ␉␊ |
116 | ␉kBluetoothSynchronousConnectionPacketType2EV3Omit␉␉= 0x0040,␊ |
117 | ␉kBluetoothSynchronousConnectionPacketType3EV3Omit␉␉= 0x0080,␊ |
118 | ␉kBluetoothSynchronousConnectionPacketType2EV5Omit␉␉= 0x0100,␊ |
119 | ␉kBluetoothSynchronousConnectionPacketType3EV5Omit␉␉= 0x0200,␊ |
120 | ␉␊ |
121 | ␉kBluetoothSynchronousConnectionPacketTypeAll␉␉␉= 0xFFFF,␊ |
122 | ␊ |
123 | ␉kBluetoothSynchronousConnectionPacketTypeEnd␊ |
124 | };␊ |
125 | ␊ |
126 | ␊ |
127 | // LAP/Inquiry Access Codes␊ |
128 | ␊ |
129 | typedef UInt32␉␉BluetoothLAP;␊ |
130 | enum␊ |
131 | {␊ |
132 | ␉kBluetoothGeneralInquiryAccessCodeIndex␉␉= 0, ␉␉␉// General/Unlimited Inquiry Access Code (GIAC)␊ |
133 | ␉kBluetoothGeneralInquiryAccessCodeLAPValue ␉= 0x9E8B33, ␉// General/Unlimited Inquiry Access Code (GIAC)␊ |
134 | ␉␊ |
135 | ␉kBluetoothLimitedInquiryAccessCodeIndex␉␉= 1, ␉␉␉// Limited Dedicated Inquiry Access Code (LIAC)␊ |
136 | ␉kBluetoothLimitedInquiryAccessCodeLAPValue ␉= 0x9E8B00, ␉// Limited Dedicated Inquiry Access Code (LIAC)␊ |
137 | ␉␊ |
138 | ␉// All other access codes are reserved for future use (indices 2-63, LAP values 0x9E8B01-0x9E8B32 and 0x9E8B34-0x9E8B3F).␊ |
139 | ␉␊ |
140 | ␉kBluetoothLimitedInquiryAccessCodeEnd␊ |
141 | };␊ |
142 | ␊ |
143 | // PageScanRepetitionMode␊ |
144 | ␊ |
145 | typedef␉UInt8␉BluetoothPageScanRepetitionMode;␊ |
146 | enum␊ |
147 | {␊ |
148 | ␉kBluetoothPageScanRepetitionModeR0 ␉␉␉= 0x00, ␊ |
149 | ␉kBluetoothPageScanRepetitionModeR1 ␉␉␉= 0x01, ␊ |
150 | ␉kBluetoothPageScanRepetitionModeR2 ␉␉␉= 0x02␊ |
151 | ␉␊ |
152 | ␉// All other values are reserved for future use.␊ |
153 | };␊ |
154 | ␊ |
155 | // PageScanPeriodMode␊ |
156 | ␊ |
157 | typedef UInt8␉BluetoothPageScanPeriodMode;␊ |
158 | enum␊ |
159 | {␊ |
160 | ␉kBluetoothPageScanPeriodModeP0 ␉␉␉␉= 0x00, ␊ |
161 | ␉kBluetoothPageScanPeriodModeP1 ␉␉␉␉= 0x01, ␊ |
162 | ␉kBluetoothPageScanPeriodModeP2 ␉␉␉␉= 0x02␊ |
163 | ␉␊ |
164 | ␉// All other values are reserved for future use.␊ |
165 | };␊ |
166 | ␊ |
167 | // PageScanMode␊ |
168 | ␊ |
169 | typedef UInt8␉BluetoothPageScanMode;␊ |
170 | enum␊ |
171 | {␊ |
172 | ␉kBluetoothPageScanModeMandatory ␉␉␉= 0x00, ␊ |
173 | ␉kBluetoothPageScanModeOptional1 ␉␉␉= 0x01, ␊ |
174 | ␉kBluetoothPageScanModeOptional2 ␉␉␉= 0x02, ␊ |
175 | ␉kBluetoothPageScanModeOptional3 ␉␉␉= 0x03␊ |
176 | ␉␊ |
177 | ␉// All other values are reserved for future use.␊ |
178 | };␊ |
179 | ␊ |
180 | #if 0␊ |
181 | #pragma mark -␊ |
182 | #pragma mark === Devices ===␊ |
183 | #endif␊ |
184 | ␊ |
185 | typedef struct␉BluetoothDeviceAddress␉␉BluetoothDeviceAddress;␊ |
186 | struct␉BluetoothDeviceAddress␊ |
187 | {␊ |
188 | ␉UInt8␉␉data[ 6 ];␊ |
189 | };␊ |
190 | ␊ |
191 | typedef struct␉BluetoothKey␉␉␉␉BluetoothKey;␊ |
192 | struct␉BluetoothKey␊ |
193 | {␊ |
194 | ␉UInt8␉␉data[ 16 ];␊ |
195 | };␊ |
196 | ␊ |
197 | typedef struct␉BluetoothPINCode␉␉␉BluetoothPINCode;␊ |
198 | struct␉BluetoothPINCode␊ |
199 | {␊ |
200 | ␉UInt8␉␉data[ 16 ];␉␉// PIN codes may be up to 128 bits.␊ |
201 | };␊ |
202 | ␊ |
203 | ␊ |
204 | //␉Physical layout of the "class of device/service" field (see Bluetooth Assigned Numbers section 1.2):␊ |
205 | //␊ |
206 | //␉ 2 2 2 2 1 1 1 1 1 1 1 1 1 1␊ |
207 | //␉ 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 <- Bit Transmission Order␊ |
208 | //␉+---------------+---------------+---------------+␊ |
209 | //␉| octet 3 | octet 2 | octet 1 | <- Octet Transmission Order␊ |
210 | //␉+---------------+---------------+---------------+␊ |
211 | //␉<------ 11 bits ----->< 5 bits ><- 6 bits ->␊ |
212 | //␉+---------------------+---------+-----------+-+-+␊ |
213 | //␉| Service Classes | Major | Minor | | |␊ |
214 | //␉+-+-+-+-+-+-+-+-+-+-+-+ Device | Device |0|0|␊ |
215 | //␉| | | | | | | |*|*|*| | Class | Class | | |␊ |
216 | //␉+-+-+-+-+-+-+-+-+-+-+-+---------+-----------+-+-+␊ |
217 | //␉ | | | | | | | | |␊ |
218 | // | | | | | | | + Limited Discoverable +- Format Type␊ |
219 | //␉ | | | | | | +- Networking␊ |
220 | //␉ | | | | | +- Rendering␊ |
221 | //␉ | | | | +- Capturing␊ |
222 | //␉ | | | +- Object Transfer␊ |
223 | //␉ | | +- Audio␊ |
224 | //␉ | +- Telephony␊ |
225 | //␉ +- Information␊ |
226 | ␊ |
227 | typedef UInt32␉␉BluetoothClassOfDevice;␊ |
228 | ␊ |
229 | #define␉␉BluetoothGetDeviceClassMajor( inCOD )␉␉( (inCOD & 0x00001F00) >> 8 )␊ |
230 | #define␉␉BluetoothGetDeviceClassMinor( inCOD )␉␉( (inCOD & 0x000000FC) >> 2 )␊ |
231 | #define␉␉BluetoothGetServiceClassMajor( inCOD )␉␉( (inCOD & 0x00FFE000) >> 13 )␊ |
232 | #define␉␉BluetoothMakeClassOfDevice( inServiceClassMajor, inDeviceClassMajor, inDeviceClassMinor )␉␉\␊ |
233 | ␉␉␉␉␉␉␉␉␉␉(((inServiceClassMajor << 13) & 0x00FFE000) | ((inDeviceClassMajor << 8) & 0x00001F00) | ((inDeviceClassMinor << 2) & 0x000000FC))␊ |
234 | ␊ |
235 | ///␊ |
236 | /// Major Service Classes (11-bit value - bits 13-23 of Device/Service field)␊ |
237 | ///␊ |
238 | ␊ |
239 | typedef UInt32␉␉BluetoothServiceClassMajor;␊ |
240 | // Service Class Major enum in BluetoothAssignedNumbers.h␊ |
241 | ␊ |
242 | ///␊ |
243 | /// Major Device Classes (5-bit value - bits 8-12 of Device/Service field)␊ |
244 | ///␊ |
245 | ␊ |
246 | typedef UInt32␉␉BluetoothDeviceClassMajor;␊ |
247 | // Device Class Major enum in BluetoothAssignedNumbers.h␊ |
248 | ␊ |
249 | ///␊ |
250 | /// Minor Device Classes (6-bit value - bits 2-7 of Device/Service field)␊ |
251 | ///␊ |
252 | ␊ |
253 | typedef UInt32␉␉BluetoothDeviceClassMinor;␊ |
254 | // Device Class Minor enum in BluetoothAssignedNumbers.h␊ |
255 | ␊ |
256 | // Misc Device Types␊ |
257 | ␊ |
258 | enum␊ |
259 | {␊ |
260 | ␉kBluetoothDeviceNameMaxLength␉= 248␊ |
261 | };␊ |
262 | typedef UInt8␉BluetoothDeviceName[ 256 ];␉␉// Max 248 bytes of UTF-8 encoded Unicode.␊ |
263 | typedef UInt16␉BluetoothClockOffset;␉␉␉// Bits 14-0 come from bits 16-2 of CLKslav-CLKmaster.␊ |
264 | typedef UInt8␉BluetoothRole;␉␉␉␉␉// ␊ |
265 | typedef UInt8␉BluetoothAllowRoleSwitch;␉␉// 0x00-0x01 valid, 0x02-0xFF reserved.␊ |
266 | enum␊ |
267 | {␊ |
268 | ␉kBluetoothDontAllowRoleSwitch ␉= 0x00, ␊ |
269 | ␉kBluetoothAllowRoleSwitch ␉␉= 0x01␊ |
270 | };␊ |
271 | ␊ |
272 | enum␊ |
273 | {␊ |
274 | ␉kBluetoothRoleBecomeMaster ␉= 0x00, ␊ |
275 | ␉kBluetoothRoleRemainSlave ␉= 0x01␊ |
276 | };␊ |
277 | ␊ |
278 | typedef struct BluetoothSetEventMask␉BluetoothSetEventMask;␊ |
279 | struct␉BluetoothSetEventMask␊ |
280 | {␊ |
281 | ␉UInt8␉␉data[ 8 ];␊ |
282 | };␊ |
283 | ␊ |
284 | typedef UInt8␉BluetoothPINType;␊ |
285 | ␊ |
286 | ␊ |
287 | #if 0␊ |
288 | #pragma mark -␊ |
289 | #pragma mark === L2CAP ===␊ |
290 | #endif␊ |
291 | ␊ |
292 | //===========================================================================================================================␊ |
293 | //␉Logical Link Control and Adaptation Protocol (L2CAP)␊ |
294 | //===========================================================================================================================␊ |
295 | ␊ |
296 | ␊ |
297 | // ACL Packet values (Bluetooth L2CAP spec section 1).␊ |
298 | ␊ |
299 | enum␊ |
300 | {␊ |
301 | ␉kBluetoothL2CAPMaxPacketSize␉␉␉␉␉= 65535,␉// Max number of data bytes in an L2CAP packet.␊ |
302 | ␊ |
303 | ␉kBluetoothACLLogicalChannelReserved ␉␉␉= 0, ␉␉// [00] Reserved for future use␊ |
304 | ␉kBluetoothACLLogicalChannelL2CAPContinue␉ ␉= 1, ␉␉// [01] Continuation of L2CAP packet.␊ |
305 | ␉kBluetoothACLLogicalChannelL2CAPStart ␉␉␉= 2, ␉␉// [10] Start of L2CAP packet.␊ |
306 | ␉kBluetoothACLLogicalChannelLMP␉ ␉␉␉␉= 3␉␉␉// [11] Link Manager Protocol packet.␊ |
307 | };␊ |
308 | ␊ |
309 | // Channel Identifiers (Bluetooth L2CAP spec section 2.1).␊ |
310 | ␊ |
311 | typedef UInt16␉␉BluetoothL2CAPChannelID;␊ |
312 | enum␊ |
313 | {␊ |
314 | ␉kBluetoothL2CAPChannelNull␉␉␉␉␉= 0x0000, ␉// Illegal, should not be used␊ |
315 | ␉kBluetoothL2CAPChannelSignalling␉ ␉␉= 0x0001, ␉// L2CAP signalling channel␊ |
316 | ␉kBluetoothL2CAPChannelConnectionLessData␉= 0x0002, ␉// L2CAP connection less data␊ |
317 | ␉kBluetoothL2CAPChannelAMPManagerProtocol␉= 0x0003,␉// AMP Manager Protocol␊ |
318 | ␉␊ |
319 | ␉// Range 0x0003 to 0x003F reserved for future use.␊ |
320 | ␉kBluetoothL2CAPChannelReservedStart␉␉␉= 0x0004,␊ |
321 | kBluetoothL2CAPChannelReservedEnd␉␉␉= 0x003F,␊ |
322 | ␊ |
323 | // Range 0x0040 to 0xFFFF are dynamically allocated.␊ |
324 | kBluetoothL2CAPChannelDynamicStart␉␉␉= 0x0040,␊ |
325 | kBluetoothL2CAPChannelDynamicEnd␉␉␉= 0xffff,␊ |
326 | ␉kBluetoothL2CAPChannelEnd␉␉␉␉␉= 0xffff␊ |
327 | };␊ |
328 | ␊ |
329 | typedef BluetoothL2CAPChannelID␉␉BluetoothL2CAPGroupID;␊ |
330 | ␊ |
331 | // Protocol/Service Multiplexor (PSM) values (Bluetooth L2CAP spec section 5.2).␊ |
332 | ␊ |
333 | typedef UInt16␉␉BluetoothL2CAPPSM;␊ |
334 | // PSM enum in BluetoothAssignedNumbers.h␊ |
335 | ␊ |
336 | // Command Codes␊ |
337 | ␊ |
338 | typedef enum␊ |
339 | {␊ |
340 | ␉kBluetoothL2CAPCommandCodeReserved␉␉␉␉␉␉␉= 0x00, ␊ |
341 | ␉kBluetoothL2CAPCommandCodeCommandReject␉␉␉␉␉␉= 0x01, ␊ |
342 | ␉kBluetoothL2CAPCommandCodeConnectionRequest␉␉␉␉␉= 0x02, ␊ |
343 | ␉kBluetoothL2CAPCommandCodeConnectionResponse␉␉␉␉= 0x03, ␊ |
344 | ␉kBluetoothL2CAPCommandCodeConfigureRequest␉␉␉␉␉= 0x04, ␊ |
345 | ␉kBluetoothL2CAPCommandCodeConfigureResponse␉␉␉␉␉= 0x05, ␊ |
346 | ␉kBluetoothL2CAPCommandCodeDisconnectionRequest␉␉␉␉= 0x06, ␊ |
347 | ␉kBluetoothL2CAPCommandCodeDisconnectionResponse␉␉␉␉= 0x07, ␊ |
348 | ␉kBluetoothL2CAPCommandCodeEchoRequest␉␉␉␉␉␉= 0x08, ␊ |
349 | ␉kBluetoothL2CAPCommandCodeEchoResponse␉␉␉␉␉␉= 0x09, ␊ |
350 | ␉kBluetoothL2CAPCommandCodeInformationRequest␉␉␉␉= 0x0A, ␊ |
351 | ␉kBluetoothL2CAPCommandCodeInformationResponse␉␉␉␉= 0x0B,␊ |
352 | ␉kBluetoothL2CAPCommandCodeCreateChannelRequest␉␉␉␉= 0x0C,␊ |
353 | ␉kBluetoothL2CAPCommandCodeCreateChannelResponse␉␉␉␉= 0x0D,␊ |
354 | ␉kBluetoothL2CAPCommandCodeMoveChannelRequest␉␉␉␉= 0x0E,␊ |
355 | ␉kBluetoothL2CAPCommandCodeMoveChannelResponse␉␉␉␉= 0x0F,␊ |
356 | ␉kBluetoothL2CAPCommandCodeMoveChannelConfirmation␉␉␉= 0x10,␊ |
357 | ␉kBluetoothL2CAPCommandCodeMoveChannelConfirmationResponse␉= 0x11,␊ |
358 | } BluetoothL2CAPCommandCode;␊ |
359 | ␊ |
360 | // Command Reject␊ |
361 | ␊ |
362 | typedef enum␊ |
363 | {␊ |
364 | ␉kBluetoothL2CAPCommandRejectReasonCommandNotUnderstood ␉= 0x0000, ␊ |
365 | ␉kBluetoothL2CAPCommandRejectReasonSignallingMTUExceeded = 0x0001, ␊ |
366 | ␉kBluetoothL2CAPCommandRejectReasonInvalidCIDInRequest ␉= 0x0002, ␊ |
367 | } BluetoothL2CAPCommandRejectReason;␊ |
368 | ␊ |
369 | typedef UInt16␉␉BluetoothL2CAPMTU;␊ |
370 | typedef␉UInt16␉␉BluetoothL2CAPLinkTimeout;␊ |
371 | typedef UInt16␉␉BluetoothL2CAPFlushTimeout;␊ |
372 | enum␊ |
373 | {␊ |
374 | ␉kBluetoothL2CAPFlushTimeoutUseExisting ␉= 0x0000, ␊ |
375 | ␉kBluetoothL2CAPFlushTimeoutImmediate ␉= 0x0001, ␊ |
376 | ␉kBluetoothL2CAPFlushTimeoutForever ␉␉= 0xFFFF, ␊ |
377 | ␉␊ |
378 | ␉kBluetoothL2CAPFlushTimeoutEnd␊ |
379 | };␊ |
380 | ␊ |
381 | typedef struct BluetoothL2CAPQualityOfServiceOptions␉BluetoothL2CAPQualityOfServiceOptions;␊ |
382 | struct BluetoothL2CAPQualityOfServiceOptions␊ |
383 | {␊ |
384 | ␉UInt8␉␉flags;␊ |
385 | ␉UInt8␉␉serviceType;␊ |
386 | ␉UInt32␉␉tokenRate;␊ |
387 | ␉UInt32␉␉tokenBucketSize;␊ |
388 | ␉UInt32␉␉peakBandwidth;␊ |
389 | ␉UInt32␉␉latency;␊ |
390 | ␉UInt32␉␉delayVariation;␊ |
391 | };␊ |
392 | ␊ |
393 | typedef struct BluetoothL2CAPRetransmissionAndFlowControlOptions BluetoothL2CAPRetransmissionAndFlowControlOptions;␊ |
394 | struct BluetoothL2CAPRetransmissionAndFlowControlOptions␊ |
395 | {␊ |
396 | ␉UInt8␉␉flags;␊ |
397 | ␉UInt8␉␉txWindowSize;␊ |
398 | ␉UInt8␉␉maxTransmit;␊ |
399 | ␉UInt16␉␉retransmissionTimeout;␊ |
400 | ␉UInt16␉␉monitorTimeout;␊ |
401 | ␉UInt16␉␉maxPDUPayloadSize;␊ |
402 | };␊ |
403 | ␊ |
404 | enum␊ |
405 | {␊ |
406 | ␉kBluetoothL2CAPInfoTypeMaxConnectionlessMTUSize = 0x0001␊ |
407 | };␊ |
408 | ␊ |
409 | // Packets␊ |
410 | ␊ |
411 | enum␊ |
412 | {␊ |
413 | ␉kBluetoothL2CAPPacketHeaderSize = 4␊ |
414 | };␊ |
415 | ␊ |
416 | typedef UInt16␉␉BluetoothL2CAPByteCount;␊ |
417 | typedef UInt8␉␉BluetoothL2CAPCommandID;␊ |
418 | typedef UInt16␉␉BluetoothL2CAPCommandByteCount;␊ |
419 | ␊ |
420 | typedef enum␊ |
421 | {␊ |
422 | kBluetoothL2CAPConnectionResultSuccessful␉␉␉␉= 0x0000,␊ |
423 | kBluetoothL2CAPConnectionResultPending␉␉␉␉␉= 0x0001,␊ |
424 | kBluetoothL2CAPConnectionResultRefusedPSMNotSupported␉= 0x0002,␊ |
425 | kBluetoothL2CAPConnectionResultRefusedSecurityBlock␉␉= 0x0003,␊ |
426 | kBluetoothL2CAPConnectionResultRefusedNoResources␉␉= 0x0004,␊ |
427 | } BluetoothL2CAPConnectionResult;␊ |
428 | ␊ |
429 | typedef enum ␊ |
430 | {␊ |
431 | kBluetoothL2CAPConnectionStatusNoInfoAvailable␉␉␉= 0x0000,␊ |
432 | kBluetoothL2CAPConnectionStatusAuthenticationPending␉= 0x0001,␊ |
433 | kBluetoothL2CAPConnectionStatusAuthorizationPending␉␉= 0x0002,␊ |
434 | } BluetoothL2CAPConnectionStatus;␊ |
435 | ␊ |
436 | typedef enum␊ |
437 | {␊ |
438 | kBluetoothL2CAPConfigurationResultSuccess␉␉␉␉␉= 0x0000,␊ |
439 | kBluetoothL2CAPConfigurationResultUnacceptableParams␉␉= 0x0001,␊ |
440 | kBluetoothL2CAPConfigurationResultRejected␉␉␉␉␉= 0x0002,␊ |
441 | kBluetoothL2CAPConfigurationResultUnknownOptions␉␉␉= 0x0003,␊ |
442 | } BluetoothL2CAPConfigurationResult;␊ |
443 | ␊ |
444 | typedef enum␊ |
445 | {␊ |
446 | kBluetoothL2CAPConfigurationOptionMTU = 0x01,␊ |
447 | kBluetoothL2CAPConfigurationOptionFlushTimeout = 0x02,␊ |
448 | kBluetoothL2CAPConfigurationOptionQoS = 0x03,␊ |
449 | kBluetoothL2CAPConfigurationOptionRetransmissionAndFlowControl = 0x04␊ |
450 | } BluetoothL2CAPConfigurationOption;␊ |
451 | ␊ |
452 | enum␊ |
453 | {␊ |
454 | kBluetoothL2CAPConfigurationOptionMTULength = 2,␊ |
455 | kBluetoothL2CAPConfigurationOptionFlushTimeoutLength = 2,␊ |
456 | kBluetoothL2CAPConfigurationOptionQoSLength = 22,␊ |
457 | kBluetoothL2CAPConfigurationOptionRetransmissionAndFlowControlLength = 9␊ |
458 | };␊ |
459 | ␊ |
460 | typedef enum␊ |
461 | {␊ |
462 | kBluetoothL2CAPConfigurationRetransmissionModeFlag = 0x01,␊ |
463 | kBluetoothL2CAPConfigurationFlowControlModeFlag = 0x02,␊ |
464 | kBluetoothL2CAPConfigurationBasicL2CAPModeFlag = 0x00,␊ |
465 | } BluetoothL2CAPConfigurationRetransmissionAndFlowControlFlags;␊ |
466 | ␊ |
467 | ␊ |
468 | typedef enum␊ |
469 | {␊ |
470 | kBluetoothL2CAPInformationTypeConnectionlessMTU␉␉␉= 0x0001,␊ |
471 | kBluetoothL2CAPInformationTypeExtendedFeatures␉␉␉= 0x0002,␊ |
472 | ␉kBluetoothL2CAPInformationTypeFixedChannelsSupported␉= 0x0003,␊ |
473 | } BluetoothL2CAPInformationType;␊ |
474 | ␊ |
475 | typedef enum␊ |
476 | {␊ |
477 | kBluetoothL2CAPInformationResultSuccess␉␉␉= 0x0000,␊ |
478 | kBluetoothL2CAPInformationResultNotSupported␉= 0x0001,␊ |
479 | } BluetoothL2CAPInformationResult;␊ |
480 | ␊ |
481 | typedef enum␊ |
482 | {␊ |
483 | kBluetoothL2CAPInformationNoExtendedFeatures␉␉␉= 0x00000000,␊ |
484 | kBluetoothL2CAPInformationFlowControlMode␉␉␉␉= 0x00000001,␊ |
485 | kBluetoothL2CAPInformationRetransmissionMode␉␉␉= 0x00000002,␊ |
486 | kBluetoothL2CAPInformationBidirectionalQoS␉␉␉␉= 0x00000004,␊ |
487 | ␉kBluetoothL2CAPInformationEnhancedRetransmissionMode␉= 0x00000008,␊ |
488 | ␉kBluetoothL2CAPInformationStreamingMode␉␉␉␉␉= 0x00000010,␊ |
489 | ␉kBluetoothL2CAPInformationFCSOption␉␉␉␉␉␉= 0x00000020,␊ |
490 | ␉kBluetoothL2CAPInformationExtendedFlowSpecification␉␉= 0x00000040,␊ |
491 | ␉kBluetoothL2CAPInformationFixedChannels␉␉␉␉␉= 0x00000080,␊ |
492 | ␉kBluetoothL2CAPInformationExtendedWindowSize␉␉␉= 0x00000100,␊ |
493 | ␉kBluetoothL2CAPUnicastConnectionlessDataReception␉␉= 0x00000200,␊ |
494 | } BluetoothL2CAPInformationExtendedFeaturesMask;␊ |
495 | ␊ |
496 | typedef enum␊ |
497 | {␊ |
498 | kBluetoothL2CAPQoSTypeNoTraffic = 0x00,␊ |
499 | kBluetoothL2CAPQoSTypeBestEffort␉= 0x01,␊ |
500 | kBluetoothL2CAPQoSTypeGuaranteed␉= 0x02,␊ |
501 | } BluetoothL2CAPQoSType;␊ |
502 | ␊ |
503 | enum␊ |
504 | {␊ |
505 | ␉kBluetoothL2CAPMTUMinimum␉␉␉␉␉= 0x0030,␉// 48 bytes␊ |
506 | ␉kBluetoothL2CAPMTUDefault␉␉␉␉␉= 0x03F9,␉// 11.10.08 - dropped back to 1017 from 1021 (don't aggravate the 3DH5 problem between CSR<->BRCM just yet)␊ |
507 | ␉kBluetoothL2CAPMTUMaximum␉␉␉␉␉= 0xffff,␉␊ |
508 | ␉kBluetoothL2CAPMTUStart␉␉␉␉␉␉= 0x7fff,␊ |
509 | ␉kBluetoothL2CAPMTUSIG␉␉␉␉␉␉= 0x0030,␉// 48 bytes␊ |
510 | ␉kBluetoothL2CAPFlushTimeoutDefault␉␉␉= kBluetoothL2CAPFlushTimeoutForever,␉// 0xffff␊ |
511 | ␉kBluetoothL2CAPQoSFlagsDefault␉␉␉␉= 0,␊ |
512 | ␉kBluetoothL2CAPQoSTypeDefault␉␉␉␉= kBluetoothL2CAPQoSTypeBestEffort,␉// 0x01␊ |
513 | ␉kBluetoothL2CAPQoSTokenRateDefault␉␉␉= 0x00000000,␊ |
514 | ␉kBluetoothL2CAPQoSTokenBucketSizeDefault␉= 0x00000000,␊ |
515 | ␉kBluetoothL2CAPQoSPeakBandwidthDefault␉␉= 0x00000000,␊ |
516 | ␉kBluetoothL2CAPQoSLatencyDefault␉␉␉= 0xffffffff,␊ |
517 | ␉kBluetoothL2CAPQoSDelayVariationDefault␉␉= 0xffffffff␊ |
518 | };␊ |
519 | ␊ |
520 | #pragma mark === AMP Manager ===␊ |
521 | typedef enum {␊ |
522 | ␉kBluetoothAMPManagerCodeReserved␉␉␉␉␉␉␉= 0x00,␊ |
523 | ␉kBluetoothAMPManagerCodeAMPCommandReject␉␉␉␉␉= 0x01,␊ |
524 | ␉kBluetoothAMPManagerCodeAMPDiscoverRequest␉␉␉␉␉= 0x02,␊ |
525 | ␉kBluetoothAMPManagerCodeAMPDiscoverResponse␉␉␉␉␉= 0x03,␊ |
526 | ␉kBluetoothAMPManagerCodeAMPChangeNotify␉␉␉␉␉␉= 0x04,␊ |
527 | ␉kBluetoothAMPManagerCodeAMPChangeResponse␉␉␉␉␉= 0x05,␊ |
528 | ␉kBluetoothAMPManagerCodeAMPGetInfoRequest␉␉␉␉␉= 0x06,␊ |
529 | ␉kBluetoothAMPManagerCodeAMPGetInfoResponse␉␉␉␉␉= 0x07,␊ |
530 | ␉kBluetoothAMPManagerCodeAMPGetAssocRequest␉␉␉␉␉= 0x08,␊ |
531 | ␉kBluetoothAMPManagerCodeAMPGetAssocResponse␉␉␉␉␉= 0x09,␊ |
532 | ␉kBluetoothAMPManagerCodeAMPCreatePhysicalLinkRequest␉␉= 0x0A,␊ |
533 | ␉kBluetoothAMPManagerCodeAMPCreatePhysicalLinkResponse␉␉= 0x0B,␊ |
534 | ␉kBluetoothAMPManagerCodeAMPDisconnectPhysicalLinkRequest␉= 0x0C,␊ |
535 | ␉kBluetoothAMPManagerCodeAMPDisconnectPhysicalLinkResponse␉= 0x0D,␊ |
536 | } BluetoothAMPManagerCode;␊ |
537 | ␉␉␊ |
538 | typedef enum {␊ |
539 | ␉kBluetoothAMPManagerCommandRejectReasonCommandNotRecognized␉= 0x0000,␊ |
540 | } BluetoothAMPCommandRejectReason;␊ |
541 | ␉␉␊ |
542 | typedef enum {␊ |
543 | ␉kBluetoothAMPManagerDiscoverResponseControllerStatusPoweredDown␉␉= 0x00,␊ |
544 | ␉kBluetoothAMPManagerDiscoverResponseControllerStatusBluetoothOnly␉= 0x01,␊ |
545 | ␉kBluetoothAMPManagerDiscoverResponseControllerStatusNoCapacity␉␉= 0x02,␊ |
546 | ␉kBluetoothAMPManagerDiscoverResponseControllerStatusLowCapacity␉␉= 0x03,␊ |
547 | ␉kBluetoothAMPManagerDiscoverResponseControllerStatusMediumCapacity␉= 0x04,␊ |
548 | ␉kBluetoothAMPManagerDiscoverResponseControllerStatusHighCapacity␉= 0x05,␊ |
549 | ␉kBluetoothAMPManagerDiscoverResponseControllerStatusFullCapacity␉= 0x06,␊ |
550 | } BluetoothAMPDiscoverResponseControllerStatus;␊ |
551 | ␉␉␊ |
552 | typedef enum {␊ |
553 | ␉kBluetoothAMPManagerGetInfoResponseSuccess␉␉␉␉= 0x00,␊ |
554 | ␉kBluetoothAMPManagerGetInfoResponseInvalidControllerID␉= 0x01,␊ |
555 | } BluetoothAMPGetInfoResponseStatus;␊ |
556 | ␉␉␊ |
557 | typedef enum {␊ |
558 | ␉kBluetoothAMPManagerGetAssocResponseSuccess␉␉␉␉= 0x00,␊ |
559 | ␉kBluetoothAMPManagerGetAssocResponseInvalidControllerID␉= 0x01,␊ |
560 | } BluetoothAMPGetAssocResponseStatus;␊ |
561 | ␉␉␊ |
562 | typedef enum {␊ |
563 | ␉kBluetoothAMPManagerCreatePhysicalLinkResponseSuccess␉␉␉␉␉␉␉␉␉␉= 0x00,␊ |
564 | ␉kBluetoothAMPManagerCreatePhysicalLinkResponseInvalidControllerID␉␉␉␉␉␉␉= 0x01,␊ |
565 | ␉kBluetoothAMPManagerCreatePhysicalLinkResponseUnableToStartLinkCreation␉␉␉␉␉␉= 0x02,␊ |
566 | ␉kBluetoothAMPManagerCreatePhysicalLinkResponseCollisionOccurred␉␉␉␉␉␉␉␉= 0x03,␊ |
567 | ␉kBluetoothAMPManagerCreatePhysicalLinkResponseAMPDisconnectedPhysicalLinkRequestReceived␉= 0x04,␊ |
568 | ␉kBluetoothAMPManagerCreatePhysicalLinkResponsePhysicalLinkAlreadyExists␉␉␉␉␉␉= 0x05,␊ |
569 | ␉kBluetoothAMPManagerCreatePhysicalLinkResponseSecurityViolation␉␉␉␉␉␉␉␉= 0x06,␊ |
570 | } BluetoothAMPCreatePhysicalLinkResponseStatus;␊ |
571 | ␉␉␊ |
572 | typedef enum {␊ |
573 | ␉kBluetoothAMPManagerDisconnectPhysicalLinkResponseSuccess␉␉␉␉= 0x00,␊ |
574 | ␉kBluetoothAMPManagerDisconnectPhysicalLinkResponseInvalidControllerID␉= 0x01,␊ |
575 | ␉kBluetoothAMPManagerDisconnectPhysicalLinkResponseNoPhysicalLink␉␉= 0x02,␊ |
576 | } BluetoothAMPDisconnectPhysicalLinkResponseStatus;␊ |
577 | ␊ |
578 | #if 0␊ |
579 | #pragma mark -␊ |
580 | #pragma mark === HCI ===␊ |
581 | #endif␊ |
582 | ␊ |
583 | //===========================================================================================================================␊ |
584 | //␉Host Controller Interface (HCI)␊ |
585 | //===========================================================================================================================␊ |
586 | ␊ |
587 | //␉HCI Command Packet␊ |
588 | //␉------------------␊ |
589 | //␉␊ |
590 | //␉ 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3␊ |
591 | //␉ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1␊ |
592 | //␉+--------------------------------+---------------+--------------+␊ |
593 | //␉| OpCode | | |␊ |
594 | //␉+--------------------+-----------| Param Length | Params... |␊ |
595 | //␉| OCF | OGF | | |␊ |
596 | //␉+--------------------+-----------+---------------+--------------+␊ |
597 | //␉| |␊ |
598 | //␉| Params... |␊ |
599 | //␉| |␊ |
600 | //␉+---------------------------------------------------------------+␊ |
601 | ␊ |
602 | // Commands␊ |
603 | ␊ |
604 | typedef UInt8␉␉BluetoothHCICommandOpCodeGroup;␊ |
605 | typedef UInt16␉␉BluetoothHCICommandOpCodeCommand;␊ |
606 | typedef UInt16␉␉BluetoothHCICommandOpCode;␊ |
607 | typedef␉UInt32␉␉BluetoothHCIVendorCommandSelector;␊ |
608 | ␊ |
609 | #define␉BluetoothHCIMakeCommandOpCode( GROUP, CMD )␉␉␉␉( ( ( ( GROUP ) & 0x003F ) << 10 ) | ( ( CMD ) & 0x03FF ) )␊ |
610 | #define␉BluetoothHCIMakeCommandOpCodeEndianSwap( GROUP, CMD )␉( CFSwapInt16HostToLittle ( BluetoothHCIMakeCommandOpCode( GROUP, CMD ) ) )␊ |
611 | #define␉BluetoothHCIExtractCommandOpCodeGroup( OPCODE )␉␉␉( ( ( OPCODE ) >> 10 ) & 0x003F )␊ |
612 | #define␉BluetoothHCIExtractCommandOpCodeCommand( OPCODE )␉␉( ( OPCODE ) & 0x03FF )␊ |
613 | ␊ |
614 | #define BluetoothHCIMakeCommandOpCodeHostOrder(GROUP, CMD )␉OSSwapLittleToHostConstInt16( ( ( ( GROUP ) & 0x003F ) << 10 ) | ( ( CMD ) & 0x03FF ) )␊ |
615 | ␊ |
616 | ␊ |
617 | enum␊ |
618 | {␊ |
619 | ␉// Command Group: NoOp␊ |
620 | ␉␊ |
621 | ␉kBluetoothHCIOpCodeNoOp␉␉␉␉␉␉␉␉␉␉␉␉= 0, ␊ |
622 | ␉kBluetoothHCICommandGroupNoOp␉␉␉␉␉␉␉␉␉␉= 0x00, ␊ |
623 | ␉␉kBluetoothHCICommandNoOp␉␉␉␉␉␉␉␉␉␉= 0x0000,␊ |
624 | ␉␊ |
625 | ␉// Command Group: Link Control␊ |
626 | ␉␊ |
627 | ␉kBluetoothHCICommandGroupLinkControl␉␉␉␉␉␉␉␉= 0x01, ␊ |
628 | ␉␉kBluetoothHCICommandInquiry␉␉␉␉␉␉␉␉␉␉= 0x0001, ␊ |
629 | ␉␉kBluetoothHCICommandInquiryCancel␉␉␉␉␉␉␉␉= 0x0002, ␊ |
630 | ␉␉kBluetoothHCICommandPeriodicInquiryMode␉␉␉␉␉␉␉= 0x0003, ␊ |
631 | ␉␉kBluetoothHCICommandExitPeriodicInquiryMode␉␉␉␉␉␉= 0x0004, ␊ |
632 | ␉␉kBluetoothHCICommandCreateConnection␉␉␉␉␉␉␉= 0x0005, ␊ |
633 | ␉␉kBluetoothHCICommandDisconnect␉␉␉␉␉␉␉␉␉= 0x0006, ␊ |
634 | ␉␉kBluetoothHCICommandAddSCOConnection␉␉␉␉␉␉␉= 0x0007,␊ |
635 | ␉␉kBluetoothHCICommandCreateConnectionCancel␉␉␉␉␉␉= 0x0008,␊ |
636 | ␉␉kBluetoothHCICommandAcceptConnectionRequest␉␉␉␉␉␉= 0x0009, ␊ |
637 | ␉␉kBluetoothHCICommandRejectConnectionRequest␉␉␉␉␉␉= 0x000A, ␊ |
638 | ␉␉kBluetoothHCICommandLinkKeyRequestReply␉␉␉␉␉␉␉= 0x000B, ␊ |
639 | ␉␉kBluetoothHCICommandLinkKeyRequestNegativeReply␉␉␉␉␉= 0x000C, ␊ |
640 | ␉␉kBluetoothHCICommandPINCodeRequestReply␉␉␉␉␉␉␉= 0x000D, ␊ |
641 | ␉␉kBluetoothHCICommandPINCodeRequestNegativeReply␉␉␉␉␉= 0x000E, ␊ |
642 | ␉␉kBluetoothHCICommandChangeConnectionPacketType␉␉␉␉␉= 0x000F, ␊ |
643 | ␉␉kBluetoothHCICommandAuthenticationRequested␉␉␉␉␉␉= 0x0011, ␊ |
644 | ␉␉kBluetoothHCICommandSetConnectionEncryption␉␉␉␉␉␉= 0x0013, ␊ |
645 | ␉␉kBluetoothHCICommandChangeConnectionLinkKey␉␉␉␉␉␉= 0x0015, ␊ |
646 | ␉␉kBluetoothHCICommandMasterLinkKey␉␉␉␉␉␉␉␉= 0x0017, ␊ |
647 | ␉␉kBluetoothHCICommandRemoteNameRequest␉␉␉␉␉␉␉= 0x0019, ␊ |
648 | ␉␉kBluetoothHCICommandReadRemoteSupportedFeatures␉␉␉␉␉= 0x001B, ␊ |
649 | ␉␉kBluetoothHCICommandReadRemoteExtendedFeatures␉␉␉␉␉= 0x001C, ␊ |
650 | ␉␉kBluetoothHCICommandReadRemoteVersionInformation␉␉␉␉= 0x001D, ␊ |
651 | ␉␉kBluetoothHCICommandReadClockOffset␉␉␉␉␉␉␉␉= 0x001F, ␊ |
652 | ␉␉kBluetoothHCICommandRemoteNameRequestCancel␉␉␉␉␉␉= 0x001A,␊ |
653 | ␉␉kBluetoothHCICommandReadLMPHandle␉␉␉␉␉␉␉␉= 0x0020,␊ |
654 | ␉␉kBluetoothHCICommandSetupSynchronousConnection␉␉␉␉␉= 0x0028,␊ |
655 | ␉␉kBluetoothHCICommandAcceptSynchronousConnectionRequest␉␉␉= 0x0029,␊ |
656 | ␉␉kBluetoothHCICommandRejectSynchronousConnectionRequest␉␉␉= 0x002A,␊ |
657 | ␉␉kBluetoothHCICommandIOCapabilityRequestReply␉␉␉␉␉= 0x002B,␊ |
658 | ␉␉kBluetoothHCICommandUserConfirmationRequestReply␉␉␉␉= 0x002C,␊ |
659 | ␉␉kBluetoothHCICommandUserConfirmationRequestNegativeReply␉␉= 0x002D,␊ |
660 | ␉␉kBluetoothHCICommandUserPasskeyRequestReply␉␉␉␉␉␉= 0x002E,␊ |
661 | ␉␉kBluetoothHCICommandUserPasskeyRequestNegativeReply␉␉␉␉= 0x002F,␊ |
662 | ␉␉kBluetoothHCICommandRemoteOOBDataRequestReply␉␉␉␉␉= 0x0030,␊ |
663 | ␉␉kBluetoothHCICommandRemoteOOBDataRequestNegativeReply␉␉␉= 0x0033,␊ |
664 | ␊ |
665 | ␉// Command Group: Link Policy␊ |
666 | ␉␊ |
667 | ␉kBluetoothHCICommandGroupLinkPolicy␉␉␉␉␉␉␉␉␉= 0x02, ␊ |
668 | ␉␉kBluetoothHCICommandHoldMode␉␉␉␉␉␉␉␉␉= 0x0001, ␊ |
669 | ␉␉kBluetoothHCICommandSniffMode␉␉␉␉␉␉␉␉␉= 0x0003, ␊ |
670 | ␉␉kBluetoothHCICommandExitSniffMode␉␉␉␉␉␉␉␉= 0x0004, ␊ |
671 | ␉␉kBluetoothHCICommandParkMode␉␉␉␉␉␉␉␉␉= 0x0005, ␊ |
672 | ␉␉kBluetoothHCICommandExitParkMode␉␉␉␉␉␉␉␉= 0x0006, ␊ |
673 | ␉␉kBluetoothHCICommandQoSSetup␉␉␉␉␉␉␉␉␉= 0x0007, ␊ |
674 | ␉␉kBluetoothHCICommandRoleDiscovery␉␉␉␉␉␉␉␉= 0x0009, ␊ |
675 | ␉␉kBluetoothHCICommandSwitchRole␉␉␉␉␉␉␉␉␉= 0x000B, ␊ |
676 | ␉␉kBluetoothHCICommandReadLinkPolicySettings␉␉␉␉␉␉= 0x000C, ␊ |
677 | ␉␉kBluetoothHCICommandWriteLinkPolicySettings␉␉␉␉␉␉= 0x000D, ␊ |
678 | ␉␉kBluetoothHCICommandReadDefaultLinkPolicySettings␉␉␉␉= 0x000E,␊ |
679 | ␉␉kBluetoothHCICommandWriteDefaultLinkPolicySettings␉␉␉␉= 0x000F,␊ |
680 | ␉␉kBluetoothHCICommandFlowSpecification␉␉␉␉␉␉␉= 0x0010,␊ |
681 | ␉␉kBluetoothHCICommandSniffSubrating␉␉␉␉␉␉␉␉= 0x0011,␊ |
682 | ␉␉kBluetoothHCICommandAcceptSniffRequest␉␉␉␉␉␉␉= 0x0031,␊ |
683 | ␉␉kBluetoothHCICommandRejectSniffRequest␉␉␉␉␉␉␉= 0x0032,␊ |
684 | ␉␊ |
685 | ␉// Command Group: Host Controller & Baseband␊ |
686 | ␉␊ |
687 | ␉kBluetoothHCICommandGroupHostController␉␉␉␉␉␉␉␉= 0x03, ␊ |
688 | ␉␉kBluetoothHCICommandSetEventMask␉␉␉␉␉␉␉␉= 0x0001, ␊ |
689 | ␉␉kBluetoothHCICommandReset␉␉␉␉␉␉␉␉␉␉= 0x0003, ␊ |
690 | ␉␉kBluetoothHCICommandSetEventFilter␉␉␉␉␉␉␉␉= 0x0005, ␊ |
691 | ␉␉kBluetoothHCICommandFlush␉␉␉␉␉␉␉␉␉␉= 0x0008, ␊ |
692 | ␉␉kBluetoothHCICommandReadPINType␉␉␉␉␉␉␉␉␉= 0x0009, ␊ |
693 | ␉␉kBluetoothHCICommandWritePINType␉␉␉␉␉␉␉␉= 0x000A, ␊ |
694 | ␉␉kBluetoothHCICommandCreateNewUnitKey␉␉␉␉␉␉␉= 0x000B, ␊ |
695 | ␉␉kBluetoothHCICommandReadStoredLinkKey␉␉␉␉␉␉␉= 0x000D, ␊ |
696 | ␉␉kBluetoothHCICommandWriteStoredLinkKey␉␉␉␉␉␉␉= 0x0011, ␊ |
697 | ␉␉kBluetoothHCICommandDeleteStoredLinkKey␉␉␉␉␉␉␉= 0x0012, ␊ |
698 | ␉␉kBluetoothHCICommandChangeLocalName␉␉␉␉␉␉␉␉= 0x0013, ␊ |
699 | ␉␉kBluetoothHCICommandReadLocalName␉␉␉␉␉␉␉␉= 0x0014, ␊ |
700 | ␉␉kBluetoothHCICommandReadConnectionAcceptTimeout␉␉␉␉␉= 0x0015, ␊ |
701 | ␉␉kBluetoothHCICommandWriteConnectionAcceptTimeout␉␉␉␉= 0x0016, ␊ |
702 | ␉␉kBluetoothHCICommandReadPageTimeout␉␉␉␉␉␉␉␉= 0x0017, ␊ |
703 | ␉␉kBluetoothHCICommandWritePageTimeout␉␉␉␉␉␉␉= 0x0018, ␊ |
704 | ␉␉kBluetoothHCICommandReadScanEnable␉␉␉␉␉␉␉␉= 0x0019, ␊ |
705 | ␉␉kBluetoothHCICommandWriteScanEnable␉␉␉␉␉␉␉␉= 0x001A, ␊ |
706 | ␉␉kBluetoothHCICommandReadPageScanActivity␉␉␉␉␉␉= 0x001B, ␊ |
707 | ␉␉kBluetoothHCICommandWritePageScanActivity␉␉␉␉␉␉= 0x001C, ␊ |
708 | ␉␉kBluetoothHCICommandReadInquiryScanActivity␉␉␉␉␉␉= 0x001D, ␊ |
709 | ␉␉kBluetoothHCICommandWriteInquiryScanActivity␉␉␉␉␉= 0x001E, ␊ |
710 | ␉␉kBluetoothHCICommandReadAuthenticationEnable␉␉␉␉␉= 0x001F, ␊ |
711 | ␉␉kBluetoothHCICommandWriteAuthenticationEnable␉␉␉␉␉= 0x0020, ␊ |
712 | ␉␉kBluetoothHCICommandReadEncryptionMode␉␉␉␉␉␉␉= 0x0021, ␊ |
713 | ␉␉kBluetoothHCICommandWriteEncryptionMode␉␉␉␉␉␉␉= 0x0022, ␊ |
714 | ␉␉kBluetoothHCICommandReadClassOfDevice␉␉␉␉␉␉␉= 0x0023,␊ |
715 | ␉␉kBluetoothHCICommandWriteClassOfDevice␉␉␉␉␉␉␉= 0x0024, ␊ |
716 | ␉␉kBluetoothHCICommandReadVoiceSetting␉␉␉␉␉␉␉= 0x0025,␊ |
717 | ␉␉kBluetoothHCICommandWriteVoiceSetting␉␉␉␉␉␉␉= 0x0026, ␊ |
718 | ␉␉kBluetoothHCICommandReadAutomaticFlushTimeout␉␉␉␉␉= 0x0027, ␊ |
719 | ␉␉kBluetoothHCICommandWriteAutomaticFlushTimeout␉␉␉␉␉= 0x0028, ␊ |
720 | ␉␉kBluetoothHCICommandReadNumberOfBroadcastRetransmissions␉␉= 0x0029, ␊ |
721 | ␉␉kBluetoothHCICommandWriteNumberOfBroadcastRetransmissions␉␉= 0x002A, ␊ |
722 | ␉␉kBluetoothHCICommandReadHoldModeActivity␉␉␉␉␉␉= 0x002B, ␊ |
723 | ␉␉kBluetoothHCICommandWriteHoldModeActivity␉␉␉␉␉␉= 0x002C, ␊ |
724 | ␉␉kBluetoothHCICommandReadTransmitPowerLevel␉␉␉␉␉␉= 0x002D, ␊ |
725 | ␉␉kBluetoothHCICommandReadSCOFlowControlEnable␉␉␉␉␉= 0x002E, ␊ |
726 | ␉␉kBluetoothHCICommandWriteSCOFlowControlEnable␉␉␉␉␉= 0x002F, ␊ |
727 | ␉␉kBluetoothHCICommandSetHostControllerToHostFlowControl␉␉␉= 0x0031, ␊ |
728 | ␉␉kBluetoothHCICommandHostBufferSize␉␉␉␉␉␉␉␉= 0x0033, ␊ |
729 | ␉␉kBluetoothHCICommandHostNumberOfCompletedPackets␉␉␉␉= 0x0035, ␊ |
730 | ␉␉kBluetoothHCICommandReadLinkSupervisionTimeout␉␉␉␉␉= 0x0036, ␊ |
731 | ␉␉kBluetoothHCICommandWriteLinkSupervisionTimeout␉␉␉␉␉= 0x0037, ␊ |
732 | ␉␉kBluetoothHCICommandReadNumberOfSupportedIAC␉␉␉␉␉= 0x0038, ␊ |
733 | ␉␉kBluetoothHCICommandReadCurrentIACLAP␉␉␉␉␉␉␉= 0x0039, ␊ |
734 | ␉␉kBluetoothHCICommandWriteCurrentIACLAP␉␉␉␉␉␉␉= 0x003A, ␊ |
735 | ␉␉kBluetoothHCICommandReadPageScanPeriodMode␉␉␉␉␉␉= 0x003B, ␊ |
736 | ␉␉kBluetoothHCICommandWritePageScanPeriodMode␉␉␉␉␉␉= 0x003C, ␊ |
737 | ␉␉kBluetoothHCICommandReadPageScanMode␉␉␉␉␉␉␉= 0x003D, ␊ |
738 | ␉␉kBluetoothHCICommandWritePageScanMode␉␉␉␉␉␉␉= 0x003E, ␊ |
739 | ␉␉kBluetoothHCICommandSetAFHClassification␉␉␉␉␉␉= 0x003F, ␉␉␊ |
740 | ␉␉kBluetoothHCICommandReadInquiryScanType␉␉␉␉␉␉␉= 0x0042, ␉␉␊ |
741 | ␉␉kBluetoothHCICommandWriteInquiryScanType␉␉␉␉␉␉= 0x0043, ␉␉␊ |
742 | ␉␉kBluetoothHCICommandReadInquiryMode␉␉␉␉␉␉␉␉= 0x0044, ␉␉␊ |
743 | ␉␉kBluetoothHCICommandWriteInquiryMode␉␉␉␉␉␉␉= 0x0045,␊ |
744 | ␉␉kBluetoothHCICommandReadPageScanType␉␉␉␉␉␉␉= 0x0046,␊ |
745 | ␉␉kBluetoothHCICommandWritePageScanType␉␉␉␉␉␉␉= 0x0047,␊ |
746 | ␉␉kBluetoothHCICommandReadAFHChannelAssessmentMode␉␉␉␉= 0x0048,␊ |
747 | ␉␉kBluetoothHCICommandWriteAFHChannelAssessmentMode␉␉␉␉= 0x0049,␊ |
748 | ␉␉kBluetoothHCICommandReadExtendedInquiryResponse␉␉␉␉␉= 0x0051, ␉␉␊ |
749 | ␉␉kBluetoothHCICommandWriteExtendedInquiryResponse␉␉␉␉= 0x0052, ␉␉␊ |
750 | ␉␉kBluetoothHCICommandReadSimplePairingMode␉␉␉␉␉␉= 0x0055,␊ |
751 | ␉␉kBluetoothHCICommandWriteSimplePairingMode␉␉␉␉␉␉= 0x0056,␊ |
752 | ␉␉kBluetoothHCICommandReadLocalOOBData␉␉␉␉␉␉␉= 0x0057,␊ |
753 | ␉␉kBluetoothHCICommandReadInquiryResponseTransmitPower␉␉␉= 0x0058,␊ |
754 | ␉␉kBluetoothHCICommandWriteInquiryResponseTransmitPower␉␉␉= 0x0059,␊ |
755 | ␉␉kBluetoothHCICommandReadDefaultErroneousDataReporting␉␉␉= 0x005A,␊ |
756 | ␉␉kBluetoothHCICommandWriteDefaultErroneousDataReporting␉␉␉= 0x005B,␊ |
757 | ␉␉kBluetoothHCICommandReadPersistentSniffInterval␉␉␉␉␉= 0x005C,␊ |
758 | ␉␉kBluetoothHCICommandWritePersistentSniffInterval␉␉␉␉= 0x005D,␊ |
759 | ␉␉kBluetoothHCICommandDeletePersistentSniffInterval␉␉␉␉= 0x005E,␊ |
760 | ␉␉kBluetoothHCICommandEnhancedFlush␉␉␉␉␉␉␉␉= 0x005F,␊ |
761 | ␉␉kBluetoothHCICommandSendKeypressNotification␉␉␉␉␉= 0x0060,␊ |
762 | ␉␊ |
763 | ␉// Command Group: Informational␊ |
764 | ␉␊ |
765 | ␉kBluetoothHCICommandGroupInformational␉␉␉␉␉␉␉␉= 0x04, ␊ |
766 | ␉␉kBluetoothHCICommandReadLocalVersionInformation␉␉␉␉␉= 0x0001, ␊ |
767 | ␉␉kBluetoothHCICommandReadLocalSupportedCommands␉␉␉␉␉= 0x0002, ␊ |
768 | ␉␉kBluetoothHCICommandReadLocalSupportedFeatures␉␉␉␉␉= 0x0003, ␊ |
769 | ␉␉kBluetoothHCICommandReadLocalExtendedFeatures␉␉␉␉␉= 0x0004,␊ |
770 | ␉␉kBluetoothHCICommandReadBufferSize␉␉␉␉␉␉␉␉= 0x0005, ␊ |
771 | ␉␉kBluetoothHCICommandReadCountryCode␉␉␉␉␉␉␉␉= 0x0007, ␊ |
772 | ␉␉kBluetoothHCICommandReadDeviceAddress␉␉␉␉␉␉␉= 0x0009, ␊ |
773 | ␉␊ |
774 | ␉// Command Group: Status␊ |
775 | ␉␊ |
776 | ␉kBluetoothHCICommandGroupStatus␉␉␉␉␉␉␉␉␉␉= 0x05, ␊ |
777 | ␉␉kBluetoothHCICommandReadFailedContactCounter␉␉␉␉␉= 0x0001, ␊ |
778 | ␉␉kBluetoothHCICommandResetFailedContactCounter␉␉␉␉␉= 0x0002, ␊ |
779 | ␉␉kBluetoothHCICommandGetLinkQuality␉␉␉␉␉␉␉␉= 0x0003, ␊ |
780 | ␉␉kBluetoothHCICommandReadRSSI␉␉␉␉␉␉␉␉␉= 0x0005, ␊ |
781 | ␉␉kBluetoothHCICommandReadAFHMappings␉␉␉␉␉␉␉␉= 0x0006,␊ |
782 | ␉␉kBluetoothHCICommandReadClock␉␉␉␉␉␉␉␉␉= 0x0007,␊ |
783 | ␊ |
784 | ␉// Command Group: Testing␊ |
785 | ␉␊ |
786 | ␉kBluetoothHCICommandGroupTesting␉␉␉␉␉␉␉␉␉= 0x06, ␊ |
787 | ␉␉kBluetoothHCICommandReadLoopbackMode␉␉␉␉␉␉␉= 0x0001, ␊ |
788 | ␉␉kBluetoothHCICommandWriteLoopbackMode␉␉␉␉␉␉␉= 0x0002, ␊ |
789 | ␉␉kBluetoothHCICommandEnableDeviceUnderTestMode␉␉␉␉␉= 0x0003, ␊ |
790 | ␉␉kBluetoothHCICommandWriteSimplePairingDebugMode␉␉␉␉␉= 0x0004,␊ |
791 | ␊ |
792 | ␉// Command Group: Logo Testing (no commands yet)␊ |
793 | ␉␊ |
794 | ␉kBluetoothHCICommandGroupLogoTesting ␉␉␉␉␉␉␉␉= 0x3E, ␊ |
795 | ␉␊ |
796 | ␉// Command Group: Vendor Specific (from Broadcom HCI Programmer's Reference Guide)␊ |
797 | ␉␊ |
798 | ␉kBluetoothHCICommandGroupVendorSpecific␉␉␉␉␉␉␉␉= 0x3f, ␊ |
799 | ␉␉kBluetoothHCICommandWriteDeviceAddress␉␉␉␉␉␉␉= 0x0001, ␊ |
800 | ␉␉kBluetoothHCICommandWriteHoppingChannels␉␉␉␉␉␉= 0x0012,␊ |
801 | ␉␉kBluetoothHCICommandInvalidateFlashAndReboot␉␉␉␉␉= 0x0017,␊ |
802 | ␉␉kBluetoothHCICommandSetMaxPower␉␉␉␉␉␉␉␉␉= 0x0026,␊ |
803 | ␉␉kBluetoothHCICommandEnableHIDEmulation␉␉␉␉␉␉␉= 0x003B,␊ |
804 | ␉␉kBluetoothHCICommandEnableRadio␉␉␉␉␉␉␉␉␉= 0x0034,␊ |
805 | ␉␉kBluetoothHCIGetHIDDeviceList␉␉␉␉␉␉␉␉␉= 0x0036,␊ |
806 | ␉␉kBluetoothHCIAddHIDDevice␉␉␉␉␉␉␉␉␉␉= 0x0037,␊ |
807 | ␉␉kBluetoothHCIRemoveHIDDevice␉␉␉␉␉␉␉␉␉= 0x0039,␊ |
808 | ␉␊ |
809 | ␉kBluetoothHCICommandGroupMax␉␉␉␉␉␉␉␉␉␉= 0x40, ␊ |
810 | ␉kBluetoothHCICommandMax␉␉␉␉␉␉␉␉␉␉␉␉= 0x03FF␊ |
811 | };␊ |
812 | ␊ |
813 | // HCI Data Types␊ |
814 | ␊ |
815 | typedef UInt8␉␉␉␉␉␉␉␉␉␉BluetoothHCIQoSFlags;␊ |
816 | typedef UInt8␉␉␉␉␉␉␉␉␉␉BluetoothHCIParamByteCount;␊ |
817 | typedef UInt16␉␉␉␉␉␉␉␉␉␉BluetoothHCIACLDataByteCount;␊ |
818 | typedef UInt8␉␉␉␉␉␉␉␉␉␉BluetoothHCISCODataByteCount;␊ |
819 | typedef UInt8␉␉␉␉␉␉␉␉␉␉BluetoothHCIInquiryLength;␊ |
820 | typedef UInt8␉␉␉␉␉␉␉␉␉␉BluetoothHCIResponseCount;␊ |
821 | typedef UInt8␉␉␉␉␉␉␉␉␉␉BluetoothHCICountryCode;␊ |
822 | typedef UInt16␉␉␉␉␉␉␉␉␉␉BluetoothHCIModeInterval;␊ |
823 | typedef UInt16␉␉␉␉␉␉␉␉␉␉BluetoothHCISniffAttemptCount;␊ |
824 | typedef UInt16␉␉␉␉␉␉␉␉␉␉BluetoothHCISniffTimeout;␊ |
825 | typedef UInt16␉␉␉␉␉␉␉␉␉␉BluetoothHCIParkModeBeaconInterval;␊ |
826 | ␊ |
827 | typedef UInt8␉␉␉␉␉␉␉␉␉␉BluetoothMaxSlots;␊ |
828 | typedef UInt16␉␉␉␉␉␉␉␉␉␉BluetoothManufacturerName;␊ |
829 | typedef UInt8␉␉␉␉␉␉␉␉␉␉BluetoothLMPVersion;␊ |
830 | typedef UInt16␉␉␉␉␉␉␉␉␉␉BluetoothLMPSubversion;␊ |
831 | ␊ |
832 | typedef UInt8␉␉␉␉␉␉␉␉␉␉BluetoothHCIConnectionMode;␊ |
833 | enum BluetoothHCIConnectionModes␊ |
834 | {␊ |
835 | ␉kConnectionActiveMode␉␉␉␉␉= 0,␊ |
836 | ␉kConnectionHoldMode␉␉␉␉␉␉= 1,␊ |
837 | ␉kConnectionSniffMode␉␉␉␉␉= 2,␊ |
838 | ␉kConnectionParkMode␉␉␉␉␉␉= 3,␊ |
839 | ␉kConnectionModeReservedForFutureUse␉␉= 4,␊ |
840 | };␊ |
841 | ␊ |
842 | typedef struct␉BluetoothHCISupportedFeatures␉␉BluetoothHCISupportedFeatures;␊ |
843 | struct BluetoothHCISupportedFeatures␊ |
844 | {␊ |
845 | ␉UInt8␉data[8];␊ |
846 | };␊ |
847 | ␊ |
848 | #if BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1␊ |
849 | typedef UInt8␉␉␉␉␉␉␉␉␉␉BluetoothHCIPageNumber;␊ |
850 | typedef struct␉BluetoothHCIExtendedFeaturesInfo␉BluetoothHCIExtendedFeaturesInfo;␊ |
851 | struct BluetoothHCIExtendedFeaturesInfo␊ |
852 | {␊ |
853 | ␉BluetoothHCIPageNumber␉page;␊ |
854 | ␉BluetoothHCIPageNumber␉maxPage;␊ |
855 | ␉UInt8␉␉␉␉␉data[8];␊ |
856 | };␊ |
857 | #endif /* BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1 */␊ |
858 | ␉␉␊ |
859 | enum BluetoothFeatureBits␊ |
860 | {␊ |
861 | ␉// Byte 0 of the support features data structure.␊ |
862 | ␊ |
863 | ␉kBluetoothFeatureThreeSlotPackets␉␉␉␉␉= (1 << 0L),␊ |
864 | ␉kBluetoothFeatureFiveSlotPackets␉␉␉␉␉= (1 << 1L),␊ |
865 | ␉kBluetoothFeatureEncryption␉␉␉␉␉␉␉= (1 << 2L),␊ |
866 | ␉kBluetoothFeatureSlotOffset␉␉␉␉␉␉␉= (1 << 3L),␊ |
867 | ␉kBluetoothFeatureTimingAccuracy␉␉␉␉␉␉= (1 << 4L),␊ |
868 | ␉kBluetoothFeatureSwitchRoles␉␉␉␉␉␉= (1 << 5L),␊ |
869 | ␉kBluetoothFeatureHoldMode␉␉␉␉␉␉␉= (1 << 6L),␊ |
870 | ␉kBluetoothFeatureSniffMode␉␉␉␉␉␉␉= (1 << 7L),␊ |
871 | ␉␊ |
872 | ␉// Byte 1 of the support features data structure.␊ |
873 | ␊ |
874 | ␉kBluetoothFeatureParkMode␉␉␉␉␉␉␉= (1 << 0L),␊ |
875 | ␉kBluetoothFeatureRSSI␉␉␉␉␉␉␉␉= (1 << 1L),␊ |
876 | ␉kBluetoothFeaturePowerControlRequests␉␉␉␉= (1 << 1L),␊ |
877 | ␉kBluetoothFeatureChannelQuality␉␉␉␉␉␉= (1 << 2L),␊ |
878 | ␉kBluetoothFeatureSCOLink␉␉␉␉␉␉␉= (1 << 3L),␊ |
879 | ␉kBluetoothFeatureHV2Packets␉␉␉␉␉␉␉= (1 << 4L),␊ |
880 | ␉kBluetoothFeatureHV3Packets␉␉␉␉␉␉␉= (1 << 5L),␊ |
881 | ␉kBluetoothFeatureULawLog␉␉␉␉␉␉␉= (1 << 6L),␊ |
882 | ␉kBluetoothFeatureALawLog␉␉␉␉␉␉␉= (1 << 7L),␊ |
883 | ␊ |
884 | ␉// Byte 2 of the support features data structure.␊ |
885 | ␊ |
886 | ␉kBluetoothFeatureCVSD␉␉␉␉␉␉␉␉= (1 << 0L),␊ |
887 | ␉kBluetoothFeaturePagingScheme␉␉␉␉␉␉= (1 << 1L),␊ |
888 | ␉kBluetoothFeaturePowerControl␉␉␉␉␉␉= (1 << 2L),␊ |
889 | ␉kBluetoothFeatureTransparentSCOData␉␉␉␉␉= (1 << 3L),␊ |
890 | ␉kBluetoothFeatureFlowControlLagBit0␉␉␉␉␉= (1 << 4L),␊ |
891 | ␉kBluetoothFeatureFlowControlLagBit1␉␉␉␉␉= (1 << 5L),␊ |
892 | ␉kBluetoothFeatureFlowControlLagBit2␉␉␉␉␉= (1 << 6L),␊ |
893 | ␉kBluetoothFeatureBroadcastEncryption␉␉␉␉= (1 << 7L),␉␊ |
894 | ␉␊ |
895 | ␉// Byte 3 of the support features data structure.␉␊ |
896 | ␉␊ |
897 | ␉kBluetoothFeatureScatterMode␉␉␉␉␉␉= (1 << 0L),␊ |
898 | ␉kBluetoothFeatureEnhancedDataRateACL2MbpsMode␉␉= (1 << 1L),␉␊ |
899 | ␉kBluetoothFeatureEnhancedDataRateACL3MbpsMode␉␉= (1 << 2L),␉␊ |
900 | ␉kBluetoothFeatureEnhancedInquiryScan␉␉␉␉= (1 << 3L),␊ |
901 | ␉kBluetoothFeatureInterlacedInquiryScan␉␉␉␉= (1 << 4L),␉␊ |
902 | ␉kBluetoothFeatureInterlacedPageScan␉␉␉␉␉= (1 << 5L),␉␉␊ |
903 | ␉kBluetoothFeatureRSSIWithInquiryResult␉␉␉␉= (1 << 6L),␉␊ |
904 | ␉kBluetoothFeatureExtendedSCOLink␉␉␉␉␉= (1 << 7L),␊ |
905 | ␊ |
906 | ␉// Byte 4 of the support features data structure.␉␊ |
907 | ␊ |
908 | ␉kBluetoothFeatureEV4Packets␉␉␉␉␉␉␉= (1 << 0L),␊ |
909 | ␉kBluetoothFeatureEV5Packets␉␉␉␉␉␉␉= (1 << 1L),␉␊ |
910 | ␉kBluetoothFeatureAbsenceMasks␉␉␉␉␉␉= (1 << 2L),␊ |
911 | ␉kBluetoothFeatureAFHCapableSlave␉␉␉␉␉= (1 << 3L),␊ |
912 | ␉kBluetoothFeatureAFHClassificationSlave␉␉␉␉= (1 << 4L),␉␊ |
913 | ␉kBluetoothFeatureAliasAuhentication␉␉␉␉␉= (1 << 5L),␊ |
914 | ␉kBluetoothFeatureAnonymityMode␉␉␉␉␉␉= (1 << 6L),␊ |
915 | ␉kBluetoothFeature3SlotEnhancedDataRateACLPackets␉= (1 << 7L),␊ |
916 | ␉␊ |
917 | ␉// Byte 5 of the support features data structure.␊ |
918 | ␊ |
919 | ␉kBluetoothFeature5SlotEnhancedDataRateACLPackets␉= (1 << 0L), // 2.0 version of this header had this at the wrong bit location␊ |
920 | ␉kBluetoothFeatureSniffSubrating␉␉␉␉␉␉= (1 << 1L),␊ |
921 | ␉kBluetoothFeaturePauseEncryption␉␉␉␉␉= (1 << 2L),␊ |
922 | ␉kBluetoothFeatureAFHCapableMaster␉␉␉␉␉= (1 << 3L),␊ |
923 | ␉kBluetoothFeatureAFHClassificationMaster␉␉␉= (1 << 4L),␊ |
924 | ␉kBluetoothFeatureEnhancedDataRateeSCO2MbpsMode␉␉= (1 << 5L),␊ |
925 | ␉kBluetoothFeatureEnhancedDataRateeSCO3MbpsMode␉␉= (1 << 6L),␊ |
926 | ␉kBluetoothFeature3SlotEnhancedDataRateeSCOPackets␉= (1 << 7L),␊ |
927 | ␉␊ |
928 | ␉// Byte 6 of the support features data structure.␉␊ |
929 | ␊ |
930 | ␉kBluetoothFeatureExtendedInquiryResponse␉␉␉= (1 << 0L),␊ |
931 | ␉kBluetoothFeatureSecureSimplePairing␉␉␉␉= (1 << 3L),␊ |
932 | ␉kBluetoothFeatureEncapsulatedPDU␉␉␉␉␉= (1 << 4L),␊ |
933 | ␉kBluetoothFeatureErroneousDataReporting␉␉␉␉= (1 << 5L),␊ |
934 | ␉kBluetoothFeatureNonFlushablePacketBoundaryFlag␉␉= (1 << 6L),␊ |
935 | ␉␊ |
936 | ␉// Byte 7 of the support features data structure.␊ |
937 | ␊ |
938 | ␉kBluetoothFeatureLinkSupervisionTimeoutChangedEvent␉= (1 << 0L),␊ |
939 | ␉kBluetoothFeatureInquiryTransmissionPowerLevel␉␉= (1 << 1L),␊ |
940 | ␉kBluetoothFeatureExtendedFeatures␉␉␉␉␉= (1 << 7L),␊ |
941 | ␉␊ |
942 | ␉// Byte 8 of the support features data structure (extended)␊ |
943 | ␊ |
944 | ␉kBluetoothFeatureSimpleSecurePairingHostMode␉␉= (1 << 0L),␊ |
945 | ␊ |
946 | };␊ |
947 | ␊ |
948 | typedef UInt16␉␉␉␉␉␉␉␉␉␉BluetoothHCIFailedContactCount;␊ |
949 | typedef struct BluetoothHCIFailedContactInfo␉␉BluetoothHCIFailedContactInfo;␊ |
950 | struct BluetoothHCIFailedContactInfo␊ |
951 | {␊ |
952 | ␉BluetoothHCIFailedContactCount␉count;␊ |
953 | ␉BluetoothConnectionHandle␉␉handle;␊ |
954 | };␊ |
955 | ␊ |
956 | typedef SInt8␉␉␉␉␉␉␉␉␉␉BluetoothHCIRSSIValue;␉/* Valid Range: -127 to +20 */␊ |
957 | typedef struct BluetoothHCIRSSIInfo␉␉␉␉␉BluetoothHCIRSSIInfo;␊ |
958 | struct BluetoothHCIRSSIInfo␊ |
959 | {␊ |
960 | ␉BluetoothConnectionHandle␉␉handle;␊ |
961 | ␉BluetoothHCIRSSIValue␉␉␉RSSIValue;␊ |
962 | };␊ |
963 | ␊ |
964 | typedef␉UInt8␉␉␉␉␉␉␉␉␉␉BluetoothHCILinkQuality;␊ |
965 | typedef struct BluetoothHCILinkQualityInfo␉␉␉BluetoothHCILinkQualityInfo;␊ |
966 | struct BluetoothHCILinkQualityInfo␊ |
967 | {␊ |
968 | ␉BluetoothConnectionHandle␉␉handle;␊ |
969 | ␉BluetoothHCILinkQuality␉␉␉qualityValue;␊ |
970 | };␊ |
971 | ␊ |
972 | typedef UInt8␉BluetoothHCIRole;␊ |
973 | typedef struct␉BluetoothHCIRoleInfo␉␉␉␉␉BluetoothHCIRoleInfo;␊ |
974 | struct BluetoothHCIRoleInfo␊ |
975 | {␊ |
976 | ␉UInt8␉␉␉␉␉␉role;␊ |
977 | ␉BluetoothConnectionHandle␉handle;␊ |
978 | };␊ |
979 | ␊ |
980 | enum BluetoothHCIRoles␊ |
981 | {␊ |
982 | ␉kBluetoothHCIMasterRole␉␉␉␉= 0x00,␊ |
983 | ␉kBluetoothHCISlaveRole␉␉␉␉= 0x01␊ |
984 | };␊ |
985 | ␊ |
986 | typedef UInt16␉␉␉␉␉␉␉␉␉␉BluetoothHCILinkPolicySettings;␊ |
987 | enum BluetoothHCILinkPolicySettingsValues␊ |
988 | {␊ |
989 | ␉kDisableAllLMModes␉␉␉␉␉= 0x0000,␊ |
990 | ␉kEnableMasterSlaveSwitch␉␉␉= 0x0001,␊ |
991 | ␉kEnableHoldMode␉␉␉␉␉␉= 0x0002,␊ |
992 | ␉kEnableSniffMode␉␉␉␉␉= 0x0004,␊ |
993 | ␉kEnableParkMode␉␉␉␉␉␉= 0x0008,␊ |
994 | ␉kReservedForFutureUse␉␉␉␉= 0x0010␊ |
995 | };␊ |
996 | ␊ |
997 | typedef struct␉BluetoothHCILinkPolicySettingsInfo␉␉BluetoothHCILinkPolicySettingsInfo;␊ |
998 | struct BluetoothHCILinkPolicySettingsInfo␊ |
999 | {␊ |
1000 | ␉BluetoothHCILinkPolicySettings␉␉settings;␊ |
1001 | ␉BluetoothConnectionHandle␉␉␉handle;␊ |
1002 | };␊ |
1003 | ␊ |
1004 | ␊ |
1005 | typedef struct BluetoothHCIQualityOfServiceSetupParams␉BluetoothHCIQualityOfServiceSetupParams;␊ |
1006 | struct BluetoothHCIQualityOfServiceSetupParams␊ |
1007 | {␊ |
1008 | ␉UInt8␉␉flags;␊ |
1009 | ␉UInt8␉␉serviceType;␊ |
1010 | ␉UInt32␉␉tokenRate;␊ |
1011 | ␉UInt32␉␉peakBandwidth;␊ |
1012 | ␉UInt32␉␉latency;␊ |
1013 | ␉UInt32␉␉delayVariation;␊ |
1014 | };␊ |
1015 | ␊ |
1016 | typedef UInt8␉␉␉␉␉␉␉␉␉␉BluetoothHCILoopbackMode;␊ |
1017 | enum␊ |
1018 | {␊ |
1019 | ␉kBluetoothHCILoopbackModeOff␉␉= 0x00,␊ |
1020 | ␉kBluetoothHCILoopbackModeLocal␉␉= 0x01,␊ |
1021 | ␉kBluetoothHCILoopbackModeRemote␉␉= 0x02␊ |
1022 | };␊ |
1023 | ␊ |
1024 | typedef UInt32 BluetoothHCIOperationID;␊ |
1025 | typedef UInt32 BluetoothHCIEventID;␊ |
1026 | typedef UInt32 BluetoothHCIDataID;␊ |
1027 | typedef UInt32 BluetoothHCISignalID;␊ |
1028 | typedef UInt32 BluetoothHCITransportID;␊ |
1029 | typedef UInt32 BluetoothHCITransportCommandID;␊ |
1030 | typedef UInt32 BluetoothHCIRequestID;␊ |
1031 | ␉␉␊ |
1032 | ␊ |
1033 | // Version Information␊ |
1034 | ␊ |
1035 | typedef struct␉BluetoothHCIVersionInfo␉␉BluetoothHCIVersionInfo;␊ |
1036 | struct␉BluetoothHCIVersionInfo␊ |
1037 | {␊ |
1038 | ␉// Local & Remote information␊ |
1039 | ␉␊ |
1040 | ␉BluetoothManufacturerName␉manufacturerName;␊ |
1041 | ␉BluetoothLMPVersion␉␉␉lmpVersion;␊ |
1042 | ␉BluetoothLMPSubversion␉␉lmpSubVersion;␊ |
1043 | ␉␊ |
1044 | ␉// Local information only␊ |
1045 | ␉␊ |
1046 | ␉UInt8␉␉hciVersion;␊ |
1047 | ␉UInt16␉␉hciRevision;␊ |
1048 | };␊ |
1049 | ␊ |
1050 | // HCI buffer sizes.␊ |
1051 | ␊ |
1052 | typedef struct␉BluetoothHCIBufferSize␉␉BluetoothHCIBufferSize;␊ |
1053 | struct␉BluetoothHCIBufferSize␊ |
1054 | {␊ |
1055 | ␉UInt16␉ACLDataPacketLength;␊ |
1056 | ␉UInt8␉SCODataPacketLength;␊ |
1057 | ␉UInt16␉totalNumACLDataPackets;␊ |
1058 | ␉UInt16␉totalNumSCODataPackets;␊ |
1059 | };␊ |
1060 | ␊ |
1061 | // Timeouts␊ |
1062 | typedef UInt16␉BluetoothHCIConnectionAcceptTimeout;␊ |
1063 | typedef UInt16␉BluetoothHCIPageTimeout;␊ |
1064 | enum BluetoothHCITimeoutValues␊ |
1065 | {␊ |
1066 | ␉kDefaultPageTimeout␉␉␉= 0x2000,␊ |
1067 | };␊ |
1068 | ␊ |
1069 | #define␉␉BluetoothGetSlotsFromSeconds( inSeconds )␉␉( (inSeconds/.000625 ) )␊ |
1070 | ␊ |
1071 | ␊ |
1072 | // Link Keys␊ |
1073 | typedef UInt16␉BluetoothHCINumLinkKeysDeleted;␊ |
1074 | typedef UInt8␉BluetoothHCINumLinkKeysToWrite;␊ |
1075 | typedef UInt8␉BluetoothHCIDeleteStoredLinkKeyFlag;␊ |
1076 | enum BluetoothHCIDeleteStoredLinkKeyFlags␊ |
1077 | {␊ |
1078 | ␉kDeleteKeyForSpecifiedDeviceOnly␉␉= 0x00,␊ |
1079 | ␉kDeleteAllStoredLinkKeys␉␉␉␉= 0x01,␊ |
1080 | };␊ |
1081 | ␊ |
1082 | typedef UInt8␉BluetoothHCIReadStoredLinkKeysFlag;␊ |
1083 | enum BluetoothHCIReadStoredLinkKeysFlags␊ |
1084 | {␊ |
1085 | ␉kReturnLinkKeyForSpecifiedDeviceOnly␉␉= 0x00,␊ |
1086 | ␉kReadAllStoredLinkKeys␉␉␉␉␉␉= 0x01,␊ |
1087 | };␊ |
1088 | ␊ |
1089 | typedef struct␉BluetoothHCIStoredLinkKeysInfo␉BluetoothHCIStoredLinkKeysInfo;␊ |
1090 | struct BluetoothHCIStoredLinkKeysInfo␊ |
1091 | {␊ |
1092 | ␉UInt16␉numLinkKeysRead;␊ |
1093 | ␉UInt16␉maxNumLinkKeysAllowedInDevice;␊ |
1094 | };␊ |
1095 | ␊ |
1096 | ␊ |
1097 | // Page Scan␊ |
1098 | ␊ |
1099 | typedef UInt8␉BluetoothHCIPageScanMode;␊ |
1100 | enum BluetoothHCIPageScanModes␊ |
1101 | {␊ |
1102 | ␉kMandatoryPageScanMode␉␉= 0x00,␊ |
1103 | ␉kOptionalPageScanMode1␉␉= 0x01,␊ |
1104 | ␉kOptionalPageScanMode2␉␉= 0x02,␊ |
1105 | ␉kOptionalPageScanMode3␉␉= 0x03,␊ |
1106 | };␊ |
1107 | ␊ |
1108 | typedef UInt8␉BluetoothHCIPageScanPeriodMode;␊ |
1109 | enum BluetoothHCIPageScanPeriodModes␊ |
1110 | {␊ |
1111 | ␉kP0Mode␉␉␉␉␉␉= 0x00,␊ |
1112 | ␉kP1Mode␉␉␉␉␉␉= 0x01,␊ |
1113 | ␉kP2Mode␉␉␉␉␉␉= 0x02,␊ |
1114 | };␊ |
1115 | ␊ |
1116 | typedef UInt8␉BluetoothHCIPageScanEnableState;␊ |
1117 | enum BluetoothHCIPageScanEnableStates␊ |
1118 | {␊ |
1119 | ␉kNoScansEnabled␉␉␉␉␉␉␉= 0x00,␊ |
1120 | ␉kInquiryScanEnabledPageScanDisabled␉␉= 0x01,␊ |
1121 | ␉kInquiryScanDisabledPageScanEnabled␉␉= 0x02,␊ |
1122 | ␉kInquiryScanEnabledPageScanEnabled␉␉= 0x03,␊ |
1123 | };␊ |
1124 | ␊ |
1125 | typedef struct␉BluetoothHCIScanActivity␉BluetoothHCIScanActivity;␊ |
1126 | struct BluetoothHCIScanActivity␊ |
1127 | {␊ |
1128 | ␉UInt16 ␉scanInterval;␊ |
1129 | ␉UInt16␉scanWindow;␊ |
1130 | };␊ |
1131 | ␊ |
1132 | typedef struct␉BluetoothHCIInquiryAccessCode␉BluetoothHCIInquiryAccessCode;␊ |
1133 | struct BluetoothHCIInquiryAccessCode␊ |
1134 | {␊ |
1135 | ␉UInt8 ␉data[3];␊ |
1136 | };␊ |
1137 | ␊ |
1138 | typedef UInt8 BluetoothHCIInquiryAccessCodeCount;␊ |
1139 | typedef struct␉BluetoothHCICurrentInquiryAccessCodes␉BluetoothHCICurrentInquiryAccessCodes;␊ |
1140 | struct BluetoothHCICurrentInquiryAccessCodes␊ |
1141 | {␊ |
1142 | ␉BluetoothHCIInquiryAccessCodeCount␉count;␉// Number of codes in array.␊ |
1143 | ␉BluetoothHCIInquiryAccessCode *␉␉codes;␉// Ptr to array of codes.␊ |
1144 | };␊ |
1145 | ␊ |
1146 | typedef␉struct BluetoothHCILinkSupervisionTimeout␉BluetoothHCILinkSupervisionTimeout;␊ |
1147 | struct BluetoothHCILinkSupervisionTimeout␊ |
1148 | {␊ |
1149 | ␉BluetoothConnectionHandle ␉handle;␊ |
1150 | ␉UInt16␉␉␉␉␉␉timeout;␊ |
1151 | };␊ |
1152 | ␊ |
1153 | typedef UInt8 BluetoothHCIFlowControlState;␊ |
1154 | enum BluetoothHCISCOFlowControlStates␊ |
1155 | {␊ |
1156 | ␉kSCOFlowControlDisabled␉␉= 0x00,␊ |
1157 | ␉kSCOFlowControlEnabled␉␉= 0x01␊ |
1158 | };␊ |
1159 | ␊ |
1160 | enum BluetoothHCIGeneralFlowControlStates␊ |
1161 | {␊ |
1162 | ␉kHostControllerToHostFlowControlOff␉␉␉= 0x00,␊ |
1163 | ␉kHCIACLDataPacketsOnHCISCODataPacketsOff␉= 0x01,␊ |
1164 | ␉kHCIACLDataPacketsOffHCISCODataPacketsOn␉= 0x02,␊ |
1165 | ␉kHCIACLDataPacketsOnHCISCODataPacketsOn␉␉= 0x03,␊ |
1166 | };␉␉␊ |
1167 | ␉␉␊ |
1168 | typedef SInt8 BluetoothHCITransmitPowerLevel;␊ |
1169 | typedef UInt8 BluetoothHCITransmitPowerLevelType;␊ |
1170 | enum BluetoothHCITransmitReadPowerLevelTypes␊ |
1171 | {␊ |
1172 | ␉kReadCurrentTransmitPowerLevel␉= 0x00,␊ |
1173 | ␉kReadMaximumTransmitPowerLevel␉= 0x01,␊ |
1174 | };␊ |
1175 | ␊ |
1176 | typedef UInt8␉BluetoothHCIAFHChannelAssessmentMode;␉␊ |
1177 | enum BluetoothHCIAFHChannelAssessmentModes␊ |
1178 | {␊ |
1179 | ␉kAFHChannelAssessmentModeDisabled␉␉= 0x00,␊ |
1180 | ␉kAFHChannelAssessmentModeEnabled␉␉= 0x01␊ |
1181 | };␊ |
1182 | ␊ |
1183 | ␊ |
1184 | typedef struct BluetoothHCITransmitPowerLevelInfo␉BluetoothHCITransmitPowerLevelInfo;␊ |
1185 | struct BluetoothHCITransmitPowerLevelInfo␊ |
1186 | {␊ |
1187 | ␉BluetoothConnectionHandle␉␉handle;␊ |
1188 | ␉BluetoothHCITransmitPowerLevel␉level; // Range: -70 <= N <= 20 (units are dBm)␊ |
1189 | };␊ |
1190 | ␊ |
1191 | typedef UInt8␉BluetoothHCINumBroadcastRetransmissions;␊ |
1192 | typedef UInt8␉BluetoothHCIHoldModeActivity;␊ |
1193 | enum BluetoothHCIHoldModeActivityStates␊ |
1194 | {␊ |
1195 | ␉kMaintainCurrentPowerState␉␉= 0x00,␊ |
1196 | ␉kSuspendPageScan␉␉␉␉= 0x01,␊ |
1197 | ␉kSuspendInquiryScan␉␉␉␉= 0x02,␊ |
1198 | ␉kSuspendPeriodicInquiries␉␉= 0x03,␊ |
1199 | };␊ |
1200 | ␊ |
1201 | typedef UInt8 BluetoothHCIAuthenticationEnable;␊ |
1202 | enum BluetoothHCIAuthentionEnableModes␊ |
1203 | {␊ |
1204 | ␉kAuthenticationDisabled␉␉␉= 0x00,␊ |
1205 | ␉kAuthenticationEnabled␉␉␉= 0x01,␊ |
1206 | };␊ |
1207 | ␊ |
1208 | typedef UInt8␉BluetoothHCIEncryptionMode;␊ |
1209 | enum BluetoothHCIEncryptionModes␊ |
1210 | {␊ |
1211 | ␉kEncryptionDisabled␉␉␉␉␉␉␉␉␉= 0x00,␉␉// Default.␊ |
1212 | ␉kEncryptionOnlyForPointToPointPackets␉␉␉␉= 0x01,␊ |
1213 | ␉kEncryptionForBothPointToPointAndBroadcastPackets␉= 0x02,␊ |
1214 | };␊ |
1215 | ␊ |
1216 | typedef UInt16␉BluetoothHCIAutomaticFlushTimeout;␊ |
1217 | typedef struct␉BluetoothHCIAutomaticFlushTimeoutInfo␉BluetoothHCIAutomaticFlushTimeoutInfo;␊ |
1218 | struct BluetoothHCIAutomaticFlushTimeoutInfo␊ |
1219 | {␊ |
1220 | ␉BluetoothConnectionHandle␉␉␉handle;␊ |
1221 | ␉BluetoothHCIAutomaticFlushTimeout␉timeout;␊ |
1222 | };␊ |
1223 | ␊ |
1224 | #define␉kInfoStringMaxLength␉␉25␊ |
1225 | typedef struct␉BluetoothTransportInfo ␉␉BluetoothTransportInfo;␊ |
1226 | typedef ␉␉BluetoothTransportInfo*␉␉BluetoothTransportInfoPtr;␊ |
1227 | struct␉␉␉BluetoothTransportInfo␊ |
1228 | {␊ |
1229 | ␉UInt32␉productID;␊ |
1230 | ␉UInt32␉vendorID;␊ |
1231 | ␉UInt32␉type;␊ |
1232 | ␉char␉productName[kInfoStringMaxLength];␊ |
1233 | ␉char␉vendorName[kInfoStringMaxLength];␊ |
1234 | };␊ |
1235 | ␊ |
1236 | enum BluetoothTransportTypes␊ |
1237 | {␊ |
1238 | ␉kBluetoothTransportTypeUSB␉␉␉␉= 0x01,␊ |
1239 | ␉kBluetoothTransportTypePCCard␉␉␉= 0x02,␊ |
1240 | ␉kBluetoothTransportTypePCICard␉␉␉= 0x03␊ |
1241 | };␊ |
1242 | ␊ |
1243 | // Inquiries␊ |
1244 | ␊ |
1245 | typedef struct␉BluetoothHCIInquiryResult␉BluetoothHCIInquiryResult;␊ |
1246 | struct␉BluetoothHCIInquiryResult␊ |
1247 | {␊ |
1248 | ␉BluetoothDeviceAddress␉␉␉␉deviceAddress;␊ |
1249 | ␉BluetoothPageScanRepetitionMode␉␉pageScanRepetitionMode;␊ |
1250 | ␉BluetoothHCIPageScanPeriodMode␉␉pageScanPeriodMode;␊ |
1251 | ␉BluetoothHCIPageScanMode␉␉␉pageScanMode;␊ |
1252 | ␉BluetoothClassOfDevice␉␉␉␉classOfDevice;␊ |
1253 | ␉BluetoothClockOffset␉␉␉␉clockOffset;␊ |
1254 | };␊ |
1255 | ␊ |
1256 | #define kBluetoothHCIInquiryResultsMaxResults 50␊ |
1257 | typedef struct␉BluetoothHCIInquiryResults␉BluetoothHCIInquiryResults;␊ |
1258 | struct␉BluetoothHCIInquiryResults␊ |
1259 | {␊ |
1260 | ␉BluetoothHCIInquiryResult␉␉results[kBluetoothHCIInquiryResultsMaxResults];␊ |
1261 | ␉IOItemCount␉␉␉␉␉␉count;␊ |
1262 | };␊ |
1263 | ␊ |
1264 | #if BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_0␊ |
1265 | ␊ |
1266 | //Inquiries with RSSI (v1.2 specification)␊ |
1267 | ␊ |
1268 | typedef struct␉BluetoothHCIInquiryWithRSSIResult␉BluetoothHCIInquiryWithRSSIResult;␊ |
1269 | struct␉BluetoothHCIInquiryWithRSSIResult␊ |
1270 | {␊ |
1271 | ␉BluetoothDeviceAddress␉␉␉␉deviceAddress;␊ |
1272 | ␉BluetoothPageScanRepetitionMode␉␉pageScanRepetitionMode;␊ |
1273 | ␉UInt8␉␉␉␉␉␉␉␉reserved;␊ |
1274 | ␉BluetoothClassOfDevice␉␉␉␉classOfDevice;␊ |
1275 | ␉BluetoothClockOffset␉␉␉␉clockOffset;␊ |
1276 | ␉BluetoothHCIRSSIValue␉␉␉␉RSSIValue;␊ |
1277 | };␊ |
1278 | ␊ |
1279 | typedef struct␉BluetoothHCIInquiryWithRSSIResults␉BluetoothHCIInquiryWithRSSIResults;␊ |
1280 | struct␉BluetoothHCIInquiryWithRSSIResults␊ |
1281 | {␊ |
1282 | ␉BluetoothHCIInquiryWithRSSIResult␉results[50];␊ |
1283 | ␉IOItemCount␉␉␉␉␉␉␉count;␊ |
1284 | };␊ |
1285 | ␊ |
1286 | //Inquiries with 'Extended Inquiry Response' (v2.1 specification)␊ |
1287 | ␊ |
1288 | typedef UInt8␉BluetoothHCIFECRequired;␊ |
1289 | enum BluetoothHCIFECRequiredValues␊ |
1290 | {␊ |
1291 | ␉kBluetoothHCIFECRequired␉␉= 0x00,␊ |
1292 | ␉kBluetoothHCIFECNotRequired␉␉= 0x01␊ |
1293 | };␊ |
1294 | ␊ |
1295 | typedef␉UInt8␉BluetoothHCIInquiryMode;␊ |
1296 | enum BluetoothHCIInquiryModes␊ |
1297 | {␊ |
1298 | ␉kBluetoothHCIInquiryModeResultFormatStandard␉␉␉␉␉␉␉␉=␉0x00,␊ |
1299 | ␉kBluetoothHCIInquiryModeResultFormatWithRSSI␉␉␉␉␉␉␉␉=␉0x01,␊ |
1300 | ␉kBluetoothHCIInquiryModeResultFormatWithRSSIOrExtendedInquiryResultFormat␉=␉0x02␊ |
1301 | };␊ |
1302 | ␊ |
1303 | typedef␉UInt8␉BluetoothHCIExtendedInquiryResponseDataType;␊ |
1304 | ␊ |
1305 | typedef struct␉BluetoothHCIExtendedInquiryResponse␉␉BluetoothHCIExtendedInquiryResponse;␉/* Extended Inquiry Response [EIR] data, consisting of a sequence of data structures in this format: [length(1byte)][data type(1byte)][data(e.g. device name)] */␊ |
1306 | struct␉BluetoothHCIExtendedInquiryResponse␊ |
1307 | {␊ |
1308 | ␉UInt8␉␉data[ 240 ];␊ |
1309 | };␊ |
1310 | ␊ |
1311 | typedef struct␉BluetoothHCIReadExtendedInquiryResponseResults␉BluetoothHCIReadExtendedInquiryResponseResults;␊ |
1312 | struct␉BluetoothHCIReadExtendedInquiryResponseResults␊ |
1313 | {␊ |
1314 | ␉BluetoothHCIFECRequired␉␉␉␉␉outFECRequired;␊ |
1315 | ␉BluetoothHCIExtendedInquiryResponse␉␉extendedInquiryResponse;␊ |
1316 | };␊ |
1317 | ␊ |
1318 | typedef struct␉BluetoothHCIExtendedInquiryResult␉BluetoothHCIExtendedInquiryResult;␊ |
1319 | struct␉BluetoothHCIExtendedInquiryResult␊ |
1320 | {␊ |
1321 | ␉UInt8␉␉␉␉␉␉␉␉numberOfReponses;␉␉␉/* always a value of 1 */␊ |
1322 | ␉BluetoothDeviceAddress␉␉␉␉deviceAddress;␊ |
1323 | ␉BluetoothPageScanRepetitionMode␉␉pageScanRepetitionMode;␊ |
1324 | ␉UInt8␉␉␉␉␉␉␉␉reserved;␊ |
1325 | ␉BluetoothClassOfDevice␉␉␉␉classOfDevice;␊ |
1326 | ␉BluetoothClockOffset␉␉␉␉clockOffset;␊ |
1327 | ␉BluetoothHCIRSSIValue␉␉␉␉RSSIValue;␊ |
1328 | ␉BluetoothHCIExtendedInquiryResponse␉extendedInquiryResponse;␊ |
1329 | };␊ |
1330 | ␊ |
1331 | // 'Simple Pairing' (v2.1 specification)␊ |
1332 | ␊ |
1333 | typedef␉UInt8␉BluetoothHCISimplePairingMode;␊ |
1334 | enum BluetoothHCISimplePairingModes␊ |
1335 | {␊ |
1336 | ␉kBluetoothHCISimplePairingModeNotSet␉␉␉␉␉␉␉␉␉␉␉=␉0x00,␊ |
1337 | ␉kBluetoothHCISimplePairingModeEnabled␉␉␉␉␉␉␉␉␉␉␉=␉0x01␊ |
1338 | };␊ |
1339 | ␊ |
1340 | typedef␉UInt8␉BluetoothSimplePairingDebugMode;␊ |
1341 | enum BluetoothSimplePairingDebugModes␊ |
1342 | {␊ |
1343 | ␉kBluetoothHCISimplePairingDebugModeDisabled␉␉␉␉␉␉␉␉␉␉=␉0x00,␊ |
1344 | ␉kBluetoothHCISimplePairingDebugModeEnabled␉␉␉␉␉␉␉␉␉␉=␉0x01␊ |
1345 | };␊ |
1346 | ␊ |
1347 | typedef struct␉BluetoothHCISimplePairingOOBData␉␉BluetoothHCISimplePairingOOBData;␊ |
1348 | struct BluetoothHCISimplePairingOOBData␊ |
1349 | {␊ |
1350 | ␉UInt8␉␉data[ 16 ];␊ |
1351 | };␊ |
1352 | ␊ |
1353 | typedef struct BluetoothHCIReadLocalOOBDataResults BluetoothHCIReadLocalOOBDataResults;␊ |
1354 | struct␉BluetoothHCIReadLocalOOBDataResults␊ |
1355 | {␊ |
1356 | ␉BluetoothHCISimplePairingOOBData␉␉hash;␊ |
1357 | ␉BluetoothHCISimplePairingOOBData␉␉randomizer;␊ |
1358 | };␊ |
1359 | ␊ |
1360 | typedef UInt8␉BluetoothIOCapability;␊ |
1361 | enum BluetoothIOCapabilities␊ |
1362 | {␊ |
1363 | ␉kBluetoothCapabilityTypeDisplayOnly␉␉␉= 0x00,␊ |
1364 | ␉kBluetoothCapabilityTypeDisplayYesNo␉␉= 0x01,␊ |
1365 | ␉kBluetoothCapabilityTypeKeyboardOnly␉␉= 0x02,␊ |
1366 | ␉kBluetoothCapabilityTypeNoInputNoOutput␉␉= 0x03␊ |
1367 | };␊ |
1368 | ␊ |
1369 | typedef UInt8␉BluetoothOOBDataPresence;␊ |
1370 | enum BluetoothOOBDataPresenceValues␊ |
1371 | {␊ |
1372 | ␉kBluetoothOOBAuthenticationDataNotPresent␉␉␉␉= 0x00,␊ |
1373 | ␉kBluetoothOOBAuthenticationDataFromRemoteDevicePresent␉= 0x01␊ |
1374 | };␊ |
1375 | ␊ |
1376 | typedef UInt8␉BluetoothAuthenticationRequirements;␊ |
1377 | enum BluetoothAuthenticationRequirementsValues␊ |
1378 | {␊ |
1379 | ␉kBluetoothAuthenticationRequirementsMITMProtectionNotRequired␉= 0x00,␉␉/* Numeric comparison with automatic accept allowed */␊ |
1380 | ␉kBluetoothAuthenticationRequirementsMITMProtectionRequired␉␉= 0x01,␉␉/* Refer to BluetoothIOCapabilities to determine authentication procedure */␊ |
1381 | ␉kBluetoothAuthenticationRequirementsMITMProtectionNotRequiredNoBonding␉␉␉= 0x00,␊ |
1382 | ␉kBluetoothAuthenticationRequirementsMITMProtectionRequiredNoBonding␉␉␉␉= 0x01,␊ |
1383 | ␉kBluetoothAuthenticationRequirementsMITMProtectionNotRequiredDedicatedBonding␉= 0x02,␊ |
1384 | ␉kBluetoothAuthenticationRequirementsMITMProtectionRequiredDedicatedBonding␉␉= 0x03,␊ |
1385 | ␉kBluetoothAuthenticationRequirementsMITMProtectionNotRequiredGeneralBonding␉␉= 0x04,␊ |
1386 | ␉kBluetoothAuthenticationRequirementsMITMProtectionRequiredGeneralBonding␉␉= 0x05␊ |
1387 | };␊ |
1388 | ␊ |
1389 | typedef struct BluetoothIOCapabilityResponse␉BluetoothIOCapabilityResponse;␊ |
1390 | struct BluetoothIOCapabilityResponse␊ |
1391 | {␊ |
1392 | ␉BluetoothDeviceAddress␉␉␉␉deviceAddress;␊ |
1393 | ␉BluetoothIOCapability␉␉␉␉ioCapability;␉␉␉␉/* possible values from BluetoothIOCapabilities above */␊ |
1394 | ␉BluetoothOOBDataPresence␉␉␉OOBDataPresence;␉␉␉␉␊ |
1395 | ␉BluetoothAuthenticationRequirements␉authenticationRequirements;␊ |
1396 | };␊ |
1397 | ␊ |
1398 | typedef UInt32␉BluetoothPasskey;␊ |
1399 | ␊ |
1400 | typedef struct BluetoothUserPasskeyNotification␉BluetoothUserPasskeyNotification;␊ |
1401 | struct BluetoothUserPasskeyNotification␊ |
1402 | {␊ |
1403 | ␉BluetoothDeviceAddress␉␉␉␉deviceAddress;␊ |
1404 | ␉BluetoothPasskey␉␉␉␉␉passkey;␉␉␉␉/* passkey for display. valid values are 000000 - 999999 */␊ |
1405 | };␊ |
1406 | ␊ |
1407 | typedef UInt8␉BluetoothKeypressNotificationType;␊ |
1408 | enum BluetoothKeypressNotificationTypes␊ |
1409 | {␊ |
1410 | ␉kBluetoothKeypressNotificationTypePasskeyEntryStarted␉␉= 0,␊ |
1411 | ␉kBluetoothKeypressNotificationTypePasskeyDigitEntered␉␉= 1,␊ |
1412 | ␉kBluetoothKeypressNotificationTypePasskeyDigitErased␉␉= 2,␊ |
1413 | ␉kBluetoothKeypressNotificationTypePasskeyCleared␉␉␉= 3,␊ |
1414 | ␉kBluetoothKeypressNotificationTypePasskeyEntryCompleted␉␉= 4␊ |
1415 | };␊ |
1416 | ␉␉␊ |
1417 | typedef struct BluetoothKeypressNotification␉BluetoothKeypressNotification;␊ |
1418 | struct BluetoothKeypressNotification␊ |
1419 | {␊ |
1420 | ␉BluetoothDeviceAddress␉␉␉␉deviceAddress;␊ |
1421 | ␉BluetoothKeypressNotificationType␉notificationType;␊ |
1422 | };␊ |
1423 | ␉␉␊ |
1424 | typedef SInt8␉TransmissionPower;␊ |
1425 | ␊ |
1426 | typedef UInt8␉BluetoothAFHMode;␊ |
1427 | typedef struct␉BluetoothAFHResults␉␉␉␉␉BluetoothAFHResults;␊ |
1428 | struct BluetoothAFHResults␊ |
1429 | {␊ |
1430 | ␉BluetoothConnectionHandle␉handle;␊ |
1431 | ␉BluetoothAFHMode␉␉␉mode;␊ |
1432 | ␉UInt8␉␉␉␉␉␉afhMap[10];␊ |
1433 | };␊ |
1434 | ␊ |
1435 | #endif /* BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_0 */␊ |
1436 | ␊ |
1437 | #if BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1␊ |
1438 | ␊ |
1439 | typedef UInt32␉BluetoothNumericValue;␊ |
1440 | ␊ |
1441 | typedef struct BluetoothUserConfirmationRequest␉BluetoothUserConfirmationRequest;␊ |
1442 | struct BluetoothUserConfirmationRequest␊ |
1443 | {␊ |
1444 | ␉BluetoothDeviceAddress␉␉␉␉deviceAddress;␊ |
1445 | ␉BluetoothNumericValue␉␉␉␉numericValue;␉␉␉␉/* numeric value for display. valid values are 000000 - 999999 */␊ |
1446 | };␊ |
1447 | ␊ |
1448 | typedef struct␉BluetoothHCIEventSimplePairingCompleteResults ␉␉BluetoothHCIEventSimplePairingCompleteResults;␊ |
1449 | struct␉␉␉BluetoothHCIEventSimplePairingCompleteResults␊ |
1450 | {␊ |
1451 | ␉BluetoothDeviceAddress␉␉␉␉␉␉deviceAddress;␊ |
1452 | };␊ |
1453 | ␊ |
1454 | #endif /* BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1 */␊ |
1455 | ␊ |
1456 | ␊ |
1457 | // Packet Sizes␊ |
1458 | ␊ |
1459 | enum␊ |
1460 | {␊ |
1461 | ␉kBluetoothHCICommandPacketHeaderSize ␉= 3, ␊ |
1462 | ␉kBluetoothHCICommandPacketMaxDataSize ␉= 255, ␊ |
1463 | ␉kBluetoothHCIMaxCommandPacketSize␉␉= kBluetoothHCICommandPacketHeaderSize + kBluetoothHCICommandPacketMaxDataSize, ␊ |
1464 | ␉␊ |
1465 | ␉kBluetoothHCIEventPacketHeaderSize␉ ␉= 2, ␊ |
1466 | ␉kBluetoothHCIEventPacketMaxDataSize ␉= 255, ␊ |
1467 | ␉kBluetoothHCIMaxEventPacketSize␉␉␉= kBluetoothHCIEventPacketHeaderSize + kBluetoothHCIEventPacketMaxDataSize, ␊ |
1468 | ␉␊ |
1469 | ␉kBluetoothHCIDataPacketHeaderSize ␉␉= 4, ␊ |
1470 | ␉kBluetoothHCIDataPacketMaxDataSize ␉␉= 65535, ␊ |
1471 | ␉kBluetoothHCIMaxDataPacketSize␉␉␉= kBluetoothHCIDataPacketHeaderSize + kBluetoothHCIDataPacketMaxDataSize␊ |
1472 | };␊ |
1473 | ␊ |
1474 | typedef UInt8␉␉BluetoothHCIEventCode;␊ |
1475 | typedef UInt8␉␉BluetoothLinkType;␊ |
1476 | enum BluetoothLinkTypes␊ |
1477 | {␊ |
1478 | ␉kBluetoothSCOConnection␉␉= 0,␊ |
1479 | ␉kBluetoothACLConnection␉␉= 1,␊ |
1480 | ␉kBluetoothESCOConnection␉= 2,␊ |
1481 | kBluetoothLinkTypeNone␉␉= 0xff␊ |
1482 | };␊ |
1483 | ␊ |
1484 | typedef UInt16␉␉BluetoothHCIVoiceSetting; // 10 bits meaningful␊ |
1485 | typedef UInt8␉␉BluetoothHCISupportedIAC;␊ |
1486 | ␊ |
1487 | typedef uint32_t␉BluetoothHCITransmitBandwidth;␊ |
1488 | typedef uint32_t␉BluetoothHCIReceiveBandwidth;␊ |
1489 | typedef uint16_t␉BluetoothHCIMaxLatency;␊ |
1490 | typedef uint8_t␉␉BluetoothHCIRetransmissionEffort;␉␉␊ |
1491 | enum BluetoothHCIRetransmissionEffortTypes␊ |
1492 | {␊ |
1493 | ␉kHCIRetransmissionEffortTypeNone␉␉␉␉␉␉␉␉= 0x00,␊ |
1494 | ␉kHCIRetransmissionEffortTypeAtLeastOneAndOptimizeForPower␉␉= 0x01,␊ |
1495 | ␉kHCIRetransmissionEffortTypeAtLeastOneAndOptimizeLinkQuality␉= 0x02,␊ |
1496 | ␉kHCIRetransmissionEffortTypeDontCare␉␉␉␉␉␉␉= 0xFF,␊ |
1497 | };␊ |
1498 | ␉␉␊ |
1499 | ␊ |
1500 | // Setup Synchronous Packet types (Bluetooth 2.1 spec section 7.7.35 - Setup Synchronous Command Complete Event)␊ |
1501 | ␊ |
1502 | typedef uint8_t␉␉BluetoothAirMode;␊ |
1503 | enum␊ |
1504 | {␊ |
1505 | ␉kBluetoothAirModeULawLog␉␉␉␉= 0x00,␊ |
1506 | ␉kBluetoothAirModeALawLog␉␉␉␉= 0x01,␊ |
1507 | ␉kBluetoothAirModeCVSD␉␉␉␉␉= 0x02,␊ |
1508 | ␉kBluetoothAirModeTransparentData␉␉= 0x03␊ |
1509 | };␊ |
1510 | ␊ |
1511 | typedef struct␉BluetoothSynchronousConnectionInfo␉␉BluetoothSynchronousConnectionInfo;␊ |
1512 | struct␉BluetoothSynchronousConnectionInfo␊ |
1513 | {␊ |
1514 | ␉BluetoothHCITransmitBandwidth␉␉transmitBandWidth;␊ |
1515 | ␉BluetoothHCIReceiveBandwidth␉␉receiveBandWidth;␊ |
1516 | ␉BluetoothHCIMaxLatency␉␉␉␉maxLatency;␊ |
1517 | ␉BluetoothHCIVoiceSetting␉␉␉voiceSetting;␊ |
1518 | ␉BluetoothHCIRetransmissionEffort␉retransmissionEffort;␊ |
1519 | ␉BluetoothPacketType␉␉␉␉␉packetType;␊ |
1520 | };␊ |
1521 | ␊ |
1522 | typedef struct␉BluetoothHCIEventSynchronousConnectionCompleteResults ␉BluetoothHCIEventSynchronousConnectionCompleteResults;␊ |
1523 | struct␉␉␉BluetoothHCIEventSynchronousConnectionCompleteResults␊ |
1524 | {␊ |
1525 | ␉BluetoothConnectionHandle␉␉␉connectionHandle;␊ |
1526 | ␉BluetoothDeviceAddress␉␉␉␉deviceAddress;␊ |
1527 | ␉BluetoothLinkType␉␉␉␉␉linkType;␊ |
1528 | ␉uint8_t␉␉␉␉␉␉␉␉transmissionInterval;␊ |
1529 | ␉uint8_t␉␉␉␉␉␉␉␉retransmissionWindow;␊ |
1530 | ␉uint16_t␉␉␉␉␉␉␉receivePacketLength;␊ |
1531 | ␉uint16_t␉␉␉␉␉␉␉transmitPacketLength;␊ |
1532 | ␉BluetoothAirMode␉␉␉␉␉airMode;␊ |
1533 | };␊ |
1534 | ␊ |
1535 | ␊ |
1536 | typedef UInt8␉BluetoothHCIStatus;␊ |
1537 | typedef UInt8␉BluetoothHCIEventStatus;␊ |
1538 | ␊ |
1539 | // Events.␊ |
1540 | ␊ |
1541 | enum␊ |
1542 | {␊ |
1543 | ␉kBluetoothHCIEventInquiryComplete␉␉␉␉␉␉␉␉␉= 0x01,␊ |
1544 | ␉kBluetoothHCIEventInquiryResult␉␉␉␉␉␉␉␉␉␉= 0x02,␊ |
1545 | ␉kBluetoothHCIEventConnectionComplete␉␉␉␉␉␉␉␉= 0x03,␊ |
1546 | ␉kBluetoothHCIEventConnectionRequest␉␉␉␉␉␉␉␉␉= 0x04,␊ |
1547 | ␉kBluetoothHCIEventDisconnectionComplete␉␉␉␉␉␉␉␉= 0x05,␊ |
1548 | ␉kBluetoothHCIEventAuthenticationComplete␉␉␉␉␉␉␉= 0x06,␊ |
1549 | ␉kBluetoothHCIEventRemoteNameRequestComplete␉␉␉␉␉␉␉= 0x07,␊ |
1550 | ␉kBluetoothHCIEventEncryptionChange␉␉␉␉␉␉␉␉␉= 0x08,␊ |
1551 | ␉kBluetoothHCIEventChangeConnectionLinkKeyComplete␉␉␉␉␉= 0x09,␊ |
1552 | ␉kBluetoothHCIEventMasterLinkKeyComplete␉␉␉␉␉␉␉␉= 0x0A,␊ |
1553 | ␉kBluetoothHCIEventReadRemoteSupportedFeaturesComplete␉␉␉␉= 0x0B,␊ |
1554 | ␉kBluetoothHCIEventReadRemoteVersionInformationComplete␉␉␉␉= 0x0C,␊ |
1555 | ␉kBluetoothHCIEventQoSSetupComplete␉␉␉␉␉␉␉␉␉= 0x0D,␊ |
1556 | ␉kBluetoothHCIEventCommandComplete␉␉␉␉␉␉␉␉␉= 0x0E,␊ |
1557 | ␉kBluetoothHCIEventCommandStatus␉␉␉␉␉␉␉␉␉␉= 0x0F,␊ |
1558 | ␉kBluetoothHCIEventHardwareError␉␉␉␉␉␉␉␉␉␉= 0x10,␊ |
1559 | ␉kBluetoothHCIEventFlushOccurred␉␉␉␉␉␉␉␉␉␉= 0x11,␊ |
1560 | ␉kBluetoothHCIEventRoleChange␉␉␉␉␉␉␉␉␉␉= 0x12,␊ |
1561 | ␉kBluetoothHCIEventNumberOfCompletedPackets␉␉␉␉␉␉␉= 0x13,␊ |
1562 | ␉kBluetoothHCIEventModeChange␉␉␉␉␉␉␉␉␉␉= 0x14,␊ |
1563 | ␉kBluetoothHCIEventReturnLinkKeys␉␉␉␉␉␉␉␉␉= 0x15,␊ |
1564 | ␉kBluetoothHCIEventPINCodeRequest␉␉␉␉␉␉␉␉␉= 0x16,␊ |
1565 | ␉kBluetoothHCIEventLinkKeyRequest␉␉␉␉␉␉␉␉␉= 0x17,␊ |
1566 | ␉kBluetoothHCIEventLinkKeyNotification␉␉␉␉␉␉␉␉= 0x18,␊ |
1567 | ␉kBluetoothHCIEventLoopbackCommand␉␉␉␉␉␉␉␉␉= 0x19,␊ |
1568 | ␉kBluetoothHCIEventDataBufferOverflow␉␉␉␉␉␉␉␉= 0x1A,␊ |
1569 | ␉kBluetoothHCIEventMaxSlotsChange␉␉␉␉␉␉␉␉␉= 0x1B,␊ |
1570 | ␉kBluetoothHCIEventReadClockOffsetComplete␉␉␉␉␉␉␉= 0x1C,␊ |
1571 | ␉kBluetoothHCIEventConnectionPacketType␉␉␉␉␉␉␉␉= 0x1D,␊ |
1572 | ␉kBluetoothHCIEventQoSViolation␉␉␉␉␉␉␉␉␉␉= 0x1E,␊ |
1573 | ␉kBluetoothHCIEventPageScanModeChange␉␉␉␉␉␉␉␉= 0x1F,␊ |
1574 | ␉kBluetoothHCIEventPageScanRepetitionModeChange␉␉␉␉␉␉= 0x20,␊ |
1575 | ␉␊ |
1576 | ␉// [v1.2]␊ |
1577 | ␊ |
1578 | ␉kBluetoothHCIEventFlowSpecificationComplete␉␉␉␉␉␉␉= 0x21,␊ |
1579 | ␉kBluetoothHCIEventInquiryResultWithRSSI␉␉␉␉␉␉␉␉= 0x22,␊ |
1580 | ␉kBluetoothHCIEventReadRemoteExtendedFeaturesComplete␉␉␉␉= 0x23,␊ |
1581 | ␉kBluetoothHCIEventSynchronousConnectionComplete␉␉␉␉␉␉= 0x2C,␊ |
1582 | ␉kBluetoothHCIEventSynchronousConnectionChanged␉␉␉␉␉␉= 0x2D,␊ |
1583 | ␊ |
1584 | ␉// [v2.1]␊ |
1585 | ␊ |
1586 | ␉kBluetoothHCIEventSniffSubstrate␉␉␉␉␉␉␉␉␉= 0x2E,␊ |
1587 | ␉kBluetoothHCIEventExtendedInquiryResult␉␉␉␉␉␉␉␉= 0x2F,␊ |
1588 | ␉kBluetoothHCIEventIOCapabilityRequest␉␉␉␉␉␉␉␉= 0x31,␊ |
1589 | ␉kBluetoothHCIEventIOCapabilityResponse␉␉␉␉␉␉␉␉= 0x32,␊ |
1590 | ␉kBluetoothHCIEventUserConfirmationRequest␉␉␉␉␉␉␉= 0x33,␊ |
1591 | ␉kBluetoothHCIEventUserPasskeyRequest␉␉␉␉␉␉␉␉= 0x34,␊ |
1592 | ␉kBluetoothHCIEventRemoteOOBDataRequest␉␉␉␉␉␉␉␉= 0x35,␊ |
1593 | ␉kBluetoothHCIEventSimplePairingComplete␉␉␉␉␉␉␉␉= 0x36,␊ |
1594 | ␉kBluetoothHCIEventLinkSupervisionTimeoutChanged␉␉␉␉␉␉= 0x38,␊ |
1595 | ␉kBluetoothHCIEventEnhancedFlushComplete␉␉␉␉␉␉␉␉= 0x39,␊ |
1596 | ␉kBluetoothHCIEventSniffRequest␉␉␉␉␉␉␉␉␉␉= 0x3A,␊ |
1597 | ␉kBluetoothHCIEventUserPasskeyNotification␉␉␉␉␉␉␉= 0x3B,␊ |
1598 | ␉kBluetoothHCIEventKeypressNotification␉␉␉␉␉␉␉␉= 0x3C,␊ |
1599 | ␉␊ |
1600 | ␉kBluetoothHCIEventLogoTesting␉␉␉␉␉␉␉␉␉␉= 0xFE,␊ |
1601 | ␉kBluetoothHCIEventVendorSpecific␉␉␉␉␉␉␉␉␉= 0xFF␊ |
1602 | };␊ |
1603 | ␊ |
1604 | // HCI Event Masks␊ |
1605 | ␊ |
1606 | // Event masks are 8 octets according to the spec. v2.1 introduces some event masks that␊ |
1607 | // actually exceed 32 bits so the 4 byte enum we had before Bluetooth 2.0 will still work for old␊ |
1608 | // the masks, but the new masks need to be defined as 64 bits.␊ |
1609 | ␊ |
1610 | typedef uint64_t␉BluetoothHCIEventMask;␊ |
1611 | ␊ |
1612 | #define␉kBluetoothHCIEventMaskDefault64Bit␉␉␉␉␉␉␉␉0x00001FFFFFFFFFFFLL␊ |
1613 | #define␉kBluetoothHCIEventMaskAll64Bit␉␉␉␉␉␉␉␉␉0xFFFFFFFFFFFFFFFFLL␊ |
1614 | ␊ |
1615 | ␉// [v1.2]␊ |
1616 | ␊ |
1617 | #define␉kBluetoothHCIEventMaskFlowSpecificationCompleteEvent␉␉␉0x0000000100000000LL␊ |
1618 | #define␉kBluetoothHCIEventMaskInquiryResultWithRSSIEvent␉␉␉␉0x0000000200000000LL␊ |
1619 | #define␉kBluetoothHCIEventMaskReadRemoteExtendedFeaturesCompleteEvent␉0x0000000400000000LL␊ |
1620 | #define␉kBluetoothHCIEventMaskSynchronousConnectionCompleteEvent␉␉0x0000080000000000LL␊ |
1621 | #define␉kBluetoothHCIEventMaskSynchronousConnectionChangedEvent␉␉␉0x0000100000000000LL␊ |
1622 | ␊ |
1623 | ␉// [v2.1]␊ |
1624 | ␊ |
1625 | #define␉kBluetoothHCIEventMaskSniffSubstrateEvent␉␉␉␉␉␉0x0000200000000000LL␊ |
1626 | #define␉kBluetoothHCIEventMaskExtendedInquiryResultEvent␉␉␉␉0x0000400000000000LL␊ |
1627 | #define␉kBluetoothHCIEventMaskLinkSupervisionTimeoutChangedEvent␉␉0x0080000000000000LL␊ |
1628 | #define␉kBluetoothHCIEventMaskEnhancedFlushCompleteEvent␉␉␉␉0x0100000000000000LL␊ |
1629 | ␉␊ |
1630 | ␉// [v2.1 Secure Simple Pairing]␊ |
1631 | ␊ |
1632 | #define␉kBluetoothHCIEventMaskIOCapabilityRequestEvent␉␉␉␉␉0x0001000000000000LL␊ |
1633 | #define␉kBluetoothHCIEventMaskIOCapabilityRequestReplyEvent␉␉␉␉0x0002000000000000LL␊ |
1634 | #define␉kBluetoothHCIEventMaskUserConfirmationRequestEvent␉␉␉␉0x0004000000000000LL␊ |
1635 | #define␉kBluetoothHCIEventMaskUserPasskeyRequestEvent␉␉␉␉␉0x0008000000000000LL␊ |
1636 | #define␉kBluetoothHCIEventMaskRemoteOOBDataRequestEvent␉␉␉␉␉0x0010000000000000LL␊ |
1637 | #define␉kBluetoothHCIEventMaskSimplePairingCompleteEvent␉␉␉␉0x0020000000000000LL␊ |
1638 | #define␉kBluetoothHCIEventMaskUserPasskeyNotificationEvent␉␉␉␉0x0400000000000000LL␊ |
1639 | #define␉kBluetoothHCIEventMaskKeypressNotificationEvent␉␉␉␉␉0x0800000000000000LL␊ |
1640 | ␉␊ |
1641 | enum␊ |
1642 | {␊ |
1643 | ␉kBluetoothHCIEventMaskNone␉␉␉␉␉␉␉␉␉␉␉= 0x00000000, ␊ |
1644 | ␉kBluetoothHCIEventMaskInquiryComplete␉␉␉␉␉␉␉␉= 0x00000001, ␊ |
1645 | ␉kBluetoothHCIEventMaskInquiryResult␉␉␉␉␉␉␉␉␉= 0x00000002, ␊ |
1646 | ␉kBluetoothHCIEventMaskConnectionComplete␉␉␉␉␉␉␉= 0x00000004, ␊ |
1647 | ␉kBluetoothHCIEventMaskConnectionRequest␉␉␉␉␉␉␉␉= 0x00000008, ␊ |
1648 | ␉kBluetoothHCIEventMaskDisconnectionComplete␉␉␉␉␉␉␉= 0x00000010, ␊ |
1649 | ␉kBluetoothHCIEventMaskAuthenticationComplete␉␉␉␉␉␉= 0x00000020, ␊ |
1650 | ␉kBluetoothHCIEventMaskRemoteNameRequestComplete␉␉␉␉␉␉= 0x00000040, ␊ |
1651 | ␉kBluetoothHCIEventMaskEncryptionChange␉␉␉␉␉␉␉␉= 0x00000080, ␊ |
1652 | ␉kBluetoothHCIEventMaskChangeConnectionLinkKeyComplete␉␉␉␉= 0x00000100, ␊ |
1653 | ␉kBluetoothHCIEventMaskMasterLinkKeyComplete␉␉␉␉␉␉␉= 0x00000200, ␊ |
1654 | ␉kBluetoothHCIEventMaskReadRemoteSupportedFeaturesComplete␉␉␉= 0x00000400, ␊ |
1655 | ␉kBluetoothHCIEventMaskReadRemoteVersionInformationComplete␉␉␉= 0x00000800, ␊ |
1656 | ␉kBluetoothHCIEventMaskQoSSetupComplete␉␉␉␉␉␉␉␉= 0x00001000, ␊ |
1657 | ␉kBluetoothHCIEventMaskCommandComplete␉␉␉␉␉␉␉␉= 0x00002000, ␊ |
1658 | ␉kBluetoothHCIEventMaskCommandStatus␉␉␉␉␉␉␉␉␉= 0x00004000, ␊ |
1659 | ␉kBluetoothHCIEventMaskHardwareError␉␉␉␉␉␉␉␉␉= 0x00008000, ␊ |
1660 | ␉kBluetoothHCIEventMaskFlushOccurred␉␉␉␉␉␉␉␉␉= 0x00010000, ␊ |
1661 | ␉kBluetoothHCIEventMaskRoleChange␉␉␉␉␉␉␉␉␉= 0x00020000, ␊ |
1662 | ␉␊ |
1663 | ␉kBluetoothHCIEventMaskNumberOfCompletedPackets␉␉␉␉␉␉= 0x00040000, ␊ |
1664 | ␉kBluetoothHCIEventMaskModeChange␉␉␉␉␉␉␉␉␉= 0x00080000, ␊ |
1665 | ␉kBluetoothHCIEventMaskReturnLinkKeys␉␉␉␉␉␉␉␉= 0x00100000, ␊ |
1666 | ␉kBluetoothHCIEventMaskPINCodeRequest␉␉␉␉␉␉␉␉= 0x00200000, ␊ |
1667 | ␉kBluetoothHCIEventMaskLinkKeyRequest␉␉␉␉␉␉␉␉= 0x00400000, ␊ |
1668 | ␉kBluetoothHCIEventMaskLinkKeyNotification␉␉␉␉␉␉␉= 0x00800000, ␊ |
1669 | ␉kBluetoothHCIEventMaskLoopbackCommand␉␉␉␉␉␉␉␉= 0x01000000, ␊ |
1670 | ␉kBluetoothHCIEventMaskDataBufferOverflow␉␉␉␉␉␉␉= 0x02000000, ␊ |
1671 | ␉kBluetoothHCIEventMaskMaxSlotsChange␉␉␉␉␉␉␉␉= 0x04000000, ␊ |
1672 | ␉kBluetoothHCIEventMaskReadClockOffsetComplete␉␉␉␉␉␉= 0x08000000, ␊ |
1673 | ␉kBluetoothHCIEventMaskConnectionPacketTypeChanged␉␉␉␉␉= 0x10000000, ␊ |
1674 | ␉kBluetoothHCIEventMaskQoSViolation␉␉␉␉␉␉␉␉␉= 0x20000000, ␊ |
1675 | ␉kBluetoothHCIEventMaskPageScanModeChange␉␉␉␉␉␉␉= 0x40000000, ␊ |
1676 | ␉kBluetoothHCIEventMaskPageScanRepetitionModeChange␉␉␉␉␉= 0x80000000, ␊ |
1677 | ␉␊ |
1678 | ␉kBluetoothHCIEventMaskAll␉␉␉␉␉␉␉␉␉␉␉= 0xFFFFFFFF, ␊ |
1679 | ␉kBluetoothHCIEventMaskDefault␉␉␉␉␉␉␉␉␉␉= kBluetoothHCIEventMaskAll␉␉/* Use kBluetoothHCIEventMaskDefault64Bit above! */␊ |
1680 | };␊ |
1681 | ␊ |
1682 | // Event results structures.␊ |
1683 | ␊ |
1684 | typedef struct␉BluetoothHCIEventConnectionCompleteResults␉␉BluetoothHCIEventConnectionCompleteResults;␊ |
1685 | struct␉␉␉BluetoothHCIEventConnectionCompleteResults␊ |
1686 | {␊ |
1687 | ␉BluetoothConnectionHandle␉␉␉␉␉connectionHandle;␊ |
1688 | ␉BluetoothDeviceAddress␉␉␉␉␉␉deviceAddress;␊ |
1689 | ␉BluetoothLinkType␉␉␉␉␉␉␉linkType;␊ |
1690 | ␉BluetoothHCIEncryptionMode␉␉␉␉␉encryptionMode;␊ |
1691 | };␊ |
1692 | ␊ |
1693 | typedef struct␉BluetoothHCIEventDisconnectionCompleteResults␉␉BluetoothHCIEventDisconnectionCompleteResults;␊ |
1694 | struct␉␉␉BluetoothHCIEventDisconnectionCompleteResults␊ |
1695 | {␊ |
1696 | ␉BluetoothConnectionHandle␉␉␉␉␉connectionHandle;␊ |
1697 | ␉BluetoothReasonCode␉␉␉␉␉␉␉reason;␊ |
1698 | };␊ |
1699 | ␊ |
1700 | typedef struct␉BluetoothHCIEventReadSupportedFeaturesResults ␉BluetoothHCIEventReadSupportedFeaturesResults;␊ |
1701 | struct ␉␉␉BluetoothHCIEventReadSupportedFeaturesResults␊ |
1702 | {␊ |
1703 | ␉BluetoothConnectionHandle␉␉␉␉␉connectionHandle;␊ |
1704 | ␉BluetoothHCISupportedFeatures␉␉␉␉supportedFeatures;␊ |
1705 | };␊ |
1706 | ␊ |
1707 | #if BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1␊ |
1708 | typedef struct␉BluetoothHCIEventReadExtendedFeaturesResults ␉BluetoothHCIEventReadExtendedFeaturesResults;␊ |
1709 | struct ␉␉␉BluetoothHCIEventReadExtendedFeaturesResults␊ |
1710 | {␊ |
1711 | ␉BluetoothConnectionHandle␉␉␉␉␉connectionHandle;␊ |
1712 | ␉BluetoothHCIExtendedFeaturesInfo␉␉␉supportedFeaturesInfo;␊ |
1713 | };␊ |
1714 | #endif /* BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1 */␊ |
1715 | ␉␉␊ |
1716 | typedef struct␉BluetoothHCIEventReadRemoteVersionInfoResults ␉BluetoothHCIEventReadRemoteVersionInfoResults;␊ |
1717 | struct ␉␉␉BluetoothHCIEventReadRemoteVersionInfoResults␊ |
1718 | {␊ |
1719 | ␉BluetoothConnectionHandle␉␉␉␉␉connectionHandle;␊ |
1720 | ␉BluetoothLMPVersion␉␉␉␉␉␉␉lmpVersion;␊ |
1721 | ␉BluetoothManufacturerName␉␉␉␉␉manufacturerName;␊ |
1722 | ␉BluetoothLMPSubversion␉␉␉␉␉␉lmpSubversion;␊ |
1723 | };␊ |
1724 | ␊ |
1725 | typedef struct␉BluetoothHCIEventRemoteNameRequestResults ␉␉BluetoothHCIEventRemoteNameRequestResults;␊ |
1726 | struct ␉␉␉BluetoothHCIEventRemoteNameRequestResults␊ |
1727 | {␊ |
1728 | ␉BluetoothDeviceAddress␉␉␉␉␉␉deviceAddress;␊ |
1729 | ␉BluetoothDeviceName␉␉␉␉␉␉␉deviceName;␊ |
1730 | };␊ |
1731 | ␊ |
1732 | typedef struct␉BluetoothHCIEventReadClockOffsetResults ␉␉BluetoothHCIEventReadClockOffsetResults;␊ |
1733 | struct␉␉␉BluetoothHCIEventReadClockOffsetResults␊ |
1734 | {␊ |
1735 | ␉BluetoothConnectionHandle␉␉␉␉␉connectionHandle;␊ |
1736 | ␉BluetoothClockOffset␉␉␉␉␉␉clockOffset;␊ |
1737 | };␊ |
1738 | ␊ |
1739 | typedef struct␉BluetoothHCIEventConnectionRequestResults ␉␉BluetoothHCIEventConnectionRequestResults;␊ |
1740 | struct␉␉␉BluetoothHCIEventConnectionRequestResults␊ |
1741 | {␊ |
1742 | ␉BluetoothDeviceAddress␉␉␉␉␉␉deviceAddress;␊ |
1743 | ␉BluetoothClassOfDevice␉␉␉␉␉␉classOfDevice;␊ |
1744 | ␉BluetoothLinkType␉␉␉␉␉␉␉linkType;␊ |
1745 | };␊ |
1746 | ␊ |
1747 | typedef struct␉BluetoothHCIEventLinkKeyNotificationResults ␉␉BluetoothHCIEventLinkKeyNotificationResults;␊ |
1748 | struct␉␉␉BluetoothHCIEventLinkKeyNotificationResults␊ |
1749 | {␊ |
1750 | ␉BluetoothDeviceAddress␉␉␉␉␉␉deviceAddress;␊ |
1751 | ␉BluetoothKey␉␉␉␉␉␉␉␉linkKey;␊ |
1752 | ␉BluetoothKeyType␉␉␉␉␉␉␉keyType;␊ |
1753 | };␊ |
1754 | ␊ |
1755 | typedef struct␉BluetoothHCIEventMaxSlotsChangeResults ␉␉BluetoothHCIEventMaxSlotsChangeResults;␊ |
1756 | struct␉␉␉BluetoothHCIEventMaxSlotsChangeResults␊ |
1757 | {␊ |
1758 | ␉BluetoothConnectionHandle␉␉␉␉␉connectionHandle;␊ |
1759 | ␉BluetoothMaxSlots␉␉␉␉␉␉␉maxSlots;␊ |
1760 | };␊ |
1761 | ␊ |
1762 | typedef struct␉BluetoothHCIEventModeChangeResults ␉␉BluetoothHCIEventModeChangeResults;␊ |
1763 | struct␉␉␉BluetoothHCIEventModeChangeResults␊ |
1764 | {␊ |
1765 | ␉BluetoothConnectionHandle␉␉␉␉␉connectionHandle;␊ |
1766 | ␉BluetoothHCIConnectionMode␉␉␉␉␉mode;␊ |
1767 | ␉BluetoothHCIModeInterval␉␉␉␉␉modeInterval;␊ |
1768 | };␊ |
1769 | ␊ |
1770 | typedef struct␉BluetoothHCIEventReturnLinkKeysResults␉BluetoothHCIEventReturnLinkKeysResults;␊ |
1771 | struct␉␉␉BluetoothHCIEventReturnLinkKeysResults␊ |
1772 | {␊ |
1773 | ␉UInt8␉␉␉␉␉␉␉␉␉␉numLinkKeys;␊ |
1774 | ␉struct {␊ |
1775 | ␉␉BluetoothDeviceAddress␉␉␉␉␉deviceAddress;␊ |
1776 | ␉␉BluetoothKey␉␉␉␉␉␉␉linkKey;␊ |
1777 | ␉} linkKeys[1];␊ |
1778 | };␊ |
1779 | ␊ |
1780 | typedef struct␉BluetoothHCIEventAuthenticationCompleteResults ␉␉BluetoothHCIEventAuthenticationCompleteResults;␊ |
1781 | struct␉␉␉BluetoothHCIEventAuthenticationCompleteResults␊ |
1782 | {␊ |
1783 | ␉BluetoothConnectionHandle␉␉␉␉␉connectionHandle;␊ |
1784 | };␊ |
1785 | ␊ |
1786 | typedef struct␉BluetoothHCIEventEncryptionChangeResults ␉␉BluetoothHCIEventEncryptionChangeResults;␊ |
1787 | struct␉␉␉BluetoothHCIEventEncryptionChangeResults␊ |
1788 | {␊ |
1789 | ␉BluetoothConnectionHandle␉␉␉␉␉connectionHandle;␊ |
1790 | ␉BluetoothEncryptionEnable␉␉␉␉␉enable;␊ |
1791 | };␊ |
1792 | ␊ |
1793 | typedef struct␉BluetoothHCIEventChangeConnectionLinkKeyCompleteResults ␉BluetoothHCIEventChangeConnectionLinkKeyCompleteResults;␊ |
1794 | struct␉␉␉BluetoothHCIEventChangeConnectionLinkKeyCompleteResults␊ |
1795 | {␊ |
1796 | ␉BluetoothConnectionHandle␉␉␉␉␉connectionHandle;␊ |
1797 | };␊ |
1798 | ␊ |
1799 | typedef struct␉BluetoothHCIEventMasterLinkKeyCompleteResults ␉BluetoothHCIEventMasterLinkKeyCompleteResults;␊ |
1800 | struct␉␉␉BluetoothHCIEventMasterLinkKeyCompleteResults␊ |
1801 | {␊ |
1802 | ␉BluetoothConnectionHandle␉␉␉␉␉connectionHandle;␊ |
1803 | ␉BluetoothKeyFlag␉␉␉␉␉␉␉keyFlag;␊ |
1804 | };␊ |
1805 | ␊ |
1806 | typedef struct␉BluetoothHCIEventQoSSetupCompleteResults ␉BluetoothHCIEventQoSSetupCompleteResults;␊ |
1807 | struct␉␉␉BluetoothHCIEventQoSSetupCompleteResults␊ |
1808 | {␊ |
1809 | ␉BluetoothConnectionHandle␉␉␉␉␉connectionHandle;␊ |
1810 | ␉BluetoothHCIQualityOfServiceSetupParams␉␉setupParams;␊ |
1811 | };␊ |
1812 | ␊ |
1813 | typedef struct␉BluetoothHCIEventHardwareErrorResults ␉BluetoothHCIEventHardwareErrorResults;␊ |
1814 | struct␉␉␉BluetoothHCIEventHardwareErrorResults␊ |
1815 | {␊ |
1816 | ␉BluetoothHCIStatus␉␉␉␉␉␉␉error;␊ |
1817 | };␊ |
1818 | ␊ |
1819 | typedef struct␉BluetoothHCIEventFlushOccurredResults ␉BluetoothHCIEventFlushOccurredResults;␊ |
1820 | struct␉␉␉BluetoothHCIEventFlushOccurredResults␊ |
1821 | {␊ |
1822 | ␉BluetoothConnectionHandle␉␉␉␉␉connectionHandle;␊ |
1823 | };␊ |
1824 | ␊ |
1825 | typedef struct␉BluetoothHCIEventRoleChangeResults ␉BluetoothHCIEventRoleChangeResults;␊ |
1826 | struct␉␉␉BluetoothHCIEventRoleChangeResults␊ |
1827 | {␊ |
1828 | ␉BluetoothConnectionHandle␉␉␉␉␉connectionHandle;␊ |
1829 | ␉BluetoothDeviceAddress␉␉␉␉␉␉deviceAddress;␊ |
1830 | ␉BluetoothRole␉␉␉␉␉␉␉␉role;␊ |
1831 | };␊ |
1832 | ␊ |
1833 | typedef struct␉BluetoothHCIEventDataBufferOverflowResults ␉BluetoothHCIEventDataBufferOverflowResults;␊ |
1834 | struct␉␉␉BluetoothHCIEventDataBufferOverflowResults␊ |
1835 | {␊ |
1836 | ␉BluetoothLinkType␉␉␉␉␉␉␉linkType;␊ |
1837 | };␊ |
1838 | ␊ |
1839 | typedef struct␉BluetoothHCIEventConnectionPacketTypeResults ␉BluetoothHCIEventConnectionPacketTypeResults;␊ |
1840 | struct␉␉␉BluetoothHCIEventConnectionPacketTypeResults␊ |
1841 | {␊ |
1842 | ␉BluetoothConnectionHandle␉␉␉␉␉connectionHandle;␊ |
1843 | ␉BluetoothPacketType␉␉␉␉␉␉␉packetType;␊ |
1844 | };␊ |
1845 | ␊ |
1846 | typedef struct␉BluetoothHCIEventReadRemoteSupportedFeaturesResults ␉BluetoothHCIEventReadRemoteSupportedFeaturesResults;␊ |
1847 | struct␉␉␉BluetoothHCIEventReadRemoteSupportedFeaturesResults␊ |
1848 | {␊ |
1849 | ␉BluetoothHCIStatus␉␉␉␉␉␉␉error;␊ |
1850 | ␉BluetoothConnectionHandle␉␉␉␉␉connectionHandle;␊ |
1851 | ␉BluetoothHCISupportedFeatures␉␉␉␉lmpFeatures;␊ |
1852 | };␊ |
1853 | ␊ |
1854 | #if BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1␊ |
1855 | typedef struct␉BluetoothHCIEventReadRemoteExtendedFeaturesResults ␉BluetoothHCIEventReadRemoteExtendedFeaturesResults;␊ |
1856 | struct␉␉␉BluetoothHCIEventReadRemoteExtendedFeaturesResults␊ |
1857 | {␊ |
1858 | ␉BluetoothHCIStatus␉␉␉␉␉␉␉error;␊ |
1859 | ␉BluetoothConnectionHandle␉␉␉␉␉connectionHandle;␊ |
1860 | ␉BluetoothHCIPageNumber␉␉␉␉␉␉page;␊ |
1861 | ␉BluetoothHCIPageNumber␉␉␉␉␉␉maxPage;␊ |
1862 | ␉BluetoothHCISupportedFeatures␉␉␉␉lmpFeatures;␊ |
1863 | };␊ |
1864 | #endif /* BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1 */␊ |
1865 | ␊ |
1866 | typedef struct␉BluetoothHCIEventQoSViolationResults ␉BluetoothHCIEventQoSViolationResults;␊ |
1867 | struct␉␉␉BluetoothHCIEventQoSViolationResults␊ |
1868 | {␊ |
1869 | ␉BluetoothConnectionHandle␉␉␉␉␉connectionHandle;␊ |
1870 | };␊ |
1871 | ␊ |
1872 | typedef struct␉BluetoothHCIEventPageScanModeChangeResults ␉BluetoothHCIEventPageScanModeChangeResults;␊ |
1873 | struct␉␉␉BluetoothHCIEventPageScanModeChangeResults␊ |
1874 | {␊ |
1875 | ␉BluetoothDeviceAddress␉␉␉deviceAddress;␊ |
1876 | ␉BluetoothPageScanMode␉␉␉pageScanMode;␊ |
1877 | };␊ |
1878 | ␊ |
1879 | typedef struct␉BluetoothHCIEventPageScanRepetitionModeChangeResults ␉BluetoothHCIEventPageScanRepetitionModeChangeResults;␊ |
1880 | struct␉␉␉BluetoothHCIEventPageScanRepetitionModeChangeResults␊ |
1881 | {␊ |
1882 | ␉BluetoothDeviceAddress␉␉␉␉deviceAddress;␊ |
1883 | ␉BluetoothPageScanRepetitionMode␉␉pageScanRepetitionMode;␊ |
1884 | };␊ |
1885 | ␊ |
1886 | typedef struct␉BluetoothHCIEventVendorSpecificResults ␉BluetoothHCIEventVendorSpecificResults;␊ |
1887 | struct␉␉␉BluetoothHCIEventVendorSpecificResults␊ |
1888 | {␊ |
1889 | ␉UInt8␉␉␉␉␉␉␉␉length;␊ |
1890 | ␉UInt8␉␉␉␉␉␉␉␉data[255];␊ |
1891 | };␊ |
1892 | ␊ |
1893 | #define kNoNotifyProc␉NULL␊ |
1894 | #define kNoUserRefCon␉NULL␊ |
1895 | ␊ |
1896 | typedef struct BluetoothHCIRequestCallbackInfo BluetoothHCIRequestCallbackInfo;␊ |
1897 | struct BluetoothHCIRequestCallbackInfo␊ |
1898 | {␊ |
1899 | ␉mach_vm_address_t␉␉␉␉␉userCallback;␉␉␉// Proc to call when async handler is called.␊ |
1900 | ␉mach_vm_address_t␉␉␉␉␉userRefCon;␉␉␉␉// For user's info.␊ |
1901 | ␉mach_vm_address_t␉␉␉␉␉internalRefCon;␉␉␉// For our purposes.␊ |
1902 | ␉mach_vm_address_t ␉␉␉␉␉asyncIDRefCon;␉␉␉// For our aync calls.␊ |
1903 | ␉mach_vm_address_t␉␉␉␉␉reserved;␉␉␉␉// For the future. Currently Unused.␊ |
1904 | };␊ |
1905 | ␊ |
1906 | // Error codes␊ |
1907 | ␊ |
1908 | enum␊ |
1909 | {␊ |
1910 | ␉kBluetoothHCIErrorSuccess␉␉␉␉␉␉␉␉␉␉␉= 0x00, ␊ |
1911 | ␉kBluetoothHCIErrorUnknownHCICommand␉␉␉␉␉␉␉␉␉= 0x01, ␊ |
1912 | ␉kBluetoothHCIErrorNoConnection␉␉␉␉␉␉␉␉␉␉= 0x02, ␊ |
1913 | ␉kBluetoothHCIErrorHardwareFailure␉␉␉␉␉␉␉␉␉= 0x03, ␊ |
1914 | ␉kBluetoothHCIErrorPageTimeout␉␉␉␉␉␉␉␉␉␉= 0x04, ␊ |
1915 | ␉kBluetoothHCIErrorAuthenticationFailure␉␉␉␉␉␉␉␉= 0x05, ␊ |
1916 | ␉kBluetoothHCIErrorKeyMissing␉␉␉␉␉␉␉␉␉␉= 0x06, ␊ |
1917 | ␉kBluetoothHCIErrorMemoryFull␉␉␉␉␉␉␉␉␉␉= 0x07, ␊ |
1918 | ␉kBluetoothHCIErrorConnectionTimeout␉␉␉␉␉␉␉␉␉= 0x08, ␊ |
1919 | ␉kBluetoothHCIErrorMaxNumberOfConnections␉␉␉␉␉␉␉= 0x09, ␊ |
1920 | ␉kBluetoothHCIErrorMaxNumberOfSCOConnectionsToADevice␉␉␉␉= 0x0A, ␊ |
1921 | ␉kBluetoothHCIErrorACLConnectionAlreadyExists␉␉␉␉␉␉= 0x0B, ␊ |
1922 | ␉kBluetoothHCIErrorCommandDisallowed␉␉␉␉␉␉␉␉␉= 0x0C, ␊ |
1923 | ␉kBluetoothHCIErrorHostRejectedLimitedResources␉␉␉␉␉␉= 0x0D, ␊ |
1924 | ␉kBluetoothHCIErrorHostRejectedSecurityReasons␉␉␉␉␉␉= 0x0E, ␊ |
1925 | ␉kBluetoothHCIErrorHostRejectedRemoteDeviceIsPersonal␉␉␉␉= 0x0F, ␊ |
1926 | ␉kBluetoothHCIErrorHostTimeout␉␉␉␉␉␉␉␉␉␉= 0x10, ␊ |
1927 | ␉kBluetoothHCIErrorUnsupportedFeatureOrParameterValue␉␉␉␉= 0x11, ␊ |
1928 | ␉kBluetoothHCIErrorInvalidHCICommandParameters␉␉␉␉␉␉= 0x12, ␊ |
1929 | ␉kBluetoothHCIErrorOtherEndTerminatedConnectionUserEnded␉␉␉␉= 0x13, ␊ |
1930 | ␉kBluetoothHCIErrorOtherEndTerminatedConnectionLowResources␉␉␉= 0x14, ␊ |
1931 | ␉kBluetoothHCIErrorOtherEndTerminatedConnectionAboutToPowerOff␉␉= 0x15, ␊ |
1932 | ␉kBluetoothHCIErrorConnectionTerminatedByLocalHost␉␉␉␉␉= 0x16, ␊ |
1933 | ␉kBluetoothHCIErrorRepeatedAttempts␉␉␉␉␉␉␉␉␉= 0x17, ␊ |
1934 | ␉kBluetoothHCIErrorPairingNotAllowed␉␉␉␉␉␉␉␉␉= 0x18, ␊ |
1935 | ␉kBluetoothHCIErrorUnknownLMPPDU␉␉␉␉␉␉␉␉␉␉= 0x19, ␊ |
1936 | ␉kBluetoothHCIErrorUnsupportedRemoteFeature␉␉␉␉␉␉␉= 0x1A, ␊ |
1937 | ␉kBluetoothHCIErrorSCOOffsetRejected␉␉␉␉␉␉␉␉␉= 0x1B, ␊ |
1938 | ␉kBluetoothHCIErrorSCOIntervalRejected␉␉␉␉␉␉␉␉= 0x1C, ␊ |
1939 | ␉kBluetoothHCIErrorSCOAirModeRejected␉␉␉␉␉␉␉␉= 0x1D, ␊ |
1940 | ␉kBluetoothHCIErrorInvalidLMPParameters␉␉␉␉␉␉␉␉= 0x1E, ␊ |
1941 | ␉kBluetoothHCIErrorUnspecifiedError␉␉␉␉␉␉␉␉␉= 0x1F, ␊ |
1942 | ␉kBluetoothHCIErrorUnsupportedLMPParameterValue␉␉␉␉␉␉= 0x20, ␊ |
1943 | ␉kBluetoothHCIErrorRoleChangeNotAllowed␉␉␉␉␉␉␉␉= 0x21, ␊ |
1944 | ␉kBluetoothHCIErrorLMPResponseTimeout␉␉␉␉␉␉␉␉= 0x22, ␊ |
1945 | ␉kBluetoothHCIErrorLMPErrorTransactionCollision␉␉␉␉␉␉= 0x23, ␊ |
1946 | ␉kBluetoothHCIErrorLMPPDUNotAllowed␉␉␉␉␉␉␉␉␉= 0x24, ␊ |
1947 | ␉kBluetoothHCIErrorEncryptionModeNotAcceptable␉␉␉␉␉␉= 0x25, ␉// Added Core Spec, v1.1␊ |
1948 | ␉kBluetoothHCIErrorUnitKeyUsed␉␉␉␉␉␉␉␉␉␉= 0x26, ␉// 1.1␊ |
1949 | ␉kBluetoothHCIErrorQoSNotSupported␉␉␉␉␉␉␉␉␉= 0x27, ␉// 1.1␊ |
1950 | ␉kBluetoothHCIErrorInstantPassed␉␉␉␉␉␉␉␉␉␉= 0x28, ␉// 1.1␊ |
1951 | ␉kBluetoothHCIErrorPairingWithUnitKeyNotSupported␉␉␉␉␉= 0x29, ␉// 1.1␊ |
1952 | ␉kBluetoothHCIErrorHostRejectedUnacceptableDeviceAddress␉␉␉␉= 0x0F,␉␉// 2.0+␊ |
1953 | ␉kBluetoothHCIErrorDifferentTransactionCollision␉␉␉␉␉␉= 0x2A, ␉// 1.2␊ |
1954 | ␉kBluetoothHCIErrorQoSUnacceptableParameter␉␉␉␉␉␉␉= 0x2C, ␉// 1.2␊ |
1955 | ␉kBluetoothHCIErrorQoSRejected␉␉␉␉␉␉␉␉␉␉= 0x2D, ␉// 1.2␊ |
1956 | ␉kBluetoothHCIErrorChannelClassificationNotSupported␉␉␉␉␉= 0x2E, ␉// 1.2␊ |
1957 | ␉kBluetoothHCIErrorInsufficientSecurity␉␉␉␉␉␉␉␉= 0x2F, ␉// 1.2␊ |
1958 | ␉kBluetoothHCIErrorParameterOutOfMandatoryRange␉␉␉␉␉␉= 0x30,␉␉// 1.2␊ |
1959 | ␉kBluetoothHCIErrorRoleSwitchPending␉␉␉␉␉␉␉␉␉= 0x31,␉␉// 1.2␊ |
1960 | ␉kBluetoothHCIErrorReservedSlotViolation␉␉␉␉␉␉␉␉= 0x34,␉␉// 1.2␊ |
1961 | ␉kBluetoothHCIErrorRoleSwitchFailed␉␉␉␉␉␉␉␉␉= 0x35,␉␉// 1.2␊ |
1962 | ␉kBluetoothHCIErrorExtendedInquiryResponseTooLarge␉␉␉␉␉= 0x36, ␉// 2.1␊ |
1963 | ␉kBluetoothHCIErrorSecureSimplePairingNotSupportedByHost␉␉␉␉= 0x37, ␉// 2.1␊ |
1964 | ␉␊ |
1965 | ␉kBluetoothHCIErrorMax␉␉␉␉␉␉␉␉␉␉␉␉= 0x37␊ |
1966 | };␊ |
1967 | ␊ |
1968 | #if 0␊ |
1969 | #pragma mark === HCI Power Mode ===␊ |
1970 | #endif␊ |
1971 | ␊ |
1972 | //===========================================================================================================================␊ |
1973 | //␉HCI Power Mode ␊ |
1974 | //===========================================================================================================================␊ |
1975 | ␊ |
1976 | typedef enum␊ |
1977 | {␊ |
1978 | ␉kBluetoothHCIPowerStateON␉␉␉␉= 0x01,␊ |
1979 | ␉kBluetoothHCIPowerStateOFF␉␉␉␉= 0x00,␊ |
1980 | ␉kBluetoothHCIPowerStateUnintialized␉␉= 0xFF,␉␊ |
1981 | } BluetoothHCIPowerState;␊ |
1982 | ␊ |
1983 | enum␊ |
1984 | {␊ |
1985 | kBluetoothHCIErrorPowerIsOFF␉␉= (kBluetoothHCIErrorMax + 1)␊ |
1986 | };␊ |
1987 | ␊ |
1988 | #if 0␊ |
1989 | #pragma mark === HCI USB Transport ===␊ |
1990 | #endif␊ |
1991 | ␊ |
1992 | //===========================================================================================================================␊ |
1993 | //␉HCI USB Transport␊ |
1994 | //===========================================================================================================================␊ |
1995 | ␊ |
1996 | //---------------------------------------------------------------------------------------------------------------------------␊ |
1997 | /*!␉@enum␉␉BluetoothHCIUSBDeviceMatchingConstants␊ |
1998 | ␉@abstract␉Bluetooth USB device matching constants␊ |
1999 | ␉@constant␉kBluetoothHCITransportUSBClassCode␉␉␉Wireless Controller␊ |
2000 | ␉@constant␉kBluetoothHCITransportUSBSubClassCode␉␉RF Controller␊ |
2001 | ␉@constant␉kBluetoothHCITransportUSBProtocolCode␉␉Bluetooth Programming␊ |
2002 | */␊ |
2003 | ␊ |
2004 | enum␊ |
2005 | {␊ |
2006 | ␉kBluetoothHCITransportUSBClassCode␉␉= 0xE0,␊ |
2007 | ␉kBluetoothHCITransportUSBSubClassCode␉= 0x01,␊ |
2008 | ␉kBluetoothHCITransportUSBProtocolCode␉= 0x01␊ |
2009 | };␊ |
2010 | ␊ |
2011 | #if 0␊ |
2012 | #pragma mark === TCI - L2CAP ===␊ |
2013 | #endif␊ |
2014 | ␊ |
2015 | //===========================================================================================================================␊ |
2016 | //␉TCI - L2CAP␊ |
2017 | //===========================================================================================================================␊ |
2018 | ␊ |
2019 | enum␊ |
2020 | {␊ |
2021 | ␉kBluetoothL2CAPTCIEventIDReserved␉␉␉␉␉␉␉= 0x00,␊ |
2022 | ␉kBluetoothL2CAPTCIEventIDL2CA_ConnectInd␉␉␉␉␉= 0x01,␊ |
2023 | ␉kBluetoothL2CAPTCIEventIDL2CA_ConfigInd␉␉␉␉␉␉= 0x02,␊ |
2024 | ␉kBluetoothL2CAPTCIEventIDL2CA_DisconnectInd␉␉␉␉␉= 0x03,␊ |
2025 | ␉kBluetoothL2CAPTCIEventIDL2CA_QoSViolationInd␉␉␉␉= 0x04,␊ |
2026 | ␉kBluetoothL2CAPTCIEventIDL2CA_TimeOutInd␉␉␉␉␉= 0x05␊ |
2027 | };␊ |
2028 | ␊ |
2029 | enum␊ |
2030 | {␊ |
2031 | ␉kBluetoothL2CAPTCICommandReserved␉␉␉␉␉␉␉= 0x0000,␊ |
2032 | ␉kBluetoothL2CAPTCICommandL2CA_ConnectReq␉␉␉␉␉= 0x0001,␊ |
2033 | ␉kBluetoothL2CAPTCICommandL2CA_DisconnectReq␉␉␉␉␉= 0x0002,␊ |
2034 | ␉kBluetoothL2CAPTCICommandL2CA_ConfigReq␉␉␉␉␉␉= 0x0003,␊ |
2035 | ␉kBluetoothL2CAPTCICommandL2CA_DisableCLT␉␉␉␉␉= 0x0004,␊ |
2036 | ␉kBluetoothL2CAPTCICommandL2CA_EnableCLT␉␉␉␉␉␉= 0x0005,␊ |
2037 | ␉kBluetoothL2CAPTCICommandL2CA_GroupCreate␉␉␉␉␉= 0x0006,␊ |
2038 | ␉kBluetoothL2CAPTCICommandL2CA_GroupClose␉␉␉␉␉= 0x0007,␊ |
2039 | ␉kBluetoothL2CAPTCICommandL2CA_GroupAddMember␉␉␉␉= 0x0008,␊ |
2040 | ␉kBluetoothL2CAPTCICommandL2CA_GroupRemoveMember␉␉␉␉= 0x0009,␊ |
2041 | ␉kBluetoothL2CAPTCICommandL2CA_GroupMembership␉␉␉␉= 0x000A,␊ |
2042 | ␉kBluetoothL2CAPTCICommandL2CA_WriteData␉␉␉␉␉␉= 0x000B,␊ |
2043 | ␉kBluetoothL2CAPTCICommandL2CA_ReadData␉␉␉␉␉␉= 0x000C,␊ |
2044 | ␉kBluetoothL2CAPTCICommandL2CA_Ping␉␉␉␉␉␉␉= 0x000D,␊ |
2045 | ␉kBluetoothL2CAPTCICommandL2CA_GetInfo␉␉␉␉␉␉= 0x000E,␊ |
2046 | ␉kBluetoothL2CAPTCICommandL2CA_Reserved1␉␉␉␉␉␉= 0x000F,␊ |
2047 | ␉kBluetoothL2CAPTCICommandL2CA_Reserved2␉␉␉␉␉␉= 0x0010,␊ |
2048 | ␉kBluetoothL2CAPTCICommandL2CA_ConnectResp␉␉␉␉␉= 0x0011,␊ |
2049 | ␉kBluetoothL2CAPTCICommandL2CA_DisconnectResp␉␉␉␉= 0x0012,␊ |
2050 | ␉kBluetoothL2CAPTCICommandL2CA_ConfigResp␉␉␉␉␉= 0x0013␊ |
2051 | };␊ |
2052 | ␊ |
2053 | #if 0␊ |
2054 | #pragma mark -␊ |
2055 | #pragma mark === RFCOMM ===␊ |
2056 | #endif␊ |
2057 | ␊ |
2058 | //===========================================================================================================================␊ |
2059 | //␉RFCOMM␊ |
2060 | //===========================================================================================================================␊ |
2061 | #define kMaxChannelIDPerSide␉31␊ |
2062 | ␊ |
2063 | typedef UInt8␉BluetoothRFCOMMChannelID;␊ |
2064 | ␊ |
2065 | #define␉RFCOMM_CHANNEL_ID_IS_VALID( CHANNEL ) (( CHANNEL >= 1 ) && ( CHANNEL <= 30 ))␊ |
2066 | ␊ |
2067 | typedef UInt16␉BluetoothRFCOMMMTU;␊ |
2068 | ␊ |
2069 | typedef enum BluetoothRFCOMMParityType␊ |
2070 | {␊ |
2071 | kBluetoothRFCOMMParityTypeNoParity = 0, ␊ |
2072 | kBluetoothRFCOMMParityTypeOddParity, ␊ |
2073 | kBluetoothRFCOMMParityTypeEvenParity, ␊ |
2074 | kBluetoothRFCOMMParityTypeMaxParity␊ |
2075 | } BluetoothRFCOMMParityType;␊ |
2076 | ␊ |
2077 | typedef enum BluetoothRFCOMMLineStatus␊ |
2078 | {␊ |
2079 | BluetoothRFCOMMLineStatusNoError = 0, ␊ |
2080 | BluetoothRFCOMMLineStatusOverrunError, ␊ |
2081 | BluetoothRFCOMMLineStatusParityError, ␊ |
2082 | BluetoothRFCOMMLineStatusFramingError␊ |
2083 | } BluetoothRFCOMMLineStatus;␊ |
2084 | ␊ |
2085 | #if 0␊ |
2086 | #pragma mark -␊ |
2087 | #pragma mark === SDP ===␊ |
2088 | #endif␊ |
2089 | ␊ |
2090 | //===========================================================================================================================␊ |
2091 | //␉SDP␊ |
2092 | //===========================================================================================================================␊ |
2093 | ␊ |
2094 | typedef UInt8␉BluetoothSDPPDUID;␊ |
2095 | enum {␊ |
2096 | kBluetoothSDPPDUIDReserved␉␉␉␉␉␉␉= 0,␊ |
2097 | kBluetoothSDPPDUIDErrorResponse␉␉␉␉␉␉= 1,␊ |
2098 | kBluetoothSDPPDUIDServiceSearchRequest␉␉␉␉= 2,␊ |
2099 | kBluetoothSDPPDUIDServiceSearchResponse␉␉␉␉= 3,␊ |
2100 | kBluetoothSDPPDUIDServiceAttributeRequest␉␉␉= 4,␊ |
2101 | kBluetoothSDPPDUIDServiceAttributeResponse␉␉␉= 5,␊ |
2102 | kBluetoothSDPPDUIDServiceSearchAttributeRequest␉␉= 6,␊ |
2103 | kBluetoothSDPPDUIDServiceSearchAttributeResponse␉= 7␊ |
2104 | };␊ |
2105 | ␊ |
2106 | #define IS_REQUEST_PDU( _pduID ) (␉( _pduID == kBluetoothSDPPDUIDServiceSearchRequest ) || \␊ |
2107 | ( _pduID == kBluetoothSDPPDUIDServiceAttributeRequest ) || \␊ |
2108 | ( _pduID == kBluetoothSDPPDUIDServiceSearchAttributeRequest ) )␊ |
2109 | ␊ |
2110 | #define IS_RESPONSE_PDU( _pduID ) (␉( _pduID == kBluetoothSDPPDUIDErrorResponse ) || \␊ |
2111 | ( _pduID == kBluetoothSDPPDUIDServiceSearchResponse ) || \␊ |
2112 | ( _pduID == kBluetoothSDPPDUIDServiceAttributeResponse ) || \␊ |
2113 | ( _pduID == kBluetoothSDPPDUIDServiceSearchAttributeResponse ) )␊ |
2114 | ␊ |
2115 | typedef UInt16␉BluetoothSDPErrorCode;␊ |
2116 | enum {␊ |
2117 | kBluetoothSDPErrorCodeSuccess␉␉␉␉␉␉= 0x0000,␊ |
2118 | kBluetoothSDPErrorCodeReserved␉␉␉␉␉␉= 0x0000,␊ |
2119 | kBluetoothSDPErrorCodeInvalidSDPVersion␉␉␉␉= 0x0001,␊ |
2120 | kBluetoothSDPErrorCodeInvalidServiceRecordHandle␉= 0x0002,␊ |
2121 | kBluetoothSDPErrorCodeInvalidRequestSyntax␉␉␉= 0x0003,␊ |
2122 | kBluetoothSDPErrorCodeInvalidPDUSize␉␉␉␉= 0x0004,␊ |
2123 | kBluetoothSDPErrorCodeInvalidContinuationState␉␉= 0x0005,␊ |
2124 | kBluetoothSDPErrorCodeInsufficientResources␉␉␉= 0x0006,␊ |
2125 | ␊ |
2126 | kBluetoothSDPErrorCodeReservedStart␉␉␉␉␉= 0x0007,␊ |
2127 | kBluetoothSDPErrorCodeReservedEnd␉␉␉␉␉= 0xFFFF␊ |
2128 | };␊ |
2129 | ␊ |
2130 | typedef UInt16␉BluetoothSDPTransactionID;␊ |
2131 | ␊ |
2132 | typedef UInt32␉BluetoothSDPServiceRecordHandle;␊ |
2133 | ␊ |
2134 | enum {␊ |
2135 | kBluetoothSDPDataElementTypeNil␉␉␉␉␉␉= 0,␊ |
2136 | kBluetoothSDPDataElementTypeUnsignedInt␉␉␉␉= 1,␊ |
2137 | kBluetoothSDPDataElementTypeSignedInt␉␉␉␉= 2,␊ |
2138 | kBluetoothSDPDataElementTypeUUID␉␉␉␉␉= 3,␊ |
2139 | kBluetoothSDPDataElementTypeString␉␉␉␉␉= 4,␊ |
2140 | kBluetoothSDPDataElementTypeBoolean␉␉␉␉␉= 5,␊ |
2141 | kBluetoothSDPDataElementTypeDataElementSequence␉␉= 6,␊ |
2142 | kBluetoothSDPDataElementTypeDataElementAlternative␉= 7,␊ |
2143 | kBluetoothSDPDataElementTypeURL␉␉␉␉␉␉= 8,␊ |
2144 | kBluetoothSDPDataElementTypeReservedStart␉␉␉= 9,␊ |
2145 | kBluetoothSDPDataElementTypeReservedEnd␉␉␉␉= 31␊ |
2146 | };␊ |
2147 | ␊ |
2148 | typedef UInt16␉BluetoothSDPUUID16;␊ |
2149 | typedef UInt32␉BluetoothSDPUUID32;␊ |
2150 | ␊ |
2151 | typedef UInt8␉BluetoothSDPDataElementTypeDescriptor;␊ |
2152 | typedef UInt8␉BluetoothSDPDataElementSizeDescriptor;␊ |
2153 | ␊ |
2154 | typedef UInt16␉BluetoothSDPServiceAttributeID;␊ |
2155 | ␊ |
2156 | #ifdef␉__cplusplus␊ |
2157 | ␉}␊ |
2158 | #endif␊ |
2159 | |