libnx  v4.8.0
btdrv_types.h
Go to the documentation of this file.
1 /**
2  * @file btdrv_types.h
3  * @brief Bluetooth driver (btdrv) service types (see btdrv.h for the rest).
4  * @author yellows8, ndeadly
5  * @copyright libnx Authors
6  */
7 #pragma once
8 #include "../types.h"
9 #include "btdrv_ids.h"
10 
11 /// BluetoothPropertyType [1.0.0-11.0.1]
12 typedef enum {
13  BtdrvBluetoothPropertyType_Name = 1, ///< Name. String, max length 0xF8 excluding NUL-terminator.
14  BtdrvBluetoothPropertyType_Address = 2, ///< \ref BtdrvAddress
15  BtdrvBluetoothPropertyType_Unknown3 = 3, ///< Only available with \ref btdrvSetAdapterProperty. Unknown, \ref BtdrvAddress.
16  BtdrvBluetoothPropertyType_ClassOfDevice = 5, ///< 3-bytes, Class of Device.
17  BtdrvBluetoothPropertyType_FeatureSet = 6, ///< 1-byte, FeatureSet. The default is value 0x68.
19 
20 /// AdapterPropertyType [12.0.0+]
21 typedef enum {
22  BtdrvAdapterPropertyType_Address = 0, ///< \ref BtdrvAddress
23  BtdrvAdapterPropertyType_Name = 1, ///< Name. String, max length 0xF8 excluding NUL-terminator.
24  BtdrvAdapterPropertyType_ClassOfDevice = 2, ///< 3-bytes, Class of Device.
25  BtdrvAdapterPropertyType_Unknown3 = 3, ///< Only available with \ref btdrvSetAdapterProperty. Unknown, \ref BtdrvAddress.
27 
28 /// EventType
29 typedef enum {
30  ///< BtdrvEventType_* should be used on [12.0.0+]
31  BtdrvEventType_InquiryDevice = 0, ///< Device found during Inquiry.
32  BtdrvEventType_InquiryStatus = 1, ///< Inquiry status changed.
33  BtdrvEventType_PairingPinCodeRequest = 2, ///< Pairing PIN code request.
34  BtdrvEventType_SspRequest = 3, ///< SSP confirm request / SSP passkey notification.
35  BtdrvEventType_Connection = 4, ///< Connection
36  BtdrvEventType_Tsi = 5, ///< SetTsi (\ref btdrvSetTsi)
37  BtdrvEventType_BurstMode = 6, ///< SetBurstMode (\ref btdrvEnableBurstMode)
38  BtdrvEventType_SetZeroRetransmission = 7, ///< \ref btdrvSetZeroRetransmission
39  BtdrvEventType_PendingConnections = 8, ///< \ref btdrvGetPendingConnections
40  BtdrvEventType_MoveToSecondaryPiconet = 9, ///< \ref btdrvMoveToSecondaryPiconet
41  BtdrvEventType_BluetoothCrash = 10, ///< BluetoothCrash
42 
43  ///< BtdrvEventTypeOld_* should be used on [1.0.0-11.0.1]
44  BtdrvEventTypeOld_Unknown0 = 0, ///< Unused
45  BtdrvEventTypeOld_InquiryDevice = 3, ///< Device found during Inquiry.
46  BtdrvEventTypeOld_InquiryStatus = 4, ///< Inquiry status changed.
47  BtdrvEventTypeOld_PairingPinCodeRequest = 5, ///< Pairing PIN code request.
48  BtdrvEventTypeOld_SspRequest = 6, ///< SSP confirm request / SSP passkey notification.
49  BtdrvEventTypeOld_Connection = 7, ///< Connection
50  BtdrvEventTypeOld_BluetoothCrash = 13, ///< BluetoothCrash
52 
53 /// BtdrvInquiryStatus
54 typedef enum {
55  BtdrvInquiryStatus_Stopped = 0, ///< Inquiry stopped.
56  BtdrvInquiryStatus_Started = 1, ///< Inquiry started.
58 
59 /// ConnectionEventType
60 typedef enum {
61  BtdrvConnectionEventType_Status = 0, ///< BtdrvEventInfo::connection::status
62  BtdrvConnectionEventType_SspConfirmRequest = 1, ///< SSP confirm request.
63  BtdrvConnectionEventType_Suspended = 2, ///< ACL Link is now Suspended.
65 
66 /// ExtEventType [1.0.0-11.0.1]
67 typedef enum {
68  BtdrvExtEventType_SetTsi = 0, ///< SetTsi (\ref btdrvSetTsi)
69  BtdrvExtEventType_ExitTsi = 1, ///< ExitTsi (\ref btdrvSetTsi)
70  BtdrvExtEventType_SetBurstMode = 2, ///< SetBurstMode (\ref btdrvEnableBurstMode)
71  BtdrvExtEventType_ExitBurstMode = 3, ///< ExitBurstMode (\ref btdrvEnableBurstMode)
72  BtdrvExtEventType_SetZeroRetransmission = 4, ///< \ref btdrvSetZeroRetransmission
73  BtdrvExtEventType_PendingConnections = 5, ///< \ref btdrvGetPendingConnections
74  BtdrvExtEventType_MoveToSecondaryPiconet = 6, ///< \ref btdrvMoveToSecondaryPiconet
76 
77 /// BluetoothHhReportType
78 /// Bit0-1 directly control the HID bluetooth transaction report-type value.
79 /// Bit2-3: these directly control the Parameter Reserved field for SetReport, for GetReport these control the Parameter Reserved and Size bits.
80 typedef enum {
86 
87 /// HidEventType
88 typedef enum {
89  ///< BtdrvHidEventType_* should be used on [12.0.0+]
90  BtdrvHidEventType_Connection = 0, ///< Connection. Only used with \ref btdrvGetHidEventInfo.
91  BtdrvHidEventType_Data = 1, ///< DATA report on the Interrupt channel.
92  BtdrvHidEventType_SetReport = 2, ///< Response to SET_REPORT.
93  BtdrvHidEventType_GetReport = 3, ///< Response to GET_REPORT.
94 
95  ///< BtdrvHidEventTypeOld_* should be used on [1.0.0-11.0.1]
96  BtdrvHidEventTypeOld_Connection = 0, ///< Connection. Only used with \ref btdrvGetHidEventInfo.
97  BtdrvHidEventTypeOld_Data = 4, ///< DATA report on the Interrupt channel.
98  BtdrvHidEventTypeOld_Ext = 7, ///< Response for extensions. Only used with \ref btdrvGetHidEventInfo.
99  BtdrvHidEventTypeOld_SetReport = 8, ///< Response to SET_REPORT.
100  BtdrvHidEventTypeOld_GetReport = 9, ///< Response to GET_REPORT.
102 
103 /// HidConnectionStatus [12.0.0+]
104 typedef enum {
105  ///< BtdrvHidConnectionStatus_* should be used on [12.0.0+]
107  BtdrvHidConnectionStatus_Opened = 1,
109 
110  ///< BtdrvHidConnectionStatusOld_* should be used on [1.0.0-11.0.1]
111  BtdrvHidConnectionStatusOld_Opened = 0,
112  BtdrvHidConnectionStatusOld_Closed = 2,
113  BtdrvHidConnectionStatusOld_Failed = 8,
115 
116 /// This determines the u16 data to write into a CircularBuffer.
117 typedef enum {
118  BtdrvFatalReason_Invalid = 0, ///< Only for \ref BtdrvEventInfo: invalid.
119  BtdrvFatalReason_Unknown1 = 1, ///< Can only be triggered by \ref btdrvEmulateBluetoothCrash, not triggered by the sysmodule otherwise.
120  BtdrvFatalReason_CommandTimeout = 2, ///< HCI command timeout.
121  BtdrvFatalReason_HardwareError = 3, ///< HCI event HCI_Hardware_Error occurred.
122  BtdrvFatalReason_Enable = 7, ///< Only for \ref BtdrvEventInfo: triggered after enabling bluetooth, depending on the value of a global state field.
123  BtdrvFatalReason_Audio = 9, ///< [12.0.0+] Only for \ref BtdrvEventInfo: triggered by Audio cmds in some cases.
125 
126 /// BleEventType
127 typedef enum {
128  BtdrvBleEventType_ClientRegistration = 0, ///< GATT client registration.
129  BtdrvBleEventType_ServerRegistration = 1, ///< GATT server registration.
130  BtdrvBleEventType_ConnectionUpdate = 2, ///< Connection update.
131  BtdrvBleEventType_PreferredConnectionParameters = 3, ///< Preferred connection parameters.
132  BtdrvBleEventType_ClientConnection = 4, ///< GATT client connection.
133  BtdrvBleEventType_ServerConnection = 5, ///< GATT server connection.
134  BtdrvBleEventType_ScanResult = 6, ///< Scan result.
135  BtdrvBleEventType_ScanFilter = 7, ///< Scan filter status.
136  BtdrvBleEventType_ClientNotify = 8, ///< GATT client notify.
137  BtdrvBleEventType_ClientCacheSave = 9, ///< GATT client cache save.
138  BtdrvBleEventType_ClientCacheLoad = 10, ///< GATT client cache load.
139  BtdrvBleEventType_ClientConfigureMtu = 11, ///< GATT client configure MTU.
140  BtdrvBleEventType_ServerAddCharacteristic = 12, ///< GATT server add characteristic.
141  BtdrvBleEventType_ServerWrite = 13, ///< GATT server write.
143 
144 /// GattAttributeType
145 typedef enum {
146  BtdrvGattAttributeType_IncludedService = 0, ///< Included service
147  BtdrvGattAttributeType_Characteristic = 1, ///< Characteristic
151 
152 /// GattAttributePermission
153 typedef enum {
154  BtdrvGattAttributePermission_Read = BIT(0),
155  BtdrvGattAttributePermission_ReadEncrypted = BIT(1),
156  BtdrvGattAttributePermission_ReadEncryptedMitm = BIT(2),
157  BtdrvGattAttributePermission_Write = BIT(4),
158  BtdrvGattAttributePermission_WriteEncrypted = BIT(5),
159  BtdrvGattAttributePermission_WriteEncryptedMitm = BIT(6),
160  BtdrvGattAttributePermission_WriteSigned = BIT(7),
161  BtdrvGattAttributePermission_WriteSignedMitm = BIT(8),
162 
163  BtdrvGattAttributePermission_ReadAllowed = BtdrvGattAttributePermission_Read | BtdrvGattAttributePermission_ReadEncrypted | BtdrvGattAttributePermission_ReadEncryptedMitm,
164  BtdrvGattAttributePermission_ReadAuthRequired = BtdrvGattAttributePermission_ReadEncrypted,
165  BtdrvGattAttributePermission_ReadMitmRequired = BtdrvGattAttributePermission_ReadEncryptedMitm,
166  BtdrvGattAttributePermission_ReadEncryptedRequired = BtdrvGattAttributePermission_ReadEncrypted | BtdrvGattAttributePermission_ReadEncryptedMitm,
167 
168  BtdrvGattAttributePermission_WriteAllowed = BtdrvGattAttributePermission_Write | BtdrvGattAttributePermission_WriteEncrypted | BtdrvGattAttributePermission_WriteEncryptedMitm | BtdrvGattAttributePermission_WriteSigned | BtdrvGattAttributePermission_WriteSignedMitm,
169  BtdrvGattAttributePermission_WriteAuthRequired = BtdrvGattAttributePermission_WriteEncrypted | BtdrvGattAttributePermission_WriteSigned,
170  BtdrvGattAttributePermission_WriteMitmRequired = BtdrvGattAttributePermission_WriteEncryptedMitm | BtdrvGattAttributePermission_WriteSignedMitm,
171  BtdrvGattAttributePermission_WriteEncryptedRequired = BtdrvGattAttributePermission_WriteEncrypted | BtdrvGattAttributePermission_WriteEncryptedMitm,
172  BtdrvGattAttributePermission_WriteSignedRequired = BtdrvGattAttributePermission_WriteSigned | BtdrvGattAttributePermission_WriteSignedMitm,
174 
175 /// GattCharacteristicProperty
176 typedef enum {
177  BtdrvGattCharacteristicProperty_Broadcast = BIT(0),
178  BtdrvGattCharacteristicProperty_Read = BIT(1),
179  BtdrvGattCharacteristicProperty_WriteNoResponse = BIT(2),
180  BtdrvGattCharacteristicProperty_Write = BIT(3),
181  BtdrvGattCharacteristicProperty_Notify = BIT(4),
182  BtdrvGattCharacteristicProperty_Indicate = BIT(5),
183  BtdrvGattCharacteristicProperty_Authentication = BIT(6),
184  BtdrvGattCharacteristicProperty_ExtendedProperties = BIT(7),
186 
187 /// GattAuthReqType
188 typedef enum {
189  BtdrvGattAuthReqType_None = 0,
190  BtdrvGattAuthReqType_NoMitm = 1,
191  BtdrvGattAuthReqType_Mitm = 2,
192  BtdrvGattAuthReqType_SignedNoMitm = 3,
193  BtdrvGattAuthReqType_SignedMitm = 4,
195 
196 /// AudioEventType
197 typedef enum {
199  BtdrvAudioEventType_Connection = 1, ///< Connection
201 
202 /// AudioOutState
203 typedef enum {
204  BtdrvAudioOutState_Stopped = 0, ///< Stopped
205  BtdrvAudioOutState_Started = 1, ///< Started
207 
208 /// AudioCodec
209 typedef enum {
210  BtdrvAudioCodec_Pcm = 0, ///< Raw PCM
212 
213 /// Address
214 typedef struct {
215  u8 address[0x6]; ///< Address
216 } BtdrvAddress;
217 
218 /// ClassOfDevice
219 typedef struct {
220  u8 class_of_device[0x3]; ///< ClassOfDevice
222 
223 /// AdapterProperty [1.0.0-11.0.1]
224 typedef struct {
225  BtdrvAddress addr; ///< Same as the data for ::BtdrvBluetoothPropertyType_Address.
226  BtdrvClassOfDevice class_of_device; ///< Same as the data for ::BtdrvBluetoothPropertyType_ClassOfDevice.
227  char name[0xF9]; ///< Same as the data for ::BtdrvBluetoothPropertyType_Name (last byte is not initialized).
228  u8 feature_set; ///< Set to hard-coded value 0x68 (same as the data for ::BtdrvBluetoothPropertyType_FeatureSet).
230 
231 /// AdapterProperty [12.0.0+]
232 typedef struct {
233  u8 type; ///< \ref BtdrvAdapterPropertyType
234  u8 size; ///< Data size.
235  u8 data[0x100]; ///< Data (above size), as specified by the type.
237 
238 /// AdapterPropertySet [12.0.0+]
239 typedef struct {
240  BtdrvAddress addr; ///< Same as the data for ::BtdrvBluetoothPropertyType_Address.
241  BtdrvClassOfDevice class_of_device; ///< Same as the data for ::BtdrvBluetoothPropertyType_ClassOfDevice.
242  char name[0xF9]; ///< Same as the data for ::BtdrvBluetoothPropertyType_Name.
244 
245 /// BluetoothPinCode [1.0.0-11.0.1]
246 typedef struct {
247  char code[0x10]; ///< PinCode
249 
250 /// BtdrvPinCode [12.0.0+]
251 typedef struct {
252  char code[0x10]; ///< PinCode
253  u8 length; ///< Length
254 } BtdrvPinCode;
255 
256 /// HidData [1.0.0-8.1.1]
257 typedef struct {
258  u16 size; ///< Size of data.
259  u8 data[0x280]; ///< Data
260 } BtdrvHidData;
261 
262 /// HidReport [9.0.0+].
263 typedef struct {
264  u16 size; ///< Size of data.
265  u8 data[0x2BC]; ///< Data
267 
268 /// PlrStatistics
269 typedef struct {
270  u8 unk_x0[0x84]; ///< Unknown
272 
273 /// PlrList
274 typedef struct {
275  u8 unk_x0[0xA4]; ///< Unknown
276 } BtdrvPlrList;
277 
278 /// ChannelMapList
279 typedef struct {
280  u8 unk_x0[0x88]; ///< Unknown
282 
283 /// LeConnectionParams [5.0.0-8.1.1]
284 typedef struct {
285  BtdrvAddress addr; ///< \ref BtdrvAddress
286  u16 min_conn_interval; ///< Minimum connection interval
287  u16 max_conn_interval; ///< Maximum connection interval
288  u16 scan_interval; ///< Scan interval
289  u16 scan_window; ///< Scan window
290  u16 slave_latency; ///< Slave latency
291  u16 supervision_tout; ///< Connection supervision timeout multiplier
292  u8 preference; ///< Unused
293  u8 pad; ///< Padding
295 
296 /// BleConnectionParameter [9.0.0+]
297 typedef struct {
298  u16 min_conn_interval; ///< Minimum connection interval
299  u16 max_conn_interval; ///< Maximum connection interval
300  u16 scan_interval; ///< Scan interval
301  u16 scan_window; ///< Scan window
302  u16 slave_latency; ///< Slave latency
303  u16 supervision_tout; ///< Connection supervision timeout multiplier
305 
306 /// BtdrvBleAdvertisePacketDataEntry
307 typedef struct {
308  u16 unk_x0; ///< Unknown
309  u8 unused[0x12]; ///< Unused
311 
312 /// BleAdvertisePacketData
313 typedef struct {
314  u32 unk_x0; ///< Unknown
315  u8 unk_x4; ///< Unknown
316  u8 size0; ///< Size of the data at unk_x6.
317  u8 unk_x6[0x1F]; ///< Unknown, see size0.
318  u8 pad[3]; ///< Padding
319  u8 count; ///< Total array entries, see entries.
320  u8 pad2[7]; ///< Padding
321  BtdrvBleAdvertisePacketDataEntry entries[0x5]; ///< \ref BtdrvBleAdvertisePacketDataEntry
322  u8 pad3[0x10]; ///< Padding
323  u8 size2; ///< Size of the data at unk_xA8.
324  u8 unk_xA5; ///< Unknown
325  u8 pad4[2]; ///< Padding
326  u8 unk_xA8[0x1F]; ///< Unknown, see size2.
327  u8 unk_xC7; ///< Unknown
328  u8 unk_xC8; ///< Unknown
329  u8 pad5[3]; ///< Padding
331 
332 /// BleAdvertisement
333 typedef struct {
334  u8 size; ///< Size of data below.
335  u8 type; ///< \ref BtdrvAdType
336  u8 data[0x1D]; ///< Advertisement data
338 
339 /// BleAdvertiseFilter
340 typedef struct {
341  u8 index; ///< Filter index
342  BtdrvBleAdvertisement adv; ///< \ref BtdrvBleAdvertisement
343  u8 mask[0x1D]; ///< Mask for advertisement data above
344  u8 mask_size; ///< Size of mask above.
346 
347 /// BleAdvertisePacketParameter
348 typedef struct {
349  u16 company_id;
350  u8 pattern_data[6];
352 
353 /// BleScanResult
354 typedef struct {
355  u8 unk_x0; ///< Unknown
356  BtdrvAddress addr; ///< \ref BtdrvAddress
357  u8 unk_x7[0x139]; ///< Unknown
358  s32 count; ///< Unknown
359  s32 unk_x144; ///< Unknown
361 
362 /// BleConnectionInfo
363 typedef struct {
364  u32 connection_handle; ///< ConnectionHandle, 0xFFFFFFFF ([5.0.0-5.0.2] 0xFFFF) is invalid.
365  BtdrvAddress addr; ///< \ref BtdrvAddress
366  u8 pad[2]; ///< Padding
368 
369 /// GattAttributeUuid
370 typedef struct {
371  u32 size; ///< UUID size, must be 0x2, 0x4, or 0x10.
372  u8 uuid[0x10]; ///< UUID with the above size.
374 
375 /// GattId
376 typedef struct {
377  u8 instance_id; ///< InstanceId
378  u8 pad[3]; ///< Padding
379  BtdrvGattAttributeUuid uuid; ///< \ref BtdrvGattAttributeUuid
380 } BtdrvGattId;
381 
382 /// GattAttribute
383 typedef struct {
384  BtdrvGattId id; ///< \ref BtdrvGattId
385  u16 type; ///< \ref BtdrvGattAttributeType
386  u16 handle;
387  u16 group_end_handle;
388  u8 property; ///< Only used when type is characteristic. \ref BtdrvGattCharacteristicProperty
389  bool is_primary; ///< Only used when type is service
391 
392 /// LeEventInfo
393 typedef struct {
394  u32 unk_x0; ///< Unknown
395  u32 unk_x4; ///< Unknown
396  u8 unk_x8; ///< Unknown
397  u8 pad[3]; ///< Padding
398  BtdrvGattAttributeUuid uuid0; ///< \ref BtdrvGattAttributeUuid
399  BtdrvGattAttributeUuid uuid1; ///< \ref BtdrvGattAttributeUuid
400  BtdrvGattAttributeUuid uuid2; ///< \ref BtdrvGattAttributeUuid
401  u16 size; ///< Size of the below data.
402  u8 data[0x3B6]; ///< Data.
404 
405 /// BleClientGattOperationInfo
406 typedef struct {
407  u8 unk_x0; ///< Converted from BtdrvLeEventInfo::unk_x0.
408  u8 pad[3]; ///< Padding
409  u32 unk_x4; ///< BtdrvLeEventInfo::unk_x4
410  u8 unk_x8; ///< BtdrvLeEventInfo::unk_x8
411  u8 pad2[3]; ///< Padding
412  BtdrvGattAttributeUuid uuid0; ///< BtdrvLeEventInfo::uuid0
413  BtdrvGattAttributeUuid uuid1; ///< BtdrvLeEventInfo::uuid1
414  BtdrvGattAttributeUuid uuid2; ///< BtdrvLeEventInfo::uuid2
415  u64 size; ///< BtdrvLeEventInfo::size
416  u8 data[0x200]; ///< BtdrvLeEventInfo::data
418 
419 /// PcmParameter
420 typedef struct {
421  u32 unk_x0; ///< Must be 0-3. Controls number of channels: 0 = mono, non-zero = stereo.
422  s32 sample_rate; ///< Sample rate. Must be one of the following: 16000, 32000, 44100, 48000.
423  u32 bits_per_sample; ///< Bits per sample. Must be 8 or 16.
425 
426 /// AudioControlButtonState
427 typedef struct {
428  u8 unk_x0[0x10]; ///< Unknown
430 
Bluetooth SIG assigned number definitions (see https://www.bluetooth.com/specifications/assigned-numb...
BtdrvHidConnectionStatus
HidConnectionStatus [12.0.0+].
Definition: btdrv_types.h:104
@ BtdrvHidConnectionStatus_Failed
BtdrvHidConnectionStatusOld_* should be used on [1.0.0-11.0.1].
Definition: btdrv_types.h:108
@ BtdrvHidConnectionStatus_Closed
BtdrvHidConnectionStatus_* should be used on [12.0.0+].
Definition: btdrv_types.h:106
BtdrvAudioCodec
AudioCodec.
Definition: btdrv_types.h:209
@ BtdrvAudioCodec_Pcm
Raw PCM.
Definition: btdrv_types.h:210
BtdrvGattAttributeType
GattAttributeType.
Definition: btdrv_types.h:145
@ BtdrvGattAttributeType_Descriptor
Descriptor.
Definition: btdrv_types.h:148
@ BtdrvGattAttributeType_Service
Service.
Definition: btdrv_types.h:149
@ BtdrvGattAttributeType_Characteristic
Characteristic.
Definition: btdrv_types.h:147
@ BtdrvGattAttributeType_IncludedService
Included service.
Definition: btdrv_types.h:146
BtdrvConnectionEventType
ConnectionEventType.
Definition: btdrv_types.h:60
@ BtdrvConnectionEventType_SspConfirmRequest
SSP confirm request.
Definition: btdrv_types.h:62
@ BtdrvConnectionEventType_Status
BtdrvEventInfo::connection::status.
Definition: btdrv_types.h:61
@ BtdrvConnectionEventType_Suspended
ACL Link is now Suspended.
Definition: btdrv_types.h:63
BtdrvAudioEventType
AudioEventType.
Definition: btdrv_types.h:197
@ BtdrvAudioEventType_Connection
Connection.
Definition: btdrv_types.h:199
@ BtdrvAudioEventType_None
None.
Definition: btdrv_types.h:198
BtdrvAudioOutState
AudioOutState.
Definition: btdrv_types.h:203
@ BtdrvAudioOutState_Stopped
Stopped.
Definition: btdrv_types.h:204
@ BtdrvAudioOutState_Started
Started.
Definition: btdrv_types.h:205
BtdrvGattCharacteristicProperty
GattCharacteristicProperty.
Definition: btdrv_types.h:176
BtdrvAdapterPropertyType
AdapterPropertyType [12.0.0+].
Definition: btdrv_types.h:21
@ BtdrvAdapterPropertyType_Address
BtdrvAddress
Definition: btdrv_types.h:22
@ BtdrvAdapterPropertyType_ClassOfDevice
3-bytes, Class of Device.
Definition: btdrv_types.h:24
@ BtdrvAdapterPropertyType_Unknown3
Only available with btdrvSetAdapterProperty. Unknown, BtdrvAddress.
Definition: btdrv_types.h:25
@ BtdrvAdapterPropertyType_Name
Name. String, max length 0xF8 excluding NUL-terminator.
Definition: btdrv_types.h:23
BtdrvFatalReason
This determines the u16 data to write into a CircularBuffer.
Definition: btdrv_types.h:117
@ BtdrvFatalReason_Invalid
Only for BtdrvEventInfo: invalid.
Definition: btdrv_types.h:118
@ BtdrvFatalReason_CommandTimeout
HCI command timeout.
Definition: btdrv_types.h:120
@ BtdrvFatalReason_Audio
[12.0.0+] Only for BtdrvEventInfo: triggered by Audio cmds in some cases.
Definition: btdrv_types.h:123
@ BtdrvFatalReason_HardwareError
HCI event HCI_Hardware_Error occurred.
Definition: btdrv_types.h:121
@ BtdrvFatalReason_Enable
Only for BtdrvEventInfo: triggered after enabling bluetooth, depending on the value of a global state...
Definition: btdrv_types.h:122
@ BtdrvFatalReason_Unknown1
Can only be triggered by btdrvEmulateBluetoothCrash, not triggered by the sysmodule otherwise.
Definition: btdrv_types.h:119
BtdrvGattAttributePermission
GattAttributePermission.
Definition: btdrv_types.h:153
BtdrvHidEventType
HidEventType.
Definition: btdrv_types.h:88
@ BtdrvHidEventTypeOld_Ext
Response for extensions. Only used with btdrvGetHidEventInfo.
Definition: btdrv_types.h:98
@ BtdrvHidEventType_Connection
BtdrvHidEventType_* should be used on [12.0.0+].
Definition: btdrv_types.h:90
@ BtdrvHidEventTypeOld_SetReport
Response to SET_REPORT.
Definition: btdrv_types.h:99
@ BtdrvHidEventType_Data
DATA report on the Interrupt channel.
Definition: btdrv_types.h:91
@ BtdrvHidEventType_GetReport
Response to GET_REPORT.
Definition: btdrv_types.h:93
@ BtdrvHidEventTypeOld_GetReport
Response to GET_REPORT.
Definition: btdrv_types.h:100
@ BtdrvHidEventTypeOld_Data
DATA report on the Interrupt channel.
Definition: btdrv_types.h:97
@ BtdrvHidEventTypeOld_Connection
Connection. Only used with btdrvGetHidEventInfo.
Definition: btdrv_types.h:96
@ BtdrvHidEventType_SetReport
Response to SET_REPORT.
Definition: btdrv_types.h:92
BtdrvInquiryStatus
BtdrvInquiryStatus.
Definition: btdrv_types.h:54
@ BtdrvInquiryStatus_Started
Inquiry started.
Definition: btdrv_types.h:56
@ BtdrvInquiryStatus_Stopped
Inquiry stopped.
Definition: btdrv_types.h:55
BtdrvExtEventType
ExtEventType [1.0.0-11.0.1].
Definition: btdrv_types.h:67
@ BtdrvExtEventType_PendingConnections
btdrvGetPendingConnections
Definition: btdrv_types.h:73
@ BtdrvExtEventType_SetBurstMode
SetBurstMode (btdrvEnableBurstMode)
Definition: btdrv_types.h:70
@ BtdrvExtEventType_MoveToSecondaryPiconet
btdrvMoveToSecondaryPiconet
Definition: btdrv_types.h:74
@ BtdrvExtEventType_SetTsi
SetTsi (btdrvSetTsi)
Definition: btdrv_types.h:68
@ BtdrvExtEventType_ExitBurstMode
ExitBurstMode (btdrvEnableBurstMode)
Definition: btdrv_types.h:71
@ BtdrvExtEventType_SetZeroRetransmission
btdrvSetZeroRetransmission
Definition: btdrv_types.h:72
@ BtdrvExtEventType_ExitTsi
ExitTsi (btdrvSetTsi)
Definition: btdrv_types.h:69
BtdrvGattAuthReqType
GattAuthReqType.
Definition: btdrv_types.h:188
BtdrvBleEventType
BleEventType.
Definition: btdrv_types.h:127
@ BtdrvBleEventType_ClientRegistration
GATT client registration.
Definition: btdrv_types.h:128
@ BtdrvBleEventType_ServerRegistration
GATT server registration.
Definition: btdrv_types.h:129
@ BtdrvBleEventType_PreferredConnectionParameters
Preferred connection parameters.
Definition: btdrv_types.h:131
@ BtdrvBleEventType_ClientCacheLoad
GATT client cache load.
Definition: btdrv_types.h:138
@ BtdrvBleEventType_ServerConnection
GATT server connection.
Definition: btdrv_types.h:133
@ BtdrvBleEventType_ScanResult
Scan result.
Definition: btdrv_types.h:134
@ BtdrvBleEventType_ServerAddCharacteristic
GATT server add characteristic.
Definition: btdrv_types.h:140
@ BtdrvBleEventType_ClientCacheSave
GATT client cache save.
Definition: btdrv_types.h:137
@ BtdrvBleEventType_ClientConnection
GATT client connection.
Definition: btdrv_types.h:132
@ BtdrvBleEventType_ConnectionUpdate
Connection update.
Definition: btdrv_types.h:130
@ BtdrvBleEventType_ServerWrite
GATT server write.
Definition: btdrv_types.h:141
@ BtdrvBleEventType_ClientNotify
GATT client notify.
Definition: btdrv_types.h:136
@ BtdrvBleEventType_ClientConfigureMtu
GATT client configure MTU.
Definition: btdrv_types.h:139
@ BtdrvBleEventType_ScanFilter
Scan filter status.
Definition: btdrv_types.h:135
BtdrvEventType
EventType.
Definition: btdrv_types.h:29
@ BtdrvEventTypeOld_BluetoothCrash
BluetoothCrash.
Definition: btdrv_types.h:50
@ BtdrvEventType_SetZeroRetransmission
btdrvSetZeroRetransmission
Definition: btdrv_types.h:38
@ BtdrvEventType_MoveToSecondaryPiconet
btdrvMoveToSecondaryPiconet
Definition: btdrv_types.h:40
@ BtdrvEventType_BluetoothCrash
BluetoothCrash.
Definition: btdrv_types.h:41
@ BtdrvEventType_InquiryDevice
BtdrvEventType_* should be used on [12.0.0+].
Definition: btdrv_types.h:31
@ BtdrvEventType_SspRequest
SSP confirm request / SSP passkey notification.
Definition: btdrv_types.h:34
@ BtdrvEventTypeOld_SspRequest
SSP confirm request / SSP passkey notification.
Definition: btdrv_types.h:48
@ BtdrvEventTypeOld_PairingPinCodeRequest
Pairing PIN code request.
Definition: btdrv_types.h:47
@ BtdrvEventType_PendingConnections
btdrvGetPendingConnections
Definition: btdrv_types.h:39
@ BtdrvEventTypeOld_Connection
Connection.
Definition: btdrv_types.h:49
@ BtdrvEventType_PairingPinCodeRequest
Pairing PIN code request.
Definition: btdrv_types.h:33
@ BtdrvEventType_Tsi
SetTsi (btdrvSetTsi)
Definition: btdrv_types.h:36
@ BtdrvEventTypeOld_Unknown0
Unused.
Definition: btdrv_types.h:44
@ BtdrvEventTypeOld_InquiryDevice
Device found during Inquiry.
Definition: btdrv_types.h:45
@ BtdrvEventType_Connection
Connection.
Definition: btdrv_types.h:35
@ BtdrvEventTypeOld_InquiryStatus
Inquiry status changed.
Definition: btdrv_types.h:46
@ BtdrvEventType_BurstMode
SetBurstMode (btdrvEnableBurstMode)
Definition: btdrv_types.h:37
@ BtdrvEventType_InquiryStatus
Inquiry status changed.
Definition: btdrv_types.h:32
BtdrvBluetoothPropertyType
BluetoothPropertyType [1.0.0-11.0.1].
Definition: btdrv_types.h:12
@ BtdrvBluetoothPropertyType_FeatureSet
1-byte, FeatureSet. The default is value 0x68.
Definition: btdrv_types.h:17
@ BtdrvBluetoothPropertyType_Address
BtdrvAddress
Definition: btdrv_types.h:14
@ BtdrvBluetoothPropertyType_Name
Name. String, max length 0xF8 excluding NUL-terminator.
Definition: btdrv_types.h:13
@ BtdrvBluetoothPropertyType_ClassOfDevice
3-bytes, Class of Device.
Definition: btdrv_types.h:16
@ BtdrvBluetoothPropertyType_Unknown3
Only available with btdrvSetAdapterProperty. Unknown, BtdrvAddress.
Definition: btdrv_types.h:15
BtdrvBluetoothHhReportType
BluetoothHhReportType Bit0-1 directly control the HID bluetooth transaction report-type value.
Definition: btdrv_types.h:80
@ BtdrvBluetoothHhReportType_Other
Other.
Definition: btdrv_types.h:81
@ BtdrvBluetoothHhReportType_Input
Input.
Definition: btdrv_types.h:82
@ BtdrvBluetoothHhReportType_Output
Output.
Definition: btdrv_types.h:83
@ BtdrvBluetoothHhReportType_Feature
Feature.
Definition: btdrv_types.h:84
AdapterProperty [1.0.0-11.0.1].
Definition: btdrv_types.h:224
u8 feature_set
Set to hard-coded value 0x68 (same as the data for BtdrvBluetoothPropertyType_FeatureSet).
Definition: btdrv_types.h:228
BtdrvAddress addr
Same as the data for BtdrvBluetoothPropertyType_Address.
Definition: btdrv_types.h:225
BtdrvClassOfDevice class_of_device
Same as the data for BtdrvBluetoothPropertyType_ClassOfDevice.
Definition: btdrv_types.h:226
AdapterPropertySet [12.0.0+].
Definition: btdrv_types.h:239
BtdrvClassOfDevice class_of_device
Same as the data for BtdrvBluetoothPropertyType_ClassOfDevice.
Definition: btdrv_types.h:241
BtdrvAddress addr
Same as the data for BtdrvBluetoothPropertyType_Address.
Definition: btdrv_types.h:240
AdapterProperty [12.0.0+].
Definition: btdrv_types.h:232
u8 size
Data size.
Definition: btdrv_types.h:234
u8 type
BtdrvAdapterPropertyType
Definition: btdrv_types.h:233
Address.
Definition: btdrv_types.h:214
AudioControlButtonState.
Definition: btdrv_types.h:427
BleAdvertiseFilter.
Definition: btdrv_types.h:340
u8 mask_size
Size of mask above.
Definition: btdrv_types.h:344
u8 index
Filter index.
Definition: btdrv_types.h:341
BtdrvBleAdvertisement adv
BtdrvBleAdvertisement
Definition: btdrv_types.h:342
BtdrvBleAdvertisePacketDataEntry.
Definition: btdrv_types.h:307
u16 unk_x0
Unknown.
Definition: btdrv_types.h:308
BleAdvertisePacketData.
Definition: btdrv_types.h:313
u8 unk_xC7
Unknown.
Definition: btdrv_types.h:327
u8 size2
Size of the data at unk_xA8.
Definition: btdrv_types.h:323
u32 unk_x0
Unknown.
Definition: btdrv_types.h:314
u8 unk_xA5
Unknown.
Definition: btdrv_types.h:324
u8 count
Total array entries, see entries.
Definition: btdrv_types.h:319
u8 unk_x4
Unknown.
Definition: btdrv_types.h:315
u8 size0
Size of the data at unk_x6.
Definition: btdrv_types.h:316
u8 unk_xC8
Unknown.
Definition: btdrv_types.h:328
BleAdvertisePacketParameter.
Definition: btdrv_types.h:348
BleAdvertisement.
Definition: btdrv_types.h:333
u8 size
Size of data below.
Definition: btdrv_types.h:334
u8 type
BtdrvAdType
Definition: btdrv_types.h:335
BleClientGattOperationInfo.
Definition: btdrv_types.h:406
u32 unk_x4
BtdrvLeEventInfo::unk_x4.
Definition: btdrv_types.h:409
u64 size
BtdrvLeEventInfo::size.
Definition: btdrv_types.h:415
BtdrvGattAttributeUuid uuid2
BtdrvLeEventInfo::uuid2.
Definition: btdrv_types.h:414
BtdrvGattAttributeUuid uuid1
BtdrvLeEventInfo::uuid1.
Definition: btdrv_types.h:413
u8 unk_x8
BtdrvLeEventInfo::unk_x8.
Definition: btdrv_types.h:410
BtdrvGattAttributeUuid uuid0
BtdrvLeEventInfo::uuid0.
Definition: btdrv_types.h:412
u8 unk_x0
Converted from BtdrvLeEventInfo::unk_x0.
Definition: btdrv_types.h:407
BleConnectionInfo.
Definition: btdrv_types.h:363
BtdrvAddress addr
BtdrvAddress
Definition: btdrv_types.h:365
u32 connection_handle
ConnectionHandle, 0xFFFFFFFF ([5.0.0-5.0.2] 0xFFFF) is invalid.
Definition: btdrv_types.h:364
BleConnectionParameter [9.0.0+].
Definition: btdrv_types.h:297
u16 min_conn_interval
Minimum connection interval.
Definition: btdrv_types.h:298
u16 slave_latency
Slave latency.
Definition: btdrv_types.h:302
u16 max_conn_interval
Maximum connection interval.
Definition: btdrv_types.h:299
u16 supervision_tout
Connection supervision timeout multiplier.
Definition: btdrv_types.h:303
u16 scan_interval
Scan interval.
Definition: btdrv_types.h:300
u16 scan_window
Scan window.
Definition: btdrv_types.h:301
BleScanResult.
Definition: btdrv_types.h:354
s32 unk_x144
Unknown.
Definition: btdrv_types.h:359
u8 unk_x0
Unknown.
Definition: btdrv_types.h:355
BtdrvAddress addr
BtdrvAddress
Definition: btdrv_types.h:356
s32 count
Unknown.
Definition: btdrv_types.h:358
BluetoothPinCode [1.0.0-11.0.1].
Definition: btdrv_types.h:246
ChannelMapList.
Definition: btdrv_types.h:279
ClassOfDevice.
Definition: btdrv_types.h:219
GattAttributeUuid.
Definition: btdrv_types.h:370
u32 size
UUID size, must be 0x2, 0x4, or 0x10.
Definition: btdrv_types.h:371
GattAttribute.
Definition: btdrv_types.h:383
u8 property
Only used when type is characteristic. BtdrvGattCharacteristicProperty.
Definition: btdrv_types.h:388
u16 type
BtdrvGattAttributeType
Definition: btdrv_types.h:385
bool is_primary
Only used when type is service.
Definition: btdrv_types.h:389
BtdrvGattId id
BtdrvGattId
Definition: btdrv_types.h:384
GattId.
Definition: btdrv_types.h:376
BtdrvGattAttributeUuid uuid
BtdrvGattAttributeUuid
Definition: btdrv_types.h:379
u8 instance_id
InstanceId.
Definition: btdrv_types.h:377
HidData [1.0.0-8.1.1].
Definition: btdrv_types.h:257
u16 size
Size of data.
Definition: btdrv_types.h:258
HidReport [9.0.0+].
Definition: btdrv_types.h:263
u16 size
Size of data.
Definition: btdrv_types.h:264
LeConnectionParams [5.0.0-8.1.1].
Definition: btdrv_types.h:284
u16 min_conn_interval
Minimum connection interval.
Definition: btdrv_types.h:286
u8 preference
Unused.
Definition: btdrv_types.h:292
u16 scan_window
Scan window.
Definition: btdrv_types.h:289
BtdrvAddress addr
BtdrvAddress
Definition: btdrv_types.h:285
u16 slave_latency
Slave latency.
Definition: btdrv_types.h:290
u16 max_conn_interval
Maximum connection interval.
Definition: btdrv_types.h:287
u8 pad
Padding.
Definition: btdrv_types.h:293
u16 supervision_tout
Connection supervision timeout multiplier.
Definition: btdrv_types.h:291
u16 scan_interval
Scan interval.
Definition: btdrv_types.h:288
LeEventInfo.
Definition: btdrv_types.h:393
u8 unk_x8
Unknown.
Definition: btdrv_types.h:396
BtdrvGattAttributeUuid uuid1
BtdrvGattAttributeUuid
Definition: btdrv_types.h:399
u32 unk_x4
Unknown.
Definition: btdrv_types.h:395
BtdrvGattAttributeUuid uuid2
BtdrvGattAttributeUuid
Definition: btdrv_types.h:400
u16 size
Size of the below data.
Definition: btdrv_types.h:401
u32 unk_x0
Unknown.
Definition: btdrv_types.h:394
BtdrvGattAttributeUuid uuid0
BtdrvGattAttributeUuid
Definition: btdrv_types.h:398
PcmParameter.
Definition: btdrv_types.h:420
u32 unk_x0
Must be 0-3. Controls number of channels: 0 = mono, non-zero = stereo.
Definition: btdrv_types.h:421
s32 sample_rate
Sample rate. Must be one of the following: 16000, 32000, 44100, 48000.
Definition: btdrv_types.h:422
u32 bits_per_sample
Bits per sample. Must be 8 or 16.
Definition: btdrv_types.h:423
BtdrvPinCode [12.0.0+].
Definition: btdrv_types.h:251
u8 length
Length.
Definition: btdrv_types.h:253
PlrList.
Definition: btdrv_types.h:274
PlrStatistics.
Definition: btdrv_types.h:269
#define BIT(n)
Creates a bitmask from a bit number.
Definition: types.h:54
uint64_t u64
64-bit unsigned integer.
Definition: types.h:22
uint8_t u8
8-bit unsigned integer.
Definition: types.h:19
uint16_t u16
16-bit unsigned integer.
Definition: types.h:20
int32_t s32
32-bit signed integer.
Definition: types.h:27
uint32_t u32
32-bit unsigned integer.
Definition: types.h:21