Chameleon

Chameleon Svn Source Tree

Root/tags/2.3/i386/include/IOKit/bluetooth/Bluetooth.h

Source at commit 2862 created 7 years 26 days ago.
By ifabio, Tag 2.3 release, bump svn to 2.4
1/*
2File:Bluetooth.h
3Contains:Public interfaces for Bluetooth technology.
4Copyright:(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/*!@headerBluetooth
21Bluetooth wireless technology
22*/
23
24#ifdef__cplusplus
25extern "C" {
26#endif
27
28
29#if 0
30
31#pragma mark === Baseband ===
32#endif
33
34//===========================================================================================================================
35//Baseband
36//===========================================================================================================================
37
38typedef UInt16BluetoothConnectionHandle;// Upper 4 bits are reserved.
39typedef uint8_tBluetoothLMPHandle;
40enum
41{
42 kBluetoothConnectionHandleNone= 0xffff
43};
44
45typedef UInt8BluetoothReasonCode;
46typedef UInt8BluetoothEncryptionEnable;
47enum
48{
49kBluetoothEncryptionEnableOff = 0x00,
50kBluetoothEncryptionEnableOn= 0x01
51};
52
53typedef UInt8BluetoothKeyFlag;
54enum
55{
56kBluetoothKeyFlagSemiPermanent = 0x00,
57kBluetoothKeyFlagTemporary = 0x01
58};
59
60typedef UInt8BluetoothKeyType;
61enum
62{
63kBluetoothKeyTypeCombination= 0x00,
64kBluetoothKeyTypeLocalUnit= 0x01,
65kBluetoothKeyTypeRemoteUnit= 0x02,
66kBluetoothKeyTypeDebugCombination= 0x03,
67kBluetoothKeyTypeUnauthenticatedCombination= 0x04,
68kBluetoothKeyTypeAuthenticatedCombination= 0x05,
69kBluetoothKeyTypeChangedCombination= 0x06,
70};
71
72// Packet types (Bluetooth spec section 7.1.5 - Create Connection)
73
74typedef UInt16BluetoothPacketType;
75enum
76{
77kBluetoothPacketTypeReserved1= 0x0001,
78kBluetoothPacketType2DH1Omit= 0x0002,// Masks OUT this packet type
79kBluetoothPacketType3DH1Omit= 0x0004,// Masks OUT this packet type
80
81kBluetoothPacketTypeDM1= 0x0008,
82kBluetoothPacketTypeDH1= 0x0010,
83kBluetoothPacketTypeHV1= 0x0020, // Reserved
84kBluetoothPacketTypeHV2= 0x0040, // Reserved
85kBluetoothPacketTypeHV3= 0x0080, // Reserved
86kBluetoothPacketTypeDV= 0x0100, // Reserved
87kBluetoothPacketType2DH3Omit= 0x0100,// Masks OUT this packet type
88kBluetoothPacketType3DH3Omit= 0x0200,// Masks OUT this packet type
89kBluetoothPacketTypeAUX= 0x0200,// Deprecated
90
91kBluetoothPacketTypeDM3= 0x0400,
92kBluetoothPacketTypeDH3= 0x0800,
93
94kBluetoothPacketType2DH5Omit= 0x1000,// Masks OUT this packet type
95kBluetoothPacketType3DM5Omit= 0x2000,// Masks OUT this packet type
96
97kBluetoothPacketTypeDM5= 0x4000,
98kBluetoothPacketTypeDH5= 0x8000,
99
100kBluetoothPacketTypeEnd
101};
102
103// Setup Synchronous Packet types (Bluetooth 2.1 spec section 7.1.26 - Setup Synchronous Command)
104
105enum
106{
107kBluetoothSynchronousConnectionPacketTypeHV1= 0x0001,
108kBluetoothSynchronousConnectionPacketTypeHV2= 0x0002,
109kBluetoothSynchronousConnectionPacketTypeHV3= 0x0004,
110kBluetoothSynchronousConnectionPacketTypeEV3= 0x0008,
111kBluetoothSynchronousConnectionPacketTypeEV4= 0x0010,
112kBluetoothSynchronousConnectionPacketTypeEV5= 0x0020,
113
114// masking out certain types:
115
116kBluetoothSynchronousConnectionPacketType2EV3Omit= 0x0040,
117kBluetoothSynchronousConnectionPacketType3EV3Omit= 0x0080,
118kBluetoothSynchronousConnectionPacketType2EV5Omit= 0x0100,
119kBluetoothSynchronousConnectionPacketType3EV5Omit= 0x0200,
120
121kBluetoothSynchronousConnectionPacketTypeAll= 0xFFFF,
122
123kBluetoothSynchronousConnectionPacketTypeEnd
124};
125
126
127// LAP/Inquiry Access Codes
128
129typedef UInt32BluetoothLAP;
130enum
131{
132kBluetoothGeneralInquiryAccessCodeIndex= 0, // General/Unlimited Inquiry Access Code (GIAC)
133kBluetoothGeneralInquiryAccessCodeLAPValue = 0x9E8B33, // General/Unlimited Inquiry Access Code (GIAC)
134
135kBluetoothLimitedInquiryAccessCodeIndex= 1, // Limited Dedicated Inquiry Access Code (LIAC)
136kBluetoothLimitedInquiryAccessCodeLAPValue = 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
140kBluetoothLimitedInquiryAccessCodeEnd
141};
142
143// PageScanRepetitionMode
144
145typedefUInt8BluetoothPageScanRepetitionMode;
146enum
147{
148kBluetoothPageScanRepetitionModeR0 = 0x00,
149kBluetoothPageScanRepetitionModeR1 = 0x01,
150kBluetoothPageScanRepetitionModeR2 = 0x02
151
152// All other values are reserved for future use.
153};
154
155// PageScanPeriodMode
156
157typedef UInt8BluetoothPageScanPeriodMode;
158enum
159{
160kBluetoothPageScanPeriodModeP0 = 0x00,
161kBluetoothPageScanPeriodModeP1 = 0x01,
162kBluetoothPageScanPeriodModeP2 = 0x02
163
164// All other values are reserved for future use.
165};
166
167// PageScanMode
168
169typedef UInt8BluetoothPageScanMode;
170enum
171{
172kBluetoothPageScanModeMandatory = 0x00,
173kBluetoothPageScanModeOptional1 = 0x01,
174kBluetoothPageScanModeOptional2 = 0x02,
175kBluetoothPageScanModeOptional3 = 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
185typedef structBluetoothDeviceAddressBluetoothDeviceAddress;
186structBluetoothDeviceAddress
187{
188UInt8data[ 6 ];
189};
190
191typedef structBluetoothKeyBluetoothKey;
192structBluetoothKey
193{
194UInt8data[ 16 ];
195};
196
197typedef structBluetoothPINCodeBluetoothPINCode;
198structBluetoothPINCode
199{
200UInt8data[ 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
227typedef UInt32BluetoothClassOfDevice;
228
229#defineBluetoothGetDeviceClassMajor( inCOD )( (inCOD & 0x00001F00) >> 8 )
230#defineBluetoothGetDeviceClassMinor( inCOD )( (inCOD & 0x000000FC) >> 2 )
231#defineBluetoothGetServiceClassMajor( inCOD )( (inCOD & 0x00FFE000) >> 13 )
232#defineBluetoothMakeClassOfDevice( 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
239typedef UInt32BluetoothServiceClassMajor;
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
246typedef UInt32BluetoothDeviceClassMajor;
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
253typedef UInt32BluetoothDeviceClassMinor;
254// Device Class Minor enum in BluetoothAssignedNumbers.h
255
256// Misc Device Types
257
258enum
259{
260kBluetoothDeviceNameMaxLength= 248
261};
262typedef UInt8BluetoothDeviceName[ 256 ];// Max 248 bytes of UTF-8 encoded Unicode.
263typedef UInt16BluetoothClockOffset;// Bits 14-0 come from bits 16-2 of CLKslav-CLKmaster.
264typedef UInt8BluetoothRole;//
265typedef UInt8BluetoothAllowRoleSwitch;// 0x00-0x01 valid, 0x02-0xFF reserved.
266enum
267{
268kBluetoothDontAllowRoleSwitch = 0x00,
269kBluetoothAllowRoleSwitch = 0x01
270};
271
272enum
273{
274kBluetoothRoleBecomeMaster = 0x00,
275kBluetoothRoleRemainSlave = 0x01
276};
277
278typedef struct BluetoothSetEventMaskBluetoothSetEventMask;
279structBluetoothSetEventMask
280{
281UInt8data[ 8 ];
282};
283
284typedef UInt8BluetoothPINType;
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
299enum
300{
301kBluetoothL2CAPMaxPacketSize= 65535,// Max number of data bytes in an L2CAP packet.
302
303kBluetoothACLLogicalChannelReserved = 0, // [00] Reserved for future use
304kBluetoothACLLogicalChannelL2CAPContinue = 1, // [01] Continuation of L2CAP packet.
305kBluetoothACLLogicalChannelL2CAPStart = 2, // [10] Start of L2CAP packet.
306kBluetoothACLLogicalChannelLMP = 3// [11] Link Manager Protocol packet.
307};
308
309// Channel Identifiers (Bluetooth L2CAP spec section 2.1).
310
311typedef UInt16BluetoothL2CAPChannelID;
312enum
313{
314kBluetoothL2CAPChannelNull= 0x0000, // Illegal, should not be used
315kBluetoothL2CAPChannelSignalling = 0x0001, // L2CAP signalling channel
316kBluetoothL2CAPChannelConnectionLessData= 0x0002, // L2CAP connection less data
317kBluetoothL2CAPChannelAMPManagerProtocol= 0x0003,// AMP Manager Protocol
318
319// Range 0x0003 to 0x003F reserved for future use.
320kBluetoothL2CAPChannelReservedStart= 0x0004,
321 kBluetoothL2CAPChannelReservedEnd= 0x003F,
322
323 // Range 0x0040 to 0xFFFF are dynamically allocated.
324 kBluetoothL2CAPChannelDynamicStart= 0x0040,
325 kBluetoothL2CAPChannelDynamicEnd= 0xffff,
326kBluetoothL2CAPChannelEnd= 0xffff
327};
328
329typedef BluetoothL2CAPChannelIDBluetoothL2CAPGroupID;
330
331// Protocol/Service Multiplexor (PSM) values (Bluetooth L2CAP spec section 5.2).
332
333typedef UInt16BluetoothL2CAPPSM;
334// PSM enum in BluetoothAssignedNumbers.h
335
336// Command Codes
337
338typedef enum
339{
340kBluetoothL2CAPCommandCodeReserved= 0x00,
341kBluetoothL2CAPCommandCodeCommandReject= 0x01,
342kBluetoothL2CAPCommandCodeConnectionRequest= 0x02,
343kBluetoothL2CAPCommandCodeConnectionResponse= 0x03,
344kBluetoothL2CAPCommandCodeConfigureRequest= 0x04,
345kBluetoothL2CAPCommandCodeConfigureResponse= 0x05,
346kBluetoothL2CAPCommandCodeDisconnectionRequest= 0x06,
347kBluetoothL2CAPCommandCodeDisconnectionResponse= 0x07,
348kBluetoothL2CAPCommandCodeEchoRequest= 0x08,
349kBluetoothL2CAPCommandCodeEchoResponse= 0x09,
350kBluetoothL2CAPCommandCodeInformationRequest= 0x0A,
351kBluetoothL2CAPCommandCodeInformationResponse= 0x0B,
352kBluetoothL2CAPCommandCodeCreateChannelRequest= 0x0C,
353kBluetoothL2CAPCommandCodeCreateChannelResponse= 0x0D,
354kBluetoothL2CAPCommandCodeMoveChannelRequest= 0x0E,
355kBluetoothL2CAPCommandCodeMoveChannelResponse= 0x0F,
356kBluetoothL2CAPCommandCodeMoveChannelConfirmation= 0x10,
357kBluetoothL2CAPCommandCodeMoveChannelConfirmationResponse= 0x11,
358} BluetoothL2CAPCommandCode;
359
360// Command Reject
361
362typedef enum
363{
364kBluetoothL2CAPCommandRejectReasonCommandNotUnderstood = 0x0000,
365kBluetoothL2CAPCommandRejectReasonSignallingMTUExceeded = 0x0001,
366kBluetoothL2CAPCommandRejectReasonInvalidCIDInRequest = 0x0002,
367} BluetoothL2CAPCommandRejectReason;
368
369typedef UInt16BluetoothL2CAPMTU;
370typedefUInt16BluetoothL2CAPLinkTimeout;
371typedef UInt16BluetoothL2CAPFlushTimeout;
372enum
373{
374kBluetoothL2CAPFlushTimeoutUseExisting = 0x0000,
375kBluetoothL2CAPFlushTimeoutImmediate = 0x0001,
376kBluetoothL2CAPFlushTimeoutForever = 0xFFFF,
377
378kBluetoothL2CAPFlushTimeoutEnd
379};
380
381typedef struct BluetoothL2CAPQualityOfServiceOptionsBluetoothL2CAPQualityOfServiceOptions;
382struct BluetoothL2CAPQualityOfServiceOptions
383{
384UInt8flags;
385UInt8serviceType;
386UInt32tokenRate;
387UInt32tokenBucketSize;
388UInt32peakBandwidth;
389UInt32latency;
390UInt32delayVariation;
391};
392
393typedef struct BluetoothL2CAPRetransmissionAndFlowControlOptions BluetoothL2CAPRetransmissionAndFlowControlOptions;
394struct BluetoothL2CAPRetransmissionAndFlowControlOptions
395{
396UInt8flags;
397UInt8txWindowSize;
398UInt8maxTransmit;
399UInt16retransmissionTimeout;
400UInt16monitorTimeout;
401UInt16maxPDUPayloadSize;
402};
403
404enum
405{
406kBluetoothL2CAPInfoTypeMaxConnectionlessMTUSize = 0x0001
407};
408
409// Packets
410
411enum
412{
413kBluetoothL2CAPPacketHeaderSize = 4
414};
415
416typedef UInt16BluetoothL2CAPByteCount;
417typedef UInt8BluetoothL2CAPCommandID;
418typedef UInt16BluetoothL2CAPCommandByteCount;
419
420typedef enum
421{
422 kBluetoothL2CAPConnectionResultSuccessful= 0x0000,
423 kBluetoothL2CAPConnectionResultPending= 0x0001,
424 kBluetoothL2CAPConnectionResultRefusedPSMNotSupported= 0x0002,
425 kBluetoothL2CAPConnectionResultRefusedSecurityBlock= 0x0003,
426 kBluetoothL2CAPConnectionResultRefusedNoResources= 0x0004,
427} BluetoothL2CAPConnectionResult;
428
429typedef enum
430{
431 kBluetoothL2CAPConnectionStatusNoInfoAvailable= 0x0000,
432 kBluetoothL2CAPConnectionStatusAuthenticationPending= 0x0001,
433 kBluetoothL2CAPConnectionStatusAuthorizationPending= 0x0002,
434} BluetoothL2CAPConnectionStatus;
435
436typedef enum
437{
438 kBluetoothL2CAPConfigurationResultSuccess= 0x0000,
439 kBluetoothL2CAPConfigurationResultUnacceptableParams= 0x0001,
440 kBluetoothL2CAPConfigurationResultRejected= 0x0002,
441 kBluetoothL2CAPConfigurationResultUnknownOptions= 0x0003,
442} BluetoothL2CAPConfigurationResult;
443
444typedef enum
445{
446 kBluetoothL2CAPConfigurationOptionMTU = 0x01,
447 kBluetoothL2CAPConfigurationOptionFlushTimeout = 0x02,
448 kBluetoothL2CAPConfigurationOptionQoS = 0x03,
449 kBluetoothL2CAPConfigurationOptionRetransmissionAndFlowControl = 0x04
450} BluetoothL2CAPConfigurationOption;
451
452enum
453{
454 kBluetoothL2CAPConfigurationOptionMTULength = 2,
455 kBluetoothL2CAPConfigurationOptionFlushTimeoutLength = 2,
456 kBluetoothL2CAPConfigurationOptionQoSLength = 22,
457 kBluetoothL2CAPConfigurationOptionRetransmissionAndFlowControlLength = 9
458};
459
460typedef enum
461{
462 kBluetoothL2CAPConfigurationRetransmissionModeFlag = 0x01,
463 kBluetoothL2CAPConfigurationFlowControlModeFlag = 0x02,
464 kBluetoothL2CAPConfigurationBasicL2CAPModeFlag = 0x00,
465} BluetoothL2CAPConfigurationRetransmissionAndFlowControlFlags;
466
467
468typedef enum
469{
470 kBluetoothL2CAPInformationTypeConnectionlessMTU= 0x0001,
471 kBluetoothL2CAPInformationTypeExtendedFeatures= 0x0002,
472kBluetoothL2CAPInformationTypeFixedChannelsSupported= 0x0003,
473} BluetoothL2CAPInformationType;
474
475typedef enum
476{
477 kBluetoothL2CAPInformationResultSuccess= 0x0000,
478 kBluetoothL2CAPInformationResultNotSupported= 0x0001,
479} BluetoothL2CAPInformationResult;
480
481typedef enum
482{
483 kBluetoothL2CAPInformationNoExtendedFeatures= 0x00000000,
484 kBluetoothL2CAPInformationFlowControlMode= 0x00000001,
485 kBluetoothL2CAPInformationRetransmissionMode= 0x00000002,
486 kBluetoothL2CAPInformationBidirectionalQoS= 0x00000004,
487kBluetoothL2CAPInformationEnhancedRetransmissionMode= 0x00000008,
488kBluetoothL2CAPInformationStreamingMode= 0x00000010,
489kBluetoothL2CAPInformationFCSOption= 0x00000020,
490kBluetoothL2CAPInformationExtendedFlowSpecification= 0x00000040,
491kBluetoothL2CAPInformationFixedChannels= 0x00000080,
492kBluetoothL2CAPInformationExtendedWindowSize= 0x00000100,
493kBluetoothL2CAPUnicastConnectionlessDataReception= 0x00000200,
494} BluetoothL2CAPInformationExtendedFeaturesMask;
495
496typedef enum
497{
498 kBluetoothL2CAPQoSTypeNoTraffic = 0x00,
499 kBluetoothL2CAPQoSTypeBestEffort= 0x01,
500 kBluetoothL2CAPQoSTypeGuaranteed= 0x02,
501} BluetoothL2CAPQoSType;
502
503enum
504{
505kBluetoothL2CAPMTUMinimum= 0x0030,// 48 bytes
506kBluetoothL2CAPMTUDefault= 0x03F9,// 11.10.08 - dropped back to 1017 from 1021 (don't aggravate the 3DH5 problem between CSR<->BRCM just yet)
507kBluetoothL2CAPMTUMaximum= 0xffff,
508kBluetoothL2CAPMTUStart= 0x7fff,
509kBluetoothL2CAPMTUSIG= 0x0030,// 48 bytes
510kBluetoothL2CAPFlushTimeoutDefault= kBluetoothL2CAPFlushTimeoutForever,// 0xffff
511kBluetoothL2CAPQoSFlagsDefault= 0,
512kBluetoothL2CAPQoSTypeDefault= kBluetoothL2CAPQoSTypeBestEffort,// 0x01
513kBluetoothL2CAPQoSTokenRateDefault= 0x00000000,
514kBluetoothL2CAPQoSTokenBucketSizeDefault= 0x00000000,
515kBluetoothL2CAPQoSPeakBandwidthDefault= 0x00000000,
516kBluetoothL2CAPQoSLatencyDefault= 0xffffffff,
517kBluetoothL2CAPQoSDelayVariationDefault= 0xffffffff
518};
519
520#pragma mark === AMP Manager ===
521typedef enum {
522kBluetoothAMPManagerCodeReserved= 0x00,
523kBluetoothAMPManagerCodeAMPCommandReject= 0x01,
524kBluetoothAMPManagerCodeAMPDiscoverRequest= 0x02,
525kBluetoothAMPManagerCodeAMPDiscoverResponse= 0x03,
526kBluetoothAMPManagerCodeAMPChangeNotify= 0x04,
527kBluetoothAMPManagerCodeAMPChangeResponse= 0x05,
528kBluetoothAMPManagerCodeAMPGetInfoRequest= 0x06,
529kBluetoothAMPManagerCodeAMPGetInfoResponse= 0x07,
530kBluetoothAMPManagerCodeAMPGetAssocRequest= 0x08,
531kBluetoothAMPManagerCodeAMPGetAssocResponse= 0x09,
532kBluetoothAMPManagerCodeAMPCreatePhysicalLinkRequest= 0x0A,
533kBluetoothAMPManagerCodeAMPCreatePhysicalLinkResponse= 0x0B,
534kBluetoothAMPManagerCodeAMPDisconnectPhysicalLinkRequest= 0x0C,
535kBluetoothAMPManagerCodeAMPDisconnectPhysicalLinkResponse= 0x0D,
536} BluetoothAMPManagerCode;
537
538typedef enum {
539kBluetoothAMPManagerCommandRejectReasonCommandNotRecognized= 0x0000,
540} BluetoothAMPCommandRejectReason;
541
542typedef enum {
543kBluetoothAMPManagerDiscoverResponseControllerStatusPoweredDown= 0x00,
544kBluetoothAMPManagerDiscoverResponseControllerStatusBluetoothOnly= 0x01,
545kBluetoothAMPManagerDiscoverResponseControllerStatusNoCapacity= 0x02,
546kBluetoothAMPManagerDiscoverResponseControllerStatusLowCapacity= 0x03,
547kBluetoothAMPManagerDiscoverResponseControllerStatusMediumCapacity= 0x04,
548kBluetoothAMPManagerDiscoverResponseControllerStatusHighCapacity= 0x05,
549kBluetoothAMPManagerDiscoverResponseControllerStatusFullCapacity= 0x06,
550} BluetoothAMPDiscoverResponseControllerStatus;
551
552typedef enum {
553kBluetoothAMPManagerGetInfoResponseSuccess= 0x00,
554kBluetoothAMPManagerGetInfoResponseInvalidControllerID= 0x01,
555} BluetoothAMPGetInfoResponseStatus;
556
557typedef enum {
558kBluetoothAMPManagerGetAssocResponseSuccess= 0x00,
559kBluetoothAMPManagerGetAssocResponseInvalidControllerID= 0x01,
560} BluetoothAMPGetAssocResponseStatus;
561
562typedef enum {
563kBluetoothAMPManagerCreatePhysicalLinkResponseSuccess= 0x00,
564kBluetoothAMPManagerCreatePhysicalLinkResponseInvalidControllerID= 0x01,
565kBluetoothAMPManagerCreatePhysicalLinkResponseUnableToStartLinkCreation= 0x02,
566kBluetoothAMPManagerCreatePhysicalLinkResponseCollisionOccurred= 0x03,
567kBluetoothAMPManagerCreatePhysicalLinkResponseAMPDisconnectedPhysicalLinkRequestReceived= 0x04,
568kBluetoothAMPManagerCreatePhysicalLinkResponsePhysicalLinkAlreadyExists= 0x05,
569kBluetoothAMPManagerCreatePhysicalLinkResponseSecurityViolation= 0x06,
570} BluetoothAMPCreatePhysicalLinkResponseStatus;
571
572typedef enum {
573kBluetoothAMPManagerDisconnectPhysicalLinkResponseSuccess= 0x00,
574kBluetoothAMPManagerDisconnectPhysicalLinkResponseInvalidControllerID= 0x01,
575kBluetoothAMPManagerDisconnectPhysicalLinkResponseNoPhysicalLink= 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
604typedef UInt8BluetoothHCICommandOpCodeGroup;
605typedef UInt16BluetoothHCICommandOpCodeCommand;
606typedef UInt16BluetoothHCICommandOpCode;
607typedefUInt32BluetoothHCIVendorCommandSelector;
608
609#defineBluetoothHCIMakeCommandOpCode( GROUP, CMD )( ( ( ( GROUP ) & 0x003F ) << 10 ) | ( ( CMD ) & 0x03FF ) )
610#defineBluetoothHCIMakeCommandOpCodeEndianSwap( GROUP, CMD )( CFSwapInt16HostToLittle ( BluetoothHCIMakeCommandOpCode( GROUP, CMD ) ) )
611#defineBluetoothHCIExtractCommandOpCodeGroup( OPCODE )( ( ( OPCODE ) >> 10 ) & 0x003F )
612#defineBluetoothHCIExtractCommandOpCodeCommand( OPCODE )( ( OPCODE ) & 0x03FF )
613
614#define BluetoothHCIMakeCommandOpCodeHostOrder(GROUP, CMD )OSSwapLittleToHostConstInt16( ( ( ( GROUP ) & 0x003F ) << 10 ) | ( ( CMD ) & 0x03FF ) )
615
616
617enum
618{
619// Command Group: NoOp
620
621kBluetoothHCIOpCodeNoOp= 0,
622kBluetoothHCICommandGroupNoOp= 0x00,
623kBluetoothHCICommandNoOp= 0x0000,
624
625// Command Group: Link Control
626
627kBluetoothHCICommandGroupLinkControl= 0x01,
628kBluetoothHCICommandInquiry= 0x0001,
629kBluetoothHCICommandInquiryCancel= 0x0002,
630kBluetoothHCICommandPeriodicInquiryMode= 0x0003,
631kBluetoothHCICommandExitPeriodicInquiryMode= 0x0004,
632kBluetoothHCICommandCreateConnection= 0x0005,
633kBluetoothHCICommandDisconnect= 0x0006,
634kBluetoothHCICommandAddSCOConnection= 0x0007,
635kBluetoothHCICommandCreateConnectionCancel= 0x0008,
636kBluetoothHCICommandAcceptConnectionRequest= 0x0009,
637kBluetoothHCICommandRejectConnectionRequest= 0x000A,
638kBluetoothHCICommandLinkKeyRequestReply= 0x000B,
639kBluetoothHCICommandLinkKeyRequestNegativeReply= 0x000C,
640kBluetoothHCICommandPINCodeRequestReply= 0x000D,
641kBluetoothHCICommandPINCodeRequestNegativeReply= 0x000E,
642kBluetoothHCICommandChangeConnectionPacketType= 0x000F,
643kBluetoothHCICommandAuthenticationRequested= 0x0011,
644kBluetoothHCICommandSetConnectionEncryption= 0x0013,
645kBluetoothHCICommandChangeConnectionLinkKey= 0x0015,
646kBluetoothHCICommandMasterLinkKey= 0x0017,
647kBluetoothHCICommandRemoteNameRequest= 0x0019,
648kBluetoothHCICommandReadRemoteSupportedFeatures= 0x001B,
649kBluetoothHCICommandReadRemoteExtendedFeatures= 0x001C,
650kBluetoothHCICommandReadRemoteVersionInformation= 0x001D,
651kBluetoothHCICommandReadClockOffset= 0x001F,
652kBluetoothHCICommandRemoteNameRequestCancel= 0x001A,
653kBluetoothHCICommandReadLMPHandle= 0x0020,
654kBluetoothHCICommandSetupSynchronousConnection= 0x0028,
655kBluetoothHCICommandAcceptSynchronousConnectionRequest= 0x0029,
656kBluetoothHCICommandRejectSynchronousConnectionRequest= 0x002A,
657kBluetoothHCICommandIOCapabilityRequestReply= 0x002B,
658kBluetoothHCICommandUserConfirmationRequestReply= 0x002C,
659kBluetoothHCICommandUserConfirmationRequestNegativeReply= 0x002D,
660kBluetoothHCICommandUserPasskeyRequestReply= 0x002E,
661kBluetoothHCICommandUserPasskeyRequestNegativeReply= 0x002F,
662kBluetoothHCICommandRemoteOOBDataRequestReply= 0x0030,
663kBluetoothHCICommandRemoteOOBDataRequestNegativeReply= 0x0033,
664
665// Command Group: Link Policy
666
667kBluetoothHCICommandGroupLinkPolicy= 0x02,
668kBluetoothHCICommandHoldMode= 0x0001,
669kBluetoothHCICommandSniffMode= 0x0003,
670kBluetoothHCICommandExitSniffMode= 0x0004,
671kBluetoothHCICommandParkMode= 0x0005,
672kBluetoothHCICommandExitParkMode= 0x0006,
673kBluetoothHCICommandQoSSetup= 0x0007,
674kBluetoothHCICommandRoleDiscovery= 0x0009,
675kBluetoothHCICommandSwitchRole= 0x000B,
676kBluetoothHCICommandReadLinkPolicySettings= 0x000C,
677kBluetoothHCICommandWriteLinkPolicySettings= 0x000D,
678kBluetoothHCICommandReadDefaultLinkPolicySettings= 0x000E,
679kBluetoothHCICommandWriteDefaultLinkPolicySettings= 0x000F,
680kBluetoothHCICommandFlowSpecification= 0x0010,
681kBluetoothHCICommandSniffSubrating= 0x0011,
682kBluetoothHCICommandAcceptSniffRequest= 0x0031,
683kBluetoothHCICommandRejectSniffRequest= 0x0032,
684
685// Command Group: Host Controller & Baseband
686
687kBluetoothHCICommandGroupHostController= 0x03,
688kBluetoothHCICommandSetEventMask= 0x0001,
689kBluetoothHCICommandReset= 0x0003,
690kBluetoothHCICommandSetEventFilter= 0x0005,
691kBluetoothHCICommandFlush= 0x0008,
692kBluetoothHCICommandReadPINType= 0x0009,
693kBluetoothHCICommandWritePINType= 0x000A,
694kBluetoothHCICommandCreateNewUnitKey= 0x000B,
695kBluetoothHCICommandReadStoredLinkKey= 0x000D,
696kBluetoothHCICommandWriteStoredLinkKey= 0x0011,
697kBluetoothHCICommandDeleteStoredLinkKey= 0x0012,
698kBluetoothHCICommandChangeLocalName= 0x0013,
699kBluetoothHCICommandReadLocalName= 0x0014,
700kBluetoothHCICommandReadConnectionAcceptTimeout= 0x0015,
701kBluetoothHCICommandWriteConnectionAcceptTimeout= 0x0016,
702kBluetoothHCICommandReadPageTimeout= 0x0017,
703kBluetoothHCICommandWritePageTimeout= 0x0018,
704kBluetoothHCICommandReadScanEnable= 0x0019,
705kBluetoothHCICommandWriteScanEnable= 0x001A,
706kBluetoothHCICommandReadPageScanActivity= 0x001B,
707kBluetoothHCICommandWritePageScanActivity= 0x001C,
708kBluetoothHCICommandReadInquiryScanActivity= 0x001D,
709kBluetoothHCICommandWriteInquiryScanActivity= 0x001E,
710kBluetoothHCICommandReadAuthenticationEnable= 0x001F,
711kBluetoothHCICommandWriteAuthenticationEnable= 0x0020,
712kBluetoothHCICommandReadEncryptionMode= 0x0021,
713kBluetoothHCICommandWriteEncryptionMode= 0x0022,
714kBluetoothHCICommandReadClassOfDevice= 0x0023,
715kBluetoothHCICommandWriteClassOfDevice= 0x0024,
716kBluetoothHCICommandReadVoiceSetting= 0x0025,
717kBluetoothHCICommandWriteVoiceSetting= 0x0026,
718kBluetoothHCICommandReadAutomaticFlushTimeout= 0x0027,
719kBluetoothHCICommandWriteAutomaticFlushTimeout= 0x0028,
720kBluetoothHCICommandReadNumberOfBroadcastRetransmissions= 0x0029,
721kBluetoothHCICommandWriteNumberOfBroadcastRetransmissions= 0x002A,
722kBluetoothHCICommandReadHoldModeActivity= 0x002B,
723kBluetoothHCICommandWriteHoldModeActivity= 0x002C,
724kBluetoothHCICommandReadTransmitPowerLevel= 0x002D,
725kBluetoothHCICommandReadSCOFlowControlEnable= 0x002E,
726kBluetoothHCICommandWriteSCOFlowControlEnable= 0x002F,
727kBluetoothHCICommandSetHostControllerToHostFlowControl= 0x0031,
728kBluetoothHCICommandHostBufferSize= 0x0033,
729kBluetoothHCICommandHostNumberOfCompletedPackets= 0x0035,
730kBluetoothHCICommandReadLinkSupervisionTimeout= 0x0036,
731kBluetoothHCICommandWriteLinkSupervisionTimeout= 0x0037,
732kBluetoothHCICommandReadNumberOfSupportedIAC= 0x0038,
733kBluetoothHCICommandReadCurrentIACLAP= 0x0039,
734kBluetoothHCICommandWriteCurrentIACLAP= 0x003A,
735kBluetoothHCICommandReadPageScanPeriodMode= 0x003B,
736kBluetoothHCICommandWritePageScanPeriodMode= 0x003C,
737kBluetoothHCICommandReadPageScanMode= 0x003D,
738kBluetoothHCICommandWritePageScanMode= 0x003E,
739kBluetoothHCICommandSetAFHClassification= 0x003F,
740kBluetoothHCICommandReadInquiryScanType= 0x0042,
741kBluetoothHCICommandWriteInquiryScanType= 0x0043,
742kBluetoothHCICommandReadInquiryMode= 0x0044,
743kBluetoothHCICommandWriteInquiryMode= 0x0045,
744kBluetoothHCICommandReadPageScanType= 0x0046,
745kBluetoothHCICommandWritePageScanType= 0x0047,
746kBluetoothHCICommandReadAFHChannelAssessmentMode= 0x0048,
747kBluetoothHCICommandWriteAFHChannelAssessmentMode= 0x0049,
748kBluetoothHCICommandReadExtendedInquiryResponse= 0x0051,
749kBluetoothHCICommandWriteExtendedInquiryResponse= 0x0052,
750kBluetoothHCICommandReadSimplePairingMode= 0x0055,
751kBluetoothHCICommandWriteSimplePairingMode= 0x0056,
752kBluetoothHCICommandReadLocalOOBData= 0x0057,
753kBluetoothHCICommandReadInquiryResponseTransmitPower= 0x0058,
754kBluetoothHCICommandWriteInquiryResponseTransmitPower= 0x0059,
755kBluetoothHCICommandReadDefaultErroneousDataReporting= 0x005A,
756kBluetoothHCICommandWriteDefaultErroneousDataReporting= 0x005B,
757kBluetoothHCICommandReadPersistentSniffInterval= 0x005C,
758kBluetoothHCICommandWritePersistentSniffInterval= 0x005D,
759kBluetoothHCICommandDeletePersistentSniffInterval= 0x005E,
760kBluetoothHCICommandEnhancedFlush= 0x005F,
761kBluetoothHCICommandSendKeypressNotification= 0x0060,
762
763// Command Group: Informational
764
765kBluetoothHCICommandGroupInformational= 0x04,
766kBluetoothHCICommandReadLocalVersionInformation= 0x0001,
767kBluetoothHCICommandReadLocalSupportedCommands= 0x0002,
768kBluetoothHCICommandReadLocalSupportedFeatures= 0x0003,
769kBluetoothHCICommandReadLocalExtendedFeatures= 0x0004,
770kBluetoothHCICommandReadBufferSize= 0x0005,
771kBluetoothHCICommandReadCountryCode= 0x0007,
772kBluetoothHCICommandReadDeviceAddress= 0x0009,
773
774// Command Group: Status
775
776kBluetoothHCICommandGroupStatus= 0x05,
777kBluetoothHCICommandReadFailedContactCounter= 0x0001,
778kBluetoothHCICommandResetFailedContactCounter= 0x0002,
779kBluetoothHCICommandGetLinkQuality= 0x0003,
780kBluetoothHCICommandReadRSSI= 0x0005,
781kBluetoothHCICommandReadAFHMappings= 0x0006,
782kBluetoothHCICommandReadClock= 0x0007,
783
784// Command Group: Testing
785
786kBluetoothHCICommandGroupTesting= 0x06,
787kBluetoothHCICommandReadLoopbackMode= 0x0001,
788kBluetoothHCICommandWriteLoopbackMode= 0x0002,
789kBluetoothHCICommandEnableDeviceUnderTestMode= 0x0003,
790kBluetoothHCICommandWriteSimplePairingDebugMode= 0x0004,
791
792// Command Group: Logo Testing (no commands yet)
793
794kBluetoothHCICommandGroupLogoTesting = 0x3E,
795
796// Command Group: Vendor Specific (from Broadcom HCI Programmer's Reference Guide)
797
798kBluetoothHCICommandGroupVendorSpecific= 0x3f,
799kBluetoothHCICommandWriteDeviceAddress= 0x0001,
800kBluetoothHCICommandWriteHoppingChannels= 0x0012,
801kBluetoothHCICommandInvalidateFlashAndReboot= 0x0017,
802kBluetoothHCICommandSetMaxPower= 0x0026,
803kBluetoothHCICommandEnableHIDEmulation= 0x003B,
804kBluetoothHCICommandEnableRadio= 0x0034,
805kBluetoothHCIGetHIDDeviceList= 0x0036,
806kBluetoothHCIAddHIDDevice= 0x0037,
807kBluetoothHCIRemoveHIDDevice= 0x0039,
808
809kBluetoothHCICommandGroupMax= 0x40,
810kBluetoothHCICommandMax= 0x03FF
811};
812
813// HCI Data Types
814
815typedef UInt8BluetoothHCIQoSFlags;
816typedef UInt8BluetoothHCIParamByteCount;
817typedef UInt16BluetoothHCIACLDataByteCount;
818typedef UInt8BluetoothHCISCODataByteCount;
819typedef UInt8BluetoothHCIInquiryLength;
820typedef UInt8BluetoothHCIResponseCount;
821typedef UInt8BluetoothHCICountryCode;
822typedef UInt16BluetoothHCIModeInterval;
823typedef UInt16BluetoothHCISniffAttemptCount;
824typedef UInt16BluetoothHCISniffTimeout;
825typedef UInt16BluetoothHCIParkModeBeaconInterval;
826
827typedef UInt8BluetoothMaxSlots;
828typedef UInt16BluetoothManufacturerName;
829typedef UInt8BluetoothLMPVersion;
830typedef UInt16BluetoothLMPSubversion;
831
832typedef UInt8BluetoothHCIConnectionMode;
833enum BluetoothHCIConnectionModes
834{
835kConnectionActiveMode= 0,
836kConnectionHoldMode= 1,
837kConnectionSniffMode= 2,
838kConnectionParkMode= 3,
839kConnectionModeReservedForFutureUse= 4,
840};
841
842typedef structBluetoothHCISupportedFeaturesBluetoothHCISupportedFeatures;
843struct BluetoothHCISupportedFeatures
844{
845UInt8data[8];
846};
847
848#if BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1
849typedef UInt8BluetoothHCIPageNumber;
850typedef structBluetoothHCIExtendedFeaturesInfoBluetoothHCIExtendedFeaturesInfo;
851struct BluetoothHCIExtendedFeaturesInfo
852{
853BluetoothHCIPageNumberpage;
854BluetoothHCIPageNumbermaxPage;
855UInt8data[8];
856};
857#endif /* BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1 */
858
859enum BluetoothFeatureBits
860{
861// Byte 0 of the support features data structure.
862
863kBluetoothFeatureThreeSlotPackets= (1 << 0L),
864kBluetoothFeatureFiveSlotPackets= (1 << 1L),
865kBluetoothFeatureEncryption= (1 << 2L),
866kBluetoothFeatureSlotOffset= (1 << 3L),
867kBluetoothFeatureTimingAccuracy= (1 << 4L),
868kBluetoothFeatureSwitchRoles= (1 << 5L),
869kBluetoothFeatureHoldMode= (1 << 6L),
870kBluetoothFeatureSniffMode= (1 << 7L),
871
872// Byte 1 of the support features data structure.
873
874kBluetoothFeatureParkMode= (1 << 0L),
875kBluetoothFeatureRSSI= (1 << 1L),
876kBluetoothFeaturePowerControlRequests= (1 << 1L),
877kBluetoothFeatureChannelQuality= (1 << 2L),
878kBluetoothFeatureSCOLink= (1 << 3L),
879kBluetoothFeatureHV2Packets= (1 << 4L),
880kBluetoothFeatureHV3Packets= (1 << 5L),
881kBluetoothFeatureULawLog= (1 << 6L),
882kBluetoothFeatureALawLog= (1 << 7L),
883
884// Byte 2 of the support features data structure.
885
886kBluetoothFeatureCVSD= (1 << 0L),
887kBluetoothFeaturePagingScheme= (1 << 1L),
888kBluetoothFeaturePowerControl= (1 << 2L),
889kBluetoothFeatureTransparentSCOData= (1 << 3L),
890kBluetoothFeatureFlowControlLagBit0= (1 << 4L),
891kBluetoothFeatureFlowControlLagBit1= (1 << 5L),
892kBluetoothFeatureFlowControlLagBit2= (1 << 6L),
893kBluetoothFeatureBroadcastEncryption= (1 << 7L),
894
895// Byte 3 of the support features data structure.
896
897kBluetoothFeatureScatterMode= (1 << 0L),
898kBluetoothFeatureEnhancedDataRateACL2MbpsMode= (1 << 1L),
899kBluetoothFeatureEnhancedDataRateACL3MbpsMode= (1 << 2L),
900kBluetoothFeatureEnhancedInquiryScan= (1 << 3L),
901kBluetoothFeatureInterlacedInquiryScan= (1 << 4L),
902kBluetoothFeatureInterlacedPageScan= (1 << 5L),
903kBluetoothFeatureRSSIWithInquiryResult= (1 << 6L),
904kBluetoothFeatureExtendedSCOLink= (1 << 7L),
905
906// Byte 4 of the support features data structure.
907
908kBluetoothFeatureEV4Packets= (1 << 0L),
909kBluetoothFeatureEV5Packets= (1 << 1L),
910kBluetoothFeatureAbsenceMasks= (1 << 2L),
911kBluetoothFeatureAFHCapableSlave= (1 << 3L),
912kBluetoothFeatureAFHClassificationSlave= (1 << 4L),
913kBluetoothFeatureAliasAuhentication= (1 << 5L),
914kBluetoothFeatureAnonymityMode= (1 << 6L),
915kBluetoothFeature3SlotEnhancedDataRateACLPackets= (1 << 7L),
916
917// Byte 5 of the support features data structure.
918
919kBluetoothFeature5SlotEnhancedDataRateACLPackets= (1 << 0L), // 2.0 version of this header had this at the wrong bit location
920kBluetoothFeatureSniffSubrating= (1 << 1L),
921kBluetoothFeaturePauseEncryption= (1 << 2L),
922kBluetoothFeatureAFHCapableMaster= (1 << 3L),
923kBluetoothFeatureAFHClassificationMaster= (1 << 4L),
924kBluetoothFeatureEnhancedDataRateeSCO2MbpsMode= (1 << 5L),
925kBluetoothFeatureEnhancedDataRateeSCO3MbpsMode= (1 << 6L),
926kBluetoothFeature3SlotEnhancedDataRateeSCOPackets= (1 << 7L),
927
928// Byte 6 of the support features data structure.
929
930kBluetoothFeatureExtendedInquiryResponse= (1 << 0L),
931kBluetoothFeatureSecureSimplePairing= (1 << 3L),
932kBluetoothFeatureEncapsulatedPDU= (1 << 4L),
933kBluetoothFeatureErroneousDataReporting= (1 << 5L),
934kBluetoothFeatureNonFlushablePacketBoundaryFlag= (1 << 6L),
935
936// Byte 7 of the support features data structure.
937
938kBluetoothFeatureLinkSupervisionTimeoutChangedEvent= (1 << 0L),
939kBluetoothFeatureInquiryTransmissionPowerLevel= (1 << 1L),
940kBluetoothFeatureExtendedFeatures= (1 << 7L),
941
942// Byte 8 of the support features data structure (extended)
943
944kBluetoothFeatureSimpleSecurePairingHostMode= (1 << 0L),
945
946};
947
948typedef UInt16BluetoothHCIFailedContactCount;
949typedef struct BluetoothHCIFailedContactInfoBluetoothHCIFailedContactInfo;
950struct BluetoothHCIFailedContactInfo
951{
952BluetoothHCIFailedContactCountcount;
953BluetoothConnectionHandlehandle;
954};
955
956typedef SInt8BluetoothHCIRSSIValue;/* Valid Range: -127 to +20 */
957typedef struct BluetoothHCIRSSIInfoBluetoothHCIRSSIInfo;
958struct BluetoothHCIRSSIInfo
959{
960BluetoothConnectionHandlehandle;
961BluetoothHCIRSSIValueRSSIValue;
962};
963
964typedefUInt8BluetoothHCILinkQuality;
965typedef struct BluetoothHCILinkQualityInfoBluetoothHCILinkQualityInfo;
966struct BluetoothHCILinkQualityInfo
967{
968BluetoothConnectionHandlehandle;
969BluetoothHCILinkQualityqualityValue;
970};
971
972typedef UInt8BluetoothHCIRole;
973typedef structBluetoothHCIRoleInfoBluetoothHCIRoleInfo;
974struct BluetoothHCIRoleInfo
975{
976UInt8role;
977BluetoothConnectionHandlehandle;
978};
979
980enum BluetoothHCIRoles
981{
982kBluetoothHCIMasterRole= 0x00,
983kBluetoothHCISlaveRole= 0x01
984};
985
986typedef UInt16BluetoothHCILinkPolicySettings;
987enum BluetoothHCILinkPolicySettingsValues
988{
989kDisableAllLMModes= 0x0000,
990kEnableMasterSlaveSwitch= 0x0001,
991kEnableHoldMode= 0x0002,
992kEnableSniffMode= 0x0004,
993kEnableParkMode= 0x0008,
994kReservedForFutureUse= 0x0010
995};
996
997typedef structBluetoothHCILinkPolicySettingsInfoBluetoothHCILinkPolicySettingsInfo;
998struct BluetoothHCILinkPolicySettingsInfo
999{
1000BluetoothHCILinkPolicySettingssettings;
1001BluetoothConnectionHandlehandle;
1002};
1003
1004
1005typedef struct BluetoothHCIQualityOfServiceSetupParamsBluetoothHCIQualityOfServiceSetupParams;
1006struct BluetoothHCIQualityOfServiceSetupParams
1007{
1008UInt8flags;
1009UInt8serviceType;
1010UInt32tokenRate;
1011UInt32peakBandwidth;
1012UInt32latency;
1013UInt32delayVariation;
1014};
1015
1016typedef UInt8BluetoothHCILoopbackMode;
1017enum
1018{
1019kBluetoothHCILoopbackModeOff= 0x00,
1020kBluetoothHCILoopbackModeLocal= 0x01,
1021kBluetoothHCILoopbackModeRemote= 0x02
1022};
1023
1024typedef UInt32 BluetoothHCIOperationID;
1025typedef UInt32 BluetoothHCIEventID;
1026typedef UInt32 BluetoothHCIDataID;
1027typedef UInt32 BluetoothHCISignalID;
1028typedef UInt32 BluetoothHCITransportID;
1029typedef UInt32 BluetoothHCITransportCommandID;
1030typedef UInt32 BluetoothHCIRequestID;
1031
1032
1033// Version Information
1034
1035typedef structBluetoothHCIVersionInfoBluetoothHCIVersionInfo;
1036structBluetoothHCIVersionInfo
1037{
1038// Local & Remote information
1039
1040BluetoothManufacturerNamemanufacturerName;
1041BluetoothLMPVersionlmpVersion;
1042BluetoothLMPSubversionlmpSubVersion;
1043
1044// Local information only
1045
1046UInt8hciVersion;
1047UInt16hciRevision;
1048};
1049
1050// HCI buffer sizes.
1051
1052typedef structBluetoothHCIBufferSizeBluetoothHCIBufferSize;
1053structBluetoothHCIBufferSize
1054{
1055UInt16ACLDataPacketLength;
1056UInt8SCODataPacketLength;
1057UInt16totalNumACLDataPackets;
1058UInt16totalNumSCODataPackets;
1059};
1060
1061// Timeouts
1062typedef UInt16BluetoothHCIConnectionAcceptTimeout;
1063typedef UInt16BluetoothHCIPageTimeout;
1064enum BluetoothHCITimeoutValues
1065{
1066kDefaultPageTimeout= 0x2000,
1067};
1068
1069#defineBluetoothGetSlotsFromSeconds( inSeconds )( (inSeconds/.000625 ) )
1070
1071
1072// Link Keys
1073typedef UInt16BluetoothHCINumLinkKeysDeleted;
1074typedef UInt8BluetoothHCINumLinkKeysToWrite;
1075typedef UInt8BluetoothHCIDeleteStoredLinkKeyFlag;
1076enum BluetoothHCIDeleteStoredLinkKeyFlags
1077{
1078kDeleteKeyForSpecifiedDeviceOnly= 0x00,
1079kDeleteAllStoredLinkKeys= 0x01,
1080};
1081
1082typedef UInt8BluetoothHCIReadStoredLinkKeysFlag;
1083enum BluetoothHCIReadStoredLinkKeysFlags
1084{
1085kReturnLinkKeyForSpecifiedDeviceOnly= 0x00,
1086kReadAllStoredLinkKeys= 0x01,
1087};
1088
1089typedef structBluetoothHCIStoredLinkKeysInfoBluetoothHCIStoredLinkKeysInfo;
1090struct BluetoothHCIStoredLinkKeysInfo
1091{
1092UInt16numLinkKeysRead;
1093UInt16maxNumLinkKeysAllowedInDevice;
1094};
1095
1096
1097// Page Scan
1098
1099typedef UInt8BluetoothHCIPageScanMode;
1100enum BluetoothHCIPageScanModes
1101{
1102kMandatoryPageScanMode= 0x00,
1103kOptionalPageScanMode1= 0x01,
1104kOptionalPageScanMode2= 0x02,
1105kOptionalPageScanMode3= 0x03,
1106};
1107
1108typedef UInt8BluetoothHCIPageScanPeriodMode;
1109enum BluetoothHCIPageScanPeriodModes
1110{
1111kP0Mode= 0x00,
1112kP1Mode= 0x01,
1113kP2Mode= 0x02,
1114};
1115
1116typedef UInt8BluetoothHCIPageScanEnableState;
1117enum BluetoothHCIPageScanEnableStates
1118{
1119kNoScansEnabled= 0x00,
1120kInquiryScanEnabledPageScanDisabled= 0x01,
1121kInquiryScanDisabledPageScanEnabled= 0x02,
1122kInquiryScanEnabledPageScanEnabled= 0x03,
1123};
1124
1125typedef structBluetoothHCIScanActivityBluetoothHCIScanActivity;
1126struct BluetoothHCIScanActivity
1127{
1128UInt16 scanInterval;
1129UInt16scanWindow;
1130};
1131
1132typedef structBluetoothHCIInquiryAccessCodeBluetoothHCIInquiryAccessCode;
1133struct BluetoothHCIInquiryAccessCode
1134{
1135UInt8 data[3];
1136};
1137
1138typedef UInt8 BluetoothHCIInquiryAccessCodeCount;
1139typedef structBluetoothHCICurrentInquiryAccessCodesBluetoothHCICurrentInquiryAccessCodes;
1140struct BluetoothHCICurrentInquiryAccessCodes
1141{
1142BluetoothHCIInquiryAccessCodeCountcount;// Number of codes in array.
1143BluetoothHCIInquiryAccessCode *codes;// Ptr to array of codes.
1144};
1145
1146typedefstruct BluetoothHCILinkSupervisionTimeoutBluetoothHCILinkSupervisionTimeout;
1147struct BluetoothHCILinkSupervisionTimeout
1148{
1149BluetoothConnectionHandle handle;
1150UInt16timeout;
1151};
1152
1153typedef UInt8 BluetoothHCIFlowControlState;
1154enum BluetoothHCISCOFlowControlStates
1155{
1156kSCOFlowControlDisabled= 0x00,
1157kSCOFlowControlEnabled= 0x01
1158};
1159
1160enum BluetoothHCIGeneralFlowControlStates
1161{
1162kHostControllerToHostFlowControlOff= 0x00,
1163kHCIACLDataPacketsOnHCISCODataPacketsOff= 0x01,
1164kHCIACLDataPacketsOffHCISCODataPacketsOn= 0x02,
1165kHCIACLDataPacketsOnHCISCODataPacketsOn= 0x03,
1166};
1167
1168typedef SInt8 BluetoothHCITransmitPowerLevel;
1169typedef UInt8 BluetoothHCITransmitPowerLevelType;
1170enum BluetoothHCITransmitReadPowerLevelTypes
1171{
1172kReadCurrentTransmitPowerLevel= 0x00,
1173kReadMaximumTransmitPowerLevel= 0x01,
1174};
1175
1176typedef UInt8BluetoothHCIAFHChannelAssessmentMode;
1177enum BluetoothHCIAFHChannelAssessmentModes
1178{
1179kAFHChannelAssessmentModeDisabled= 0x00,
1180kAFHChannelAssessmentModeEnabled= 0x01
1181};
1182
1183
1184typedef struct BluetoothHCITransmitPowerLevelInfoBluetoothHCITransmitPowerLevelInfo;
1185struct BluetoothHCITransmitPowerLevelInfo
1186{
1187BluetoothConnectionHandlehandle;
1188BluetoothHCITransmitPowerLevellevel; // Range: -70 <= N <= 20 (units are dBm)
1189};
1190
1191typedef UInt8BluetoothHCINumBroadcastRetransmissions;
1192typedef UInt8BluetoothHCIHoldModeActivity;
1193enum BluetoothHCIHoldModeActivityStates
1194{
1195kMaintainCurrentPowerState= 0x00,
1196kSuspendPageScan= 0x01,
1197kSuspendInquiryScan= 0x02,
1198kSuspendPeriodicInquiries= 0x03,
1199};
1200
1201typedef UInt8 BluetoothHCIAuthenticationEnable;
1202enum BluetoothHCIAuthentionEnableModes
1203{
1204kAuthenticationDisabled= 0x00,
1205kAuthenticationEnabled= 0x01,
1206};
1207
1208typedef UInt8BluetoothHCIEncryptionMode;
1209enum BluetoothHCIEncryptionModes
1210{
1211kEncryptionDisabled= 0x00,// Default.
1212kEncryptionOnlyForPointToPointPackets= 0x01,
1213kEncryptionForBothPointToPointAndBroadcastPackets= 0x02,
1214};
1215
1216typedef UInt16BluetoothHCIAutomaticFlushTimeout;
1217typedef structBluetoothHCIAutomaticFlushTimeoutInfoBluetoothHCIAutomaticFlushTimeoutInfo;
1218struct BluetoothHCIAutomaticFlushTimeoutInfo
1219{
1220BluetoothConnectionHandlehandle;
1221BluetoothHCIAutomaticFlushTimeouttimeout;
1222};
1223
1224#definekInfoStringMaxLength25
1225typedef structBluetoothTransportInfo BluetoothTransportInfo;
1226typedef BluetoothTransportInfo*BluetoothTransportInfoPtr;
1227structBluetoothTransportInfo
1228{
1229UInt32productID;
1230UInt32vendorID;
1231UInt32type;
1232charproductName[kInfoStringMaxLength];
1233charvendorName[kInfoStringMaxLength];
1234};
1235
1236enum BluetoothTransportTypes
1237{
1238kBluetoothTransportTypeUSB= 0x01,
1239kBluetoothTransportTypePCCard= 0x02,
1240kBluetoothTransportTypePCICard= 0x03
1241};
1242
1243// Inquiries
1244
1245typedef structBluetoothHCIInquiryResultBluetoothHCIInquiryResult;
1246structBluetoothHCIInquiryResult
1247{
1248BluetoothDeviceAddressdeviceAddress;
1249BluetoothPageScanRepetitionModepageScanRepetitionMode;
1250BluetoothHCIPageScanPeriodModepageScanPeriodMode;
1251BluetoothHCIPageScanModepageScanMode;
1252BluetoothClassOfDeviceclassOfDevice;
1253BluetoothClockOffsetclockOffset;
1254};
1255
1256#define kBluetoothHCIInquiryResultsMaxResults 50
1257typedef structBluetoothHCIInquiryResultsBluetoothHCIInquiryResults;
1258structBluetoothHCIInquiryResults
1259{
1260BluetoothHCIInquiryResultresults[kBluetoothHCIInquiryResultsMaxResults];
1261IOItemCountcount;
1262};
1263
1264#if BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_0
1265
1266//Inquiries with RSSI (v1.2 specification)
1267
1268typedef structBluetoothHCIInquiryWithRSSIResultBluetoothHCIInquiryWithRSSIResult;
1269structBluetoothHCIInquiryWithRSSIResult
1270{
1271BluetoothDeviceAddressdeviceAddress;
1272BluetoothPageScanRepetitionModepageScanRepetitionMode;
1273UInt8reserved;
1274BluetoothClassOfDeviceclassOfDevice;
1275BluetoothClockOffsetclockOffset;
1276BluetoothHCIRSSIValueRSSIValue;
1277};
1278
1279typedef structBluetoothHCIInquiryWithRSSIResultsBluetoothHCIInquiryWithRSSIResults;
1280structBluetoothHCIInquiryWithRSSIResults
1281{
1282BluetoothHCIInquiryWithRSSIResultresults[50];
1283IOItemCountcount;
1284};
1285
1286//Inquiries with 'Extended Inquiry Response' (v2.1 specification)
1287
1288typedef UInt8BluetoothHCIFECRequired;
1289enum BluetoothHCIFECRequiredValues
1290{
1291kBluetoothHCIFECRequired= 0x00,
1292kBluetoothHCIFECNotRequired= 0x01
1293};
1294
1295typedefUInt8BluetoothHCIInquiryMode;
1296enum BluetoothHCIInquiryModes
1297{
1298kBluetoothHCIInquiryModeResultFormatStandard=0x00,
1299kBluetoothHCIInquiryModeResultFormatWithRSSI=0x01,
1300kBluetoothHCIInquiryModeResultFormatWithRSSIOrExtendedInquiryResultFormat=0x02
1301};
1302
1303typedefUInt8BluetoothHCIExtendedInquiryResponseDataType;
1304
1305typedef structBluetoothHCIExtendedInquiryResponseBluetoothHCIExtendedInquiryResponse;/* 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)] */
1306structBluetoothHCIExtendedInquiryResponse
1307{
1308UInt8data[ 240 ];
1309};
1310
1311typedef structBluetoothHCIReadExtendedInquiryResponseResultsBluetoothHCIReadExtendedInquiryResponseResults;
1312structBluetoothHCIReadExtendedInquiryResponseResults
1313{
1314BluetoothHCIFECRequiredoutFECRequired;
1315BluetoothHCIExtendedInquiryResponseextendedInquiryResponse;
1316};
1317
1318typedef structBluetoothHCIExtendedInquiryResultBluetoothHCIExtendedInquiryResult;
1319structBluetoothHCIExtendedInquiryResult
1320{
1321UInt8numberOfReponses;/* always a value of 1 */
1322BluetoothDeviceAddressdeviceAddress;
1323BluetoothPageScanRepetitionModepageScanRepetitionMode;
1324UInt8reserved;
1325BluetoothClassOfDeviceclassOfDevice;
1326BluetoothClockOffsetclockOffset;
1327BluetoothHCIRSSIValueRSSIValue;
1328BluetoothHCIExtendedInquiryResponseextendedInquiryResponse;
1329};
1330
1331// 'Simple Pairing' (v2.1 specification)
1332
1333typedefUInt8BluetoothHCISimplePairingMode;
1334enum BluetoothHCISimplePairingModes
1335{
1336kBluetoothHCISimplePairingModeNotSet=0x00,
1337kBluetoothHCISimplePairingModeEnabled=0x01
1338};
1339
1340typedefUInt8BluetoothSimplePairingDebugMode;
1341enum BluetoothSimplePairingDebugModes
1342{
1343kBluetoothHCISimplePairingDebugModeDisabled=0x00,
1344kBluetoothHCISimplePairingDebugModeEnabled=0x01
1345};
1346
1347typedef structBluetoothHCISimplePairingOOBDataBluetoothHCISimplePairingOOBData;
1348struct BluetoothHCISimplePairingOOBData
1349{
1350UInt8data[ 16 ];
1351};
1352
1353typedef struct BluetoothHCIReadLocalOOBDataResults BluetoothHCIReadLocalOOBDataResults;
1354structBluetoothHCIReadLocalOOBDataResults
1355{
1356BluetoothHCISimplePairingOOBDatahash;
1357BluetoothHCISimplePairingOOBDatarandomizer;
1358};
1359
1360typedef UInt8BluetoothIOCapability;
1361enum BluetoothIOCapabilities
1362{
1363kBluetoothCapabilityTypeDisplayOnly= 0x00,
1364kBluetoothCapabilityTypeDisplayYesNo= 0x01,
1365kBluetoothCapabilityTypeKeyboardOnly= 0x02,
1366kBluetoothCapabilityTypeNoInputNoOutput= 0x03
1367};
1368
1369typedef UInt8BluetoothOOBDataPresence;
1370enum BluetoothOOBDataPresenceValues
1371{
1372kBluetoothOOBAuthenticationDataNotPresent= 0x00,
1373kBluetoothOOBAuthenticationDataFromRemoteDevicePresent= 0x01
1374};
1375
1376typedef UInt8BluetoothAuthenticationRequirements;
1377enum BluetoothAuthenticationRequirementsValues
1378{
1379kBluetoothAuthenticationRequirementsMITMProtectionNotRequired= 0x00,/* Numeric comparison with automatic accept allowed */
1380kBluetoothAuthenticationRequirementsMITMProtectionRequired= 0x01,/* Refer to BluetoothIOCapabilities to determine authentication procedure */
1381kBluetoothAuthenticationRequirementsMITMProtectionNotRequiredNoBonding= 0x00,
1382kBluetoothAuthenticationRequirementsMITMProtectionRequiredNoBonding= 0x01,
1383kBluetoothAuthenticationRequirementsMITMProtectionNotRequiredDedicatedBonding= 0x02,
1384kBluetoothAuthenticationRequirementsMITMProtectionRequiredDedicatedBonding= 0x03,
1385kBluetoothAuthenticationRequirementsMITMProtectionNotRequiredGeneralBonding= 0x04,
1386kBluetoothAuthenticationRequirementsMITMProtectionRequiredGeneralBonding= 0x05
1387};
1388
1389typedef struct BluetoothIOCapabilityResponseBluetoothIOCapabilityResponse;
1390struct BluetoothIOCapabilityResponse
1391{
1392BluetoothDeviceAddressdeviceAddress;
1393BluetoothIOCapabilityioCapability;/* possible values from BluetoothIOCapabilities above */
1394BluetoothOOBDataPresenceOOBDataPresence;
1395BluetoothAuthenticationRequirementsauthenticationRequirements;
1396};
1397
1398typedef UInt32BluetoothPasskey;
1399
1400typedef struct BluetoothUserPasskeyNotificationBluetoothUserPasskeyNotification;
1401struct BluetoothUserPasskeyNotification
1402{
1403BluetoothDeviceAddressdeviceAddress;
1404BluetoothPasskeypasskey;/* passkey for display. valid values are 000000 - 999999 */
1405};
1406
1407typedef UInt8BluetoothKeypressNotificationType;
1408enum BluetoothKeypressNotificationTypes
1409{
1410kBluetoothKeypressNotificationTypePasskeyEntryStarted= 0,
1411kBluetoothKeypressNotificationTypePasskeyDigitEntered= 1,
1412kBluetoothKeypressNotificationTypePasskeyDigitErased= 2,
1413kBluetoothKeypressNotificationTypePasskeyCleared= 3,
1414kBluetoothKeypressNotificationTypePasskeyEntryCompleted= 4
1415};
1416
1417typedef struct BluetoothKeypressNotificationBluetoothKeypressNotification;
1418struct BluetoothKeypressNotification
1419{
1420BluetoothDeviceAddressdeviceAddress;
1421BluetoothKeypressNotificationTypenotificationType;
1422};
1423
1424typedef SInt8TransmissionPower;
1425
1426typedef UInt8BluetoothAFHMode;
1427typedef structBluetoothAFHResultsBluetoothAFHResults;
1428struct BluetoothAFHResults
1429{
1430BluetoothConnectionHandlehandle;
1431BluetoothAFHModemode;
1432UInt8afhMap[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
1439typedef UInt32BluetoothNumericValue;
1440
1441typedef struct BluetoothUserConfirmationRequestBluetoothUserConfirmationRequest;
1442struct BluetoothUserConfirmationRequest
1443{
1444BluetoothDeviceAddressdeviceAddress;
1445BluetoothNumericValuenumericValue;/* numeric value for display. valid values are 000000 - 999999 */
1446};
1447
1448typedef structBluetoothHCIEventSimplePairingCompleteResults BluetoothHCIEventSimplePairingCompleteResults;
1449structBluetoothHCIEventSimplePairingCompleteResults
1450{
1451BluetoothDeviceAddressdeviceAddress;
1452};
1453
1454#endif /* BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1 */
1455
1456
1457// Packet Sizes
1458
1459enum
1460{
1461kBluetoothHCICommandPacketHeaderSize = 3,
1462kBluetoothHCICommandPacketMaxDataSize = 255,
1463kBluetoothHCIMaxCommandPacketSize= kBluetoothHCICommandPacketHeaderSize + kBluetoothHCICommandPacketMaxDataSize,
1464
1465kBluetoothHCIEventPacketHeaderSize = 2,
1466kBluetoothHCIEventPacketMaxDataSize = 255,
1467kBluetoothHCIMaxEventPacketSize= kBluetoothHCIEventPacketHeaderSize + kBluetoothHCIEventPacketMaxDataSize,
1468
1469kBluetoothHCIDataPacketHeaderSize = 4,
1470kBluetoothHCIDataPacketMaxDataSize = 65535,
1471kBluetoothHCIMaxDataPacketSize= kBluetoothHCIDataPacketHeaderSize + kBluetoothHCIDataPacketMaxDataSize
1472};
1473
1474typedef UInt8BluetoothHCIEventCode;
1475typedef UInt8BluetoothLinkType;
1476enum BluetoothLinkTypes
1477{
1478kBluetoothSCOConnection= 0,
1479kBluetoothACLConnection= 1,
1480kBluetoothESCOConnection= 2,
1481 kBluetoothLinkTypeNone= 0xff
1482};
1483
1484typedef UInt16BluetoothHCIVoiceSetting; // 10 bits meaningful
1485typedef UInt8BluetoothHCISupportedIAC;
1486
1487typedef uint32_tBluetoothHCITransmitBandwidth;
1488typedef uint32_tBluetoothHCIReceiveBandwidth;
1489typedef uint16_tBluetoothHCIMaxLatency;
1490typedef uint8_tBluetoothHCIRetransmissionEffort;
1491enum BluetoothHCIRetransmissionEffortTypes
1492{
1493kHCIRetransmissionEffortTypeNone= 0x00,
1494kHCIRetransmissionEffortTypeAtLeastOneAndOptimizeForPower= 0x01,
1495kHCIRetransmissionEffortTypeAtLeastOneAndOptimizeLinkQuality= 0x02,
1496kHCIRetransmissionEffortTypeDontCare= 0xFF,
1497};
1498
1499
1500// Setup Synchronous Packet types (Bluetooth 2.1 spec section 7.7.35 - Setup Synchronous Command Complete Event)
1501
1502typedef uint8_tBluetoothAirMode;
1503enum
1504{
1505kBluetoothAirModeULawLog= 0x00,
1506kBluetoothAirModeALawLog= 0x01,
1507kBluetoothAirModeCVSD= 0x02,
1508kBluetoothAirModeTransparentData= 0x03
1509};
1510
1511typedef structBluetoothSynchronousConnectionInfoBluetoothSynchronousConnectionInfo;
1512structBluetoothSynchronousConnectionInfo
1513{
1514BluetoothHCITransmitBandwidthtransmitBandWidth;
1515BluetoothHCIReceiveBandwidthreceiveBandWidth;
1516BluetoothHCIMaxLatencymaxLatency;
1517BluetoothHCIVoiceSettingvoiceSetting;
1518BluetoothHCIRetransmissionEffortretransmissionEffort;
1519BluetoothPacketTypepacketType;
1520};
1521
1522typedef structBluetoothHCIEventSynchronousConnectionCompleteResults BluetoothHCIEventSynchronousConnectionCompleteResults;
1523structBluetoothHCIEventSynchronousConnectionCompleteResults
1524{
1525BluetoothConnectionHandleconnectionHandle;
1526BluetoothDeviceAddressdeviceAddress;
1527BluetoothLinkTypelinkType;
1528uint8_ttransmissionInterval;
1529uint8_tretransmissionWindow;
1530uint16_treceivePacketLength;
1531uint16_ttransmitPacketLength;
1532BluetoothAirModeairMode;
1533};
1534
1535
1536typedef UInt8BluetoothHCIStatus;
1537typedef UInt8BluetoothHCIEventStatus;
1538
1539// Events.
1540
1541enum
1542{
1543kBluetoothHCIEventInquiryComplete= 0x01,
1544kBluetoothHCIEventInquiryResult= 0x02,
1545kBluetoothHCIEventConnectionComplete= 0x03,
1546kBluetoothHCIEventConnectionRequest= 0x04,
1547kBluetoothHCIEventDisconnectionComplete= 0x05,
1548kBluetoothHCIEventAuthenticationComplete= 0x06,
1549kBluetoothHCIEventRemoteNameRequestComplete= 0x07,
1550kBluetoothHCIEventEncryptionChange= 0x08,
1551kBluetoothHCIEventChangeConnectionLinkKeyComplete= 0x09,
1552kBluetoothHCIEventMasterLinkKeyComplete= 0x0A,
1553kBluetoothHCIEventReadRemoteSupportedFeaturesComplete= 0x0B,
1554kBluetoothHCIEventReadRemoteVersionInformationComplete= 0x0C,
1555kBluetoothHCIEventQoSSetupComplete= 0x0D,
1556kBluetoothHCIEventCommandComplete= 0x0E,
1557kBluetoothHCIEventCommandStatus= 0x0F,
1558kBluetoothHCIEventHardwareError= 0x10,
1559kBluetoothHCIEventFlushOccurred= 0x11,
1560kBluetoothHCIEventRoleChange= 0x12,
1561kBluetoothHCIEventNumberOfCompletedPackets= 0x13,
1562kBluetoothHCIEventModeChange= 0x14,
1563kBluetoothHCIEventReturnLinkKeys= 0x15,
1564kBluetoothHCIEventPINCodeRequest= 0x16,
1565kBluetoothHCIEventLinkKeyRequest= 0x17,
1566kBluetoothHCIEventLinkKeyNotification= 0x18,
1567kBluetoothHCIEventLoopbackCommand= 0x19,
1568kBluetoothHCIEventDataBufferOverflow= 0x1A,
1569kBluetoothHCIEventMaxSlotsChange= 0x1B,
1570kBluetoothHCIEventReadClockOffsetComplete= 0x1C,
1571kBluetoothHCIEventConnectionPacketType= 0x1D,
1572kBluetoothHCIEventQoSViolation= 0x1E,
1573kBluetoothHCIEventPageScanModeChange= 0x1F,
1574kBluetoothHCIEventPageScanRepetitionModeChange= 0x20,
1575
1576// [v1.2]
1577
1578kBluetoothHCIEventFlowSpecificationComplete= 0x21,
1579kBluetoothHCIEventInquiryResultWithRSSI= 0x22,
1580kBluetoothHCIEventReadRemoteExtendedFeaturesComplete= 0x23,
1581kBluetoothHCIEventSynchronousConnectionComplete= 0x2C,
1582kBluetoothHCIEventSynchronousConnectionChanged= 0x2D,
1583
1584// [v2.1]
1585
1586kBluetoothHCIEventSniffSubstrate= 0x2E,
1587kBluetoothHCIEventExtendedInquiryResult= 0x2F,
1588kBluetoothHCIEventIOCapabilityRequest= 0x31,
1589kBluetoothHCIEventIOCapabilityResponse= 0x32,
1590kBluetoothHCIEventUserConfirmationRequest= 0x33,
1591kBluetoothHCIEventUserPasskeyRequest= 0x34,
1592kBluetoothHCIEventRemoteOOBDataRequest= 0x35,
1593kBluetoothHCIEventSimplePairingComplete= 0x36,
1594kBluetoothHCIEventLinkSupervisionTimeoutChanged= 0x38,
1595kBluetoothHCIEventEnhancedFlushComplete= 0x39,
1596kBluetoothHCIEventSniffRequest= 0x3A,
1597kBluetoothHCIEventUserPasskeyNotification= 0x3B,
1598kBluetoothHCIEventKeypressNotification= 0x3C,
1599
1600kBluetoothHCIEventLogoTesting= 0xFE,
1601kBluetoothHCIEventVendorSpecific= 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
1610typedef uint64_tBluetoothHCIEventMask;
1611
1612#definekBluetoothHCIEventMaskDefault64Bit0x00001FFFFFFFFFFFLL
1613#definekBluetoothHCIEventMaskAll64Bit0xFFFFFFFFFFFFFFFFLL
1614
1615// [v1.2]
1616
1617#definekBluetoothHCIEventMaskFlowSpecificationCompleteEvent0x0000000100000000LL
1618#definekBluetoothHCIEventMaskInquiryResultWithRSSIEvent0x0000000200000000LL
1619#definekBluetoothHCIEventMaskReadRemoteExtendedFeaturesCompleteEvent0x0000000400000000LL
1620#definekBluetoothHCIEventMaskSynchronousConnectionCompleteEvent0x0000080000000000LL
1621#definekBluetoothHCIEventMaskSynchronousConnectionChangedEvent0x0000100000000000LL
1622
1623// [v2.1]
1624
1625#definekBluetoothHCIEventMaskSniffSubstrateEvent0x0000200000000000LL
1626#definekBluetoothHCIEventMaskExtendedInquiryResultEvent0x0000400000000000LL
1627#definekBluetoothHCIEventMaskLinkSupervisionTimeoutChangedEvent0x0080000000000000LL
1628#definekBluetoothHCIEventMaskEnhancedFlushCompleteEvent0x0100000000000000LL
1629
1630// [v2.1 Secure Simple Pairing]
1631
1632#definekBluetoothHCIEventMaskIOCapabilityRequestEvent0x0001000000000000LL
1633#definekBluetoothHCIEventMaskIOCapabilityRequestReplyEvent0x0002000000000000LL
1634#definekBluetoothHCIEventMaskUserConfirmationRequestEvent0x0004000000000000LL
1635#definekBluetoothHCIEventMaskUserPasskeyRequestEvent0x0008000000000000LL
1636#definekBluetoothHCIEventMaskRemoteOOBDataRequestEvent0x0010000000000000LL
1637#definekBluetoothHCIEventMaskSimplePairingCompleteEvent0x0020000000000000LL
1638#definekBluetoothHCIEventMaskUserPasskeyNotificationEvent0x0400000000000000LL
1639#definekBluetoothHCIEventMaskKeypressNotificationEvent0x0800000000000000LL
1640
1641enum
1642{
1643kBluetoothHCIEventMaskNone= 0x00000000,
1644kBluetoothHCIEventMaskInquiryComplete= 0x00000001,
1645kBluetoothHCIEventMaskInquiryResult= 0x00000002,
1646kBluetoothHCIEventMaskConnectionComplete= 0x00000004,
1647kBluetoothHCIEventMaskConnectionRequest= 0x00000008,
1648kBluetoothHCIEventMaskDisconnectionComplete= 0x00000010,
1649kBluetoothHCIEventMaskAuthenticationComplete= 0x00000020,
1650kBluetoothHCIEventMaskRemoteNameRequestComplete= 0x00000040,
1651kBluetoothHCIEventMaskEncryptionChange= 0x00000080,
1652kBluetoothHCIEventMaskChangeConnectionLinkKeyComplete= 0x00000100,
1653kBluetoothHCIEventMaskMasterLinkKeyComplete= 0x00000200,
1654kBluetoothHCIEventMaskReadRemoteSupportedFeaturesComplete= 0x00000400,
1655kBluetoothHCIEventMaskReadRemoteVersionInformationComplete= 0x00000800,
1656kBluetoothHCIEventMaskQoSSetupComplete= 0x00001000,
1657kBluetoothHCIEventMaskCommandComplete= 0x00002000,
1658kBluetoothHCIEventMaskCommandStatus= 0x00004000,
1659kBluetoothHCIEventMaskHardwareError= 0x00008000,
1660kBluetoothHCIEventMaskFlushOccurred= 0x00010000,
1661kBluetoothHCIEventMaskRoleChange= 0x00020000,
1662
1663kBluetoothHCIEventMaskNumberOfCompletedPackets= 0x00040000,
1664kBluetoothHCIEventMaskModeChange= 0x00080000,
1665kBluetoothHCIEventMaskReturnLinkKeys= 0x00100000,
1666kBluetoothHCIEventMaskPINCodeRequest= 0x00200000,
1667kBluetoothHCIEventMaskLinkKeyRequest= 0x00400000,
1668kBluetoothHCIEventMaskLinkKeyNotification= 0x00800000,
1669kBluetoothHCIEventMaskLoopbackCommand= 0x01000000,
1670kBluetoothHCIEventMaskDataBufferOverflow= 0x02000000,
1671kBluetoothHCIEventMaskMaxSlotsChange= 0x04000000,
1672kBluetoothHCIEventMaskReadClockOffsetComplete= 0x08000000,
1673kBluetoothHCIEventMaskConnectionPacketTypeChanged= 0x10000000,
1674kBluetoothHCIEventMaskQoSViolation= 0x20000000,
1675kBluetoothHCIEventMaskPageScanModeChange= 0x40000000,
1676kBluetoothHCIEventMaskPageScanRepetitionModeChange= 0x80000000,
1677
1678kBluetoothHCIEventMaskAll= 0xFFFFFFFF,
1679kBluetoothHCIEventMaskDefault= kBluetoothHCIEventMaskAll/* Use kBluetoothHCIEventMaskDefault64Bit above! */
1680};
1681
1682// Event results structures.
1683
1684typedef structBluetoothHCIEventConnectionCompleteResultsBluetoothHCIEventConnectionCompleteResults;
1685structBluetoothHCIEventConnectionCompleteResults
1686{
1687BluetoothConnectionHandleconnectionHandle;
1688BluetoothDeviceAddressdeviceAddress;
1689BluetoothLinkTypelinkType;
1690BluetoothHCIEncryptionModeencryptionMode;
1691};
1692
1693typedef structBluetoothHCIEventDisconnectionCompleteResultsBluetoothHCIEventDisconnectionCompleteResults;
1694structBluetoothHCIEventDisconnectionCompleteResults
1695{
1696BluetoothConnectionHandleconnectionHandle;
1697BluetoothReasonCodereason;
1698};
1699
1700typedef structBluetoothHCIEventReadSupportedFeaturesResults BluetoothHCIEventReadSupportedFeaturesResults;
1701struct BluetoothHCIEventReadSupportedFeaturesResults
1702{
1703BluetoothConnectionHandleconnectionHandle;
1704BluetoothHCISupportedFeaturessupportedFeatures;
1705};
1706
1707#if BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1
1708typedef structBluetoothHCIEventReadExtendedFeaturesResults BluetoothHCIEventReadExtendedFeaturesResults;
1709struct BluetoothHCIEventReadExtendedFeaturesResults
1710{
1711BluetoothConnectionHandleconnectionHandle;
1712BluetoothHCIExtendedFeaturesInfosupportedFeaturesInfo;
1713};
1714#endif /* BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1 */
1715
1716typedef structBluetoothHCIEventReadRemoteVersionInfoResults BluetoothHCIEventReadRemoteVersionInfoResults;
1717struct BluetoothHCIEventReadRemoteVersionInfoResults
1718{
1719BluetoothConnectionHandleconnectionHandle;
1720BluetoothLMPVersionlmpVersion;
1721BluetoothManufacturerNamemanufacturerName;
1722BluetoothLMPSubversionlmpSubversion;
1723};
1724
1725typedef structBluetoothHCIEventRemoteNameRequestResults BluetoothHCIEventRemoteNameRequestResults;
1726struct BluetoothHCIEventRemoteNameRequestResults
1727{
1728BluetoothDeviceAddressdeviceAddress;
1729BluetoothDeviceNamedeviceName;
1730};
1731
1732typedef structBluetoothHCIEventReadClockOffsetResults BluetoothHCIEventReadClockOffsetResults;
1733structBluetoothHCIEventReadClockOffsetResults
1734{
1735BluetoothConnectionHandleconnectionHandle;
1736BluetoothClockOffsetclockOffset;
1737};
1738
1739typedef structBluetoothHCIEventConnectionRequestResults BluetoothHCIEventConnectionRequestResults;
1740structBluetoothHCIEventConnectionRequestResults
1741{
1742BluetoothDeviceAddressdeviceAddress;
1743BluetoothClassOfDeviceclassOfDevice;
1744BluetoothLinkTypelinkType;
1745};
1746
1747typedef structBluetoothHCIEventLinkKeyNotificationResults BluetoothHCIEventLinkKeyNotificationResults;
1748structBluetoothHCIEventLinkKeyNotificationResults
1749{
1750BluetoothDeviceAddressdeviceAddress;
1751BluetoothKeylinkKey;
1752BluetoothKeyTypekeyType;
1753};
1754
1755typedef structBluetoothHCIEventMaxSlotsChangeResults BluetoothHCIEventMaxSlotsChangeResults;
1756structBluetoothHCIEventMaxSlotsChangeResults
1757{
1758BluetoothConnectionHandleconnectionHandle;
1759BluetoothMaxSlotsmaxSlots;
1760};
1761
1762typedef structBluetoothHCIEventModeChangeResults BluetoothHCIEventModeChangeResults;
1763structBluetoothHCIEventModeChangeResults
1764{
1765BluetoothConnectionHandleconnectionHandle;
1766BluetoothHCIConnectionModemode;
1767BluetoothHCIModeIntervalmodeInterval;
1768};
1769
1770typedef structBluetoothHCIEventReturnLinkKeysResultsBluetoothHCIEventReturnLinkKeysResults;
1771structBluetoothHCIEventReturnLinkKeysResults
1772{
1773UInt8numLinkKeys;
1774struct {
1775BluetoothDeviceAddressdeviceAddress;
1776BluetoothKeylinkKey;
1777} linkKeys[1];
1778};
1779
1780typedef structBluetoothHCIEventAuthenticationCompleteResults BluetoothHCIEventAuthenticationCompleteResults;
1781structBluetoothHCIEventAuthenticationCompleteResults
1782{
1783BluetoothConnectionHandleconnectionHandle;
1784};
1785
1786typedef structBluetoothHCIEventEncryptionChangeResults BluetoothHCIEventEncryptionChangeResults;
1787structBluetoothHCIEventEncryptionChangeResults
1788{
1789BluetoothConnectionHandleconnectionHandle;
1790BluetoothEncryptionEnableenable;
1791};
1792
1793typedef structBluetoothHCIEventChangeConnectionLinkKeyCompleteResults BluetoothHCIEventChangeConnectionLinkKeyCompleteResults;
1794structBluetoothHCIEventChangeConnectionLinkKeyCompleteResults
1795{
1796BluetoothConnectionHandleconnectionHandle;
1797};
1798
1799typedef structBluetoothHCIEventMasterLinkKeyCompleteResults BluetoothHCIEventMasterLinkKeyCompleteResults;
1800structBluetoothHCIEventMasterLinkKeyCompleteResults
1801{
1802BluetoothConnectionHandleconnectionHandle;
1803BluetoothKeyFlagkeyFlag;
1804};
1805
1806typedef structBluetoothHCIEventQoSSetupCompleteResults BluetoothHCIEventQoSSetupCompleteResults;
1807structBluetoothHCIEventQoSSetupCompleteResults
1808{
1809BluetoothConnectionHandleconnectionHandle;
1810BluetoothHCIQualityOfServiceSetupParamssetupParams;
1811};
1812
1813typedef structBluetoothHCIEventHardwareErrorResults BluetoothHCIEventHardwareErrorResults;
1814structBluetoothHCIEventHardwareErrorResults
1815{
1816BluetoothHCIStatuserror;
1817};
1818
1819typedef structBluetoothHCIEventFlushOccurredResults BluetoothHCIEventFlushOccurredResults;
1820structBluetoothHCIEventFlushOccurredResults
1821{
1822BluetoothConnectionHandleconnectionHandle;
1823};
1824
1825typedef structBluetoothHCIEventRoleChangeResults BluetoothHCIEventRoleChangeResults;
1826structBluetoothHCIEventRoleChangeResults
1827{
1828BluetoothConnectionHandleconnectionHandle;
1829BluetoothDeviceAddressdeviceAddress;
1830BluetoothRolerole;
1831};
1832
1833typedef structBluetoothHCIEventDataBufferOverflowResults BluetoothHCIEventDataBufferOverflowResults;
1834structBluetoothHCIEventDataBufferOverflowResults
1835{
1836BluetoothLinkTypelinkType;
1837};
1838
1839typedef structBluetoothHCIEventConnectionPacketTypeResults BluetoothHCIEventConnectionPacketTypeResults;
1840structBluetoothHCIEventConnectionPacketTypeResults
1841{
1842BluetoothConnectionHandleconnectionHandle;
1843BluetoothPacketTypepacketType;
1844};
1845
1846typedef structBluetoothHCIEventReadRemoteSupportedFeaturesResults BluetoothHCIEventReadRemoteSupportedFeaturesResults;
1847structBluetoothHCIEventReadRemoteSupportedFeaturesResults
1848{
1849BluetoothHCIStatuserror;
1850BluetoothConnectionHandleconnectionHandle;
1851BluetoothHCISupportedFeatureslmpFeatures;
1852};
1853
1854#if BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1
1855typedef structBluetoothHCIEventReadRemoteExtendedFeaturesResults BluetoothHCIEventReadRemoteExtendedFeaturesResults;
1856structBluetoothHCIEventReadRemoteExtendedFeaturesResults
1857{
1858BluetoothHCIStatuserror;
1859BluetoothConnectionHandleconnectionHandle;
1860BluetoothHCIPageNumberpage;
1861BluetoothHCIPageNumbermaxPage;
1862BluetoothHCISupportedFeatureslmpFeatures;
1863};
1864#endif /* BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1 */
1865
1866typedef structBluetoothHCIEventQoSViolationResults BluetoothHCIEventQoSViolationResults;
1867structBluetoothHCIEventQoSViolationResults
1868{
1869BluetoothConnectionHandleconnectionHandle;
1870};
1871
1872typedef structBluetoothHCIEventPageScanModeChangeResults BluetoothHCIEventPageScanModeChangeResults;
1873structBluetoothHCIEventPageScanModeChangeResults
1874{
1875BluetoothDeviceAddressdeviceAddress;
1876BluetoothPageScanModepageScanMode;
1877};
1878
1879typedef structBluetoothHCIEventPageScanRepetitionModeChangeResults BluetoothHCIEventPageScanRepetitionModeChangeResults;
1880structBluetoothHCIEventPageScanRepetitionModeChangeResults
1881{
1882BluetoothDeviceAddressdeviceAddress;
1883BluetoothPageScanRepetitionModepageScanRepetitionMode;
1884};
1885
1886typedef structBluetoothHCIEventVendorSpecificResults BluetoothHCIEventVendorSpecificResults;
1887structBluetoothHCIEventVendorSpecificResults
1888{
1889UInt8length;
1890UInt8data[255];
1891};
1892
1893#define kNoNotifyProcNULL
1894#define kNoUserRefConNULL
1895
1896typedef struct BluetoothHCIRequestCallbackInfo BluetoothHCIRequestCallbackInfo;
1897struct BluetoothHCIRequestCallbackInfo
1898{
1899mach_vm_address_tuserCallback;// Proc to call when async handler is called.
1900mach_vm_address_tuserRefCon;// For user's info.
1901mach_vm_address_tinternalRefCon;// For our purposes.
1902mach_vm_address_t asyncIDRefCon;// For our aync calls.
1903mach_vm_address_treserved;// For the future. Currently Unused.
1904};
1905
1906// Error codes
1907
1908enum
1909{
1910kBluetoothHCIErrorSuccess= 0x00,
1911kBluetoothHCIErrorUnknownHCICommand= 0x01,
1912kBluetoothHCIErrorNoConnection= 0x02,
1913kBluetoothHCIErrorHardwareFailure= 0x03,
1914kBluetoothHCIErrorPageTimeout= 0x04,
1915kBluetoothHCIErrorAuthenticationFailure= 0x05,
1916kBluetoothHCIErrorKeyMissing= 0x06,
1917kBluetoothHCIErrorMemoryFull= 0x07,
1918kBluetoothHCIErrorConnectionTimeout= 0x08,
1919kBluetoothHCIErrorMaxNumberOfConnections= 0x09,
1920kBluetoothHCIErrorMaxNumberOfSCOConnectionsToADevice= 0x0A,
1921kBluetoothHCIErrorACLConnectionAlreadyExists= 0x0B,
1922kBluetoothHCIErrorCommandDisallowed= 0x0C,
1923kBluetoothHCIErrorHostRejectedLimitedResources= 0x0D,
1924kBluetoothHCIErrorHostRejectedSecurityReasons= 0x0E,
1925kBluetoothHCIErrorHostRejectedRemoteDeviceIsPersonal= 0x0F,
1926kBluetoothHCIErrorHostTimeout= 0x10,
1927kBluetoothHCIErrorUnsupportedFeatureOrParameterValue= 0x11,
1928kBluetoothHCIErrorInvalidHCICommandParameters= 0x12,
1929kBluetoothHCIErrorOtherEndTerminatedConnectionUserEnded= 0x13,
1930kBluetoothHCIErrorOtherEndTerminatedConnectionLowResources= 0x14,
1931kBluetoothHCIErrorOtherEndTerminatedConnectionAboutToPowerOff= 0x15,
1932kBluetoothHCIErrorConnectionTerminatedByLocalHost= 0x16,
1933kBluetoothHCIErrorRepeatedAttempts= 0x17,
1934kBluetoothHCIErrorPairingNotAllowed= 0x18,
1935kBluetoothHCIErrorUnknownLMPPDU= 0x19,
1936kBluetoothHCIErrorUnsupportedRemoteFeature= 0x1A,
1937kBluetoothHCIErrorSCOOffsetRejected= 0x1B,
1938kBluetoothHCIErrorSCOIntervalRejected= 0x1C,
1939kBluetoothHCIErrorSCOAirModeRejected= 0x1D,
1940kBluetoothHCIErrorInvalidLMPParameters= 0x1E,
1941kBluetoothHCIErrorUnspecifiedError= 0x1F,
1942kBluetoothHCIErrorUnsupportedLMPParameterValue= 0x20,
1943kBluetoothHCIErrorRoleChangeNotAllowed= 0x21,
1944kBluetoothHCIErrorLMPResponseTimeout= 0x22,
1945kBluetoothHCIErrorLMPErrorTransactionCollision= 0x23,
1946kBluetoothHCIErrorLMPPDUNotAllowed= 0x24,
1947kBluetoothHCIErrorEncryptionModeNotAcceptable= 0x25, // Added Core Spec, v1.1
1948kBluetoothHCIErrorUnitKeyUsed= 0x26, // 1.1
1949kBluetoothHCIErrorQoSNotSupported= 0x27, // 1.1
1950kBluetoothHCIErrorInstantPassed= 0x28, // 1.1
1951kBluetoothHCIErrorPairingWithUnitKeyNotSupported= 0x29, // 1.1
1952kBluetoothHCIErrorHostRejectedUnacceptableDeviceAddress= 0x0F,// 2.0+
1953kBluetoothHCIErrorDifferentTransactionCollision= 0x2A, // 1.2
1954kBluetoothHCIErrorQoSUnacceptableParameter= 0x2C, // 1.2
1955kBluetoothHCIErrorQoSRejected= 0x2D, // 1.2
1956kBluetoothHCIErrorChannelClassificationNotSupported= 0x2E, // 1.2
1957kBluetoothHCIErrorInsufficientSecurity= 0x2F, // 1.2
1958kBluetoothHCIErrorParameterOutOfMandatoryRange= 0x30,// 1.2
1959kBluetoothHCIErrorRoleSwitchPending= 0x31,// 1.2
1960kBluetoothHCIErrorReservedSlotViolation= 0x34,// 1.2
1961kBluetoothHCIErrorRoleSwitchFailed= 0x35,// 1.2
1962kBluetoothHCIErrorExtendedInquiryResponseTooLarge= 0x36, // 2.1
1963kBluetoothHCIErrorSecureSimplePairingNotSupportedByHost= 0x37, // 2.1
1964
1965kBluetoothHCIErrorMax= 0x37
1966};
1967
1968#if 0
1969#pragma mark === HCI Power Mode ===
1970#endif
1971
1972//===========================================================================================================================
1973//HCI Power Mode
1974//===========================================================================================================================
1975
1976typedef enum
1977{
1978kBluetoothHCIPowerStateON= 0x01,
1979kBluetoothHCIPowerStateOFF= 0x00,
1980kBluetoothHCIPowerStateUnintialized= 0xFF,
1981} BluetoothHCIPowerState;
1982
1983enum
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/*!@enumBluetoothHCIUSBDeviceMatchingConstants
1998@abstractBluetooth USB device matching constants
1999@constantkBluetoothHCITransportUSBClassCodeWireless Controller
2000@constantkBluetoothHCITransportUSBSubClassCodeRF Controller
2001@constantkBluetoothHCITransportUSBProtocolCodeBluetooth Programming
2002*/
2003
2004enum
2005{
2006kBluetoothHCITransportUSBClassCode= 0xE0,
2007kBluetoothHCITransportUSBSubClassCode= 0x01,
2008kBluetoothHCITransportUSBProtocolCode= 0x01
2009};
2010
2011#if 0
2012#pragma mark === TCI - L2CAP ===
2013#endif
2014
2015//===========================================================================================================================
2016//TCI - L2CAP
2017//===========================================================================================================================
2018
2019enum
2020{
2021kBluetoothL2CAPTCIEventIDReserved= 0x00,
2022kBluetoothL2CAPTCIEventIDL2CA_ConnectInd= 0x01,
2023kBluetoothL2CAPTCIEventIDL2CA_ConfigInd= 0x02,
2024kBluetoothL2CAPTCIEventIDL2CA_DisconnectInd= 0x03,
2025kBluetoothL2CAPTCIEventIDL2CA_QoSViolationInd= 0x04,
2026kBluetoothL2CAPTCIEventIDL2CA_TimeOutInd= 0x05
2027};
2028
2029enum
2030{
2031kBluetoothL2CAPTCICommandReserved= 0x0000,
2032kBluetoothL2CAPTCICommandL2CA_ConnectReq= 0x0001,
2033kBluetoothL2CAPTCICommandL2CA_DisconnectReq= 0x0002,
2034kBluetoothL2CAPTCICommandL2CA_ConfigReq= 0x0003,
2035kBluetoothL2CAPTCICommandL2CA_DisableCLT= 0x0004,
2036kBluetoothL2CAPTCICommandL2CA_EnableCLT= 0x0005,
2037kBluetoothL2CAPTCICommandL2CA_GroupCreate= 0x0006,
2038kBluetoothL2CAPTCICommandL2CA_GroupClose= 0x0007,
2039kBluetoothL2CAPTCICommandL2CA_GroupAddMember= 0x0008,
2040kBluetoothL2CAPTCICommandL2CA_GroupRemoveMember= 0x0009,
2041kBluetoothL2CAPTCICommandL2CA_GroupMembership= 0x000A,
2042kBluetoothL2CAPTCICommandL2CA_WriteData= 0x000B,
2043kBluetoothL2CAPTCICommandL2CA_ReadData= 0x000C,
2044kBluetoothL2CAPTCICommandL2CA_Ping= 0x000D,
2045kBluetoothL2CAPTCICommandL2CA_GetInfo= 0x000E,
2046kBluetoothL2CAPTCICommandL2CA_Reserved1= 0x000F,
2047kBluetoothL2CAPTCICommandL2CA_Reserved2= 0x0010,
2048kBluetoothL2CAPTCICommandL2CA_ConnectResp= 0x0011,
2049kBluetoothL2CAPTCICommandL2CA_DisconnectResp= 0x0012,
2050kBluetoothL2CAPTCICommandL2CA_ConfigResp= 0x0013
2051};
2052
2053#if 0
2054#pragma mark -
2055#pragma mark === RFCOMM ===
2056#endif
2057
2058//===========================================================================================================================
2059//RFCOMM
2060//===========================================================================================================================
2061#define kMaxChannelIDPerSide31
2062
2063typedef UInt8BluetoothRFCOMMChannelID;
2064
2065#defineRFCOMM_CHANNEL_ID_IS_VALID( CHANNEL ) (( CHANNEL >= 1 ) && ( CHANNEL <= 30 ))
2066
2067typedef UInt16BluetoothRFCOMMMTU;
2068
2069typedef enum BluetoothRFCOMMParityType
2070{
2071 kBluetoothRFCOMMParityTypeNoParity = 0,
2072 kBluetoothRFCOMMParityTypeOddParity,
2073 kBluetoothRFCOMMParityTypeEvenParity,
2074 kBluetoothRFCOMMParityTypeMaxParity
2075} BluetoothRFCOMMParityType;
2076
2077typedef 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
2094typedef UInt8BluetoothSDPPDUID;
2095enum {
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
2115typedef UInt16BluetoothSDPErrorCode;
2116enum {
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
2130typedef UInt16BluetoothSDPTransactionID;
2131
2132typedef UInt32BluetoothSDPServiceRecordHandle;
2133
2134enum {
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
2148typedef UInt16BluetoothSDPUUID16;
2149typedef UInt32BluetoothSDPUUID32;
2150
2151typedef UInt8BluetoothSDPDataElementTypeDescriptor;
2152typedef UInt8BluetoothSDPDataElementSizeDescriptor;
2153
2154typedef UInt16BluetoothSDPServiceAttributeID;
2155
2156#ifdef__cplusplus
2157}
2158#endif
2159

Archive Download this file

Revision: 2862