master
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6#ifndef _INC_BTHDEF
7#define _INC_BTHDEF
8
9#include <_mingw_unicode.h>
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15/* ULONGLONG according to google */
16__MINGW_EXTENSION typedef ULONGLONG BTH_ADDR, *PBTH_ADDR;
17/* ULONG according to google */
18typedef ULONG BTH_COD, *PBTH_COD;
19typedef ULONG BTH_LAP, *PBTH_LAP;
20
21/*http://www.koders.com/delphi/fidD54082EB25FCAB99B74E5FDB4F3937EFB567FE9A.aspx*/
22/* The following parts are under LGPL */
23
24DEFINE_GUID(GUID_BTHPORT_DEVICE_INTERFACE,0x0850302A,0xB344,0x4fda,0x9B,0xE9,0x90,0x57,0x6B,0x8D,0x46,0xF0);
25DEFINE_GUID(GUID_BLUETOOTH_RADIO_IN_RANGE,0xEA3B5B82,0x26EE,0x450E,0xB0,0xD8,0xD2,0x6F,0xE3,0x0A,0x38,0x69);
26DEFINE_GUID(GUID_BLUETOOTH_RADIO_OUT_OF_RANGE,0xE28867C9,0xC2AA,0x4CED,0xB9,0x69,0x45,0x70,0x86,0x60,0x37,0xC4);
27DEFINE_GUID(GUID_BLUETOOTH_PIN_REQUEST,0xBD198B7C,0x24AB,0x4B9A,0x8C,0x0D,0xA8,0xEA,0x83,0x49,0xAA,0x16);
28DEFINE_GUID(GUID_BLUETOOTH_L2CAP_EVENT,0x7EAE4030,0xB709,0x4AA8,0xAC,0x55,0xE9,0x53,0x82,0x9C,0x9D,0xAA);
29DEFINE_GUID(GUID_BLUETOOTH_HCI_EVENT,0xFC240062,0x1541,0x49BE,0xB4,0x63,0x84,0xC4,0xDC,0xD7,0xBF,0x7F);
30DEFINE_GUID(BLUETOOTH_BASE_UUID,0x00000000,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
31DEFINE_GUID(SDP_PROTOCOL_UUID,0x00000001,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
32DEFINE_GUID(UDP_PROTOCOL_UUID,0x00000002,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
33DEFINE_GUID(RFCOMM_PROTOCOL_UUID,0x00000003,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
34DEFINE_GUID(TCP_PROTOCOL_UUID,0x00000004,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
35DEFINE_GUID(TCSBIN_PROTOCOL_UUID,0x00000005,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
36DEFINE_GUID(TCSAT_PROTOCOL_UUID,0x00000006,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
37DEFINE_GUID(OBEX_PROTOCOL_UUID,0x00000008,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
38DEFINE_GUID(IP_PROTOCOL_UUID,0x00000009,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
39DEFINE_GUID(FTP_PROTOCOL_UUID,0x0000000A,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
40DEFINE_GUID(HTTP_PROTOCOL_UUID,0x0000000C,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
41DEFINE_GUID(WSP_PROTOCOL_UUID,0x0000000E,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
42DEFINE_GUID(BNEP_PROTOCOL_UUID,0x0000000F,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
43DEFINE_GUID(UPNP_PROTOCOL_UUID,0x00000010,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
44DEFINE_GUID(HCCC_PROTOCOL_UUID,0x00000012,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
45DEFINE_GUID(HCDC_PROTOCOL_UUID,0x00000014,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
46DEFINE_GUID(HN_PROTOCOL_UUID,0x00000016,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
47DEFINE_GUID(AVCTP_PROTOCOL_UUID,0x00000017,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
48DEFINE_GUID(AVDTP_PROTOCOL_UUID,0x00000019,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
49DEFINE_GUID(CMPT_PROTOCOL_UUID,0x0000001B,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
50DEFINE_GUID(UDI_C_PLANE_PROTOCOL_UUID,0x0000001D,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
51DEFINE_GUID(L2CAP_PROTOCOL_UUID,0x00000100,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
52
53#define SDP_PROTOCOL_UUID16 0x0001
54#define UDP_PROTOCOL_UUID16 0x0002
55#define RFCOMM_PROTOCOL_UUID16 0x0003
56#define TCP_PROTOCOL_UUID16 0x0004
57#define TCSBIN_PROTOCOL_UUID16 0x0005
58#define TCSAT_PROTOCOL_UUID16 0x0006
59#define OBEX_PROTOCOL_UUID16 0x0008
60#define IP_PROTOCOL_UUID16 0x0009
61#define FTP_PROTOCOL_UUID16 0x000A
62#define HTTP_PROTOCOL_UUID16 0x000C
63#define WSP_PROTOCOL_UUID16 0x000E
64#define BNEP_PROTOCOL_UUID16 0x000F
65#define UPNP_PROTOCOL_UUID16 0x0010
66#define HID_PROTOCOL_UUID16 0x0011
67#define HCCC_PROTOCOL_UUID16 0x0012
68#define HCDC_PROTOCOL_UUID16 0x0014
69#define HCN_PROTOCOL_UUID16 0x0016
70#define AVCTP_PROTOCOL_UUID16 0x0017
71#define AVDTP_PROTOCOL_UUID16 0x0019
72#define CMPT_PROTOCOL_UUID16 0x001B
73#define UDI_C_PLANE_PROTOCOL_UUID16 0x001D
74#define L2CAP_PROTOCOL_UUID16 0x0100
75
76DEFINE_GUID(ServiceDiscoveryServerServiceClassID_UUID,0x00001000,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
77DEFINE_GUID(BrowseGroupDescriptorServiceClassID_UUID,0x00001001,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
78DEFINE_GUID(PublicBrowseGroupServiceClass_UUID,0x00001002,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
79DEFINE_GUID(SerialPortServiceClass_UUID,0x00001101,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
80DEFINE_GUID(LANAccessUsingPPPServiceClass_UUID,0x00001102,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
81DEFINE_GUID(DialupNetworkingServiceClass_UUID,0x00001103,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
82DEFINE_GUID(IrMCSyncServiceClass_UUID,0x00001104,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
83DEFINE_GUID(OBEXObjectPushServiceClass_UUID,0x00001105,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
84DEFINE_GUID(OBEXFileTransferServiceClass_UUID,0x00001106,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
85DEFINE_GUID(IrMCSyncCommandServiceClass_UUID,0x00001107,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
86DEFINE_GUID(HeadsetServiceClass_UUID,0x00001108,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
87DEFINE_GUID(CordlessTelephonyServiceClass_UUID,0x00001109,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
88DEFINE_GUID(AudioSourceServiceClass_UUID,0x0000110A,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
89DEFINE_GUID(AudioSinkServiceClass_UUID,0x0000110B,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
90DEFINE_GUID(AVRemoteControlTargetServiceClass_UUID,0x0000110C,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
91DEFINE_GUID(AdvancedAudioDistributionServiceClass_UUID,0x0000110D,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
92DEFINE_GUID(AVRemoteControlServiceClass_UUID,0x0000110E,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
93DEFINE_GUID(VideoConferencingServiceClass_UUID,0x0000110F,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
94DEFINE_GUID(IntercomServiceClass_UUID,0x00001110,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
95DEFINE_GUID(FaxServiceClass_UUID,0x00001111,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
96DEFINE_GUID(HeadsetAudioGatewayServiceClass_UUID,0x00001112,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
97DEFINE_GUID(WAPServiceClass_UUID,0x00001113,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
98DEFINE_GUID(WAPClientServiceClass_UUID,0x00001114,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
99DEFINE_GUID(PANUServiceClass_UUID,0x00001115,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
100DEFINE_GUID(NAPServiceClass_UUID,0x00001116,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
101DEFINE_GUID(GNServiceClass_UUID,0x00001117,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
102DEFINE_GUID(DirectPrintingServiceClass_UUID,0x00001118,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
103DEFINE_GUID(ReferencePrintingServiceClass_UUID,0x00001119,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
104DEFINE_GUID(ImagingServiceClass_UUID,0x0000111A,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
105DEFINE_GUID(ImagingResponderServiceClass_UUID,0x0000111B,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
106DEFINE_GUID(ImagingAutomaticArchiveServiceClass_UUID,0x0000111C,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
107DEFINE_GUID(ImagingReferenceObjectsServiceClass_UUID,0x0000111D,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
108DEFINE_GUID(HandsfreeServiceClass_UUID,0x0000111E,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
109DEFINE_GUID(HandsfreeAudioGatewayServiceClass_UUID,0x0000111F,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
110DEFINE_GUID(DirectPrintingReferenceObjectsServiceClass_UUID,0x00001120,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
111DEFINE_GUID(ReflectedUIServiceClass_UUID,0x00001121,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
112DEFINE_GUID(BasicPringingServiceClass_UUID,0x00001122,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
113DEFINE_GUID(PrintingStatusServiceClass_UUID,0x00001123,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
114DEFINE_GUID(HumanInterfaceDeviceServiceClass_UUID,0x00001124,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
115DEFINE_GUID(HardcopyCableReplacementServiceClass_UUID,0x00001125,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
116DEFINE_GUID(HCRPrintServiceClass_UUID,0x00001126,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
117DEFINE_GUID(HCRScanServiceClass_UUID,0x00001127,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
118DEFINE_GUID(CommonISDNAccessServiceClass_UUID,0x00001128,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
119DEFINE_GUID(VideoConferencingGWServiceClass_UUID,0x00001129,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
120DEFINE_GUID(UDIMTServiceClass_UUID,0x0000112A,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
121DEFINE_GUID(UDITAServiceClass_UUID,0x0000112B,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
122DEFINE_GUID(AudioVideoServiceClass_UUID,0x0000112C,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
123DEFINE_GUID(PnPInformationServiceClass_UUID,0x00001200,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
124DEFINE_GUID(GenericNetworkingServiceClass_UUID,0x00001201,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
125DEFINE_GUID(GenericFileTransferServiceClass_UUID,0x00001202,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
126DEFINE_GUID(GenericAudioServiceClass_UUID,0x00001203,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
127DEFINE_GUID(GenericTelephonyServiceClass_UUID,0x00001204,0x0000,0x1000,0x80,0x00,0x00,0x80,0x5F,0x9B,0x34,0xFB);
128
129#define ServiceDiscoveryServerServiceClassID_UUID16 0x1000
130#define BrowseGroupDescriptorServiceClassID_UUID16 0x1001
131#define PublicBrowseGroupServiceClassID_UUID16 0x1002
132#define SerialPortServiceClassID_UUID16 0x1101
133#define LANAccessUsingPPPServiceClassID_UUID16 0x1102
134#define DialupNetworkingServiceClassID_UUID16 0x1103
135#define IrMCSyncServiceClassID_UUID16 0x1104
136#define OBEXObjectPushServiceClassID_UUID16 0x1105
137#define OBEXFileTransferServiceClassID_UUID16 0x1106
138#define IrMcSyncCommandServiceClassID_UUID16 0x1107
139#define HeadsetServiceClassID_UUID16 0x1108
140#define CordlessServiceClassID_UUID16 0x1109
141#define AudioSourceServiceClassID_UUID16 0x110A
142#define AudioSinkSourceServiceClassID_UUID16 0x110B
143#define AVRemoteControlTargetServiceClassID_UUID16 0x110C
144#define AdvancedAudioDistributionServiceClassID_UUID16 0x110D
145#define AVRemoteControlServiceClassID_UUID16 0x110E
146#define VideoConferencingServiceClassID_UUID16 0x110F
147#define IntercomServiceClassID_UUID16 0x1110
148#define FaxServiceClassID_UUID16 0x1111
149#define HeadsetAudioGatewayServiceClassID_UUID16 0x1112
150#define WAPServiceClassID_UUID16 0x1113
151#define WAPClientServiceClassID_UUID16 0x1114
152#define PANUServiceClassID_UUID16 0x1115
153#define NAPServiceClassID_UUID16 0x1116
154#define GNServiceClassID_UUID16 0x1117
155#define DirectPrintingServiceClassID_UUID16 0x1118
156#define ReferencePrintingServiceClassID_UUID16 0x1119
157#define ImagingServiceClassID_UUID16 0x111A
158#define ImagingResponderServiceClassID_UUID16 0x111B
159#define ImagingAutomaticArchiveServiceClassID_UUID16 0x111C
160#define ImagingReferenceObjectsServiceClassID_UUID16 0x111D
161#define HandsfreeServiceClassID_UUID16 0x111E
162#define HandsfreeAudioGatewayServiceClassID_UUID16 0x111F
163#define DirectPrintingReferenceObjectsServiceClassID_UUID16 0x1120
164#define ReflectsUIServiceClassID_UUID16 0x1121
165#define BasicPrintingServiceClassID_UUID16 0x1122
166#define PrintingStatusServiceClassID_UUID16 0x1123
167#define HumanInterfaceDeviceServiceClassID_UUID16 0x1124
168#define HardcopyCableReplacementServiceClassID_UUID16 0x1125
169#define HCRPrintServiceClassID_UUID16 0x1126
170#define HCRScanServiceClassID_UUID16 0x1127
171#define CommonISDNAccessServiceClass_UUID16 0x1128
172#define VideoConferencingGWServiceClass_UUID16 0x1129
173#define UDIMTServiceClass_UUID16 0x112A
174#define UDITAServiceClass_UUID16 0x112B
175#define AudioVideoServiceClass_UUID16 0x112C
176
177#define PnPInformationServiceClassID_UUID16 0x1200
178#define GenericNetworkingServiceClassID_UUID16 0x1201
179#define GenericFileTransferServiceClassID_UUID16 0x1202
180#define GenericAudioServiceClassID_UUID16 0x1203
181#define GenericTelephonyServiceClassID_UUID16 0x1204
182
183#define BTH_MAX_NAME_SIZE 248
184#define BTH_MAX_PIN_SIZE 16
185#define BTH_LINK_KEY_LENGTH 16
186
187#define BTH_MFG_ERICSSON 0
188#define BTH_MFG_NOKIA 1
189#define BTH_MFG_INTEL 2
190#define BTH_MFG_IBM 3
191#define BTH_MFG_TOSHIBA 4
192#define BTH_MFG_3COM 5
193#define BTH_MFG_MICROSOFT 6
194#define BTH_MFG_LUCENT 7
195#define BTH_MFG_MOTOROLA 8
196#define BTH_MFG_INFINEON 9
197#define BTH_MFG_CSR 10
198#define BTH_MFG_SILICONWAVE 11
199#define BTH_MFG_DIGIANSWER 12
200#define BTH_MFG_TI 13
201#define BTH_MFG_PARTHUS 14
202#define BTH_MFG_BROADCOM 15
203#define BTH_MFG_MITEL 16
204#define BTH_MFG_WIDCOMM 17
205#define BTH_MFG_ZEEVO 18
206#define BTH_MFG_ATMEL 19
207#define BTH_MFG_MITSIBUSHI 20
208#define BTH_MFG_RTX_TELECOM 21
209#define BTH_MFG_KC_TECHNOLOGY 22
210#define BTH_MFG_NEWLOGIC 23
211#define BTH_MFG_TRANSILICA 24
212#define BTH_MFG_ROHDE_SCHWARZ 25
213#define BTH_MFG_TTPCOM 26
214#define BTH_MFG_SIGNIA 27
215#define BTH_MFG_CONEXANT 28
216#define BTH_MFG_QUALCOMM 29
217#define BTH_MFG_INVENTEL 30
218#define BTH_MFG_AVM_BERLIN 31
219#define BTH_MFG_BANDSPEED 32
220#define BTH_MFG_MANSELLA 33
221#define BTH_MFG_NEC 34
222#define BTH_MFG_WAVEPLUS_TECHNOLOGY_CO 35
223#define BTH_MFG_ALCATEL 36
224#define BTH_MFG_PHILIPS_SEMICONDUCTOR 37
225#define BTH_MFG_C_TECHNOLOGIES 38
226#define BTH_MFG_OPEN_INTERFACE 39
227#define BTH_MFG_RF_MICRO_DEVICES 40
228#define BTH_MFG_HITACHI 41
229#define BTH_MFG_SYMBOL_TECHNOLOGIES 42
230#define BTH_MFG_TENOVIS 43
231#define BTH_MFG_MACRONIX_INTERNATIONAL 44
232#define BTH_MFG_MARVELL 72
233#define BTH_MFG_APPLE 76
234#define BTH_MFG_NORDIC_SEMICONDUCTORS_ASA 89
235#define BTH_MFG_ARUBA_NETWORKS 283
236#define BTH_MFG_INTERNAL_USE 65535
237
238#define BTH_ADDR_NULL 0ULL
239
240#define NAP_MASK 0xFFFF00000000ULL
241#define SAP_MASK 0x0000FFFFFFFFULL
242#define NAP_BIT_OFFSET 32
243#define SAP_BIT_OFFSET 0
244
245#define GET_NAP(X) (((X)&NAP_MASK)>>NAP_BIT_OFFSET)
246#define GET_SAP(X) (((X)&SAP_MASK)>>SAP_BIT_OFFSET)
247#define SET_NAP(X) ((X)<<NAP_BIT_OFFSET)
248#define SET_SAP(X) ((X)<<SAP_BIT_OFFSET)
249#define SET_NAP_SAP(X,Y) (SET_NAP(X)|SET_SAP(Y))
250
251#define COD_FORMAT_BIT_OFFSET 0
252#define COD_MINOR_BIT_OFFSET 2
253#define COD_MAJOR_BIT_OFFSET 8
254#define COD_SERVICE_BIT_OFFSET 13
255
256#define COD_FORMAT_MASK 0x000003
257#define COD_MINOR_MASK 0x0000FC
258#define COD_MAJOR_MASK 0x001F00
259#define COD_SERVICE_MASK 0xFFE0000
260
261#define GET_COD_FORMAT(X) (((X) & COD_FORMAT_MASK) >> COD_FORMAT_BIT_OFFSET)
262#define GET_COD_MINOR(X) (((X) & COD_MINOR_MASK) >> COD_MINOR_BIT_OFFSET)
263#define GET_COD_MAJOR(X) (((X) & COD_MAJOR_MASK) >> COD_MAJOR_BIT_OFFSET)
264#define GET_COD_SERVICE(X) (((X) & COD_SERVICE_MASK) >> COD_SERVICE_BIT_OFFSET)
265
266#define SET_COD_MINOR(X,Y) (((X) & ~(COD_MINOR_MASK)) | ((Y) << COD_MINOR_BIT_OFFSET))
267#define SET_COD_MAJOR(X,Y) (((X) & ~(COD_MAJOR_MASK)) | ((Y) << COD_MAJOR_BIT_OFFSET))
268#define SET_COD_SERVICE(X,Y) (((X) & ~(COD_SERVICE_MASK)) | ((Y) << COD_SERVICE_BIT_OFFSET))
269
270#define COD_VERSION 0
271
272#define COD_SERVICE_LIMITED 0x0001
273#define COD_SERVICE_LE_AUDIO 0x0002
274#define COD_SERVICE_POSITIONING 0x0008
275#define COD_SERVICE_NETWORKING 0x0010
276#define COD_SERVICE_RENDERING 0x0020
277#define COD_SERVICE_CAPTURING 0x0040
278#define COD_SERVICE_OBJECT_XFER 0x0080
279#define COD_SERVICE_AUDIO 0x0100
280#define COD_SERVICE_TELEPHONY 0x0200
281#define COD_SERVICE_INFORMATION 0x0400
282
283#define COD_SERVICE_VALID_MASK (COD_SERVICE_LIMITED | COD_SERVICE_LE_AUDIO | COD_SERVICE_POSITIONING | COD_SERVICE_NETWORKING | COD_SERVICE_RENDERING | COD_SERVICE_CAPTURING | COD_SERVICE_OBJECT_XFER | COD_SERVICE_AUDIO | COD_SERVICE_TELEPHONY | COD_SERVICE_INFORMATION)
284
285#define COD_SERVICE_MAX_COUNT 10
286
287#define COD_MAJOR_MISCELLANEOUS 0x00
288#define COD_MAJOR_COMPUTER 0x01
289#define COD_MAJOR_PHONE 0x02
290#define COD_MAJOR_LAN_ACCESS 0x03
291#define COD_MAJOR_AUDIO 0x04
292#define COD_MAJOR_PERIPHERAL 0x05
293#define COD_MAJOR_IMAGING 0x06
294#define COD_MAJOR_WEARABLE 0x07
295#define COD_MAJOR_TOY 0x08
296#define COD_MAJOR_HEALTH 0x09
297#define COD_MAJOR_UNCLASSIFIED 0x1F
298
299#define COD_COMPUTER_MINOR_UNCLASSIFIED 0x00
300#define COD_COMPUTER_MINOR_DESKTOP 0x01
301#define COD_COMPUTER_MINOR_SERVER 0x02
302#define COD_COMPUTER_MINOR_LAPTOP 0x03
303#define COD_COMPUTER_MINOR_HANDHELD 0x04
304#define COD_COMPUTER_MINOR_PALM 0x05
305#define COD_COMPUTER_MINOR_WEARABLE 0x06
306
307#define COD_PHONE_MINOR_UNCLASSIFIED 0x00
308#define COD_PHONE_MINOR_CELLULAR 0x01
309#define COD_PHONE_MINOR_CORDLESS 0x02
310#define COD_PHONE_MINOR_SMART 0x03
311#define COD_PHONE_MINOR_WIRED_MODEM 0x04
312
313#define COD_AUDIO_MINOR_UNCLASSIFIED 0x00
314#define COD_AUDIO_MINOR_HEADSET 0x01
315#define COD_AUDIO_MINOR_HANDS_FREE 0x02
316#define COD_AUDIO_MINOR_HEADSET_HANDS_FREE 0x03
317#define COD_AUDIO_MINOR_MICROPHONE 0x04
318#define COD_AUDIO_MINOR_LOUDSPEAKER 0x05
319#define COD_AUDIO_MINOR_HEADPHONES 0x06
320#define COD_AUDIO_MINOR_PORTABLE_AUDIO 0x07
321#define COD_AUDIO_MINOR_CAR_AUDIO 0x08
322#define COD_AUDIO_MINOR_SET_TOP_BOX 0x09
323#define COD_AUDIO_MINOR_HIFI_AUDIO 0x0A
324#define COD_AUDIO_MINOR_VCR 0x0B
325#define COD_AUDIO_MINOR_VIDEO_CAMERA 0x0C
326#define COD_AUDIO_MINOR_CAMCORDER 0x0D
327#define COD_AUDIO_MINOR_VIDEO_MONITOR 0x0E
328#define COD_AUDIO_MINOR_VIDEO_DISPLAY_LOUDSPEAKER 0x0F
329#define COD_AUDIO_MINOR_VIDEO_DISPLAY_CONFERENCING 0x10
330/* #define COD_AUDIO_MINOR_RESERVED 0x11 */
331#define COD_AUDIO_MINOR_GAMING_TOY 0x12
332
333#define COD_PERIPHERAL_MINOR_KEYBOARD_MASK 0x10
334#define COD_PERIPHERAL_MINOR_POINTER_MASK 0x20
335
336#define COD_PERIPHERAL_MINOR_NO_CATEGORY 0x00
337#define COD_PERIPHERAL_MINOR_JOYSTICK 0x01
338#define COD_PERIPHERAL_MINOR_GAMEPAD 0x02
339#define COD_PERIPHERAL_MINOR_REMOTE_CONTROL 0x03
340#define COD_PERIPHERAL_MINOR_SENSING 0x04
341
342#define COD_IMAGING_MINOR_DISPLAY_MASK 0x04
343#define COD_IMAGING_MINOR_CAMERA_MASK 0x08
344#define COD_IMAGING_MINOR_SCANNER_MASK 0x10
345#define COD_IMAGING_MINOR_PRINTER_MASK 0x20
346
347#define COD_WEARABLE_MINOR_WRIST_WATCH 0x01
348#define COD_WEARABLE_MINOR_PAGER 0x02
349#define COD_WEARABLE_MINOR_JACKET 0x03
350#define COD_WEARABLE_MINOR_HELMET 0x04
351#define COD_WEARABLE_MINOR_GLASSES 0x05
352
353#define COD_TOY_MINOR_ROBOT 0x01
354#define COD_TOY_MINOR_VEHICLE 0x02
355#define COD_TOY_MINOR_DOLL_ACTION_FIGURE 0x03
356#define COD_TOY_MINOR_CONTROLLER 0x04
357#define COD_TOY_MINOR_GAME 0x05
358
359#define COD_HEALTH_MINOR_BLOOD_PRESSURE_MONITOR 0x01
360#define COD_HEALTH_MINOR_THERMOMETER 0x02
361#define COD_HEALTH_MINOR_WEIGHING_SCALE 0x03
362#define COD_HEALTH_MINOR_GLUCOSE_METER 0x04
363#define COD_HEALTH_MINOR_PULSE_OXIMETER 0x05
364#define COD_HEALTH_MINOR_HEART_PULSE_MONITOR 0x06
365#define COD_HEALTH_MINOR_HEALTH_DATA_DISPLAY 0x07
366#define COD_HEALTH_MINOR_STEP_COUNTER 0x08
367
368#define COD_LAN_ACCESS_BIT_OFFSET 5
369#define COD_LAN_MINOR_MASK 0x0000001C
370#define COD_LAN_ACCESS_MASK 0x000000E0
371
372#define GET_COD_LAN_MINOR(X) (((X) & COD_LAN_MINOR_MASK) >> COD_MINOR_BIT_OFFSET)
373#define GET_COD_LAN_ACCESS(X) (((X) & COD_LAN_ACCESS_MASK) >> COD_LAN_ACCESS_BIT_OFFSET)
374
375#define COD_LAN_MINOR_UNCLASSIFIED 0x00
376
377#define COD_LAN_ACCESS_0_USED 0x00
378#define COD_LAN_ACCESS_17_USED 0x01
379#define COD_LAN_ACCESS_33_USED 0x02
380#define COD_LAN_ACCESS_50_USED 0x03
381#define COD_LAN_ACCESS_67_USED 0x04
382#define COD_LAN_ACCESS_83_USED 0x05
383#define COD_LAN_ACCESS_99_USED 0x06
384#define COD_LAN_ACCESS_FULL 0x07
385
386#define LAP_GIAC_VALUE 0x009E8B00
387
388#define LAP_LIAC_VALUE 0x009E8B00
389#define BTH_ADDR_IAC_FIRST 0x9E8B00
390#define BTH_ADDR_IAC_LAST 0x9E8B3
391#define BTH_ADDR_LIAC 0x9E8B00
392#define BTH_ADDR_GIAC 0x9E8B33
393
394typedef UCHAR BTHSTATUS, *PBTHSTATUS;
395
396#define BTH_ERROR(X) ((X) != BTH_ERROR_SUCCESS)
397#define BTH_SUCCESS(X) ((X) === BTH_ERROR_SUCCESS)
398
399#define BTH_ERROR_SUCCESS 0x00
400#define BTH_ERROR_UNKNOWN_HCI_COMMAND 0x01
401#define BTH_ERROR_NO_CONNECTION 0x02
402#define BTH_ERROR_HARDWARE_FAILURE 0x03
403#define BTH_ERROR_PAGE_TIMEOUT 0x04
404#define BTH_ERROR_AUTHENTICATION_FAILURE 0x05
405#define BTH_ERROR_KEY_MISSING 0x06
406#define BTH_ERROR_MEMORY_FULL 0x07
407#define BTH_ERROR_CONNECTION_TIMEOUT 0x08
408#define BTH_ERROR_MAX_NUMBER_OF_CONNECTIONS 0x09
409#define BTH_ERROR_MAX_NUMBER_OF_SCO_CONNECTIONS 0x0A
410#define BTH_ERROR_ACL_CONNECTION_ALREADY_EXISTS 0x0B
411#define BTH_ERROR_COMMAND_DISALLOWED 0x0C
412#define BTH_ERROR_HOST_REJECTED_LIMITED_RESOURCES 0x0D
413#define BTH_ERROR_HOST_REJECTED_SECURITY_REASONS 0x0E
414#define BTH_ERROR_HOST_REJECTED_PERSONAL_DEVICE 0x0F
415#define BTH_ERROR_HOST_TIMEOUT 0x10
416#define BTH_ERROR_UNSUPPORTED_FEATURE_OR_PARAMETER 0x11
417#define BTH_ERROR_INVALID_HCI_PARAMETER 0x12
418#define BTH_ERROR_REMOTE_USER_ENDED_CONNECTION 0x13
419#define BTH_ERROR_REMOTE_LOW_RESOURCES 0x14
420#define BTH_ERROR_REMOTE_POWERING_OFF 0x15
421#define BTH_ERROR_LOCAL_HOST_TERMINATED_CONNECTION 0x16
422#define BTH_ERROR_REPEATED_ATTEMPTS 0x17
423#define BTH_ERROR_PAIRING_NOT_ALLOWED 0x18
424#define BTH_ERROR_UKNOWN_LMP_PDU 0x19
425#define BTH_ERROR_UNSUPPORTED_REMOTE_FEATURE 0x1A
426#define BTH_ERROR_SCO_OFFSET_REJECTED 0x1B
427#define BTH_ERROR_SCO_INTERVAL_REJECTED 0x1C
428#define BTH_ERROR_SCO_AIRMODE_REJECTED 0x1D
429#define BTH_ERROR_INVALID_LMP_PARAMETERS 0x1E
430#define BTH_ERROR_UNSPECIFIED_ERROR 0x1F
431#define BTH_ERROR_UNSUPPORTED_LMP_PARM_VALUE 0x20
432#define BTH_ERROR_ROLE_CHANGE_NOT_ALLOWED 0x21
433#define BTH_ERROR_LMP_RESPONSE_TIMEOUT 0x22
434#define BTH_ERROR_LMP_TRANSACTION_COLLISION 0x23
435#define BTH_ERROR_LMP_PDU_NOT_ALLOWED 0x24
436#define BTH_ERROR_ENCRYPTION_MODE_NOT_ACCEPTABLE 0x25
437#define BTH_ERROR_UNIT_KEY_NOT_USED 0x26
438#define BTH_ERROR_QOS_IS_NOT_SUPPORTED 0x27
439#define BTH_ERROR_INSTANT_PASSED 0x28
440#define BTH_ERROR_PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED 0x29
441#define BTH_ERROR_DIFFERENT_TRANSACTION_COLLISION 0x2A
442#define BTH_ERROR_QOS_UNACCEPTABLE_PARAMETER 0x2C
443#define BTH_ERROR_QOS_REJECTED 0x2D
444#define BTH_ERROR_CHANNEL_CLASSIFICATION_NOT_SUPPORTED 0x2E
445#define BTH_ERROR_INSUFFICIENT_SECURITY 0x2F
446#define BTH_ERROR_PARAMETER_OUT_OF_MANDATORY_RANGE 0x30
447#define BTH_ERROR_ROLE_SWITCH_PENDING 0x32
448#define BTH_ERROR_RESERVED_SLOT_VIOLATION 0x34
449#define BTH_ERROR_ROLE_SWITCH_FAILED 0x35
450#define BTH_ERROR_EXTENDED_INQUIRY_RESPONSE_TOO_LARGE 0x36
451#define BTH_ERROR_SECURE_SIMPLE_PAIRING_NOT_SUPPORTED_BY_HOST 0x37
452#define BTH_ERROR_HOST_BUSY_PAIRING 0x38
453#define BTH_ERROR_CONNECTION_REJECTED_DUE_TO_NO_SUITABLE_CHANNEL_FOUND 0x39
454#define BTH_ERROR_CONTROLLER_BUSY 0x3A
455#define BTH_ERROR_UNACCEPTABLE_CONNECTION_INTERVAL 0x3B
456#define BTH_ERROR_DIRECTED_ADVERTISING_TIMEOUT 0x3C
457#define BTH_ERROR_CONNECTION_TERMINATED_DUE_TO_MIC_FAILURE 0x3D
458#define BTH_ERROR_CONNECTION_FAILED_TO_BE_ESTABLISHED 0x3E
459#define BTH_ERROR_MAC_CONNECTION_FAILED 0x3F
460#define BTH_ERROR_COARSE_CLOCK_ADJUSTMENT_REJECTED 0x40
461#define BTH_ERROR_TYPE_0_SUBMAP_NOT_DEFINED 0x41
462#define BTH_ERROR_UNKNOWN_ADVERTISING_IDENTIFIER 0x42
463#define BTH_ERROR_LIMIT_REACHED 0x43
464#define BTH_ERROR_OPERATION_CANCELLED_BY_HOST 0X44
465#define BTH_ERROR_PACKET_TOO_LONG 0x45
466#define BTH_ERROR_UNSPECIFIED 0xFF
467
468#define L2CAP_MIN_MTU 48
469#define L2CAP_MAX_MTU 0xFFFF
470#define L2CAP_DEFAULT_MTU 672
471
472#define MAX_L2CAP_PING_DATA_LENGTH 44
473#define MAX_L2CAP_INFO_DATA_LENGTH 44
474
475#define BDIF_ADDRESS 0x00000001
476#define BDIF_COD 0x00000002
477#define BDIF_NAME 0x00000004
478#define BDIF_PAIRED 0x00000008
479#define BDIF_PERSONAL 0x00000010
480#define BDIF_CONNECTED 0x00000020
481
482#if (NTDDI_VERSION > NTDDI_VISTASP1)
483
484#define BDIF_SHORT_NAME 0x00000040
485#define BDIF_VISIBLE 0x00000080
486#define BDIF_SSP_SUPPORTED 0x00000100
487#define BDIF_SSP_PAIRED 0x00000200
488#define BDIF_SSP_MITM_PROTECTED 0x00000400
489#define BDIF_RSSI 0x00001000
490#define BDIF_EIR 0x00002000
491
492#if (NTDDI_VERSION >= NTDDI_WIN8)
493
494#define BDIF_BR 0x00004000
495#define BDIF_LE 0x00008000
496#define BDIF_LE_PAIRED 0x00010000
497#define BDIF_LE_PERSONAL 0x00020000
498#define BDIF_LE_MITM_PROTECTED 0x00040000
499#define BDIF_LE_PRIVACY_ENABLED 0x00080000
500#define BDIF_LE_RANDOM_ADDRESS_TYPE 0x00100000
501
502#if (NTDDI_VERSION >= NTDDI_WIN10)
503
504#define BDIF_LE_DISCOVERABLE 0x00200000
505#define BDIF_LE_NAME 0x00400000
506#define BDIF_LE_VISIBLE 0x00800000
507
508#if (NTDDI_VERSION >= NTDDI_WIN10_RS2)
509
510#define BDIF_LE_CONNECTED 0x01000000
511#define BDIF_LE_CONNECTABLE 0x02000000
512#define BDIF_BR_SECURE_CONNECTION_PAIRED 0x08000000
513#define BDIF_LE_SECURE_CONNECTION_PAIRED 0x10000000
514
515#define BDIF_DEBUGKEY 0x20000000
516#define BDIF_LE_DEBUGKEY 0x40000000
517
518#if (NTDDI_VERSION >= NTDDI_WIN10_19H1)
519
520#define BDIF_TX_POWER 0x80000000
521
522#define BDIF_VALID_FLAGS (BDIF_ADDRESS | BDIF_COD | BDIF_NAME | BDIF_PAIRED | BDIF_PERSONAL | BDIF_CONNECTED | BDIF_SHORT_NAME | BDIF_VISIBLE | BDIF_RSSI | BDIF_EIR | BDIF_SSP_PAIRED | BDIF_SSP_MITM_PROTECTED | BDIF_BR | BDIF_LE | BDIF_LE_PAIRED | BDIF_LE_PERSONAL | BDIF_LE_MITM_PROTECTED | BDIF_LE_PRIVACY_ENABLED | BDIF_LE_RANDOM_ADDRESS_TYPE | BDIF_LE_DISCOVERABLE | BDIF_LE_NAME | BDIF_LE_VISIBLE | BDIF_LE_CONNECTED | BDIF_LE_CONNECTABLE | BDIF_BR_SECURE_CONNECTION_PAIRED | BDIF_LE_SECURE_CONNECTION_PAIRED | BDIF_DEBUGKEY | BDIF_LE_DEBUGKEY | BDIF_TX_POWER)
523
524#else
525
526#define BDIF_VALID_FLAGS (BDIF_ADDRESS | BDIF_COD | BDIF_NAME | BDIF_PAIRED | BDIF_PERSONAL | BDIF_CONNECTED | BDIF_SHORT_NAME | BDIF_VISIBLE | BDIF_RSSI | BDIF_EIR | BDIF_SSP_PAIRED | BDIF_SSP_MITM_PROTECTED | BDIF_BR | BDIF_LE | BDIF_LE_PAIRED | BDIF_LE_PERSONAL | BDIF_LE_MITM_PROTECTED | BDIF_LE_PRIVACY_ENABLED | BDIF_LE_RANDOM_ADDRESS_TYPE | BDIF_LE_DISCOVERABLE | BDIF_LE_NAME | BDIF_LE_VISIBLE | BDIF_LE_CONNECTED | BDIF_LE_CONNECTABLE | BDIF_BR_SECURE_CONNECTION_PAIRED | BDIF_LE_SECURE_CONNECTION_PAIRED | BDIF_DEBUGKEY | BDIF_LE_DEBUGKEY)
527
528#endif /* NTDDI_WIN10_19H1 */
529
530#else
531
532#define BDIF_VALID_FLAGS (BDIF_ADDRESS | BDIF_COD | BDIF_NAME | BDIF_PAIRED | BDIF_PERSONAL | BDIF_CONNECTED | BDIF_SHORT_NAME | BDIF_VISIBLE | BDIF_RSSI | BDIF_EIR | BDIF_SSP_PAIRED | BDIF_SSP_MITM_PROTECTED | BDIF_BR | BDIF_LE | BDIF_LE_PAIRED | BDIF_LE_PERSONAL | BDIF_LE_MITM_PROTECTED | BDIF_LE_PRIVACY_ENABLED | BDIF_LE_RANDOM_ADDRESS_TYPE | BDIF_LE_DISCOVERABLE | BDIF_LE_NAME | BDIF_LE_VISIBLE)
533
534#endif /* NTDDI_WIN10_RS2 */
535
536#else
537
538#define BDIF_VALID_FLAGS (BDIF_ADDRESS | BDIF_COD | BDIF_NAME | BDIF_PAIRED | BDIF_PERSONAL | BDIF_CONNECTED | BDIF_SHORT_NAME | BDIF_VISIBLE | BDIF_RSSI | BDIF_EIR | BDIF_SSP_PAIRED | BDIF_SSP_MITM_PROTECTED | BDIF_BR | BDIF_LE | BDIF_LE_PAIRED | BDIF_LE_PERSONAL | BDIF_LE_MITM_PROTECTED | BDIF_LE_PRIVACY_ENABLED | BDIF_LE_RANDOM_ADDRESS_TYPE)
539
540#endif /* NTDDI_WIN10 */
541
542#else
543
544#define BDIF_VALID_FLAGS (BDIF_ADDRESS | BDIF_COD | BDIF_NAME | BDIF_PAIRED | BDIF_PERSONAL | BDIF_CONNECTED | BDIF_SHORT_NAME | BDIF_VISIBLE | BDIF_RSSI | BDIF_EIR | BDIF_SSP_PAIRED | BDIF_SSP_MITM_PROTECTED)
545
546#endif /* NTDDI_WIN8 */
547
548#else
549
550#define BDIF_VALID_FLAGS (BDIF_ADDRESS | BDIF_COD | BDIF_NAME | BDIF_PAIRED | BDIF_PERSONAL | BDIF_CONNECTED)
551
552#endif /* NTDDI_VISTASP1 */
553
554typedef struct _BTH_DEVICE_INFO {
555 ULONG flags;
556 BTH_ADDR address;
557 BTH_COD classOfDevice;
558 CHAR name[BTH_MAX_NAME_SIZE];
559} BTH_DEVICE_INFO, *PBTH_DEVICE_INFO;
560
561typedef struct _BTH_RADIO_IN_RANGE {
562 BTH_DEVICE_INFO deviceInfo;
563 ULONG previousDeviceFlags;
564} BTH_RADIO_IN_RANGE, *PBTH_RADIO_IN_RANGE;
565
566typedef struct _BTH_L2CAP_EVENT_INFO {
567 BTH_ADDR bthAddress;
568 USHORT psm;
569 UCHAR connected;
570 UCHAR initiated;
571} BTH_L2CAP_EVENT_INFO, *PBTH_L2CAP_EVENT_INFO;
572
573#define HCI_CONNNECTION_TYPE_ACL 1
574#define HCI_CONNNECTION_TYPE_SCO 2
575
576typedef struct _BTH_HCI_EVENT_INFO {
577 BTH_ADDR bthAddress;
578 UCHAR connectionType;
579 UCHAR connected;
580} BTH_HCI_EVENT_INFO, *PBTH_HCI_EVENT_INFO;
581
582typedef enum _IO_CAPABILITY {
583 IoCaps_DisplayOnly = 0x00,
584 IoCaps_DisplayYesNo = 0x01,
585 IoCaps_KeyboardOnly = 0x02,
586 IoCaps_NoInputNoOutput = 0x03,
587 IoCaps_Undefined = 0xff
588} IO_CAPABILITY;
589
590typedef enum _AUTHENTICATION_REQUIREMENTS {
591 MITMProtectionNotRequired = 0x00,
592 MITMProtectionRequired = 0x01,
593 MITMProtectionNotRequiredBonding = 0x02,
594 MITMProtectionRequiredBonding = 0x03,
595 MITMProtectionNotRequiredGeneralBonding = 0x04,
596 MITMProtectionRequiredGeneralBonding = 0x05,
597 MITMProtectionNotDefined = 0xff
598} AUTHENTICATION_REQUIREMENTS;
599
600#define IsMITMProtectionRequired(requirements) ((MITMProtectionRequired == requirements) || (MITMProtectionRequiredBonding == requirements) || (MITMProtectionRequiredGeneralBonding == requirements))
601
602#define BTH_MAX_SERVICE_NAME_SIZE 256
603#define MAX_UUIDS_IN_QUERY 12
604#define BTH_VID_DEFAULT_VALUE 0xFFFF
605
606#define SDP_ERROR_INVALID_SDP_VERSION 0x0001
607#define SDP_ERROR_INVALID_RECORD_HANDLE 0x0002
608#define SDP_ERROR_INVALID_REQUEST_SYNTAX 0x0003
609#define SDP_ERROR_INVALID_PDU_SIZE 0x0004
610#define SDP_ERROR_INVALID_CONTINUATION_STATE 0x0005
611#define SDP_ERROR_INSUFFICIENT_RESOURCES 0x0006
612
613#define SDP_ERROR_SUCCESS 0x0000
614#define SDP_ERROR_SERVER_INVALID_RESPONSE 0x0100
615#define SDP_ERROR_SERVER_RESPONSE_DID_NOT_PARSE 0x0200
616#define SDP_ERROR_SERVER_BAD_FORMAT 0x0300
617#define SDP_ERROR_COULD_NOT_SEND_CONTINUE 0x0400
618#define SDP_ERROR_RESPONSE_TOO_LARGE 0x0500
619
620#define SDP_ATTRIB_RECORD_HANDLE 0x0000
621#define SDP_ATTRIB_CLASS_ID_LIST 0x0001
622#define SDP_ATTRIB_RECORD_STATE 0x0002
623#define SDP_ATTRIB_SERVICE_ID 0x0003
624#define SDP_ATTRIB_PROTOCOL_DESCRIPTOR_LIST 0x0004
625#define SDP_ATTRIB_BROWSE_GROUP_LIST 0x0005
626#define SDP_ATTRIB_LANG_BASE_ATTRIB_ID_LIST 0x0006
627#define SDP_ATTRIB_INFO_TIME_TO_LIVE 0x0007
628#define SDP_ATTRIB_AVAILABILITY 0x0008
629#define SDP_ATTRIB_PROFILE_DESCRIPTOR_LIST 0x0009
630#define SDP_ATTRIB_DOCUMENTATION_URL 0x000A
631#define SDP_ATTRIB_CLIENT_EXECUTABLE_URL 0x000B
632#define SDP_ATTRIB_ICON_URL 0x000C
633#define SDP_ATTRIB_ADDITIONAL_PROTOCOL_DESCRIPTOR_LIST 0x000D
634
635#define SDP_ATTRIB_PROFILE_SPECIFIC 0x0200
636
637#define LANG_BASE_LANGUAGE_INDEX 0x0000
638#define LANG_BASE_ENCODING_INDEX 0x0001
639#define LANG_BASE_OFFSET_INDEX 0x0002
640#define LANG_DEFAULT_ID 0x0100
641
642#define LANGUAGE_EN_US 0x656E
643#define ENCODING_UTF_8 0x006A
644
645#define STRING_NAME_OFFSET 0x0000
646#define STRING_DESCRIPTION_OFFSET 0x0001
647#define STRING_PROVIDER_NAME_OFFSET 0x0002
648
649#define SDP_ATTRIB_SDP_VERSION_NUMBER_LIST 0x0200
650#define SDP_ATTRIB_SDP_DATABASE_STATE 0x0201
651
652#define SDP_ATTRIB_BROWSE_GROUP_ID 0x0200
653
654#define SDP_ATTRIB_CORDLESS_EXTERNAL_NETWORK 0x0301
655
656#define SDP_ATTRIB_FAX_CLASS_1_SUPPORT 0x0302
657#define SDP_ATTRIB_FAX_CLASS_2_0_SUPPORT 0x0303
658#define SDP_ATTRIB_FAX_CLASS_2_SUPPORT 0x0304
659#define SDP_ATTRIB_FAX_AUDIO_FEEDBACK_SUPPORT 0x0305
660
661#define SDP_ATTRIB_HEADSET_REMOTE_AUDIO_VOLUME_CONTROL 0x0302
662
663#define SDP_ATTRIB_LAN_LPSUBNET 0x0200
664
665#define SDP_ATTRIB_OBJECT_PUSH_SUPPORTED_FORMATS_LIST 0x0303
666#define SDP_ATTRIB_SYNCH_SUPPORTED_DATA_STORES_LIST 0x0301
667
668#define SDP_ATTRIB_SERVICE_VERSION 0x0300
669
670#define SDP_ATTRIB_PAN_NETWORK_ADDRESS 0x0306
671#define SDP_ATTRIB_PAN_WAP_GATEWAY 0x0307
672#define SDP_ATTRIB_PAN_HOME_PAGE_URL 0x0308
673#define SDP_ATTRIB_PAN_WAP_STACK_TYPE 0x0309
674#define SDP_ATTRIB_PAN_SECURITY_DESCRIPTION 0x030A
675#define SDP_ATTRIB_PAN_NET_ACCESS_TYPE 0x030B
676#define SDP_ATTRIB_PAN_MAX_NET_ACCESS_RATE 0x030C
677
678#define SDP_ATTRIB_IMAGING_SUPPORTED_CAPABILITIES 0x0310
679#define SDP_ATTRIB_IMAGING_SUPPORTED_FEATURES 0x0311
680#define SDP_ATTRIB_IMAGING_SUPPORTED_FUNCTIONS 0x0312
681#define SDP_ATTRIB_IMAGING_TOTAL_DATA_CAPACITY 0x0313
682
683#define SDP_ATTRIB_DI_SPECIFICATION_ID 0x0200
684#define SDP_ATTRIB_DI_VENDOR_ID 0x0201
685#define SDP_ATTRIB_DI_PRODUCT_ID 0x0202
686#define SDP_ATTRIB_DI_VERSION 0x0203
687#define SDP_ATTRIB_DI_PRIMARY_RECORD 0x0204
688#define SDP_ATTRIB_DI_VENDOR_ID_SOURCE 0x0205
689
690#define SDP_ATTRIB_HID_DEVICE_RELEASE_NUMBER 0x0200
691#define SDP_ATTRIB_HID_PARSER_VERSION 0x0201
692#define SDP_ATTRIB_HID_DEVICE_SUBCLASS 0x0202
693#define SDP_ATTRIB_HID_COUNTRY_CODE 0x0203
694#define SDP_ATTRIB_HID_VIRTUAL_CABLE 0x0204
695#define SDP_ATTRIB_HID_RECONNECT_INITIATE 0x0205
696#define SDP_ATTRIB_HID_DESCRIPTOR_LIST 0x0206
697#define SDP_ATTRIB_HID_LANG_ID_BASE_LIST 0x0207
698#define SDP_ATTRIB_HID_SDP_DISABLE 0x0208
699#define SDP_ATTRIB_HID_BATTERY_POWER 0x0209
700#define SDP_ATTRIB_HID_REMOTE_WAKE 0x020A
701#define SDP_ATTRIB_HID_REPORT_LIST 0x020B
702#define SDP_ATTRIB_HID_SUPERVISION_TIMEOUT 0x020C
703#define SDP_ATTRIB_HID_NORMALLY_CONNECTABLE 0x020D
704#define SDP_ATTRIB_HID_BOOT_DEVICE 0x020E
705
706#define CORDLESS_EXTERNAL_NETWORK_PSTN 0x01
707#define CORDLESS_EXTERNAL_NETWORK_ISDN 0x02
708#define CORDLESS_EXTERNAL_NETWORK_GSM 0x03
709#define CORDLESS_EXTERNAL_NETWORK_CDMA 0x04
710#define CORDLESS_EXTERNAL_NETWORK_ANALOG_CELLULAR 0x05
711#define CORDLESS_EXTERNAL_NETWORK_PACKET_SWITCHED 0x06
712#define CORDLESS_EXTERNAL_NETWORK_OTHER 0x07
713
714#define OBJECT_PUSH_FORMAT_VCARD_2_1 0x01
715#define OBJECT_PUSH_FORMAT_VCARD_3_0 0x02
716#define OBJECT_PUSH_FORMAT_VCAL_1_0 0x03
717#define OBJECT_PUSH_FORMAT_ICAL_2_0 0x04
718#define OBJECT_PUSH_FORMAT_VNOTE 0x05
719#define OBJECT_PUSH_FORMAT_VMESSAGE 0x06
720#define OBJECT_PUSH_FORMAT_ANY 0xFF
721
722#define SYNCH_DATA_STORE_PHONEBOOK 0x01
723#define SYNCH_DATA_STORE_CALENDAR 0x03
724#define SYNCH_DATA_STORE_NOTES 0x05
725#define SYNCH_DATA_STORE_MESSAGES 0x06
726
727#define DI_VENDOR_ID_SOURCE_BLUETOOTH_SIG 0x0001
728#define DI_VENDOR_ID_SOURCE_USB_IF 0x0002
729
730#define PSM_SDP 0x0001
731#define PSM_RFCOMM 0x0003
732#define PSM_TCS_BIN 0x0005
733#define PSM_TCS_BIN_CORDLESS 0x0007
734#define PSM_BNEP 0x0000
735#define PSM_HID_CONTROL 0x0011
736#define PSM_HID_INTERRUPT 0x0013
737#define PSM_AVCTP 0x0017
738#define PSM_AVDTP 0x0019
739#define PSM_UDI_C_PLANE 0x001D
740
741#define STR_ADDR_FMTA "(%02x:%02x:%02x:%02x:%02x:%02x)"
742#define STR_ADDR_FMTW L"(%02x:%02x:%02x:%02x:%02x:%02x)"
743
744#define STR_ADDR_SHORT_FMTA "%04x%08x"
745#define STR_ADDR_SHORT_FMTW L"%04x%08x"
746
747#define STR_ADDR_FMT __MINGW_NAME_AW(STR_ADDR_FMT)
748#define STR_ADDR_SHORT_FMT __MINGW_NAME_AW(STR_ADDR_SHORT_FMT)
749
750#define GET_BITS(X,Y,Z) (((X)>>(Y))&Z)
751#define GET_BIT(X,Y) GET_BITS(X,Y,0x1)
752
753#define LMP_3_SLOT_PACKETS(X) GET_BIT(X, 1)
754#define LMP_ENCRYPTION(X) GET_BIT(X, 2)
755#define LMP_SLOT_OFFSET(X) GET_BIT(X, 3)
756#define LMP_TIMING_ACCURACY(X) GET_BIT(X, 4)
757#define LMP_SWITCH(X) GET_BIT(X, 5)
758#define LMP_HOLD_MODE(X) GET_BIT(X, 6)
759#define LMP_SNIFF_MODE(X) GET_BIT(X, 7)
760#define LMP_PARK_MODE(X) GET_BIT(X, 8)
761#define LMP_RSSI(X) GET_BIT(X, 9)
762#define LMP_CHANNEL_QUALITY_DRIVEN_MODE(X) GET_BIT(X, 10)
763#define LMP_SCO_LINK(X) GET_BIT(X, 11)
764#define LMP_HV2_PACKETS(X) GET_BIT(X, 12)
765#define LMP_HV3_PACKETS(X) GET_BIT(X, 13)
766#define LMP_MU_LAW_LOG(X) GET_BIT(X, 14)
767#define LMP_A_LAW_LOG(X) GET_BIT(X, 15)
768#define LMP_CVSD(X) GET_BIT(X, 16)
769#define LMP_PAGING_SCHEME(X) GET_BIT(X, 17)
770#define LMP_POWER_CONTROL(X) GET_BIT(X, 18)
771#define LMP_TRANSPARENT_SCO_DATA(X) GET_BIT(X, 19)
772#define LMP_FLOW_CONTROL_LAG(X) GET_BITS(X, 20, 0x3)
773
774#ifdef __cplusplus
775}
776#endif
777#endif /*_INC_BTHDEF*/