1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 use shared::bthsdpdef::SDP_ERROR;
7 use shared::guiddef::GUID;
8 use shared::minwindef::{DWORD, UCHAR, ULONG, USHORT};
9 use shared::ntdef::{CHAR, ULONGLONG};
10 pub const BTH_MAJORVERSION: DWORD = 2;
11 pub const BTH_MINORVERSION: DWORD = 1;
12 DEFINE_GUID!{GUID_BTHPORT_DEVICE_INTERFACE,
13     0x850302a, 0xb344, 0x4fda, 0x9b, 0xe9, 0x90, 0x57, 0x6b, 0x8d, 0x46, 0xf0}
14 DEFINE_GUID!{GUID_BTH_RFCOMM_SERVICE_DEVICE_INTERFACE,
15     0xb142fc3e, 0xfa4e, 0x460b, 0x8a, 0xbc, 0x07, 0x2b, 0x62, 0x8b, 0x3c, 0x70}
16 DEFINE_GUID!{GUID_BLUETOOTH_RADIO_IN_RANGE,
17     0xea3b5b82, 0x26ee, 0x450e, 0xb0, 0xd8, 0xd2, 0x6f, 0xe3, 0x0a, 0x38, 0x69}
18 DEFINE_GUID!{GUID_BLUETOOTH_RADIO_OUT_OF_RANGE,
19     0xe28867c9, 0xc2aa, 0x4ced, 0xb9, 0x69, 0x45, 0x70, 0x86, 0x60, 0x37, 0xc4}
20 DEFINE_GUID!{GUID_BLUETOOTH_L2CAP_EVENT,
21     0x7eae4030, 0xb709, 0x4aa8, 0xac, 0x55, 0xe9, 0x53, 0x82, 0x9c, 0x9d, 0xaa}
22 DEFINE_GUID!{GUID_BLUETOOTH_HCI_EVENT,
23     0xfc240062, 0x1541, 0x49be, 0xb4, 0x63, 0x84, 0xc4, 0xdc, 0xd7, 0xbf, 0x7f}
24 DEFINE_GUID!{GUID_BLUETOOTH_AUTHENTICATION_REQUEST,
25     0x5DC9136D, 0x996C, 0x46DB, 0x84, 0xF5, 0x32, 0xC0, 0xA3, 0xF4, 0x73, 0x52}
26 DEFINE_GUID!{GUID_BLUETOOTH_KEYPRESS_EVENT,
27     0xD668DFCD, 0x0F4E, 0x4EFC, 0xBF, 0xE0, 0x39, 0x2E, 0xEE, 0xC5, 0x10, 0x9C}
28 DEFINE_GUID!{GUID_BLUETOOTH_HCI_VENDOR_EVENT,
29     0x547247e6, 0x45bb, 0x4c33, 0xaf, 0x8c, 0xc0, 0x0e, 0xfe, 0x15, 0xa7, 0x1d}
30 DEFINE_GUID!{Bluetooth_Base_UUID,
31     0x00000000, 0x0000, 0x1000, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB}
32 pub const SDP_PROTOCOL_UUID16: USHORT = 0x0001;
33 pub const UDP_PROTOCOL_UUID16: USHORT = 0x0002;
34 pub const RFCOMM_PROTOCOL_UUID16: USHORT = 0x0003;
35 pub const TCP_PROTOCOL_UUID16: USHORT = 0x0004;
36 pub const TCSBIN_PROTOCOL_UUID16: USHORT = 0x0005;
37 pub const TCSAT_PROTOCOL_UUID16: USHORT = 0x0006;
38 pub const ATT_PROTOCOL_UUID16: USHORT = 0x0007;
39 pub const OBEX_PROTOCOL_UUID16: USHORT = 0x0008;
40 pub const IP_PROTOCOL_UUID16: USHORT = 0x0009;
41 pub const FTP_PROTOCOL_UUID16: USHORT = 0x000A;
42 pub const HTTP_PROTOCOL_UUID16: USHORT = 0x000C;
43 pub const WSP_PROTOCOL_UUID16: USHORT = 0x000E;
44 pub const BNEP_PROTOCOL_UUID16: USHORT = 0x000F;
45 pub const UPNP_PROTOCOL_UUID16: USHORT = 0x0010;
46 pub const HID_PROTOCOL_UUID16: USHORT = 0x0011;
47 pub const HCCC_PROTOCOL_UUID16: USHORT = 0x0012;
48 pub const HCDC_PROTOCOL_UUID16: USHORT = 0x0014;
49 pub const HCN_PROTOCOL_UUID16: USHORT = 0x0016;
50 pub const AVCTP_PROTOCOL_UUID16: USHORT = 0x0017;
51 pub const AVDTP_PROTOCOL_UUID16: USHORT = 0x0019;
52 pub const CMPT_PROTOCOL_UUID16: USHORT = 0x001B;
53 pub const UDI_C_PLANE_PROTOCOL_UUID16: USHORT = 0x001D;
54 pub const L2CAP_PROTOCOL_UUID16: USHORT = 0x0100;
55 DEFINE_BLUETOOTH_UUID128!{SDP_PROTOCOL_UUID, SDP_PROTOCOL_UUID16}
56 DEFINE_BLUETOOTH_UUID128!{UDP_PROTOCOL_UUID, UDP_PROTOCOL_UUID16}
57 DEFINE_BLUETOOTH_UUID128!{RFCOMM_PROTOCOL_UUID, RFCOMM_PROTOCOL_UUID16}
58 DEFINE_BLUETOOTH_UUID128!{TCP_PROTOCOL_UUID, TCP_PROTOCOL_UUID16}
59 DEFINE_BLUETOOTH_UUID128!{TCSBIN_PROTOCOL_UUID, TCSBIN_PROTOCOL_UUID16}
60 DEFINE_BLUETOOTH_UUID128!{TCSAT_PROTOCOL_UUID, TCSAT_PROTOCOL_UUID16}
61 DEFINE_BLUETOOTH_UUID128!{ATT_PROTOCOL_UUID, ATT_PROTOCOL_UUID16}
62 DEFINE_BLUETOOTH_UUID128!{OBEX_PROTOCOL_UUID, OBEX_PROTOCOL_UUID16}
63 DEFINE_BLUETOOTH_UUID128!{IP_PROTOCOL_UUID, IP_PROTOCOL_UUID16}
64 DEFINE_BLUETOOTH_UUID128!{FTP_PROTOCOL_UUID, FTP_PROTOCOL_UUID16}
65 DEFINE_BLUETOOTH_UUID128!{HTTP_PROTOCOL_UUID, HTTP_PROTOCOL_UUID16}
66 DEFINE_BLUETOOTH_UUID128!{WSP_PROTOCOL_UUID, WSP_PROTOCOL_UUID16}
67 DEFINE_BLUETOOTH_UUID128!{BNEP_PROTOCOL_UUID, BNEP_PROTOCOL_UUID16}
68 DEFINE_BLUETOOTH_UUID128!{UPNP_PROTOCOL_UUID, UPNP_PROTOCOL_UUID16}
69 DEFINE_BLUETOOTH_UUID128!{HID_PROTOCOL_UUID, HID_PROTOCOL_UUID16}
70 DEFINE_BLUETOOTH_UUID128!{HCCC_PROTOCOL_UUID, HCCC_PROTOCOL_UUID16}
71 DEFINE_BLUETOOTH_UUID128!{HCDC_PROTOCOL_UUID, HCDC_PROTOCOL_UUID16}
72 DEFINE_BLUETOOTH_UUID128!{HCN_PROTOCOL_UUID, HCN_PROTOCOL_UUID16}
73 DEFINE_BLUETOOTH_UUID128!{AVCTP_PROTOCOL_UUID, AVCTP_PROTOCOL_UUID16}
74 DEFINE_BLUETOOTH_UUID128!{AVDTP_PROTOCOL_UUID, AVDTP_PROTOCOL_UUID16}
75 DEFINE_BLUETOOTH_UUID128!{CMPT_PROTOCOL_UUID, CMPT_PROTOCOL_UUID16}
76 DEFINE_BLUETOOTH_UUID128!{UDI_C_PLANE_PROTOCOL_UUID, UDI_C_PLANE_PROTOCOL_UUID16}
77 DEFINE_BLUETOOTH_UUID128!{L2CAP_PROTOCOL_UUID, L2CAP_PROTOCOL_UUID16}
78 pub const ServiceDiscoveryServerServiceClassID_UUID16: USHORT = 0x1000;
79 pub const BrowseGroupDescriptorServiceClassID_UUID16: USHORT = 0x1001;
80 pub const PublicBrowseGroupServiceClassID_UUID16: USHORT = 0x1002;
81 pub const SerialPortServiceClassID_UUID16: USHORT = 0x1101;
82 pub const LANAccessUsingPPPServiceClassID_UUID16: USHORT = 0x1102;
83 pub const DialupNetworkingServiceClassID_UUID16: USHORT = 0x1103;
84 pub const IrMCSyncServiceClassID_UUID16: USHORT = 0x1104;
85 pub const OBEXObjectPushServiceClassID_UUID16: USHORT = 0x1105;
86 pub const OBEXFileTransferServiceClassID_UUID16: USHORT = 0x1106;
87 pub const IrMcSyncCommandServiceClassID_UUID16: USHORT = 0x1107;
88 pub const HeadsetServiceClassID_UUID16: USHORT = 0x1108;
89 pub const CordlessTelephonyServiceClassID_UUID16: USHORT = 0x1109;
90 pub const AudioSourceServiceClassID_UUID16: USHORT = 0x110A;
91 pub const AudioSinkServiceClassID_UUID16: USHORT = 0x110B;
92 pub const AVRemoteControlTargetServiceClassID_UUID16: USHORT = 0x110C;
93 pub const AVRemoteControlServiceClassID_UUID16: USHORT = 0x110E;
94 pub const AVRemoteControlControllerServiceClass_UUID16: USHORT = 0x110F;
95 pub const IntercomServiceClassID_UUID16: USHORT = 0x1110;
96 pub const FaxServiceClassID_UUID16: USHORT = 0x1111;
97 pub const HeadsetAudioGatewayServiceClassID_UUID16: USHORT = 0x1112;
98 pub const WAPServiceClassID_UUID16: USHORT = 0x1113;
99 pub const WAPClientServiceClassID_UUID16: USHORT = 0x1114;
100 pub const PANUServiceClassID_UUID16: USHORT = 0x1115;
101 pub const NAPServiceClassID_UUID16: USHORT = 0x1116;
102 pub const GNServiceClassID_UUID16: USHORT = 0x1117;
103 pub const DirectPrintingServiceClassID_UUID16: USHORT = 0x1118;
104 pub const ReferencePrintingServiceClassID_UUID16: USHORT = 0x1119;
105 pub const ImagingResponderServiceClassID_UUID16: USHORT = 0x111B;
106 pub const ImagingAutomaticArchiveServiceClassID_UUID16: USHORT = 0x111C;
107 pub const ImagingReferenceObjectsServiceClassID_UUID16: USHORT = 0x111D;
108 pub const HandsfreeServiceClassID_UUID16: USHORT = 0x111E;
109 pub const HandsfreeAudioGatewayServiceClassID_UUID16: USHORT = 0x111F;
110 pub const DirectPrintingReferenceObjectsServiceClassID_UUID16: USHORT = 0x1120;
111 pub const ReflectsUIServiceClassID_UUID16: USHORT = 0x1121;
112 pub const PrintingStatusServiceClassID_UUID16: USHORT = 0x1123;
113 pub const HumanInterfaceDeviceServiceClassID_UUID16: USHORT = 0x1124;
114 pub const HCRPrintServiceClassID_UUID16: USHORT = 0x1126;
115 pub const HCRScanServiceClassID_UUID16: USHORT = 0x1127;
116 pub const CommonISDNAccessServiceClassID_UUID16: USHORT = 0x1128;
117 pub const VideoConferencingGWServiceClassID_UUID16: USHORT = 0x1129;
118 pub const UDIMTServiceClassID_UUID16: USHORT = 0x112A;
119 pub const UDITAServiceClassID_UUID16: USHORT = 0x112B;
120 pub const AudioVideoServiceClassID_UUID16: USHORT = 0x112C;
121 pub const SimAccessServiceClassID_UUID16: USHORT = 0x112D;
122 pub const PhonebookAccessPceServiceClassID_UUID16: USHORT = 0x112E;
123 pub const PhonebookAccessPseServiceClassID_UUID16: USHORT = 0x112F;
124 pub const HeadsetHSServiceClassID_UUID16: USHORT = 0x1131;
125 pub const MessageAccessServerServiceClassID_UUID16: USHORT = 0x1132;
126 pub const MessageNotificationServerServiceClassID_UUID16: USHORT = 0x1133;
127 pub const GNSSServerServiceClassID_UUID16: USHORT = 0x1136;
128 pub const ThreeDimensionalDisplayServiceClassID_UUID16: USHORT = 0x1137;
129 pub const ThreeDimensionalGlassesServiceClassID_UUID16: USHORT = 0x1138;
130 pub const MPSServiceClassID_UUID16: USHORT = 0x113B;
131 pub const CTNAccessServiceClassID_UUID16: USHORT = 0x113C;
132 pub const CTNNotificationServiceClassID_UUID16: USHORT = 0x113D;
133 pub const PnPInformationServiceClassID_UUID16: USHORT = 0x1200;
134 pub const GenericNetworkingServiceClassID_UUID16: USHORT = 0x1201;
135 pub const GenericFileTransferServiceClassID_UUID16: USHORT = 0x1202;
136 pub const GenericAudioServiceClassID_UUID16: USHORT = 0x1203;
137 pub const GenericTelephonyServiceClassID_UUID16: USHORT = 0x1204;
138 pub const UPnpServiceClassID_UUID16: USHORT = 0x1205;
139 pub const UPnpIpServiceClassID_UUID16: USHORT = 0x1206;
140 pub const ESdpUpnpIpPanServiceClassID_UUID16: USHORT = 0x1300;
141 pub const ESdpUpnpIpLapServiceClassID_UUID16: USHORT = 0x1301;
142 pub const ESdpUpnpL2capServiceClassID_UUID16: USHORT = 0x1302;
143 pub const VideoSourceServiceClassID_UUID16: USHORT = 0x1303;
144 pub const VideoSinkServiceClassID_UUID16: USHORT = 0x1304;
145 pub const HealthDeviceProfileSourceServiceClassID_UUID16: USHORT = 0x1401;
146 pub const HealthDeviceProfileSinkServiceClassID_UUID16: USHORT = 0x1402;
147 DEFINE_BLUETOOTH_UUID128!{ServiceDiscoveryServerServiceClassID_UUID,
148     ServiceDiscoveryServerServiceClassID_UUID16}
149 DEFINE_BLUETOOTH_UUID128!{BrowseGroupDescriptorServiceClassID_UUID,
150     BrowseGroupDescriptorServiceClassID_UUID16}
151 DEFINE_BLUETOOTH_UUID128!{PublicBrowseGroupServiceClass_UUID,
152     PublicBrowseGroupServiceClassID_UUID16}
153 DEFINE_BLUETOOTH_UUID128!{SerialPortServiceClass_UUID,
154     SerialPortServiceClassID_UUID16}
155 DEFINE_BLUETOOTH_UUID128!{LANAccessUsingPPPServiceClass_UUID,
156     LANAccessUsingPPPServiceClassID_UUID16}
157 DEFINE_BLUETOOTH_UUID128!{DialupNetworkingServiceClass_UUID,
158     DialupNetworkingServiceClassID_UUID16}
159 DEFINE_BLUETOOTH_UUID128!{IrMCSyncServiceClass_UUID,
160     IrMCSyncServiceClassID_UUID16}
161 DEFINE_BLUETOOTH_UUID128!{OBEXObjectPushServiceClass_UUID,
162     OBEXObjectPushServiceClassID_UUID16}
163 DEFINE_BLUETOOTH_UUID128!{OBEXFileTransferServiceClass_UUID,
164     OBEXFileTransferServiceClassID_UUID16}
165 DEFINE_BLUETOOTH_UUID128!{IrMCSyncCommandServiceClass_UUID,
166     IrMcSyncCommandServiceClassID_UUID16}
167 DEFINE_BLUETOOTH_UUID128!{HeadsetServiceClass_UUID,
168     HeadsetServiceClassID_UUID16}
169 DEFINE_BLUETOOTH_UUID128!{CordlessTelephonyServiceClass_UUID,
170     CordlessTelephonyServiceClassID_UUID16}
171 DEFINE_BLUETOOTH_UUID128!{AudioSourceServiceClass_UUID,
172     AudioSourceServiceClassID_UUID16}
173 DEFINE_BLUETOOTH_UUID128!{AudioSinkServiceClass_UUID,
174     AudioSinkServiceClassID_UUID16}
175 DEFINE_BLUETOOTH_UUID128!{AVRemoteControlTargetServiceClass_UUID,
176     AVRemoteControlTargetServiceClassID_UUID16}
177 DEFINE_BLUETOOTH_UUID128!{AVRemoteControlServiceClass_UUID,
178     AVRemoteControlServiceClassID_UUID16}
179 DEFINE_BLUETOOTH_UUID128!{AVRemoteControlControllerServiceClass_UUID,
180     AVRemoteControlControllerServiceClass_UUID16}
181 DEFINE_BLUETOOTH_UUID128!{IntercomServiceClass_UUID,
182     IntercomServiceClassID_UUID16}
183 DEFINE_BLUETOOTH_UUID128!{FaxServiceClass_UUID,
184     FaxServiceClassID_UUID16}
185 DEFINE_BLUETOOTH_UUID128!{HeadsetAudioGatewayServiceClass_UUID,
186     HeadsetAudioGatewayServiceClassID_UUID16}
187 DEFINE_BLUETOOTH_UUID128!{WAPServiceClass_UUID,
188     WAPServiceClassID_UUID16}
189 DEFINE_BLUETOOTH_UUID128!{WAPClientServiceClass_UUID,
190     WAPClientServiceClassID_UUID16}
191 DEFINE_BLUETOOTH_UUID128!{PANUServiceClass_UUID,
192     PANUServiceClassID_UUID16}
193 DEFINE_BLUETOOTH_UUID128!{NAPServiceClass_UUID,
194     NAPServiceClassID_UUID16}
195 DEFINE_BLUETOOTH_UUID128!{GNServiceClass_UUID,
196     GNServiceClassID_UUID16}
197 DEFINE_BLUETOOTH_UUID128!{DirectPrintingServiceClass_UUID,
198     DirectPrintingServiceClassID_UUID16}
199 DEFINE_BLUETOOTH_UUID128!{ReferencePrintingServiceClass_UUID,
200     ReferencePrintingServiceClassID_UUID16}
201 DEFINE_BLUETOOTH_UUID128!{ImagingResponderServiceClass_UUID,
202     ImagingResponderServiceClassID_UUID16}
203 DEFINE_BLUETOOTH_UUID128!{ImagingAutomaticArchiveServiceClass_UUID,
204     ImagingAutomaticArchiveServiceClassID_UUID16}
205 DEFINE_BLUETOOTH_UUID128!{ImagingReferenceObjectsServiceClass_UUID,
206     ImagingReferenceObjectsServiceClassID_UUID16}
207 DEFINE_BLUETOOTH_UUID128!{HandsfreeServiceClass_UUID,
208     HandsfreeServiceClassID_UUID16}
209 DEFINE_BLUETOOTH_UUID128!{HandsfreeAudioGatewayServiceClass_UUID,
210     HandsfreeAudioGatewayServiceClassID_UUID16}
211 DEFINE_BLUETOOTH_UUID128!{DirectPrintingReferenceObjectsServiceClass_UUID,
212     DirectPrintingReferenceObjectsServiceClassID_UUID16}
213 DEFINE_BLUETOOTH_UUID128!{ReflectedUIServiceClass_UUID,
214     ReflectsUIServiceClassID_UUID16}
215 DEFINE_BLUETOOTH_UUID128!{PrintingStatusServiceClass_UUID,
216     PrintingStatusServiceClassID_UUID16}
217 DEFINE_BLUETOOTH_UUID128!{HumanInterfaceDeviceServiceClass_UUID,
218     HumanInterfaceDeviceServiceClassID_UUID16}
219 DEFINE_BLUETOOTH_UUID128!{HCRPrintServiceClass_UUID,
220     HCRPrintServiceClassID_UUID16}
221 DEFINE_BLUETOOTH_UUID128!{HCRScanServiceClass_UUID,
222     HCRScanServiceClassID_UUID16}
223 DEFINE_BLUETOOTH_UUID128!{CommonISDNAccessServiceClass_UUID,
224     CommonISDNAccessServiceClassID_UUID16}
225 DEFINE_BLUETOOTH_UUID128!{VideoConferencingGWServiceClass_UUID,
226     VideoConferencingGWServiceClassID_UUID16}
227 DEFINE_BLUETOOTH_UUID128!{UDIMTServiceClass_UUID,
228     UDIMTServiceClassID_UUID16}
229 DEFINE_BLUETOOTH_UUID128!{UDITAServiceClass_UUID,
230     UDITAServiceClassID_UUID16}
231 DEFINE_BLUETOOTH_UUID128!{AudioVideoServiceClass_UUID,
232     AudioVideoServiceClassID_UUID16}
233 DEFINE_BLUETOOTH_UUID128!{SimAccessServiceClass_UUID,
234     SimAccessServiceClassID_UUID16}
235 DEFINE_BLUETOOTH_UUID128!{PhonebookAccessPceServiceClass_UUID,
236     PhonebookAccessPceServiceClassID_UUID16}
237 DEFINE_BLUETOOTH_UUID128!{PhonebookAccessPseServiceClass_UUID,
238     PhonebookAccessPseServiceClassID_UUID16}
239 DEFINE_BLUETOOTH_UUID128!{HeadsetHSServiceClass_UUID,
240     HeadsetHSServiceClassID_UUID16}
241 DEFINE_BLUETOOTH_UUID128!{MessageAccessServerServiceClass_UUID,
242     MessageAccessServerServiceClassID_UUID16}
243 DEFINE_BLUETOOTH_UUID128!{MessageNotificationServerServiceClass_UUID,
244     MessageNotificationServerServiceClassID_UUID16}
245 DEFINE_BLUETOOTH_UUID128!{GNSSServerServiceClass_UUID,
246     GNSSServerServiceClassID_UUID16}
247 DEFINE_BLUETOOTH_UUID128!{ThreeDimensionalDisplayServiceClass_UUID,
248     ThreeDimensionalDisplayServiceClassID_UUID16}
249 DEFINE_BLUETOOTH_UUID128!{ThreeDimensionalGlassesServiceClass_UUID,
250     ThreeDimensionalGlassesServiceClassID_UUID16}
251 DEFINE_BLUETOOTH_UUID128!{MPSServiceClass_UUID,
252     MPSServiceClassID_UUID16}
253 DEFINE_BLUETOOTH_UUID128!{CTNAccessServiceClass_UUID,
254     CTNAccessServiceClassID_UUID16}
255 DEFINE_BLUETOOTH_UUID128!{CTNNotificationServiceClass_UUID,
256     CTNNotificationServiceClassID_UUID16}
257 DEFINE_BLUETOOTH_UUID128!{PnPInformationServiceClass_UUID,
258     PnPInformationServiceClassID_UUID16}
259 DEFINE_BLUETOOTH_UUID128!{GenericNetworkingServiceClass_UUID,
260     GenericNetworkingServiceClassID_UUID16}
261 DEFINE_BLUETOOTH_UUID128!{GenericFileTransferServiceClass_UUID,
262     GenericFileTransferServiceClassID_UUID16}
263 DEFINE_BLUETOOTH_UUID128!{GenericAudioServiceClass_UUID,
264     GenericAudioServiceClassID_UUID16}
265 DEFINE_BLUETOOTH_UUID128!{GenericTelephonyServiceClass_UUID,
266     GenericTelephonyServiceClassID_UUID16}
267 DEFINE_BLUETOOTH_UUID128!{UPnpServiceClass_UUID,
268     UPnpServiceClassID_UUID16}
269 DEFINE_BLUETOOTH_UUID128!{UPnpIpServiceClass_UUID,
270     UPnpIpServiceClassID_UUID16}
271 DEFINE_BLUETOOTH_UUID128!{ESdpUpnpIpPanServiceClass_UUID,
272     ESdpUpnpIpPanServiceClassID_UUID16}
273 DEFINE_BLUETOOTH_UUID128!{ESdpUpnpIpLapServiceClass_UUID,
274     ESdpUpnpIpLapServiceClassID_UUID16}
275 DEFINE_BLUETOOTH_UUID128!{ESdpUpnpL2capServiceClass_UUID,
276     ESdpUpnpL2capServiceClassID_UUID16}
277 DEFINE_BLUETOOTH_UUID128!{VideoSourceServiceClass_UUID,
278     VideoSourceServiceClassID_UUID16}
279 DEFINE_BLUETOOTH_UUID128!{VideoSinkServiceClass_UUID,
280     VideoSinkServiceClassID_UUID16}
281 DEFINE_BLUETOOTH_UUID128!{HealthDeviceProfileSourceServiceClass_UUID,
282     HealthDeviceProfileSourceServiceClassID_UUID16}
283 DEFINE_BLUETOOTH_UUID128!{HealthDeviceProfileSinkServiceClass_UUID,
284     HealthDeviceProfileSinkServiceClassID_UUID16}
285 pub const AdvancedAudioDistributionProfileID_UUID16: USHORT = 0x110D;
286 pub const ImagingServiceProfileID_UUID16: USHORT = 0x111A;
287 pub const BasicPrintingProfileID_UUID16: USHORT = 0x1122;
288 pub const HardcopyCableReplacementProfileID_UUID16: USHORT = 0x1125;
289 pub const PhonebookAccessProfileID_UUID16: USHORT = 0x1130;
290 pub const MessageAccessProfileID_UUID16: USHORT = 0x1134;
291 pub const GNSSProfileID_UUID16: USHORT = 0x1135;
292 pub const ThreeDimensionalSynchronizationProfileID_UUID16: USHORT = 0x1139;
293 pub const MPSProfileID_UUID16: USHORT = 0x113A;
294 pub const CTNProfileID_UUID16: USHORT = 0x113E;
295 pub const VideoDistributionProfileID_UUID16: USHORT = 0x1305;
296 pub const HealthDeviceProfileID_UUID16: USHORT = 0x1400;
297 DEFINE_BLUETOOTH_UUID128!{AdvancedAudioDistributionProfile_UUID,
298     AdvancedAudioDistributionProfileID_UUID16}
299 DEFINE_BLUETOOTH_UUID128!{ImagingServiceProfile_UUID,
300     ImagingServiceProfileID_UUID16}
301 DEFINE_BLUETOOTH_UUID128!{BasicPrintingProfile_UUID,
302     BasicPrintingProfileID_UUID16}
303 DEFINE_BLUETOOTH_UUID128!{HardcopyCableReplacementProfile_UUID,
304     HardcopyCableReplacementProfileID_UUID16}
305 DEFINE_BLUETOOTH_UUID128!{PhonebookAccessProfile_UUID,
306     PhonebookAccessProfileID_UUID16}
307 DEFINE_BLUETOOTH_UUID128!{MessageAccessProfile_UUID,
308     MessageAccessProfileID_UUID16}
309 DEFINE_BLUETOOTH_UUID128!{GNSSProfile_UUID,
310     GNSSProfileID_UUID16}
311 DEFINE_BLUETOOTH_UUID128!{ThreeDimensionalSynchronizationProfile_UUID,
312     ThreeDimensionalSynchronizationProfileID_UUID16}
313 DEFINE_BLUETOOTH_UUID128!{MPSProfile_UUID,
314     MPSProfileID_UUID16}
315 DEFINE_BLUETOOTH_UUID128!{CTNProfile_UUID,
316     CTNProfileID_UUID16}
317 DEFINE_BLUETOOTH_UUID128!{VideoDistributionProfile_UUID,
318     VideoDistributionProfileID_UUID16}
319 DEFINE_BLUETOOTH_UUID128!{HealthDeviceProfile_UUID,
320     HealthDeviceProfileID_UUID16}
321 pub const VideoConferencingServiceClass_UUID: GUID = AVRemoteControlControllerServiceClass_UUID;
322 pub const VideoConferencingServiceClassID_UUID16: USHORT
323     = AVRemoteControlControllerServiceClass_UUID16;
324 pub const HN_PROTOCOL_UUID: GUID = HCN_PROTOCOL_UUID;
325 pub const BasicPringingServiceClass_UUID: GUID = BasicPrintingProfile_UUID;
326 pub const CommonISDNAccessServiceClass_UUID16: USHORT = CommonISDNAccessServiceClassID_UUID16;
327 pub const VideoConferencingGWServiceClass_UUID16: USHORT
328     = VideoConferencingGWServiceClassID_UUID16;
329 pub const UDIMTServiceClass_UUID16: USHORT = UDIMTServiceClassID_UUID16;
330 pub const UDITAServiceClass_UUID16: USHORT = UDITAServiceClassID_UUID16;
331 pub const AudioVideoServiceClass_UUID16: USHORT = AudioVideoServiceClassID_UUID16;
332 pub const CordlessServiceClassID_UUID16: USHORT = CordlessTelephonyServiceClassID_UUID16;
333 pub const AudioSinkSourceServiceClassID_UUID16: USHORT = AudioSinkServiceClassID_UUID16;
334 pub const AdvancedAudioDistributionServiceClassID_UUID16: USHORT
335     = AdvancedAudioDistributionProfileID_UUID16;
336 pub const ImagingServiceClassID_UUID16: USHORT = ImagingServiceProfileID_UUID16;
337 pub const BasicPrintingServiceClassID_UUID16: USHORT = BasicPrintingProfileID_UUID16;
338 pub const HardcopyCableReplacementServiceClassID_UUID16: USHORT
339     = HardcopyCableReplacementProfileID_UUID16;
340 pub const AdvancedAudioDistributionServiceClass_UUID: GUID = AdvancedAudioDistributionProfile_UUID;
341 pub const ImagingServiceClass_UUID: GUID = ImagingServiceProfile_UUID;
342 pub const BasicPrintingServiceClass_UUID: GUID = BasicPrintingProfile_UUID;
343 pub const HardcopyCableReplacementServiceClass_UUID: GUID = HardcopyCableReplacementProfile_UUID;
344 pub const VideoDistributionServiceClass_UUID: GUID = VideoDistributionProfile_UUID;
345 pub const BTH_MAX_NAME_SIZE: usize = 248;
346 pub const BTH_MAX_PIN_SIZE: usize = 16;
347 pub const BTH_LINK_KEY_LENGTH: usize = 16;
348 pub const BTH_MFG_ERICSSON: u16 = 0;
349 pub const BTH_MFG_NOKIA: u16 = 1;
350 pub const BTH_MFG_INTEL: u16 = 2;
351 pub const BTH_MFG_IBM: u16 = 3;
352 pub const BTH_MFG_TOSHIBA: u16 = 4;
353 pub const BTH_MFG_3COM: u16 = 5;
354 pub const BTH_MFG_MICROSOFT: u16 = 6;
355 pub const BTH_MFG_LUCENT: u16 = 7;
356 pub const BTH_MFG_MOTOROLA: u16 = 8;
357 pub const BTH_MFG_INFINEON: u16 = 9;
358 pub const BTH_MFG_CSR: u16 = 10;
359 pub const BTH_MFG_SILICONWAVE: u16 = 11;
360 pub const BTH_MFG_DIGIANSWER: u16 = 12;
361 pub const BTH_MFG_TI: u16 = 13;
362 pub const BTH_MFG_PARTHUS: u16 = 14;
363 pub const BTH_MFG_BROADCOM: u16 = 15;
364 pub const BTH_MFG_MITEL: u16 = 16;
365 pub const BTH_MFG_WIDCOMM: u16 = 17;
366 pub const BTH_MFG_ZEEVO: u16 = 18;
367 pub const BTH_MFG_ATMEL: u16 = 19;
368 pub const BTH_MFG_MITSIBUSHI: u16 = 20;
369 pub const BTH_MFG_RTX_TELECOM: u16 = 21;
370 pub const BTH_MFG_KC_TECHNOLOGY: u16 = 22;
371 pub const BTH_MFG_NEWLOGIC: u16 = 23;
372 pub const BTH_MFG_TRANSILICA: u16 = 24;
373 pub const BTH_MFG_ROHDE_SCHWARZ: u16 = 25;
374 pub const BTH_MFG_TTPCOM: u16 = 26;
375 pub const BTH_MFG_SIGNIA: u16 = 27;
376 pub const BTH_MFG_CONEXANT: u16 = 28;
377 pub const BTH_MFG_QUALCOMM: u16 = 29;
378 pub const BTH_MFG_INVENTEL: u16 = 30;
379 pub const BTH_MFG_AVM_BERLIN: u16 = 31;
380 pub const BTH_MFG_BANDSPEED: u16 = 32;
381 pub const BTH_MFG_MANSELLA: u16 = 33;
382 pub const BTH_MFG_NEC: u16 = 34;
383 pub const BTH_MFG_WAVEPLUS_TECHNOLOGY_CO: u16 = 35;
384 pub const BTH_MFG_ALCATEL: u16 = 36;
385 pub const BTH_MFG_PHILIPS_SEMICONDUCTOR: u16 = 37;
386 pub const BTH_MFG_C_TECHNOLOGIES: u16 = 38;
387 pub const BTH_MFG_OPEN_INTERFACE: u16 = 39;
388 pub const BTH_MFG_RF_MICRO_DEVICES: u16 = 40;
389 pub const BTH_MFG_HITACHI: u16 = 41;
390 pub const BTH_MFG_SYMBOL_TECHNOLOGIES: u16 = 42;
391 pub const BTH_MFG_TENOVIS: u16 = 43;
392 pub const BTH_MFG_MACRONIX_INTERNATIONAL: u16 = 44;
393 pub const BTH_MFG_APPLE: u16 = 76;
394 pub const BTH_MFG_NORDIC_SEMICONDUCTORS_ASA: u16 = 89;
395 pub const BTH_MFG_ARUBA_NETWORKS: u16 = 283;
396 pub const BTH_MFG_INTERNAL_USE: u16 = 65535;
397 pub type BTH_ADDR = ULONGLONG;
398 pub type PBTH_ADDR = *mut ULONGLONG;
399 pub type BTH_COD = ULONG;
400 pub type PBTH_COD = *mut ULONG;
401 pub type BTH_LAP = ULONG;
402 pub type PBTH_LAP = *mut ULONG;
403 pub const BTH_ADDR_NULL: BTH_ADDR = 0x0000000000000000;
404 pub const NAP_MASK: u64 = 0xFFFF00000000;
405 pub const SAP_MASK: u64 = 0x0000FFFFFFFF;
406 pub const NAP_BIT_OFFSET: u8 = 8 * 4;
407 pub const SAP_BIT_OFFSET: u8 = 0;
408 #[inline]
GET_NAP(addr: BTH_ADDR) -> u16409 pub fn GET_NAP(addr: BTH_ADDR) -> u16 {
410     ((addr & NAP_MASK) >> NAP_BIT_OFFSET) as u16
411 }
412 #[inline]
GET_SAP(addr: BTH_ADDR) -> u32413 pub fn GET_SAP(addr: BTH_ADDR) -> u32 {
414     ((addr & SAP_MASK) >> SAP_BIT_OFFSET) as u32
415 }
416 #[inline]
SET_NAP(nap: u16) -> BTH_ADDR417 pub fn SET_NAP(nap: u16) -> BTH_ADDR {
418     (nap as u64) << NAP_BIT_OFFSET
419 }
420 #[inline]
SET_SAP(sap: u32) -> BTH_ADDR421 pub fn SET_SAP(sap: u32) -> BTH_ADDR {
422     (sap as u64) << SAP_BIT_OFFSET
423 }
424 #[inline]
SET_NAP_SAP(nap: u16, sap: u32) -> BTH_ADDR425 pub fn SET_NAP_SAP(nap: u16, sap: u32) -> BTH_ADDR {
426     SET_NAP(nap) | SET_SAP(sap)
427 }
428 pub const COD_FORMAT_BIT_OFFSET: u8 = 0;
429 pub const COD_MINOR_BIT_OFFSET: u8 = 2;
430 pub const COD_MAJOR_BIT_OFFSET: u8 = 8 * 1;
431 pub const COD_SERVICE_BIT_OFFSET: u8 = 8 * 1 + 5;
432 pub const COD_FORMAT_MASK: u32 = 0x000003;
433 pub const COD_MINOR_MASK: u32 = 0x0000FC;
434 pub const COD_MAJOR_MASK: u32 = 0x001F00;
435 pub const COD_SERVICE_MASK: u32 = 0xFFE000;
436 #[inline]
GET_COD_FORMAT(cod: BTH_COD) -> u8437 pub fn GET_COD_FORMAT(cod: BTH_COD) -> u8 {
438     ((cod & COD_FORMAT_MASK) >> COD_FORMAT_BIT_OFFSET) as u8
439 }
440 #[inline]
GET_COD_MINOR(cod: BTH_COD) -> u8441 pub fn GET_COD_MINOR(cod: BTH_COD) -> u8 {
442     ((cod & COD_MINOR_MASK) >> COD_MINOR_BIT_OFFSET) as u8
443 }
444 #[inline]
GET_COD_MAJOR(cod: BTH_COD) -> u8445 pub fn GET_COD_MAJOR(cod: BTH_COD) -> u8 {
446     ((cod & COD_MAJOR_MASK) >> COD_MAJOR_BIT_OFFSET) as u8
447 }
448 #[inline]
GET_COD_SERVICE(cod: BTH_COD) -> u16449 pub fn GET_COD_SERVICE(cod: BTH_COD) -> u16 {
450     ((cod & COD_SERVICE_MASK) >> COD_SERVICE_BIT_OFFSET) as u16
451 }
452 #[inline]
SET_COD_MINOR(cod: BTH_COD, minor: u8) -> BTH_COD453 pub fn SET_COD_MINOR(cod: BTH_COD, minor: u8) -> BTH_COD {
454     (cod & !COD_MINOR_MASK) | ((minor as u32) << COD_MINOR_BIT_OFFSET)
455 }
456 #[inline]
SET_COD_MAJOR(cod: BTH_COD, major: u8) -> BTH_COD457 pub fn SET_COD_MAJOR(cod: BTH_COD, major: u8) -> BTH_COD {
458     (cod & !COD_MAJOR_MASK) | ((major as u32) << COD_MAJOR_BIT_OFFSET)
459 }
460 #[inline]
SET_COD_SERVICE(cod: BTH_COD, service: u16) -> BTH_COD461 pub fn SET_COD_SERVICE(cod: BTH_COD, service: u16) -> BTH_COD {
462     (cod & !COD_SERVICE_MASK) | ((service as u32) << COD_SERVICE_BIT_OFFSET)
463 }
464 pub const COD_VERSION: u32 = 0x0;
465 pub const COD_SERVICE_LIMITED: u16 = 0x0001;
466 pub const COD_SERVICE_POSITIONING: u16 = 0x0008;
467 pub const COD_SERVICE_NETWORKING: u16 = 0x0010;
468 pub const COD_SERVICE_RENDERING: u16 = 0x0020;
469 pub const COD_SERVICE_CAPTURING: u16 = 0x0040;
470 pub const COD_SERVICE_OBJECT_XFER: u16 = 0x0080;
471 pub const COD_SERVICE_AUDIO: u16 = 0x0100;
472 pub const COD_SERVICE_TELEPHONY: u16 = 0x0200;
473 pub const COD_SERVICE_INFORMATION: u16 = 0x0400;
474 pub const COD_SERVICE_VALID_MASK: u16 = COD_SERVICE_LIMITED | COD_SERVICE_POSITIONING
475     | COD_SERVICE_NETWORKING | COD_SERVICE_RENDERING | COD_SERVICE_CAPTURING
476     | COD_SERVICE_OBJECT_XFER | COD_SERVICE_AUDIO | COD_SERVICE_TELEPHONY
477     | COD_SERVICE_INFORMATION;
478 pub const COD_SERVICE_MAX_COUNT: usize = 9;
479 pub const COD_MAJOR_MISCELLANEOUS: u8 = 0x00;
480 pub const COD_MAJOR_COMPUTER: u8 = 0x01;
481 pub const COD_MAJOR_PHONE: u8 = 0x02;
482 pub const COD_MAJOR_LAN_ACCESS: u8 = 0x03;
483 pub const COD_MAJOR_AUDIO: u8 = 0x04;
484 pub const COD_MAJOR_PERIPHERAL: u8 = 0x05;
485 pub const COD_MAJOR_IMAGING: u8 = 0x06;
486 pub const COD_MAJOR_WEARABLE: u8 = 0x07;
487 pub const COD_MAJOR_TOY: u8 = 0x08;
488 pub const COD_MAJOR_HEALTH: u8 = 0x09;
489 pub const COD_MAJOR_UNCLASSIFIED: u8 = 0x1F;
490 pub const COD_COMPUTER_MINOR_UNCLASSIFIED: u8 = 0x00;
491 pub const COD_COMPUTER_MINOR_DESKTOP: u8 = 0x01;
492 pub const COD_COMPUTER_MINOR_SERVER: u8 = 0x02;
493 pub const COD_COMPUTER_MINOR_LAPTOP: u8 = 0x03;
494 pub const COD_COMPUTER_MINOR_HANDHELD: u8 = 0x04;
495 pub const COD_COMPUTER_MINOR_PALM: u8 = 0x05;
496 pub const COD_COMPUTER_MINOR_WEARABLE: u8 = 0x06;
497 pub const COD_PHONE_MINOR_UNCLASSIFIED: u8 = 0x00;
498 pub const COD_PHONE_MINOR_CELLULAR: u8 = 0x01;
499 pub const COD_PHONE_MINOR_CORDLESS: u8 = 0x02;
500 pub const COD_PHONE_MINOR_SMART: u8 = 0x03;
501 pub const COD_PHONE_MINOR_WIRED_MODEM: u8 = 0x04;
502 pub const COD_AUDIO_MINOR_UNCLASSIFIED: u8 = 0x00;
503 pub const COD_AUDIO_MINOR_HEADSET: u8 = 0x01;
504 pub const COD_AUDIO_MINOR_HANDS_FREE: u8 = 0x02;
505 pub const COD_AUDIO_MINOR_HEADSET_HANDS_FREE: u8 = 0x03;
506 pub const COD_AUDIO_MINOR_MICROPHONE: u8 = 0x04;
507 pub const COD_AUDIO_MINOR_LOUDSPEAKER: u8 = 0x05;
508 pub const COD_AUDIO_MINOR_HEADPHONES: u8 = 0x06;
509 pub const COD_AUDIO_MINOR_PORTABLE_AUDIO: u8 = 0x07;
510 pub const COD_AUDIO_MINOR_CAR_AUDIO: u8 = 0x08;
511 pub const COD_AUDIO_MINOR_SET_TOP_BOX: u8 = 0x09;
512 pub const COD_AUDIO_MINOR_HIFI_AUDIO: u8 = 0x0A;
513 pub const COD_AUDIO_MINOR_VCR: u8 = 0x0B;
514 pub const COD_AUDIO_MINOR_VIDEO_CAMERA: u8 = 0x0C;
515 pub const COD_AUDIO_MINOR_CAMCORDER: u8 = 0x0D;
516 pub const COD_AUDIO_MINOR_VIDEO_MONITOR: u8 = 0x0E;
517 pub const COD_AUDIO_MINOR_VIDEO_DISPLAY_LOUDSPEAKER: u8 = 0x0F;
518 pub const COD_AUDIO_MINOR_VIDEO_DISPLAY_CONFERENCING: u8 = 0x10;
519 pub const COD_AUDIO_MINOR_GAMING_TOY: u8 = 0x12;
520 pub const COD_PERIPHERAL_MINOR_KEYBOARD_MASK: u8 = 0x10;
521 pub const COD_PERIPHERAL_MINOR_POINTER_MASK: u8 = 0x20;
522 pub const COD_PERIPHERAL_MINOR_NO_CATEGORY: u8 = 0x00;
523 pub const COD_PERIPHERAL_MINOR_JOYSTICK: u8 = 0x01;
524 pub const COD_PERIPHERAL_MINOR_GAMEPAD: u8 = 0x02;
525 pub const COD_PERIPHERAL_MINOR_REMOTE_CONTROL: u8 = 0x03;
526 pub const COD_PERIPHERAL_MINOR_SENSING: u8 = 0x04;
527 pub const COD_IMAGING_MINOR_DISPLAY_MASK: u8 = 0x04;
528 pub const COD_IMAGING_MINOR_CAMERA_MASK: u8 = 0x08;
529 pub const COD_IMAGING_MINOR_SCANNER_MASK: u8 = 0x10;
530 pub const COD_IMAGING_MINOR_PRINTER_MASK: u8 = 0x20;
531 pub const COD_WEARABLE_MINOR_WRIST_WATCH: u8 = 0x01;
532 pub const COD_WEARABLE_MINOR_PAGER: u8 = 0x02;
533 pub const COD_WEARABLE_MINOR_JACKET: u8 = 0x03;
534 pub const COD_WEARABLE_MINOR_HELMET: u8 = 0x04;
535 pub const COD_WEARABLE_MINOR_GLASSES: u8 = 0x05;
536 pub const COD_TOY_MINOR_ROBOT: u8 = 0x01;
537 pub const COD_TOY_MINOR_VEHICLE: u8 = 0x02;
538 pub const COD_TOY_MINOR_DOLL_ACTION_FIGURE: u8 = 0x03;
539 pub const COD_TOY_MINOR_CONTROLLER: u8 = 0x04;
540 pub const COD_TOY_MINOR_GAME: u8 = 0x05;
541 pub const COD_HEALTH_MINOR_BLOOD_PRESSURE_MONITOR: u8 = 0x01;
542 pub const COD_HEALTH_MINOR_THERMOMETER: u8 = 0x02;
543 pub const COD_HEALTH_MINOR_WEIGHING_SCALE: u8 = 0x03;
544 pub const COD_HEALTH_MINOR_GLUCOSE_METER: u8 = 0x04;
545 pub const COD_HEALTH_MINOR_PULSE_OXIMETER: u8 = 0x05;
546 pub const COD_HEALTH_MINOR_HEART_PULSE_MONITOR: u8 = 0x06;
547 pub const COD_HEALTH_MINOR_HEALTH_DATA_DISPLAY: u8 = 0x07;
548 pub const COD_HEALTH_MINOR_STEP_COUNTER: u8 = 0x08;
549 pub const COD_LAN_ACCESS_BIT_OFFSET: u8 = 5;
550 pub const COD_LAN_MINOR_MASK: u32 = 0x00001C;
551 pub const COD_LAN_ACCESS_MASK: u32 = 0x0000E0;
552 #[inline]
GET_COD_LAN_MINOR(cod: BTH_COD) -> u8553 pub fn GET_COD_LAN_MINOR(cod: BTH_COD) -> u8 {
554     ((cod & COD_LAN_MINOR_MASK) >> COD_MINOR_BIT_OFFSET) as u8
555 }
556 #[inline]
GET_COD_LAN_ACCESS(cod: BTH_COD) -> u8557 pub fn GET_COD_LAN_ACCESS(cod: BTH_COD) -> u8 {
558     ((cod & COD_LAN_ACCESS_MASK) >> COD_LAN_ACCESS_BIT_OFFSET) as u8
559 }
560 pub const COD_LAN_MINOR_UNCLASSIFIED: u8 = 0x00;
561 pub const COD_LAN_ACCESS_0_USED: u8 = 0x00;
562 pub const COD_LAN_ACCESS_17_USED: u8 = 0x01;
563 pub const COD_LAN_ACCESS_33_USED: u8 = 0x02;
564 pub const COD_LAN_ACCESS_50_USED: u8 = 0x03;
565 pub const COD_LAN_ACCESS_67_USED: u8 = 0x04;
566 pub const COD_LAN_ACCESS_83_USED: u8 = 0x05;
567 pub const COD_LAN_ACCESS_99_USED: u8 = 0x06;
568 pub const COD_LAN_ACCESS_FULL: u8 = 0x07;
569 pub const BTH_EIR_FLAGS_ID: u8 = 0x01;
570 pub const BTH_EIR_16_UUIDS_PARTIAL_ID: u8 = 0x02;
571 pub const BTH_EIR_16_UUIDS_COMPLETE_ID: u8 = 0x03;
572 pub const BTH_EIR_32_UUIDS_PARTIAL_ID: u8 = 0x04;
573 pub const BTH_EIR_32_UUIDS_COMPLETE_ID: u8 = 0x05;
574 pub const BTH_EIR_128_UUIDS_PARTIAL_ID: u8 = 0x06;
575 pub const BTH_EIR_128_UUIDS_COMPLETE_ID: u8 = 0x07;
576 pub const BTH_EIR_LOCAL_NAME_PARTIAL_ID: u8 = 0x08;
577 pub const BTH_EIR_LOCAL_NAME_COMPLETE_ID: u8 = 0x09;
578 pub const BTH_EIR_TX_POWER_LEVEL_ID: u8 = 0x0A;
579 pub const BTH_EIR_OOB_OPT_DATA_LEN_ID: u8 = 0x0B;
580 pub const BTH_EIR_OOB_BD_ADDR_ID: u8 = 0x0C;
581 pub const BTH_EIR_OOB_COD_ID: u8 = 0x0D;
582 pub const BTH_EIR_OOB_SP_HASH_ID: u8 = 0x0E;
583 pub const BTH_EIR_OOB_SP_RANDOMIZER_ID: u8 = 0x0F;
584 pub const BTH_EIR_MANUFACTURER_ID: u8 = 0xFF;
585 pub const BTH_EIR_SIZE: usize = 240;
586 // #define LAP_GIAC_INIT { 0x33, 0x8B, 0x9E }
587 // #define LAP_LIAC_INIT { 0x00, 0x8B, 0x9E }
588 pub const LAP_GIAC_VALUE: BTH_LAP = 0x009E8B33;
589 pub const LAP_LIAC_VALUE: BTH_LAP = 0x009E8B00;
590 pub const BTH_ADDR_IAC_FIRST: BTH_ADDR = 0x9E8B00;
591 pub const BTH_ADDR_IAC_LAST: BTH_ADDR = 0x9E8B3f;
592 pub const BTH_ADDR_LIAC: BTH_ADDR = 0x9E8B00;
593 pub const BTH_ADDR_GIAC: BTH_ADDR = 0x9E8B33;
594 pub type BTHSTATUS = UCHAR;
595 pub type PBTHSTATUS = *mut UCHAR;
596 #[inline]
BTH_ERROR(btStatus: BTHSTATUS) -> bool597 pub fn BTH_ERROR(btStatus: BTHSTATUS) -> bool {
598     btStatus != BTH_ERROR_SUCCESS
599 }
600 #[inline]
BTH_SUCCESS(btStatus: BTHSTATUS) -> bool601 pub fn BTH_SUCCESS(btStatus: BTHSTATUS) -> bool {
602     btStatus == BTH_ERROR_SUCCESS
603 }
604 pub const BTH_ERROR_SUCCESS: BTHSTATUS = 0x00;
605 pub const BTH_ERROR_UNKNOWN_HCI_COMMAND: BTHSTATUS = 0x01;
606 pub const BTH_ERROR_NO_CONNECTION: BTHSTATUS = 0x02;
607 pub const BTH_ERROR_HARDWARE_FAILURE: BTHSTATUS = 0x03;
608 pub const BTH_ERROR_PAGE_TIMEOUT: BTHSTATUS = 0x04;
609 pub const BTH_ERROR_AUTHENTICATION_FAILURE: BTHSTATUS = 0x05;
610 pub const BTH_ERROR_KEY_MISSING: BTHSTATUS = 0x06;
611 pub const BTH_ERROR_MEMORY_FULL: BTHSTATUS = 0x07;
612 pub const BTH_ERROR_CONNECTION_TIMEOUT: BTHSTATUS = 0x08;
613 pub const BTH_ERROR_MAX_NUMBER_OF_CONNECTIONS: BTHSTATUS = 0x09;
614 pub const BTH_ERROR_MAX_NUMBER_OF_SCO_CONNECTIONS: BTHSTATUS = 0x0a;
615 pub const BTH_ERROR_ACL_CONNECTION_ALREADY_EXISTS: BTHSTATUS = 0x0b;
616 pub const BTH_ERROR_COMMAND_DISALLOWED: BTHSTATUS = 0x0c;
617 pub const BTH_ERROR_HOST_REJECTED_LIMITED_RESOURCES: BTHSTATUS = 0x0d;
618 pub const BTH_ERROR_HOST_REJECTED_SECURITY_REASONS: BTHSTATUS = 0x0e;
619 pub const BTH_ERROR_HOST_REJECTED_PERSONAL_DEVICE: BTHSTATUS = 0x0f;
620 pub const BTH_ERROR_HOST_TIMEOUT: BTHSTATUS = 0x10;
621 pub const BTH_ERROR_UNSUPPORTED_FEATURE_OR_PARAMETER: BTHSTATUS = 0x11;
622 pub const BTH_ERROR_INVALID_HCI_PARAMETER: BTHSTATUS = 0x12;
623 pub const BTH_ERROR_REMOTE_USER_ENDED_CONNECTION: BTHSTATUS = 0x13;
624 pub const BTH_ERROR_REMOTE_LOW_RESOURCES: BTHSTATUS = 0x14;
625 pub const BTH_ERROR_REMOTE_POWERING_OFF: BTHSTATUS = 0x15;
626 pub const BTH_ERROR_LOCAL_HOST_TERMINATED_CONNECTION: BTHSTATUS = 0x16;
627 pub const BTH_ERROR_REPEATED_ATTEMPTS: BTHSTATUS = 0x17;
628 pub const BTH_ERROR_PAIRING_NOT_ALLOWED: BTHSTATUS = 0x18;
629 pub const BTH_ERROR_UKNOWN_LMP_PDU: BTHSTATUS = 0x19;
630 pub const BTH_ERROR_UNSUPPORTED_REMOTE_FEATURE: BTHSTATUS = 0x1a;
631 pub const BTH_ERROR_SCO_OFFSET_REJECTED: BTHSTATUS = 0x1b;
632 pub const BTH_ERROR_SCO_INTERVAL_REJECTED: BTHSTATUS = 0x1c;
633 pub const BTH_ERROR_SCO_AIRMODE_REJECTED: BTHSTATUS = 0x1d;
634 pub const BTH_ERROR_INVALID_LMP_PARAMETERS: BTHSTATUS = 0x1e;
635 pub const BTH_ERROR_UNSPECIFIED_ERROR: BTHSTATUS = 0x1f;
636 pub const BTH_ERROR_UNSUPPORTED_LMP_PARM_VALUE: BTHSTATUS = 0x20;
637 pub const BTH_ERROR_ROLE_CHANGE_NOT_ALLOWED: BTHSTATUS = 0x21;
638 pub const BTH_ERROR_LMP_RESPONSE_TIMEOUT: BTHSTATUS = 0x22;
639 pub const BTH_ERROR_LMP_TRANSACTION_COLLISION: BTHSTATUS = 0x23;
640 pub const BTH_ERROR_LMP_PDU_NOT_ALLOWED: BTHSTATUS = 0x24;
641 pub const BTH_ERROR_ENCRYPTION_MODE_NOT_ACCEPTABLE: BTHSTATUS = 0x25;
642 pub const BTH_ERROR_UNIT_KEY_NOT_USED: BTHSTATUS = 0x26;
643 pub const BTH_ERROR_QOS_IS_NOT_SUPPORTED: BTHSTATUS = 0x27;
644 pub const BTH_ERROR_INSTANT_PASSED: BTHSTATUS = 0x28;
645 pub const BTH_ERROR_PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED: BTHSTATUS = 0x29;
646 pub const BTH_ERROR_DIFFERENT_TRANSACTION_COLLISION: BTHSTATUS = 0x2a;
647 pub const BTH_ERROR_QOS_UNACCEPTABLE_PARAMETER: BTHSTATUS = 0x2c;
648 pub const BTH_ERROR_QOS_REJECTED: BTHSTATUS = 0x2d;
649 pub const BTH_ERROR_CHANNEL_CLASSIFICATION_NOT_SUPPORTED: BTHSTATUS = 0x2e;
650 pub const BTH_ERROR_INSUFFICIENT_SECURITY: BTHSTATUS = 0x2f;
651 pub const BTH_ERROR_PARAMETER_OUT_OF_MANDATORY_RANGE: BTHSTATUS = 0x30;
652 pub const BTH_ERROR_ROLE_SWITCH_PENDING: BTHSTATUS = 0x32;
653 pub const BTH_ERROR_RESERVED_SLOT_VIOLATION: BTHSTATUS = 0x34;
654 pub const BTH_ERROR_ROLE_SWITCH_FAILED: BTHSTATUS = 0x35;
655 pub const BTH_ERROR_EXTENDED_INQUIRY_RESPONSE_TOO_LARGE: BTHSTATUS = 0x36;
656 pub const BTH_ERROR_SECURE_SIMPLE_PAIRING_NOT_SUPPORTED_BY_HOST: BTHSTATUS = 0x37;
657 pub const BTH_ERROR_HOST_BUSY_PAIRING: BTHSTATUS = 0x38;
658 pub const BTH_ERROR_CONNECTION_REJECTED_DUE_TO_NO_SUITABLE_CHANNEL_FOUND: BTHSTATUS = 0x39;
659 pub const BTH_ERROR_CONTROLLER_BUSY: BTHSTATUS = 0x3a;
660 pub const BTH_ERROR_UNACCEPTABLE_CONNECTION_INTERVAL: BTHSTATUS = 0x3b;
661 pub const BTH_ERROR_DIRECTED_ADVERTISING_TIMEOUT: BTHSTATUS = 0x3c;
662 pub const BTH_ERROR_CONNECTION_TERMINATED_DUE_TO_MIC_FAILURE: BTHSTATUS = 0x3d;
663 pub const BTH_ERROR_CONNECTION_FAILED_TO_BE_ESTABLISHED: BTHSTATUS = 0x3e;
664 pub const BTH_ERROR_MAC_CONNECTION_FAILED: BTHSTATUS = 0x3f;
665 pub const BTH_ERROR_UNSPECIFIED: BTHSTATUS = 0xFF;
666 pub const L2CAP_MIN_MTU: u16 = 48;
667 pub const L2CAP_MAX_MTU: u16 = 0xFFFF;
668 pub const L2CAP_DEFAULT_MTU: u16 = 672;
669 pub const MAX_L2CAP_PING_DATA_LENGTH: usize = 44;
670 pub const MAX_L2CAP_INFO_DATA_LENGTH: usize = 44;
671 pub const BDIF_ADDRESS: u32 = 0x00000001;
672 pub const BDIF_COD: u32 = 0x00000002;
673 pub const BDIF_NAME: u32 = 0x00000004;
674 pub const BDIF_PAIRED: u32 = 0x00000008;
675 pub const BDIF_PERSONAL: u32 = 0x00000010;
676 pub const BDIF_CONNECTED: u32 = 0x00000020;
677 pub const BDIF_SHORT_NAME: u32 = 0x00000040;
678 pub const BDIF_VISIBLE: u32 = 0x00000080;
679 pub const BDIF_SSP_SUPPORTED: u32 = 0x00000100;
680 pub const BDIF_SSP_PAIRED: u32 = 0x00000200;
681 pub const BDIF_SSP_MITM_PROTECTED: u32 = 0x00000400;
682 pub const BDIF_RSSI: u32 = 0x00001000;
683 pub const BDIF_EIR: u32 = 0x00002000;
684 pub const BDIF_BR: u32 = 0x00004000;
685 pub const BDIF_LE: u32 = 0x00008000;
686 pub const BDIF_LE_PAIRED: u32 = 0x00010000;
687 pub const BDIF_LE_PERSONAL: u32 = 0x00020000;
688 pub const BDIF_LE_MITM_PROTECTED: u32 = 0x00040000;
689 pub const BDIF_LE_PRIVACY_ENABLED: u32 = 0x00080000;
690 pub const BDIF_LE_RANDOM_ADDRESS_TYPE: u32 = 0x00100000;
691 pub const BDIF_LE_DISCOVERABLE: u32 = 0x00200000;
692 pub const BDIF_LE_NAME: u32 = 0x00400000;
693 pub const BDIF_LE_VISIBLE: u32 = 0x00800000;
694 pub const BDIF_LE_CONNECTED: u32 = 0x01000000;
695 pub const BDIF_LE_CONNECTABLE: u32 = 0x02000000;
696 pub const BDIF_CONNECTION_INBOUND: u32 = 0x04000000;
697 pub const BDIF_BR_SECURE_CONNECTION_PAIRED: u32 = 0x08000000;
698 pub const BDIF_LE_SECURE_CONNECTION_PAIRED: u32 = 0x10000000;
699 pub const BDIF_VALID_FLAGS: u32 =  BDIF_ADDRESS | BDIF_COD | BDIF_NAME | BDIF_PAIRED
700     | BDIF_PERSONAL | BDIF_CONNECTED | BDIF_SHORT_NAME | BDIF_VISIBLE | BDIF_RSSI | BDIF_EIR
701     | BDIF_SSP_PAIRED | BDIF_SSP_MITM_PROTECTED | BDIF_BR | BDIF_LE | BDIF_LE_PAIRED
702     | BDIF_LE_PERSONAL | BDIF_LE_MITM_PROTECTED | BDIF_LE_PRIVACY_ENABLED
703     | BDIF_LE_RANDOM_ADDRESS_TYPE | BDIF_LE_DISCOVERABLE | BDIF_LE_NAME | BDIF_LE_VISIBLE
704     | BDIF_LE_CONNECTED | BDIF_LE_CONNECTABLE | BDIF_CONNECTION_INBOUND
705     | BDIF_BR_SECURE_CONNECTION_PAIRED | BDIF_LE_SECURE_CONNECTION_PAIRED;
706 STRUCT!{struct BTH_DEVICE_INFO {
707     flags: ULONG,
708     address: BTH_ADDR,
709     classOfDevice: BTH_COD,
710     name: [CHAR; BTH_MAX_NAME_SIZE],
711 }}
712 pub type PBTH_DEVICE_INFO = *mut BTH_DEVICE_INFO;
713 STRUCT!{struct BTH_RADIO_IN_RANGE {
714     deviceInfo: BTH_DEVICE_INFO,
715     previousDeviceFlags: ULONG,
716 }}
717 pub type PBTH_RADIO_IN_RANGE = *mut BTH_RADIO_IN_RANGE;
718 STRUCT!{struct BTH_L2CAP_EVENT_INFO {
719     bthAddress: BTH_ADDR,
720     psm: USHORT,
721     connected: UCHAR,
722     initiated: UCHAR,
723 }}
724 pub type PBTH_L2CAP_EVENT_INFO = *mut BTH_L2CAP_EVENT_INFO;
725 pub const HCI_CONNECTION_TYPE_ACL: u8 = 1;
726 pub const HCI_CONNECTION_TYPE_SCO: u8 = 2;
727 pub const HCI_CONNECTION_TYPE_LE: u8 = 3;
728 pub const HCI_CONNNECTION_TYPE_ACL: u8 = HCI_CONNECTION_TYPE_ACL;
729 pub const HCI_CONNNECTION_TYPE_SCO: u8 = HCI_CONNECTION_TYPE_SCO;
730 STRUCT!{struct BTH_HCI_EVENT_INFO {
731     bthAddress: BTH_ADDR,
732     connectionType: UCHAR,
733     connected: UCHAR,
734 }}
735 pub type PBTH_HCI_EVENT_INFO = *mut BTH_HCI_EVENT_INFO;
736 ENUM!{enum IO_CAPABILITY {
737     IoCaps_DisplayOnly = 0x00,
738     IoCaps_DisplayYesNo = 0x01,
739     IoCaps_KeyboardOnly = 0x02,
740     IoCaps_NoInputNoOutput = 0x03,
741     IoCaps_Undefined = 0xff,
742 }}
743 ENUM!{enum AUTHENTICATION_REQUIREMENTS {
744     MITMProtectionNotRequired = 0x00,
745     MITMProtectionRequired = 0x01,
746     MITMProtectionNotRequiredBonding = 0x02,
747     MITMProtectionRequiredBonding = 0x03,
748     MITMProtectionNotRequiredGeneralBonding = 0x04,
749     MITMProtectionRequiredGeneralBonding = 0x05,
750     MITMProtectionNotDefined = 0xff,
751 }}
752 #[inline]
IsMITMProtectionRequired(requirements: AUTHENTICATION_REQUIREMENTS) -> bool753 pub fn IsMITMProtectionRequired(requirements: AUTHENTICATION_REQUIREMENTS) -> bool {
754     MITMProtectionRequired == requirements || MITMProtectionRequiredBonding == requirements
755         || MITMProtectionRequiredGeneralBonding == requirements
756 }
757 pub const BTH_MAX_SERVICE_NAME_SIZE: usize = 256;
758 pub const MAX_UUIDS_IN_QUERY: usize = 12;
759 pub const BTH_VID_DEFAULT_VALUE: u16 = 0xFFFF;
760 pub const SDP_ERROR_INVALID_SDP_VERSION: u16 = 0x0001;
761 pub const SDP_ERROR_INVALID_RECORD_HANDLE: u16 = 0x0002;
762 pub const SDP_ERROR_INVALID_REQUEST_SYNTAX: u16 = 0x0003;
763 pub const SDP_ERROR_INVALID_PDU_SIZE: u16 = 0x0004;
764 pub const SDP_ERROR_INVALID_CONTINUATION_STATE: u16 = 0x0005;
765 pub const SDP_ERROR_INSUFFICIENT_RESOURCES: u16 = 0x0006;
766 pub const SDP_ERROR_SUCCESS: SDP_ERROR = 0x0000;
767 pub const SDP_ERROR_SERVER_INVALID_RESPONSE: SDP_ERROR = 0x0100;
768 pub const SDP_ERROR_SERVER_RESPONSE_DID_NOT_PARSE: SDP_ERROR = 0x0200;
769 pub const SDP_ERROR_SERVER_BAD_FORMAT: SDP_ERROR = 0x0300;
770 pub const SDP_ERROR_COULD_NOT_SEND_CONTINUE: SDP_ERROR = 0x0400;
771 pub const SDP_ERROR_RESPONSE_TOO_LARGE: SDP_ERROR = 0x0500;
772 pub const SDP_ATTRIB_RECORD_HANDLE: u16 = 0x0000;
773 pub const SDP_ATTRIB_CLASS_ID_LIST: u16 = 0x0001;
774 pub const SDP_ATTRIB_RECORD_STATE: u16 = 0x0002;
775 pub const SDP_ATTRIB_SERVICE_ID: u16 = 0x0003;
776 pub const SDP_ATTRIB_PROTOCOL_DESCRIPTOR_LIST: u16 = 0x0004;
777 pub const SDP_ATTRIB_BROWSE_GROUP_LIST: u16 = 0x0005;
778 pub const SDP_ATTRIB_LANG_BASE_ATTRIB_ID_LIST: u16 = 0x0006;
779 pub const SDP_ATTRIB_INFO_TIME_TO_LIVE: u16 = 0x0007;
780 pub const SDP_ATTRIB_AVAILABILITY: u16 = 0x0008;
781 pub const SDP_ATTRIB_PROFILE_DESCRIPTOR_LIST: u16 = 0x0009;
782 pub const SDP_ATTRIB_DOCUMENTATION_URL: u16 = 0x000A;
783 pub const SDP_ATTRIB_CLIENT_EXECUTABLE_URL: u16 = 0x000B;
784 pub const SDP_ATTRIB_ICON_URL: u16 = 0x000C;
785 pub const SDP_ATTRIB_ADDITIONAL_PROTOCOL_DESCRIPTOR_LIST: u16 = 0x000D;
786 pub const SDP_ATTRIB_PROFILE_SPECIFIC: u16 = 0x0200;
787 pub const LANG_BASE_LANGUAGE_INDEX: u16 = 0x0000;
788 pub const LANG_BASE_ENCODING_INDEX: u16 = 0x0001;
789 pub const LANG_BASE_OFFSET_INDEX: u16 = 0x0002;
790 pub const LANG_DEFAULT_ID: u16 = 0x0100;
791 pub const LANGUAGE_EN_US: u16 = 0x656E;
792 pub const ENCODING_UTF_8: u16 = 0x006A;
793 pub const STRING_NAME_OFFSET: u16 = 0x0000;
794 pub const STRING_DESCRIPTION_OFFSET: u16 = 0x0001;
795 pub const STRING_PROVIDER_NAME_OFFSET: u16 = 0x0002;
796 pub const SDP_ATTRIB_SDP_VERSION_NUMBER_LIST: u16 = 0x0200;
797 pub const SDP_ATTRIB_SDP_DATABASE_STATE: u16 = 0x0201;
798 pub const SDP_ATTRIB_BROWSE_GROUP_ID: u16 = 0x0200;
799 pub const SDP_ATTRIB_CORDLESS_EXTERNAL_NETWORK: u16 = 0x0301;
800 pub const SDP_ATTRIB_FAX_CLASS_1_SUPPORT: u16 = 0x0302;
801 pub const SDP_ATTRIB_FAX_CLASS_2_0_SUPPORT: u16 = 0x0303;
802 pub const SDP_ATTRIB_FAX_CLASS_2_SUPPORT: u16 = 0x0304;
803 pub const SDP_ATTRIB_FAX_AUDIO_FEEDBACK_SUPPORT: u16 = 0x0305;
804 pub const SDP_ATTRIB_HEADSET_REMOTE_AUDIO_VOLUME_CONTROL: u16 = 0x0302;
805 pub const SDP_ATTRIB_LAN_LPSUBNET: u16 = 0x0200;
806 pub const SDP_ATTRIB_OBJECT_PUSH_SUPPORTED_FORMATS_LIST: u16 = 0x0303;
807 pub const SDP_ATTRIB_SYNCH_SUPPORTED_DATA_STORES_LIST: u16 = 0x0301;
808 pub const SDP_ATTRIB_SERVICE_VERSION: u16 = 0x0300;
809 pub const SDP_ATTRIB_PAN_NETWORK_ADDRESS: u16 = 0x0306;
810 pub const SDP_ATTRIB_PAN_WAP_GATEWAY: u16 = 0x0307;
811 pub const SDP_ATTRIB_PAN_HOME_PAGE_URL: u16 = 0x0308;
812 pub const SDP_ATTRIB_PAN_WAP_STACK_TYPE: u16 = 0x0309;
813 pub const SDP_ATTRIB_PAN_SECURITY_DESCRIPTION: u16 = 0x030A;
814 pub const SDP_ATTRIB_PAN_NET_ACCESS_TYPE: u16 = 0x030B;
815 pub const SDP_ATTRIB_PAN_MAX_NET_ACCESS_RATE: u16 = 0x030C;
816 pub const SDP_ATTRIB_IMAGING_SUPPORTED_CAPABILITIES: u16 = 0x0310;
817 pub const SDP_ATTRIB_IMAGING_SUPPORTED_FEATURES: u16 = 0x0311;
818 pub const SDP_ATTRIB_IMAGING_SUPPORTED_FUNCTIONS: u16 = 0x0312;
819 pub const SDP_ATTRIB_IMAGING_TOTAL_DATA_CAPACITY: u16 = 0x0313;
820 pub const SDP_ATTRIB_DI_SPECIFICATION_ID: u16 = 0x0200;
821 pub const SDP_ATTRIB_DI_VENDOR_ID: u16 = 0x0201;
822 pub const SDP_ATTRIB_DI_PRODUCT_ID: u16 = 0x0202;
823 pub const SDP_ATTRIB_DI_VERSION: u16 = 0x0203;
824 pub const SDP_ATTRIB_DI_PRIMARY_RECORD: u16 = 0x0204;
825 pub const SDP_ATTRIB_DI_VENDOR_ID_SOURCE: u16 = 0x0205;
826 pub const SDP_ATTRIB_HID_DEVICE_RELEASE_NUMBER: u16 = 0x0200;
827 pub const SDP_ATTRIB_HID_PARSER_VERSION: u16 = 0x0201;
828 pub const SDP_ATTRIB_HID_DEVICE_SUBCLASS: u16 = 0x0202;
829 pub const SDP_ATTRIB_HID_COUNTRY_CODE: u16 = 0x0203;
830 pub const SDP_ATTRIB_HID_VIRTUAL_CABLE: u16 = 0x0204;
831 pub const SDP_ATTRIB_HID_RECONNECT_INITIATE: u16 = 0x0205;
832 pub const SDP_ATTRIB_HID_DESCRIPTOR_LIST: u16 = 0x0206;
833 pub const SDP_ATTRIB_HID_LANG_ID_BASE_LIST: u16 = 0x0207;
834 pub const SDP_ATTRIB_HID_SDP_DISABLE: u16 = 0x0208;
835 pub const SDP_ATTRIB_HID_BATTERY_POWER: u16 = 0x0209;
836 pub const SDP_ATTRIB_HID_REMOTE_WAKE: u16 = 0x020A;
837 pub const SDP_ATTRIB_HID_PROFILE_VERSION: u16 = 0x020B;
838 pub const SDP_ATTRIB_HID_SUPERVISION_TIMEOUT: u16 = 0x020C;
839 pub const SDP_ATTRIB_HID_NORMALLY_CONNECTABLE: u16 = 0x020D;
840 pub const SDP_ATTRIB_HID_BOOT_DEVICE: u16 = 0x020E;
841 pub const SDP_ATTRIB_HID_SSR_HOST_MAX_LATENCY: u16 = 0x020F;
842 pub const SDP_ATTRIB_HID_SSR_HOST_MIN_TIMEOUT: u16 = 0x0210;
843 pub const CORDLESS_EXTERNAL_NETWORK_PSTN: u8 = 0x01;
844 pub const CORDLESS_EXTERNAL_NETWORK_ISDN: u8 = 0x02;
845 pub const CORDLESS_EXTERNAL_NETWORK_GSM: u8 = 0x03;
846 pub const CORDLESS_EXTERNAL_NETWORK_CDMA: u8 = 0x04;
847 pub const CORDLESS_EXTERNAL_NETWORK_ANALOG_CELLULAR: u8 = 0x05;
848 pub const CORDLESS_EXTERNAL_NETWORK_PACKET_SWITCHED: u8 = 0x06;
849 pub const CORDLESS_EXTERNAL_NETWORK_OTHER: u8 = 0x07;
850 pub const OBJECT_PUSH_FORMAT_VCARD_2_1: u8 = 0x01;
851 pub const OBJECT_PUSH_FORMAT_VCARD_3_0: u8 = 0x02;
852 pub const OBJECT_PUSH_FORMAT_VCAL_1_0: u8 = 0x03;
853 pub const OBJECT_PUSH_FORMAT_ICAL_2_0: u8 = 0x04;
854 pub const OBJECT_PUSH_FORMAT_VNOTE: u8 = 0x05;
855 pub const OBJECT_PUSH_FORMAT_VMESSAGE: u8 = 0x06;
856 pub const OBJECT_PUSH_FORMAT_ANY: u8 = 0xFF;
857 pub const SYNCH_DATA_STORE_PHONEBOOK: u8 = 0x01;
858 pub const SYNCH_DATA_STORE_CALENDAR: u8 = 0x03;
859 pub const SYNCH_DATA_STORE_NOTES: u8 = 0x05;
860 pub const SYNCH_DATA_STORE_MESSAGES: u8 = 0x06;
861 pub const DI_VENDOR_ID_SOURCE_BLUETOOTH_SIG: u16 = 0x0001;
862 pub const DI_VENDOR_ID_SOURCE_USB_IF: u16 = 0x0002;
863 pub const PSM_SDP: u16 = 0x0001;
864 pub const PSM_RFCOMM: u16 = 0x0003;
865 pub const PSM_TCS_BIN: u16 = 0x0005;
866 pub const PSM_TCS_BIN_CORDLESS: u16 = 0x0007;
867 pub const PSM_BNEP: u16 = 0x000F;
868 pub const PSM_HID_CONTROL: u16 = 0x0011;
869 pub const PSM_HID_INTERRUPT: u16 = 0x0013;
870 pub const PSM_UPNP: u16 = 0x0015;
871 pub const PSM_AVCTP: u16 = 0x0017;
872 pub const PSM_AVDTP: u16 = 0x0019;
873 pub const PSM_AVCTP_BROWSE: u16 = 0x001B;
874 pub const PSM_UDI_C_PLANE: u16 = 0x001D;
875 pub const PSM_ATT: u16 = 0x001F;
876 pub const PSM_3DSP: u16 = 0x0021;
877 pub const PSM_LE_IPSP: u16 = 0x0023;
878 pub const STR_ADDR_FMTA: &'static str = "(%02x:%02x:%02x:%02x:%02x:%02x)\0";
879 // #define STR_ADDR_FMTW L"(%02x:%02x:%02x:%02x:%02x:%02x)"
880 pub const STR_ADDR_SHORT_FMTA: &'static str = "%04x%08x\0";
881 // #define STR_ADDR_SHORT_FMTW L"%04x%08x"
882 pub const STR_USBHCI_CLASS_HARDWAREIDA: &'static str = "USB\\Class_E0&SubClass_01&Prot_01\0";
883 // #define STR_USBHCI_CLASS_HARDWAREIDW L"USB\\Class_E0&SubClass_01&Prot_01"
884 #[inline]
GET_BITS(field: u64, offset: u8, mask: u64) -> u64885 pub fn GET_BITS(field: u64, offset: u8, mask: u64) -> u64 {
886     (field >> offset) & mask
887 }
888 #[inline]
GET_BIT(field: u64, offset: u8) -> u64889 pub fn GET_BIT(field: u64, offset: u8) -> u64 {
890     GET_BITS(field, offset, 1)
891 }
892 #[inline]
LMP_3_SLOT_PACKETS(x: u64) -> u64893 pub fn LMP_3_SLOT_PACKETS(x: u64) -> u64 {
894     GET_BIT(x, 0)
895 }
896 #[inline]
LMP_5_SLOT_PACKETS(x: u64) -> u64897 pub fn LMP_5_SLOT_PACKETS(x: u64) -> u64 {
898     GET_BIT(x, 1)
899 }
900 #[inline]
LMP_ENCRYPTION(x: u64) -> u64901 pub fn LMP_ENCRYPTION(x: u64) -> u64 {
902     GET_BIT(x, 2)
903 }
904 #[inline]
LMP_SLOT_OFFSET(x: u64) -> u64905 pub fn LMP_SLOT_OFFSET(x: u64) -> u64 {
906     GET_BIT(x, 3)
907 }
908 #[inline]
LMP_TIMING_ACCURACY(x: u64) -> u64909 pub fn LMP_TIMING_ACCURACY(x: u64) -> u64 {
910     GET_BIT(x, 4)
911 }
912 #[inline]
LMP_SWITCH(x: u64) -> u64913 pub fn LMP_SWITCH(x: u64) -> u64 {
914     GET_BIT(x, 5)
915 }
916 #[inline]
LMP_HOLD_MODE(x: u64) -> u64917 pub fn LMP_HOLD_MODE(x: u64) -> u64 {
918     GET_BIT(x, 6)
919 }
920 #[inline]
LMP_SNIFF_MODE(x: u64) -> u64921 pub fn LMP_SNIFF_MODE(x: u64) -> u64 {
922     GET_BIT(x, 7)
923 }
924 #[inline]
LMP_PARK_MODE(x: u64) -> u64925 pub fn LMP_PARK_MODE(x: u64) -> u64 {
926     GET_BIT(x, 8)
927 }
928 #[inline]
LMP_RSSI(x: u64) -> u64929 pub fn LMP_RSSI(x: u64) -> u64 {
930     GET_BIT(x, 9)
931 }
932 #[inline]
LMP_CHANNEL_QUALITY_DRIVEN_MODE(x: u64) -> u64933 pub fn LMP_CHANNEL_QUALITY_DRIVEN_MODE(x: u64) -> u64 {
934     GET_BIT(x, 10)
935 }
936 #[inline]
LMP_SCO_LINK(x: u64) -> u64937 pub fn LMP_SCO_LINK(x: u64) -> u64 {
938     GET_BIT(x, 11)
939 }
940 #[inline]
LMP_HV2_PACKETS(x: u64) -> u64941 pub fn LMP_HV2_PACKETS(x: u64) -> u64 {
942     GET_BIT(x, 12)
943 }
944 #[inline]
LMP_HV3_PACKETS(x: u64) -> u64945 pub fn LMP_HV3_PACKETS(x: u64) -> u64 {
946     GET_BIT(x, 13)
947 }
948 #[inline]
LMP_MU_LAW_LOG(x: u64) -> u64949 pub fn LMP_MU_LAW_LOG(x: u64) -> u64 {
950     GET_BIT(x, 14)
951 }
952 #[inline]
LMP_A_LAW_LOG(x: u64) -> u64953 pub fn LMP_A_LAW_LOG(x: u64) -> u64 {
954     GET_BIT(x, 15)
955 }
956 #[inline]
LMP_CVSD(x: u64) -> u64957 pub fn LMP_CVSD(x: u64) -> u64 {
958     GET_BIT(x, 16)
959 }
960 #[inline]
LMP_PAGING_SCHEME(x: u64) -> u64961 pub fn LMP_PAGING_SCHEME(x: u64) -> u64 {
962     GET_BIT(x, 17)
963 }
964 #[inline]
LMP_POWER_CONTROL(x: u64) -> u64965 pub fn LMP_POWER_CONTROL(x: u64) -> u64 {
966     GET_BIT(x, 18)
967 }
968 #[inline]
LMP_TRANSPARENT_SCO_DATA(x: u64) -> u64969 pub fn LMP_TRANSPARENT_SCO_DATA(x: u64) -> u64 {
970     GET_BIT(x, 19)
971 }
972 #[inline]
LMP_FLOW_CONTROL_LAG(x: u64) -> u64973 pub fn LMP_FLOW_CONTROL_LAG(x: u64) -> u64 {
974     GET_BITS(x, 20, 0x3)
975 }
976 #[inline]
LMP_BROADCAST_ENCRYPTION(x: u64) -> u64977 pub fn LMP_BROADCAST_ENCRYPTION(x: u64) -> u64 {
978     GET_BIT(x, 23)
979 }
980 #[inline]
LMP_ENHANCED_DATA_RATE_ACL_2MBPS_MODE(x: u64) -> u64981 pub fn LMP_ENHANCED_DATA_RATE_ACL_2MBPS_MODE(x: u64) -> u64 {
982     GET_BIT(x, 25)
983 }
984 #[inline]
LMP_ENHANCED_DATA_RATE_ACL_3MBPS_MODE(x: u64) -> u64985 pub fn LMP_ENHANCED_DATA_RATE_ACL_3MBPS_MODE(x: u64) -> u64 {
986     GET_BIT(x, 26)
987 }
988 #[inline]
LMP_ENHANCED_INQUIRY_SCAN(x: u64) -> u64989 pub fn LMP_ENHANCED_INQUIRY_SCAN(x: u64) -> u64 {
990     GET_BIT(x, 27)
991 }
992 #[inline]
LMP_INTERLACED_INQUIRY_SCAN(x: u64) -> u64993 pub fn LMP_INTERLACED_INQUIRY_SCAN(x: u64) -> u64 {
994     GET_BIT(x, 28)
995 }
996 #[inline]
LMP_INTERLACED_PAGE_SCAN(x: u64) -> u64997 pub fn LMP_INTERLACED_PAGE_SCAN(x: u64) -> u64 {
998     GET_BIT(x, 29)
999 }
1000 #[inline]
LMP_RSSI_WITH_INQUIRY_RESULTS(x: u64) -> u641001 pub fn LMP_RSSI_WITH_INQUIRY_RESULTS(x: u64) -> u64 {
1002     GET_BIT(x, 30)
1003 }
1004 #[inline]
LMP_ESCO_LINK(x: u64) -> u641005 pub fn LMP_ESCO_LINK(x: u64) -> u64 {
1006     GET_BIT(x, 31)
1007 }
1008 #[inline]
LMP_EV4_PACKETS(x: u64) -> u641009 pub fn LMP_EV4_PACKETS(x: u64) -> u64 {
1010     GET_BIT(x, 32)
1011 }
1012 #[inline]
LMP_EV5_PACKETS(x: u64) -> u641013 pub fn LMP_EV5_PACKETS(x: u64) -> u64 {
1014     GET_BIT(x, 33)
1015 }
1016 #[inline]
LMP_AFH_CAPABLE_SLAVE(x: u64) -> u641017 pub fn LMP_AFH_CAPABLE_SLAVE(x: u64) -> u64 {
1018     GET_BIT(x, 35)
1019 }
1020 #[inline]
LMP_AFH_CLASSIFICATION_SLAVE(x: u64) -> u641021 pub fn LMP_AFH_CLASSIFICATION_SLAVE(x: u64) -> u64 {
1022     GET_BIT(x, 36)
1023 }
1024 #[inline]
LMP_BR_EDR_NOT_SUPPORTED(x: u64) -> u641025 pub fn LMP_BR_EDR_NOT_SUPPORTED(x: u64) -> u64 {
1026     GET_BIT(x, 37)
1027 }
1028 #[inline]
LMP_LE_SUPPORTED(x: u64) -> u641029 pub fn LMP_LE_SUPPORTED(x: u64) -> u64 {
1030     GET_BIT(x, 38)
1031 }
1032 #[inline]
LMP_3SLOT_EDR_ACL_PACKETS(x: u64) -> u641033 pub fn LMP_3SLOT_EDR_ACL_PACKETS(x: u64) -> u64 {
1034     GET_BIT(x, 39)
1035 }
1036 #[inline]
LMP_5SLOT_EDR_ACL_PACKETS(x: u64) -> u641037 pub fn LMP_5SLOT_EDR_ACL_PACKETS(x: u64) -> u64 {
1038     GET_BIT(x, 40)
1039 }
1040 #[inline]
LMP_SNIFF_SUBRATING(x: u64) -> u641041 pub fn LMP_SNIFF_SUBRATING(x: u64) -> u64 {
1042     GET_BIT(x, 41)
1043 }
1044 #[inline]
LMP_PAUSE_ENCRYPTION(x: u64) -> u641045 pub fn LMP_PAUSE_ENCRYPTION(x: u64) -> u64 {
1046     GET_BIT(x, 42)
1047 }
1048 #[inline]
LMP_AFH_CAPABLE_MASTER(x: u64) -> u641049 pub fn LMP_AFH_CAPABLE_MASTER(x: u64) -> u64 {
1050     GET_BIT(x, 43)
1051 }
1052 #[inline]
LMP_AFH_CLASSIFICATION_MASTER(x: u64) -> u641053 pub fn LMP_AFH_CLASSIFICATION_MASTER(x: u64) -> u64 {
1054     GET_BIT(x, 44)
1055 }
1056 #[inline]
LMP_EDR_ESCO_2MBPS_MODE(x: u64) -> u641057 pub fn LMP_EDR_ESCO_2MBPS_MODE(x: u64) -> u64 {
1058     GET_BIT(x, 45)
1059 }
1060 #[inline]
LMP_EDR_ESCO_3MBPS_MODE(x: u64) -> u641061 pub fn LMP_EDR_ESCO_3MBPS_MODE(x: u64) -> u64 {
1062     GET_BIT(x, 46)
1063 }
1064 #[inline]
LMP_3SLOT_EDR_ESCO_PACKETS(x: u64) -> u641065 pub fn LMP_3SLOT_EDR_ESCO_PACKETS(x: u64) -> u64 {
1066     GET_BIT(x, 47)
1067 }
1068 #[inline]
LMP_EXTENDED_INQUIRY_RESPONSE(x: u64) -> u641069 pub fn LMP_EXTENDED_INQUIRY_RESPONSE(x: u64) -> u64 {
1070     GET_BIT(x, 48)
1071 }
1072 #[inline]
LMP_SIMULT_LE_BR_TO_SAME_DEV(x: u64) -> u641073 pub fn LMP_SIMULT_LE_BR_TO_SAME_DEV(x: u64) -> u64 {
1074     GET_BIT(x, 49)
1075 }
1076 #[inline]
LMP_SECURE_SIMPLE_PAIRING(x: u64) -> u641077 pub fn LMP_SECURE_SIMPLE_PAIRING(x: u64) -> u64 {
1078     GET_BIT(x, 51)
1079 }
1080 #[inline]
LMP_ENCAPSULATED_PDU(x: u64) -> u641081 pub fn LMP_ENCAPSULATED_PDU(x: u64) -> u64 {
1082     GET_BIT(x, 52)
1083 }
1084 #[inline]
LMP_ERRONEOUS_DATA_REPORTING(x: u64) -> u641085 pub fn LMP_ERRONEOUS_DATA_REPORTING(x: u64) -> u64 {
1086     GET_BIT(x, 53)
1087 }
1088 #[inline]
LMP_NON_FLUSHABLE_PACKET_BOUNDARY_FLAG(x: u64) -> u641089 pub fn LMP_NON_FLUSHABLE_PACKET_BOUNDARY_FLAG(x: u64) -> u64 {
1090     GET_BIT(x, 54)
1091 }
1092 #[inline]
LMP_LINK_SUPERVISION_TIMEOUT_CHANGED_EVENT(x: u64) -> u641093 pub fn LMP_LINK_SUPERVISION_TIMEOUT_CHANGED_EVENT(x: u64) -> u64 {
1094     GET_BIT(x, 56)
1095 }
1096 #[inline]
LMP_INQUIRY_RESPONSE_TX_POWER_LEVEL(x: u64) -> u641097 pub fn LMP_INQUIRY_RESPONSE_TX_POWER_LEVEL(x: u64) -> u64 {
1098     GET_BIT(x, 57)
1099 }
1100 #[inline]
LMP_EXTENDED_FEATURES(x: u64) -> u641101 pub fn LMP_EXTENDED_FEATURES(x: u64) -> u64 {
1102     GET_BIT(x, 63)
1103 }
1104