winapi_ui_automation/shared/
bthdef.rs

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