libnx  v4.6.0
btdrv.h
Go to the documentation of this file.
1 /**
2  * @file btdrv.h
3  * @brief Bluetooth driver (btdrv) service IPC wrapper.
4  * @author yellows8, ndeadly
5  * @copyright libnx Authors
6  */
7 #pragma once
8 #include "../types.h"
9 #include "../kernel/event.h"
10 #include "../services/btdrv_types.h"
11 #include "../services/set.h"
12 #include "../sf/service.h"
13 
14 /// Data for \ref btdrvGetEventInfo. The data stored here depends on the \ref BtdrvEventType.
15 typedef struct {
16  union {
17  u8 data[0x400]; ///< Raw data.
18 
19  struct {
20  u32 val; ///< Value
21  } type0; ///< ::BtdrvEventTypeOld_Unknown0
22 
23  struct {
24  union {
25  struct {
26  char name[0xF9]; ///< Device name, NUL-terminated string.
27  BtdrvAddress addr; ///< Device address.
28  u8 reserved_xFF[0x10]; ///< Reserved
29  BtdrvClassOfDevice class_of_device; ///< Class of Device.
30  u8 unk_x112[0x4]; ///< Set to fixed value u32 0x1.
31  u8 reserved_x116[0xFA]; ///< Reserved
32  u8 reserved_x210[0x5C]; ///< Reserved
33  char name2[0xF9]; ///< Device name, NUL-terminated string. Same as name above, except starting at index 1.
34  u8 rssi[0x4]; ///< s32 RSSI
35  u8 name3[0x4]; ///< Two bytes which are the same as name[11-12].
36  u8 reserved_x36D[0x10]; ///< Reserved
37  } v1; ///< [1.0.0-11.0.1]
38 
39  struct {
40  BtdrvAddress addr; ///< Device address.
41  char name[0xF9]; ///< Device name, NUL-terminated string.
42  BtdrvClassOfDevice class_of_device; ///< Class of Device.
43  u8 reserved[0x6]; ///< Reserved
44  } v12; ///< [12.0.0+]
45  };
46  } inquiry_device; ///< ::BtdrvEventType_InquiryDevice
47 
48  struct {
49  union {
50  struct {
51  BtdrvInquiryStatus status; ///< \ref BtdrvInquiryStatus
52  } v1; ///< [1.0.0-11.0.1]
53 
54  struct {
55  u8 status; ///< \ref BtdrvInquiryStatus
56  u8 pad[3]; ///< Padding
57  u32 service_mask; ///< Services value from \ref btdrvStartInquiry when starting, otherwise this is value 0.
58  } v12; ///< [12.0.0+]
59  };
60  } inquiry_status; ///< ::BtdrvEventType_InquiryStatus
61 
62  struct {
63  BtdrvAddress addr; ///< Device address.
64  char name[0xF9]; ///< Device name, NUL-terminated string.
65  BtdrvClassOfDevice class_of_device; ///< Class of Device.
66  } pairing_pin_code_request; ///< ::BtdrvEventType_PairingPinCodeRequest
67 
68  struct {
69  union {
70  struct {
71  BtdrvAddress addr; ///< Device address.
72  char name[0xF9]; ///< Device name, NUL-terminated string.
73  BtdrvClassOfDevice class_of_device; ///< Class of Device.
74  u8 pad[2]; ///< Padding
75  u32 type; ///< 0 = SSP confirm request, 3 = SSP passkey notification.
76  s32 passkey; ///< Passkey, only set when the above field is value 3.
77  } v1; ///< [1.0.0-11.0.1]
78 
79  struct {
80  BtdrvAddress addr; ///< Device address.
81  char name[0xF9]; ///< Device name, NUL-terminated string.
82  BtdrvClassOfDevice class_of_device; ///< Class of Device.
83  u8 flag; ///< bool flag for Just Works. With SSP passkey notification this is always 0.
84  u8 pad; ///< Padding
85  s32 passkey; ///< Passkey
86  } v12; ///< [12.0.0+]
87  };
88  } ssp_request; ///< ::BtdrvEventType_SspRequest
89 
90  struct {
91  union {
92  struct {
93  BtdrvAddress addr; ///< Device address.
94  u8 pad[2]; ///< Padding
95  u32 status; ///< Status, always 0 except with ::BtdrvConnectionEventType_Status: 2 = ACL Link is now Resumed, 9 = connection failed (pairing/authentication failed, or opening the hid connection failed).
96  u32 type; ///< \ref BtdrvConnectionEventType
97  } v1; ///< [1.0.0-8.1.1]
98 
99  struct {
100  u32 status; ///< Status, always 0 except with ::BtdrvConnectionEventType_Status: 2 = ACL Link is now Resumed, 9 = connection failed (pairing/authentication failed, or opening the hid connection failed).
101  BtdrvAddress addr; ///< Device address.
102  u8 pad[2]; ///< Padding
103  u32 type; ///< \ref BtdrvConnectionEventType
104  } v9; ///< [9.0.0-11.0.1]
105 
106  struct {
107  u32 type; ///< \ref BtdrvConnectionEventType
108  BtdrvAddress addr; ///< Device address.
109  u8 reserved[0xfe]; ///< Reserved
110  } v12; ///< [12.0.0+]
111  };
112  } connection; ///< ::BtdrvEventType_Connection
113 
114  struct {
115  BtdrvAddress addr; ///< Device address.
116  u8 status; ///< Status flag: 1 = success, 0 = failure.
117  u8 value; ///< Tsi value, when the above indicates success.
118  } tsi; ///< ::BtdrvEventType_Tsi
119 
120  struct {
121  BtdrvAddress addr; ///< Device address.
122  u8 status; ///< Status flag: 1 = success, 0 = failure.
123  u8 value; ///< Input bool value from \ref btdrvEnableBurstMode, when the above indicates success.
124  } burst_mode; ///< ::BtdrvEventType_BurstMode
125 
126  struct {
127  BtdrvAddress addr; ///< Device address.
128  u8 status; ///< Status flag: 1 = success, 0 = failure.
129  u8 flag; ///< Bool flag, when the above indicates success.
130  } set_zero_retransmission; ///< ::BtdrvEventType_SetZeroRetransmission
131 
132  struct {
133  u8 status; ///< Status flag: 1 = success, 0 = failure.
134  u8 pad[0x3]; ///< Padding
135  u32 count; ///< Count value.
136  } pending_connections; ///< ::BtdrvEventType_PendingConnections
137 
138  struct {
139  BtdrvAddress addr; ///< Device address.
140  u8 status; ///< Status flag: 1 = success, 0 = failure.
141  } move_to_secondary_piconet; ///< ::BtdrvEventType_MoveToSecondaryPiconet
142 
143  struct {
144  u16 reason; ///< \ref BtdrvFatalReason
145  } bluetooth_crash; ///< ::BtdrvEventType_BluetoothCrash
146  };
148 
149 /// Data for \ref btdrvGetHidEventInfo. The data stored here depends on the \ref BtdrvHidEventType.
150 typedef struct {
151  union {
152  u8 data[0x480]; ///< Raw data.
153 
154  struct {
155  union {
156  struct {
157  BtdrvAddress addr; ///< Device address.
158  u8 pad[2]; ///< Padding
159  BtdrvHidConnectionStatus status; ///< \ref BtdrvHidConnectionStatus
160  } v1; ///< [1.0.0-11.0.1]
161 
162  struct {
163  BtdrvHidConnectionStatus status; ///< \ref BtdrvHidConnectionStatus
164  BtdrvAddress addr; ///< Device address.
165  } v12; ///< [12.0.0+]
166  };
167  } connection; ///< ::BtdrvHidEventType_Connection
168 
169  struct {
170  u32 type; ///< \ref BtdrvExtEventType, controls which data is stored below.
171 
172  union {
173  struct {
174  u32 status; ///< 0 for success, non-zero for error.
175  BtdrvAddress addr; ///< Device address.
176  } set_tsi; ///< ::BtdrvExtEventType_SetTsi
177 
178  struct {
179  u32 status; ///< 0 for success, non-zero for error.
180  BtdrvAddress addr; ///< Device address.
181  } exit_tsi; ///< ::BtdrvExtEventType_ExitTsi
182 
183  struct {
184  u32 status; ///< 0 for success, non-zero for error.
185  BtdrvAddress addr; ///< Device address.
186  } set_burst_mode; ///< ::BtdrvExtEventType_SetBurstMode
187 
188  struct {
189  u32 status; ///< 0 for success, non-zero for error.
190  BtdrvAddress addr; ///< Device address.
191  } exit_burst_mode; ///< ::BtdrvExtEventType_ExitBurstMode
192 
193  struct {
194  u32 status; ///< 0 for success, non-zero for error.
195  BtdrvAddress addr; ///< Device address.
196  u8 pad[2]; ///< Padding
197  u8 flag; ///< Flag
198  } set_zero_retransmission; ///< ::BtdrvExtEventType_SetZeroRetransmission
199 
200  struct {
201  u32 status; ///< 0 for success, non-zero for error.
202  BtdrvAddress addr; ///< Unused
203  u8 pad[2]; ///< Padding
204  u32 count; ///< Count value.
205  } pending_connections; ///< ::BtdrvExtEventType_PendingConnections
206 
207  struct {
208  u32 status; ///< 0 for success, non-zero for error.
209  BtdrvAddress addr; ///< Device address.
210  } move_to_secondary_piconet; ///< ::BtdrvExtEventType_MoveToSecondaryPiconet
211  };
212  } ext; ///< ::BtdrvHidEventType_Ext [1.0.0-11.0.1]
213  };
215 
216 /// Data for \ref btdrvGetHidReportEventInfo. The data stored here depends on the \ref BtdrvHidEventType.
217 typedef struct {
218  union {
219  u8 data[0x480]; ///< Raw data.
220 
221  struct {
222  union {
223  struct {
224  struct {
226  u8 pad[2];
228  u32 size;
229  } hdr;
230  u8 unused[0x3]; ///< Unused
231  BtdrvAddress addr; ///< \ref BtdrvAddress
232  u8 unused2[0x3]; ///< Unused
234  } v1; ///< [1.0.0-6.2.0]
235 
236  struct {
237  u8 unused[0x3]; ///< Unused
238  BtdrvAddress addr; ///< \ref BtdrvAddress
239  u8 unused2[0x3]; ///< Unused
240  BtdrvHidData report;
241  } v7; ///< [7.0.0-8.1.1]
242 
243  struct {
244  u32 res; ///< Always 0.
245  u8 unk_x4; ///< Always 0.
246  BtdrvAddress addr; ///< \ref BtdrvAddress
247  u8 pad; ///< Padding
249  } v9; ///< [9.0.0+]
250  };
251  } data_report; ///< ::BtdrvHidEventType_DataReport
252 
253  struct {
254  union {
255  u8 rawdata[0xC]; ///< Raw data.
256 
257  struct {
258  u32 res; ///< 0 = success, non-zero = error.
259  BtdrvAddress addr; ///< \ref BtdrvAddress
260  u8 pad[2]; ///< Padding
261  };
262  };
263  } set_report; ///< ::BtdrvHidEventType_SetReport
264 
265  struct {
266  union {
267  union {
268  u8 rawdata[0x290]; ///< Raw data.
269 
270  struct {
271  BtdrvAddress addr; ///< \ref BtdrvAddress
272  u8 pad[2]; ///< Padding
273  u32 res; ///< Unknown. hid-sysmodule only uses the below data when this field is 0.
274  BtdrvHidData report; ///< \ref BtdrvHidData
275  u8 pad2[2]; ///< Padding
276  };
277  } v1; ///< [1.0.0-8.1.1]
278 
279  union {
280  u8 rawdata[0x2C8]; ///< Raw data.
281 
282  struct {
283  u32 res; ///< Unknown. hid-sysmodule only uses the below report when this field is 0.
284  BtdrvAddress addr; ///< \ref BtdrvAddress
285  BtdrvHidReport report; ///< \ref BtdrvHidReport
286  };
287  } v9; ///< [9.0.0+]
288  };
289  } get_report; ///< ::BtdrvHidEventType_GetReport
290  };
292 
293 /// The raw sharedmem data for HidReportEventInfo.
294 typedef struct {
295  struct {
296  u8 type; ///< \ref BtdrvHidEventType
297  u8 pad[7];
298  u64 tick;
299  u64 size;
300  } hdr;
301 
304 
305 /// Data for \ref btdrvGetAudioEventInfo. The data stored here depends on the \ref BtdrvAudioEventType.
306 typedef union {
307  struct {
308  u32 status; ///< Status: 0 = AV connection closed, 1 = AV connection opened, 2 = failed to open AV connection.
309  BtdrvAddress addr; ///< Device address.
310  u8 pad[2]; ///< Padding
311  } connection; ///< ::BtdrvAudioEventType_Connection
313 
314 /// CircularBuffer
315 typedef struct {
316  Mutex mutex;
317  void* event_type; ///< Not set with sharedmem.
318  u8 data[0x2710];
319  s32 write_offset;
320  s32 read_offset;
321  u64 utilization;
322  char name[0x11];
323  u8 initialized;
325 
326 /// Data for \ref btdrvGetBleManagedEventInfo and \ref btdrvGetLeHidEventInfo. The data stored here depends on the \ref BtdrvBleEventType.
327 typedef struct {
328  union {
329  u8 data[0x400];
330 
331  struct {
332  u32 result; ///< 0 for success, non-zero for error.
333  u8 client_if; ///< Client interface handle
334  u8 status; ///< Registration status. 0 = Unregistered, 1 = Registered
335  u8 pad[2]; ///< Padding
336  } client_registration; ///< ::BtdrvBleEventType_ClientRegistration
337 
338  struct {
339  u32 result; ///< 0 for success, non-zero for error.
340  u8 server_if; ///< Server interface handle. Unused
341  u8 status; ///< Registration status. 0 = Unregistered, 1 = Registered
342  u8 pad[2]; ///< Padding
343  } server_registration; ///< ::BtdrvBleEventType_ServerRegistration
344 
345  struct {
346  u32 result; ///< 0 for success, non-zero for error.
347  u32 conn_id; ///< Connection ID
348  u16 conn_interval; ///< Connection interval
349  u16 conn_latency; ///< Connection latency
350  u16 supervision_tout; ///< Connection supervision timeout multiplier
351  u8 pad[2]; ///< Padding
352  } connection_update; ///< ::BtdrvBleEventType_ConnectionUpdate
353 
354  struct {
355  u32 conn_id; ///< Connection ID
356  u16 min_conn_interval; ///< Minimum connection interval
357  u16 max_conn_interval; ///< Maximum connection interval
358  u16 slave_latency; ///< Slave latency
359  u16 supervision_tout; ///< Connection supervision timeout multiplier
360  } preferred_connection_parameters; ///< ::BtdrvBleEventType_PreferredConnectionParameters
361 
362  struct {
363  u32 result; ///< 0 for success, non-zero for error.
364  u8 status; ///< Connection status. 0 = Connected, 2 = Disconnected
365  u8 client_if; ///< Client interface handle
366  u8 pad[2]; ///< Padding
367  u32 conn_id; ///< Connection ID
368  BtdrvAddress address; ///< Device address
369  u16 reason; ///< Disconnection reason
370  } client_connection; ///< ::BtdrvBleEventType_ClientConnection
371 
372  struct {
373  u32 result; ///< 0 for success, non-zero for error.
374  u8 status; ///< Connection status. 0 = Connected, 2 = Disconnected
375  u16 server_if; ///< Server interface handle
376  u8 pad; ///< Padding
377  u32 conn_id; ///< Connection ID
378  BtdrvAddress address; ///< Device address
379  u16 reason; ///< Disconnection reason
380  } server_connection; ///< ::BtdrvBleEventType_ServerConnection
381 
382  struct {
383  u32 result; ///< 0 for success, non-zero for error.
384  u8 status; ///< BLE scan status. 1 = Scan complete, 2 = New device found, 0xFF = Scan started
385  u8 device_type; ///< Device type. 0 = BD/EDR, 1 = BLE, 2 = Dual Mode
386  u8 ble_addr_type; ///< BLE address type. 0 = Public, 1 = Random, 2 = Public ID, 3 = Random ID
387  BtdrvAddress address; ///< Device address
388  BtdrvBleAdvertisement ad_list[10]; ///< BLE Advertisement list \ref BtdrvBleAdvertisement
389  u8 count; ///< Number of entries above
390  s32 rssi; ///< RSSI value
391  } scan_result; ///< ::BtdrvBleEventType_ScanResult
392 
393  struct {
394  u32 result; ///< 0 for success, non-zero for error.
395  u32 action; ///< Scan filter action. 0 = Add, 1 = Delete, 2 = Clear, 3 = Enable, 4 = Disable
396  } scan_filter; ///< ::BtdrvBleEventType_ScanFilter
397 
398  struct {
399  u32 result; ///< 0 for success, non-zero for error.
400  u32 conn_id; ///< Connection ID
401  u8 type; ///< Notification type. 4 = Notification, 5 = Indication.
402  u8 pad[3]; ///< Padding
403  BtdrvGattAttributeUuid serv_uuid; ///< GATT Service UUID \ref BtdrvGattAttributeUuid
404  BtdrvGattAttributeUuid char_uuid; ///< GATT Characteristic UUID \ref BtdrvGattAttributeUuid
405  BtdrvGattAttributeUuid desc_uuid; ///< GATT Descriptor UUID \ref BtdrvGattAttributeUuid
406  u16 size; ///< Size of the below data
407  u8 data[0x200]; ///< Notification data.
408  u8 pad2[2]; ///< Padding
409  } client_notify; ///< ::BtdrvBleEventType_ClientNotify
410 
411  struct {
412  u32 result; ///< 0 for success, non-zero for error.
413  u32 conn_id; ///< Connection ID
414  u32 count; ///< Number of attributes below.
415  BtdrvGattAttribute attr_list[10]; ///< List of Gatt attributes \ref BtdrvGattAttribute
416  } client_cache_save; ///< ::BtdrvBleEventType_ClientCacheSave
417 
418  struct {
419  u32 result; ///< 0 for success, non-zero for error.
420  u32 conn_id; ///< Connection ID
421  u16 unk_x8; ///< Unknown. Always 0
422  u8 unused[0x142]; ///< Unused
423  } client_cache_load; ///< ::BtdrvBleEventType_ClientCacheLoad
424 
425  struct {
426  u32 result; ///< 0 for success, non-zero for error.
427  u32 conn_id; ///< Connection ID
428  u16 mtu; ///< MTU value
429  u8 pad[2]; ///< Padding
430  } client_configure_mtu; ///< ::BtdrvBleEventType_ClientConfigureMtu
431 
432  struct {
433  u32 result; ///< 0 for success, non-zero for error.
434  u32 server_if; ///< Server interface handle
435  BtdrvGattAttributeUuid uuid; ///< \ref BtdrvGattAttributeUuid
436  u16 service_id; ///< Service ID
437  u16 attr_id; ///< Attribute ID
438  u8 attr_type; ///< Attribute type \ref BtdrvGattAttributeType
439  u8 property; ///< Characteristic properties. Only set if attr_type is 1 \ref BtdrvGattCharacteristicProperty
440  u8 is_primary; ///< Is a primary service or not
441  u8 pad; ///< Padding
442  } server_add_characteristic; ///< ::BtdrvBleEventType_ServerAddCharacteristic
443 
444  struct {
445  u32 result; ///< 0 for success, non-zero for error.
446  u16 conn_id; ///< Connection ID
447  u8 unk_x6; ///< Unknown. Always 1
448  u8 pad; ///< Padding
449  u16 service_id; ///< Service ID
450  u16 attr_id; ///< Attribute ID
451  u8 attr_type; ///< Attribute type \ref BtdrvGattAttributeType
452  u8 data[0x200]; ///< Data
453  u16 size; ///< Size of the above data
454  u16 offset; ///< Offset
455  u8 pad2[2]; ///< Padding
456  } server_write; ///< ::BtdrvBleEventType_ServerWrite
457  };
459 
460 /// Initialize btdrv.
462 
463 /// Exit btdrv.
464 void btdrvExit(void);
465 
466 /// Gets the Service object for the actual btdrv service session.
468 
469 /**
470  * @brief InitializeBluetooth
471  * @note This is used by btm-sysmodule, this should not be used by other processes.
472  * @note The Event must be closed by the user once finished with it.
473  * @param[out] out_event Output Event with autoclear=true.
474  */
476 
477 /**
478  * @brief EnableBluetooth
479  * @note This is used by btm-sysmodule.
480  */
482 
483 /**
484  * @brief DisableBluetooth
485  * @note This is used by btm-sysmodule.
486  */
488 
489 /**
490  * @brief FinalizeBluetooth
491  * @note This is not used by btm-sysmodule, this should not be used by other processes.
492  */
494 
495 /**
496  * @brief GetAdapterProperties [1.0.0-11.0.1]
497  * @param[out] properties \ref BtdrvAdapterPropertyOld
498  */
500 
501 /**
502  * @brief GetAdapterProperties [12.0.0+]
503  * @param[out] properties \ref BtdrvAdapterPropertySet
504  */
506 
507 /**
508  * @brief GetAdapterProperty [1.0.0-11.0.1]
509  * @param[in] type \ref BtdrvBluetoothPropertyType
510  * @param[out] buffer Output buffer, see \ref BtdrvBluetoothPropertyType for the contents.
511  * @param[in] size Output buffer size.
512  */
514 
515 /**
516  * @brief GetAdapterProperty [12.0.0+]
517  * @param[in] type \ref BtdrvAdapterPropertyType
518  * @param[in] property \ref BtdrvAdapterProperty
519  */
521 
522 /**
523  * @brief SetAdapterProperty [1.0.0-11.0.1]
524  * @param[in] type \ref BtdrvBluetoothPropertyType
525  * @param[in] buffer Input buffer, see \ref BtdrvBluetoothPropertyType for the contents.
526  * @param[in] size Input buffer size.
527  */
528 Result btdrvLegacySetAdapterProperty(BtdrvBluetoothPropertyType type, const void* buffer, size_t size);
529 
530 /**
531  * @brief SetAdapterProperty [12.0.0+]
532  * @param[in] type \ref BtdrvAdapterPropertyType
533  * @param[in] property \ref BtdrvAdapterProperty
534  */
536 
537 /**
538  * @brief StartInquiry [1.0.0-11.0.1]. This starts Inquiry, the output data will be available via \ref btdrvGetEventInfo. Inquiry will automatically stop in 10.24 seconds.
539  * @note This is used by btm-sysmodule.
540  */
542 
543 /**
544  * @brief StartInquiry [12.0.0+]. This starts Inquiry, the output data will be available via \ref btdrvGetEventInfo.
545  * @param[in] services Bitfield of allowed services. When -1 the original defaults from pre-12.0.0 are used.
546  * @param[in] duration Inquiry duration in nanoseconds.
547  * @note This is used by btm-sysmodule.
548  */
549 Result btdrvStartInquiry(u32 services, s64 duration);
550 
551 /**
552  * @brief This stops Inquiry which was started by \ref btdrvStartInquiry, if it's still active.
553  * @note This is used by btm-sysmodule.
554  */
556 
557 /**
558  * @brief CreateBond
559  * @note This is used by btm-sysmodule.
560  * @param[in] addr \ref BtdrvAddress
561  * @param[in] type TransportType
562  */
564 
565 /**
566  * @brief RemoveBond
567  * @note This is used by btm-sysmodule.
568  * @param[in] addr \ref BtdrvAddress
569  */
571 
572 /**
573  * @brief CancelBond
574  * @note This is used by btm-sysmodule.
575  * @param[in] addr \ref BtdrvAddress
576  */
578 
579 /**
580  * @brief RespondToPinRequest [1.0.0-11.0.1]
581  * @note The official sysmodule only uses the input \ref BtdrvAddress.
582  * @param[in] addr \ref BtdrvAddress
583  * @param[in] flag Flag
584  * @param[in] pin_code \ref BtdrvBluetoothPinCode
585  * @param[in] length Length of pin_code
586  */
588 
589 /**
590  * @brief RespondToPinRequest [12.0.0+]
591  * @param[in] addr \ref BtdrvAddress
592  * @param[in] pin_code \ref BtdrvPinCode
593  */
595 
596 /**
597  * @brief RespondToSspRequest
598  * @note The official sysmodule only uses the input \ref BtdrvAddress and the flag.
599  * @note This is used by btm-sysmodule.
600  * @param[in] addr \ref BtdrvAddress
601  * @param[in] variant BluetoothSspVariant
602  * @param[in] accept Whether the request is accepted.
603  * @param[in] passkey Passkey.
604  */
605 Result btdrvRespondToSspRequest(BtdrvAddress addr, u32 variant, bool accept, u32 passkey);
606 
607 /**
608  * @brief GetEventInfo
609  * @note This is used by btm-sysmodule.
610  * @param[out] buffer Output buffer, see \ref BtdrvEventInfo.
611  * @param[in] size Output buffer size.
612  * @param[out] type Output BtdrvEventType.
613  */
614 Result btdrvGetEventInfo(void* buffer, size_t size, BtdrvEventType *type);
615 
616 /**
617  * @brief InitializeHid
618  * @note This is used by btm-sysmodule, this should not be used by other processes.
619  * @note The Event must be closed by the user once finished with it.
620  * @param[out] out_event Output Event with autoclear=true.
621  */
623 
624 /**
625  * @brief OpenHidConnection
626  * @note This is used by btm-sysmodule.
627  * @param[in] addr \ref BtdrvAddress
628  */
630 
631 /**
632  * @brief CloseHidConnection
633  * @note This is used by btm-sysmodule.
634  * @param[in] addr \ref BtdrvAddress
635  */
637 
638 /**
639  * @brief This sends a HID DATA transaction packet with report-type Output.
640  * @param[in] addr \ref BtdrvAddress
641  * @param[in] buffer Input \ref BtdrvHidReport, on pre-9.0.0 this is \ref BtdrvHidData.
642  */
644 
645 /**
646  * @brief WriteHidData2
647  * @param[in] addr \ref BtdrvAddress
648  * @param[in] buffer Input buffer, same as the buffer for \ref btdrvWriteHidData.
649  * @param[in] size Input buffer size.
650  */
651 Result btdrvWriteHidData2(BtdrvAddress addr, const void* buffer, size_t size);
652 
653 /**
654  * @brief This sends a HID SET_REPORT transaction packet.
655  * @param[in] addr \ref BtdrvAddress
656  * @param[in] type \ref BtdrvBluetoothHhReportType
657  * @param[in] buffer Input \ref BtdrvHidReport, on pre-9.0.0 this is \ref BtdrvHidData.
658  */
660 
661 /**
662  * @brief This sends a HID GET_REPORT transaction packet.
663  * @param[in] addr \ref BtdrvAddress
664  * @param[in] report_id This is sent in the packet for the Report Id, when non-zero.
665  * @param[in] type \ref BtdrvBluetoothHhReportType
666  */
668 
669 /**
670  * @brief TriggerConnection
671  * @note This is used by btm-sysmodule.
672  * @param[in] addr \ref BtdrvAddress
673  * @param[in] unk [9.0.0+] Unknown
674  */
676 
677 /**
678  * @brief AddPairedDeviceInfo
679  * @note This is used by btm-sysmodule.
680  * @param[in] settings \ref SetSysBluetoothDevicesSettings
681  */
683 
684 /**
685  * @brief GetPairedDeviceInfo
686  * @note This is used by btm-sysmodule.
687  * @param[in] addr \ref BtdrvAddress
688  * @param[out] settings \ref SetSysBluetoothDevicesSettings
689  */
691 
692 /**
693  * @brief FinalizeHid
694  * @note This is not used by btm-sysmodule, this should not be used by other processes.
695  */
697 
698 /**
699  * @brief GetHidEventInfo
700  * @note This is used by btm-sysmodule.
701  * @param[out] buffer Output buffer, see \ref BtdrvHidEventInfo.
702  * @param[in] size Output buffer size.
703  * @param[out] type \ref BtdrvHidEventType, always ::BtdrvHidEventType_Connection or ::BtdrvHidEventType_Ext.
704  */
705 Result btdrvGetHidEventInfo(void* buffer, size_t size, BtdrvHidEventType *type);
706 
707 /**
708  * @brief SetTsi
709  * @note The response will be available via \ref btdrvGetHidEventInfo ([12.0.0+] \ref btdrvGetEventInfo).
710  * @note This is used by btm-sysmodule.
711  * @param[in] addr \ref BtdrvAddress
712  * @param[in] tsi Tsi: non-value-0xFF to Set, value 0xFF to Exit. See also \ref BtmTsiMode.
713  */
715 
716 /**
717  * @brief EnableBurstMode
718  * @note The response will be available via \ref btdrvGetHidEventInfo ([12.0.0+] \ref btdrvGetEventInfo).
719  * @note This is used by btm-sysmodule.
720  * @param[in] addr \ref BtdrvAddress
721  * @param[in] flag Flag: true = Set, false = Exit.
722  */
724 
725 /**
726  * @brief SetZeroRetransmission
727  * @note The response will be available via \ref btdrvGetHidEventInfo ([12.0.0+] \ref btdrvGetEventInfo).
728  * @note This is used by btm-sysmodule.
729  * @param[in] addr \ref BtdrvAddress
730  * @param[in] report_ids Input buffer containing an array of u8s.
731  * @param[in] count Total u8s in the input buffer. This can be 0, the max is 5.
732  */
734 
735 /**
736  * @brief EnableMcMode
737  * @note This is used by btm-sysmodule.
738  * @param[in] flag Flag
739  */
741 
742 /**
743  * @brief EnableLlrScan
744  * @note This is used by btm-sysmodule.
745  */
747 
748 /**
749  * @brief DisableLlrScan
750  * @note This is used by btm-sysmodule.
751  */
753 
754 /**
755  * @brief EnableRadio
756  * @note This is used by btm-sysmodule.
757  * @param[in] flag Flag
758  */
760 
761 /**
762  * @brief SetVisibility
763  * @note This is used by btm-sysmodule.
764  * @param[in] inquiry_scan Controls Inquiry Scan, whether the device can be discovered during Inquiry.
765  * @param[in] page_scan Controls Page Scan, whether the device accepts connections.
766  */
767 Result btdrvSetVisibility(bool inquiry_scan, bool page_scan);
768 
769 /**
770  * @brief EnableTbfcScan
771  * @note Only available on [4.0.0+].
772  * @note This is used by btm-sysmodule.
773  * @param[in] flag Flag
774  */
776 
777 /**
778  * @brief RegisterHidReportEvent
779  * @note This also does sharedmem init/handling if needed, on [7.0.0+].
780  * @note The Event must be closed by the user once finished with it.
781  * @param[out] out_event Output Event with autoclear=true. This is signaled when data is available with \ref btdrvGetHidReportEventInfo.
782  */
784 
785 /**
786  * @brief GetHidReportEventInfo
787  * @note \ref btdrvRegisterHidReportEvent must be used before this, on [7.0.0+].
788  * @note This is used by hid-sysmodule. When used by other processes, hid/user-process will conflict. No events will be received by that user-process, or it will be corrupted, etc.
789  * @note [7.0.0+] When data isn't available, the type is set to ::BtdrvHidEventType_Data, with the buffer cleared to all-zero.
790  * @param[out] buffer Output buffer, see \ref BtdrvHidReportEventInfo.
791  * @param[in] size Output buffer size.
792  * @param[out] type \ref BtdrvHidEventType
793  */
794 Result btdrvGetHidReportEventInfo(void* buffer, size_t size, BtdrvHidEventType *type);
795 
796 /// Gets the SharedMemory addr for HidReportEventInfo (\ref BtdrvCircularBuffer), only valid when \ref btdrvRegisterHidReportEvent was previously used, on [7.0.0+].
798 
799 /**
800  * @brief GetLatestPlr
801  * @param[out] out Output \ref BtdrvPlrList, on pre-9.0.0 this is \ref BtdrvPlrStatistics.
802  */
804 
805 /**
806  * @brief GetPendingConnections
807  * @note The output data will be available via \ref btdrvGetHidEventInfo ([12.0.0+] \ref btdrvGetEventInfo).
808  * @note This is used by btm-sysmodule.
809  * @note Only available on [3.0.0+].
810  */
812 
813 /**
814  * @brief GetChannelMap
815  * @note Only available on [3.0.0+].
816  * @param[out] out \ref BtdrvChannelMapList
817  */
819 
820 /**
821  * @brief EnableTxPowerBoostSetting
822  * @note Only available on [3.0.0+].
823  * @param[in] flag Input flag.
824  */
826 
827 /**
828  * @brief IsTxPowerBoostSettingEnabled
829  * @note Only available on [3.0.0+].
830  * @param[out] out Output flag.
831  */
833 
834 /**
835  * @brief EnableAfhSetting
836  * @note Only available on [3.0.0+].
837  * @param[in] flag Input flag.
838  */
840 
841 /**
842  * @brief IsAfhSettingEnabled
843  * @note Only available on [3.0.0+].
844  * @param[out] out Output flag.
845  */
847 
848 /**
849  * @brief InitializeBle
850  * @note Only available on [5.0.0+].
851  * @note This is used by btm-sysmodule.
852  * @note The Event must be closed by the user once finished with it.
853  * @param[out] out_event Output Event with autoclear=true.
854  */
856 
857 /**
858  * @brief EnableBle
859  * @note Only available on [5.0.0+].
860  * @note This is used by btm-sysmodule.
861  */
863 
864 /**
865  * @brief DisableBle
866  * @note Only available on [5.0.0+].
867  * @note This is used by btm-sysmodule.
868  */
870 
871 /**
872  * @brief FinalizeBle
873  * @note Only available on [5.0.0+].
874  */
876 
877 /**
878  * @brief SetBleVisibility
879  * @note Only available on [5.0.0+].
880  * @param[in] discoverable Whether the BLE device is discoverable.
881  * @param[in] connectable Whether the BLE device is connectable.
882  */
883 Result btdrvSetBleVisibility(bool discoverable, bool connectable);
884 
885 /**
886  * @brief SetLeConnectionParameter
887  * @note Only available on [5.0.0-8.1.1]. This is the older version of \ref btdrvSetBleConnectionParameter.
888  * @param[in] param \ref BtdrvLeConnectionParams
889  */
891 
892 /**
893  * @brief SetBleConnectionParameter
894  * @note Only available on [9.0.0+]. This is the newer version of \ref btdrvSetLeConnectionParameter.
895  * @param[in] addr \ref BtdrvAddress
896  * @param[in] param \ref BtdrvBleConnectionParameter
897  * @param[in] preference Unused
898  */
900 
901 /**
902  * @brief SetLeDefaultConnectionParameter
903  * @note Only available on [5.0.0-8.1.1]. This is the older version of \ref btdrvSetBleDefaultConnectionParameter.
904  * @param[in] param \ref BtdrvLeConnectionParams
905  */
907 
908 /**
909  * @brief SetBleDefaultConnectionParameter
910  * @note Only available on [9.0.0+]. This is the newer version of \ref btdrvSetLeDefaultConnectionParameter.
911  * @param[in] param \ref BtdrvBleConnectionParameter
912  */
914 
915 /**
916  * @brief SetBleAdvertiseData
917  * @note Only available on [5.0.0+].
918  * @param[in] data \ref BtdrvBleAdvertisePacketData
919  */
921 
922 /**
923  * @brief SetBleAdvertiseParameter
924  * @note Only available on [5.0.0+].
925  * @param[in] addr \ref BtdrvAddress
926  * @param[in] min_interval Minimum advertisement interval
927  * @param[in] max_interval Maximum advertisement interval
928  */
929 Result btdrvSetBleAdvertiseParameter(BtdrvAddress addr, u16 min_interval, u16 max_interval);
930 
931 /**
932  * @brief StartBleScan
933  * @note Only available on [5.0.0+].
934  * @note This is used by btm-sysmodule.
935  */
937 
938 /**
939  * @brief StopBleScan
940  * @note Only available on [5.0.0+].
941  * @note This is used by btm-sysmodule.
942  */
944 
945 /**
946  * @brief AddBleScanFilterCondition
947  * @note Only available on [5.0.0+].
948  * @note This is used by btm-sysmodule.
949  * @param[in] filter \ref BtdrvBleAdvertiseFilter
950  */
952 
953 /**
954  * @brief DeleteBleScanFilterCondition
955  * @note Only available on [5.0.0+].
956  * @note This is used by btm-sysmodule.
957  * @param[in] filter \ref BtdrvBleAdvertiseFilter
958  */
960 
961 /**
962  * @brief DeleteBleScanFilter
963  * @note Only available on [5.0.0+].
964  * @param[in] index Filter index
965  */
967 
968 /**
969  * @brief ClearBleScanFilters
970  * @note Only available on [5.0.0+].
971  * @note This is used by btm-sysmodule.
972  */
974 
975 /**
976  * @brief EnableBleScanFilter
977  * @note Only available on [5.0.0+].
978  * @note This is used by btm-sysmodule.
979  * @param[in] flag Flag
980  */
982 
983 /**
984  * @brief RegisterGattClient
985  * @note Only available on [5.0.0+].
986  * @note This is used by btm-sysmodule.
987  * @param[in] uuid \ref BtdrvGattAttributeUuid
988  */
990 
991 /**
992  * @brief UnregisterGattClient
993  * @note Only available on [5.0.0+].
994  * @param[in] client_if Client interface ID
995  */
997 
998 /**
999  * @brief UnregisterAllGattClients
1000  * @note Only available on [5.0.0+].
1001  */
1003 
1004 /**
1005  * @brief ConnectGattServer
1006  * @note Only available on [5.0.0+].
1007  * @note This is used by btm-sysmodule.
1008  * @param[in] client_if Client interface ID
1009  * @param[in] addr \ref BtdrvAddress
1010  * @param[in] is_direct Whether a direct connection or a background auto connection
1011  * @param[in] AppletResourceUserId AppletResourceUserId
1012  */
1013 Result btdrvConnectGattServer(u8 client_if, BtdrvAddress addr, bool is_direct, u64 AppletResourceUserId);
1014 
1015 /**
1016  * @brief CancelConnectGattServer
1017  * @note Only available on [5.1.0+].
1018  * @note This is used by btm-sysmodule.
1019  * @param[in] client_if Client interface ID
1020  * @param[in] addr \ref BtdrvAddress
1021  * @param[in] is_direct Whether a direct connection or a background auto connection
1022  */
1023 Result btdrvCancelConnectGattServer(u8 client_if, BtdrvAddress addr, bool is_direct);
1024 
1025 /**
1026  * @brief DisconnectGattServer
1027  * @note Only available on [5.0.0+].
1028  * @note This is used by btm-sysmodule.
1029  * @param[in] conn_id Connection ID
1030  */
1032 
1033 /**
1034  * @brief GetGattAttribute
1035  * @note Only available on [5.0.0+].
1036  * @param[in] addr \ref BtdrvAddress, only used on pre-9.0.0.
1037  * @param[in] conn_id Connection ID
1038  */
1040 
1041 /**
1042  * @brief GetGattService
1043  * @note Only available on [5.0.0+].
1044  * @param[in] conn_id Connection ID
1045  * @param[in] uuid \ref BtdrvGattAttributeUuid
1046  */
1048 
1049 /**
1050  * @brief ConfigureAttMtu
1051  * @note Only available on [5.0.0+].
1052  * @note This is used by btm-sysmodule.
1053  * @param[in] conn_id Connection ID
1054  * @param[in] mtu MTU
1055  */
1057 
1058 /**
1059  * @brief RegisterGattServer
1060  * @note Only available on [5.0.0+].
1061  * @param[in] uuid \ref BtdrvGattAttributeUuid
1062  */
1064 
1065 /**
1066  * @brief UnregisterGattServer
1067  * @note Only available on [5.0.0+].
1068  * @param[in] server_if Server interface ID
1069  */
1071 
1072 /**
1073  * @brief ConnectGattClient
1074  * @note Only available on [5.0.0+].
1075  * @param[in] server_if Server interface ID
1076  * @param[in] addr \ref BtdrvAddress
1077  * @param[in] is_direct Whether a direct connection or a background auto connection
1078  */
1079 Result btdrvConnectGattClient(u8 server_if, BtdrvAddress addr, bool is_direct);
1080 
1081 /**
1082  * @brief DisconnectGattClient
1083  * @note Only available on [5.0.0+].
1084  * @param[in] conn_id Connection ID
1085  * @param[in] addr \ref BtdrvAddress, only used on pre-9.0.0.
1086  */
1088 
1089 /**
1090  * @brief AddGattService
1091  * @note Only available on [5.0.0+].
1092  * @param[in] server_if Server interface ID
1093  * @param[in] uuid \ref BtdrvGattAttributeUuid
1094  * @param[in] num_handle Number of handles
1095  * @param[in] is_primary Is a primary service or not
1096  */
1097 Result btdrvAddGattService(u8 server_if, const BtdrvGattAttributeUuid *uuid, u8 num_handle, bool is_primary);
1098 
1099 /**
1100  * @brief EnableGattService
1101  * @note Only available on [5.0.0+].
1102  * @param[in] service_id Service ID
1103  * @param[in] uuid \ref BtdrvGattAttributeUuid
1104  */
1106 
1107 /**
1108  * @brief AddGattCharacteristic
1109  * @note Only available on [5.0.0+].
1110  * @param[in] service_id Service ID
1111  * @param[in] serv_uuid Service UUID \ref BtdrvGattAttributeUuid
1112  * @param[in] char_uuid Characteristic UUID \ref BtdrvGattAttributeUuid
1113  * @param[in] permissions \ref BtdrvGattAttributePermission
1114  * @param[in] property \ref BtdrvGattCharacteristicProperty
1115  */
1116 Result btdrvAddGattCharacteristic(u8 service_id, const BtdrvGattAttributeUuid *serv_uuid, const BtdrvGattAttributeUuid *char_uuid, u8 permissions, u16 property);
1117 
1118 /**
1119  * @brief AddGattDescriptor
1120  * @note Only available on [5.0.0+].
1121  * @param[in] service_id Service ID
1122  * @param[in] serv_uuid Service UUID \ref BtdrvGattAttributeUuid
1123  * @param[in] desc_uuid Descriptor UUID \ref BtdrvGattAttributeUuid
1124  * @param[in] permissions \ref BtdrvGattAttributePermission
1125  */
1126 Result btdrvAddGattDescriptor(u8 service_id, const BtdrvGattAttributeUuid *serv_uuid, const BtdrvGattAttributeUuid *desc_uuid, u16 permissions);
1127 
1128 /**
1129  * @brief GetBleManagedEventInfo
1130  * @note Only available on [5.0.0+].
1131  * @note This is used by btm-sysmodule.
1132  * @param[out] buffer Output buffer. 0x400-bytes from state is written here. See \ref BtdrvBleEventInfo.
1133  * @param[in] size Output buffer size.
1134  * @param[out] type Output BtdrvBleEventType.
1135  */
1136 Result btdrvGetBleManagedEventInfo(void* buffer, size_t size, BtdrvBleEventType *type);
1137 
1138 /**
1139  * @brief GetGattFirstCharacteristic
1140  * @note Only available on [5.0.0+].
1141  * @param[in] conn_id Connection ID
1142  * @param[in] serv_id Service GATT ID \ref BtdrvGattId
1143  * @param[in] is_primary Is a primary service or not
1144  * @param[in] filter_uuid Characteristic filter UUID \ref BtdrvGattAttributeUuid
1145  * @param[out] out_property Output property \ref BtdrvGattCharacteristicProperty
1146  * @param[out] out_char_id Output characteristic GATT ID \ref BtdrvGattId
1147  */
1148 Result btdrvGetGattFirstCharacteristic(u32 conn_id, const BtdrvGattId *serv_id, bool is_primary, const BtdrvGattAttributeUuid *filter_uuid, u8 *out_property, BtdrvGattId *out_char_id);
1149 
1150 /**
1151  * @brief GetGattNextCharacteristic
1152  * @note Only available on [5.0.0+].
1153  * @param[in] conn_id Connection ID
1154  * @param[in] serv_id Service ID \ref BtdrvGattId
1155  * @param[in] is_primary Is a primary service or not
1156  * @param[in] char_id Previous characteristic GATT ID \ref BtdrvGattId
1157  * @param[in] filter_uuid Characteristic filter UUID \ref BtdrvGattAttributeUuid
1158  * @param[out] out_property Output property \ref BtdrvGattCharacteristicProperty
1159  * @param[out] out_char_id Output characteristic GATT ID \ref BtdrvGattId
1160  */
1161 Result btdrvGetGattNextCharacteristic(u32 conn_id, const BtdrvGattId *serv_id, bool is_primary, const BtdrvGattId *char_id, const BtdrvGattAttributeUuid *filter_uuid, u8 *out_property, BtdrvGattId *out_char_id);
1162 
1163 /**
1164  * @brief GetGattFirstDescriptor
1165  * @note Only available on [5.0.0+].
1166  * @param[in] conn_id Connection ID
1167  * @param[in] serv_id Service GATT ID \ref BtdrvGattId
1168  * @param[in] is_primary Is a primary service or not
1169  * @param[in] char_id Characteristic GATT ID \ref BtdrvGattId
1170  * @param[in] filter_uuid Descriptor filter UUID \ref BtdrvGattAttributeUuid
1171  * @param[out] out_desc_id Output descriptor GATT ID \ref BtdrvGattId
1172  */
1173 Result btdrvGetGattFirstDescriptor(u32 conn_id, const BtdrvGattId *serv_id, bool is_primary, const BtdrvGattId *char_id, const BtdrvGattAttributeUuid *filter_uuid, BtdrvGattId *out_desc_id);
1174 
1175 /**
1176  * @brief GetGattNextDescriptor
1177  * @note Only available on [5.0.0+].
1178  * @param[in] conn_id Connection ID
1179  * @param[in] serv_id Service GATT ID \ref BtdrvGattId
1180  * @param[in] is_primary Is a primary service or not
1181  * @param[in] char_id Characteristic GATT ID \ref BtdrvGattId
1182  * @param[in] desc_id Previous descriptor GATT ID \ref BtdrvGattId
1183  * @param[in] filter_uuid Descriptor filter UUID \ref BtdrvGattAttributeUuid
1184  * @param[out] out_desc_id Output descriptor GATT ID \ref BtdrvGattId
1185  */
1186 Result btdrvGetGattNextDescriptor(u32 conn_id, const BtdrvGattId *serv_id, bool is_primary, const BtdrvGattId *char_id, const BtdrvGattId *desc_id, const BtdrvGattAttributeUuid *filter_uuid, BtdrvGattId *out_desc_id);
1187 
1188 /**
1189  * @brief RegisterGattManagedDataPath
1190  * @note Only available on [5.0.0+].
1191  * @note This is used by btm-sysmodule.
1192  * @param[in] uuid \ref BtdrvGattAttributeUuid
1193  */
1195 
1196 /**
1197  * @brief UnregisterGattManagedDataPath
1198  * @note Only available on [5.0.0+].
1199  * @param[in] uuid \ref BtdrvGattAttributeUuid
1200  */
1202 
1203 /**
1204  * @brief RegisterGattHidDataPath
1205  * @note Only available on [5.0.0+].
1206  * @note This is used by btm-sysmodule.
1207  * @param[in] uuid \ref BtdrvGattAttributeUuid
1208  */
1210 
1211 /**
1212  * @brief UnregisterGattHidDataPath
1213  * @note Only available on [5.0.0+].
1214  * @note This is used by btm-sysmodule.
1215  * @param[in] uuid \ref BtdrvGattAttributeUuid
1216  */
1218 
1219 /**
1220  * @brief RegisterGattDataPath
1221  * @note Only available on [5.0.0+].
1222  * @note This is used by btm-sysmodule.
1223  * @param[in] uuid \ref BtdrvGattAttributeUuid
1224  */
1226 
1227 /**
1228  * @brief UnregisterGattDataPath
1229  * @note Only available on [5.0.0+].
1230  * @note This is used by btm-sysmodule.
1231  * @param[in] uuid \ref BtdrvGattAttributeUuid
1232  */
1234 
1235 /**
1236  * @brief ReadGattCharacteristic
1237  * @note Only available on [5.0.0+].
1238  * @param[in] connection_handle ConnectionHandle
1239  * @param[in] is_primary Is a primary service or not
1240  * @param[in] serv_id Service GATT ID \ref BtdrvGattId
1241  * @param[in] char_id Characteristic GATT ID \ref BtdrvGattId
1242  * @param[in] auth_req \ref BtdrvGattAuthReqType
1243  */
1244 Result btdrvReadGattCharacteristic(u32 connection_handle, bool is_primary, const BtdrvGattId *serv_id, const BtdrvGattId *char_id, u8 auth_req);
1245 
1246 /**
1247  * @brief ReadGattDescriptor
1248  * @note Only available on [5.0.0+].
1249  * @param[in] connection_handle ConnectionHandle
1250  * @param[in] is_primary Is a primary service or not
1251  * @param[in] serv_id Service GATT ID \ref BtdrvGattId
1252  * @param[in] char_id Characteristic GATT ID \ref BtdrvGattId
1253  * @param[in] desc_id Descriptor GATT ID \ref BtdrvGattId
1254  * @param[in] auth_req \ref BtdrvGattAuthReqType
1255  */
1256 Result btdrvReadGattDescriptor(u32 connection_handle, bool is_primary, const BtdrvGattId *serv_id, const BtdrvGattId *char_id, const BtdrvGattId *desc_id, u8 auth_req);
1257 
1258 /**
1259  * @brief WriteGattCharacteristic
1260  * @note Only available on [5.0.0+].
1261  * @param[in] connection_handle ConnectionHandle
1262  * @param[in] is_primary Is a primary service or not
1263  * @param[in] serv_id Service GATT ID \ref BtdrvGattId
1264  * @param[in] char_id Characteristic GATT ID \ref BtdrvGattId
1265  * @param[in] buffer Input buffer.
1266  * @param[in] size Input buffer size, must be <=0x258.
1267  * @param[in] auth_req \ref BtdrvGattAuthReqType
1268  * @param[in] with_response Whether to use Write-With-Response write type or not
1269  */
1270 Result btdrvWriteGattCharacteristic(u32 connection_handle, bool is_primary, const BtdrvGattId *serv_id, const BtdrvGattId *char_id, const void* buffer, size_t size, u8 auth_req, bool with_response);
1271 
1272 /**
1273  * @brief WriteGattDescriptor
1274  * @note Only available on [5.0.0+].
1275  * @param[in] connection_handle ConnectionHandle
1276  * @param[in] is_primary Is a primary service or not
1277  * @param[in] serv_id Service GATT ID \ref BtdrvGattId
1278  * @param[in] char_id Characteristic GATT ID \ref BtdrvGattId
1279  * @param[in] desc_id Descriptor GATT ID \ref BtdrvGattId
1280  * @param[in] buffer Input buffer.
1281  * @param[in] size Input buffer size, must be <=0x258.
1282  * @param[in] auth_req \ref BtdrvGattAuthReqType
1283  */
1284 Result btdrvWriteGattDescriptor(u32 connection_handle, bool is_primary, const BtdrvGattId *serv_id, const BtdrvGattId *char_id, const BtdrvGattId *desc_id, const void* buffer, size_t size, u8 auth_req);
1285 
1286 /**
1287  * @brief RegisterGattNotification
1288  * @note Only available on [5.0.0+].
1289  * @param[in] connection_handle ConnectionHandle
1290  * @param[in] is_primary Is a primary service or not
1291  * @param[in] serv_id Service GATT ID \ref BtdrvGattId
1292  * @param[in] char_id Characteristic GATT ID \ref BtdrvGattId
1293  */
1294 Result btdrvRegisterGattNotification(u32 connection_handle, bool is_primary, const BtdrvGattId *serv_id, const BtdrvGattId *char_id);
1295 
1296 /**
1297  * @brief UnregisterGattNotification
1298  * @note Only available on [5.0.0+].
1299  * @param[in] connection_handle ConnectionHandle
1300  * @param[in] is_primary Is a primary service or not
1301  * @param[in] serv_id Service GATT ID \ref BtdrvGattId
1302  * @param[in] char_id Characteristic GATT ID \ref BtdrvGattId
1303  */
1304 Result btdrvUnregisterGattNotification(u32 connection_handle, bool is_primary, const BtdrvGattId *serv_id, const BtdrvGattId *char_id);
1305 
1306 /**
1307  * @brief GetLeHidEventInfo
1308  * @note Only available on [5.0.0+].
1309  * @note The state used by this is reset after writing the data to output.
1310  * @param[out] buffer Output buffer. 0x400-bytes from state is written here. See \ref BtdrvBleEventInfo.
1311  * @param[in] size Output buffer size.
1312  * @param[out] type \ref BtdrvBleEventType.
1313  */
1314 Result btdrvGetLeHidEventInfo(void* buffer, size_t size, BtdrvBleEventType *type);
1315 
1316 /**
1317  * @brief RegisterBleHidEvent
1318  * @note Only available on [5.0.0+].
1319  * @note The Event must be closed by the user once finished with it.
1320  * @param[out] out_event Output Event with autoclear=true.
1321  */
1323 
1324 /**
1325  * @brief SetBleScanParameter
1326  * @note Only available on [5.1.0+].
1327  * @note This is used by btm-sysmodule.
1328  * @param[in] scan_interval Scan interval
1329  * @param[in] scan_window Scan window
1330  */
1331 Result btdrvSetBleScanParameter(u16 scan_interval, u16 scan_window);
1332 
1333 /**
1334  * @brief MoveToSecondaryPiconet
1335  * @note The response will be available via \ref btdrvGetHidEventInfo ([12.0.0+] \ref btdrvGetEventInfo).
1336  * @note Only available on [10.0.0+].
1337  * @param[in] addr \ref BtdrvAddress
1338  */
1340 
1341 /**
1342  * @brief IsBluetoothEnabled
1343  * @note Only available on [12.0.0+].
1344  * @param[out] out Output flag.
1345  */
1347 
1348 /**
1349  * @brief AcquireAudioEvent
1350  * @note Only available on [12.0.0+].
1351  * @param[out] out_event Output Event.
1352  * @param[in] autoclear Event autoclear.
1353  */
1354 Result btdrvAcquireAudioEvent(Event* out_event, bool autoclear);
1355 
1356 /**
1357  * @brief GetAudioEventInfo
1358  * @note Only available on [12.0.0+].
1359  * @param[out] buffer Output buffer, see \ref BtdrvAudioEventInfo.
1360  * @param[in] size Output buffer size.
1361  * @param[out] type \ref BtdrvAudioEventType.
1362  */
1363 Result btdrvGetAudioEventInfo(void* buffer, size_t size, BtdrvAudioEventType *type);
1364 
1365 /**
1366  * @brief OpenAudioConnection
1367  * @note Only available on [12.0.0+].
1368  * @param[in] addr \ref BtdrvAddress
1369  */
1371 
1372 /**
1373  * @brief CloseAudioConnection
1374  * @note Only available on [12.0.0+].
1375  * @param[in] addr \ref BtdrvAddress
1376  */
1378 
1379 /**
1380  * @brief OpenAudioOut
1381  * @note Only available on [12.0.0+].
1382  * @param[in] addr \ref BtdrvAddress
1383  * @param[out] audio_handle Audio handle.
1384  */
1386 
1387 /**
1388  * @brief CloseAudioOut
1389  * @note Only available on [12.0.0+].
1390  * @param[in] audio_handle Audio handle from \ref btdrvOpenAudioOut.
1391  */
1393 
1394 /**
1395  * @brief StartAudioOut
1396  * @note Only available on [12.0.0+].
1397  * @param[in] audio_handle Audio handle from \ref btdrvOpenAudioOut.
1398  * @param[in] pcm_param \ref BtdrvPcmParameter
1399  * @param[in] in_latency Input latency in nanoseconds.
1400  * @param[out] out_latency Output latency in nanoseconds.
1401  * @param[out] out1 Unknown output.
1402  */
1403 Result btdrvStartAudioOut(u32 audio_handle, const BtdrvPcmParameter *pcm_param, s64 in_latency, s64 *out_latency, u64 *out1);
1404 
1405 /**
1406  * @brief StopAudioOut
1407  * @note Only available on [12.0.0+].
1408  * @param[in] audio_handle Audio handle from \ref btdrvOpenAudioOut.
1409  */
1411 
1412 /**
1413  * @brief GetAudioOutState
1414  * @note Only available on [12.0.0+].
1415  * @param[in] audio_handle Audio handle from \ref btdrvOpenAudioOut.
1416  * @param[out] out \ref BtdrvAudioOutState
1417  */
1419 
1420 /**
1421  * @brief GetAudioOutFeedingCodec
1422  * @note Only available on [12.0.0+].
1423  * @param[in] audio_handle Audio handle from \ref btdrvOpenAudioOut.
1424  * @param[out] out \ref BtdrvAudioCodec
1425  */
1427 
1428 /**
1429  * @brief GetAudioOutFeedingParameter
1430  * @note Only available on [12.0.0+].
1431  * @param[in] audio_handle Audio handle from \ref btdrvOpenAudioOut.
1432  * @param[out] out \ref BtdrvPcmParameter
1433  */
1435 
1436 /**
1437  * @brief AcquireAudioOutStateChangedEvent
1438  * @note Only available on [12.0.0+].
1439  * @param[in] audio_handle Audio handle from \ref btdrvOpenAudioOut.
1440  * @param[out] out_event Output Event.
1441  * @param[in] autoclear Event autoclear.
1442  */
1443 Result btdrvAcquireAudioOutStateChangedEvent(u32 audio_handle, Event* out_event, bool autoclear);
1444 
1445 /**
1446  * @brief AcquireAudioOutBufferAvailableEvent
1447  * @note Only available on [12.0.0+].
1448  * @param[in] audio_handle Audio handle from \ref btdrvOpenAudioOut.
1449  * @param[out] out_event Output Event.
1450  * @param[in] autoclear Event autoclear.
1451  */
1452 Result btdrvAcquireAudioOutBufferAvailableEvent(u32 audio_handle, Event* out_event, bool autoclear);
1453 
1454 /**
1455  * @brief SendAudioData
1456  * @note Only available on [12.0.0+].
1457  * @param[in] audio_handle Audio handle from \ref btdrvOpenAudioOut.
1458  * @param[in] buffer Input buffer.
1459  * @param[in] size Input buffer size.
1460  * @param[out] Output transferred size. This is always either 0 (error occured) or the buffer size.
1461  */
1462 Result btdrvSendAudioData(u32 audio_handle, const void* buffer, size_t size, u64 *transferred_size);
1463 
1464 /**
1465  * @brief AcquireAudioControlInputStateChangedEvent
1466  * @note Only available on [12.0.0+].
1467  * @param[out] out_event Output Event.
1468  * @param[in] autoclear Event autoclear.
1469  */
1471 
1472 /**
1473  * @brief GetAudioControlInputState
1474  * @note Only available on [12.0.0+].
1475  * @param[out] states Output array of \ref BtdrvAudioControlButtonState.
1476  * @param[in] count Size of the states array in entries, the maximum is 0xF.
1477  * @param[out] total_out Total output entries.
1478  */
1480 
1481 /**
1482  * @brief AcquireAudioConnectionStateChangedEvent
1483  * @note Only available on [12.0.0-13.2.1].
1484  * @param[out] out_event Output Event.
1485  * @param[in] autoclear Event autoclear.
1486  */
1488 
1489 /**
1490  * @brief GetConnectedAudioDevice
1491  * @note Only available on [12.0.0-13.2.1].
1492  * @param[out] addrs Output array of \ref BtdrvAddress.
1493  * @param[in] count Size of the addrs array in entries, the maximum is 0x8.
1494  * @param[out] total_out Total output entries.
1495  */
1497 
1498 /**
1499  * @brief CloseAudioControlInput
1500  * @note Only available on [13.0.0+].
1501  * @param[in] addr \ref BtdrvAddress
1502  */
1504 
1505 /**
1506  * @brief RegisterAudioControlNotification
1507  * @note Only available on [13.0.0+].
1508  * @param[in] addr \ref BtdrvAddress
1509  * @param[in] event_type AvrcEventType
1510  */
1512 
1513 /**
1514  * @brief SendAudioControlPassthroughCommand
1515  * @note Only available on [13.0.0+].
1516  * @param[in] addr \ref BtdrvAddress
1517  * @param[in] op_id AvrcOperationId
1518  * @param[in] state_type AvrcStateType
1519  */
1521 
1522 /**
1523  * @brief SendAudioControlSetAbsoluteVolumeCommand
1524  * @note Only available on [13.0.0+].
1525  * @param[in] addr \ref BtdrvAddress
1526  * @param[in] val Input value
1527  */
1529 
1530 /**
1531  * @brief IsManufacturingMode
1532  * @note Only available on [5.0.0+].
1533  * @param[out] out Output flag.
1534  */
1536 
1537 /**
1538  * @brief EmulateBluetoothCrash
1539  * @note Only available on [7.0.0+].
1540  * @param[in] reason \ref BtdrvFatalReason
1541  */
1543 
1544 /**
1545  * @brief GetBleChannelMap
1546  * @note Only available on [9.0.0+].
1547  * @param[out] out \ref BtdrvChannelMapList
1548  */
1550 
1551 ///@name CircularBuffer
1552 ///@{
1553 
1554 /**
1555  * @brief Read
1556  * @note Used by \ref btdrvGetHidReportEventInfo on [7.0.0+].
1557  * @param c \ref BtdrvCircularBuffer
1558  */
1560 
1561 /**
1562  * @brief Free
1563  * @note Used by \ref btdrvGetHidReportEventInfo on [7.0.0+].
1564  * @param c \ref BtdrvCircularBuffer
1565  */
1567 
1568 ///@}
1569 
Result btdrvFinalizeBle(void)
FinalizeBle.
Result btdrvConnectGattServer(u8 client_if, BtdrvAddress addr, bool is_direct, u64 AppletResourceUserId)
ConnectGattServer.
Result btdrvOpenAudioConnection(BtdrvAddress addr)
OpenAudioConnection.
Result btdrvAcquireAudioConnectionStateChangedEvent(Event *out_event, bool autoclear)
AcquireAudioConnectionStateChangedEvent.
Result btdrvSetHidReport(BtdrvAddress addr, BtdrvBluetoothHhReportType type, const BtdrvHidReport *buffer)
This sends a HID SET_REPORT transaction packet.
Result btdrvGetPairedDeviceInfo(BtdrvAddress addr, SetSysBluetoothDevicesSettings *settings)
GetPairedDeviceInfo.
Result btdrvGetHidReportEventInfo(void *buffer, size_t size, BtdrvHidEventType *type)
GetHidReportEventInfo.
Result btdrvSetLeConnectionParameter(const BtdrvLeConnectionParams *param)
SetLeConnectionParameter.
Result btdrvGetGattAttribute(BtdrvAddress addr, u32 conn_id)
GetGattAttribute.
Result btdrvUnregisterGattServer(u8 server_if)
UnregisterGattServer.
Result btdrvGetHidReport(BtdrvAddress addr, u8 report_id, BtdrvBluetoothHhReportType type)
This sends a HID GET_REPORT transaction packet.
Result btdrvOpenHidConnection(BtdrvAddress addr)
OpenHidConnection.
Result btdrvClearBleScanFilters(void)
ClearBleScanFilters.
Result btdrvUnregisterGattHidDataPath(const BtdrvGattAttributeUuid *uuid)
UnregisterGattHidDataPath.
Result btdrvDisconnectGattServer(u32 conn_id)
DisconnectGattServer.
Result btdrvIsTxPowerBoostSettingEnabled(bool *out)
IsTxPowerBoostSettingEnabled.
Result btdrvCloseAudioOut(u32 audio_handle)
CloseAudioOut.
Result btdrvWriteGattCharacteristic(u32 connection_handle, bool is_primary, const BtdrvGattId *serv_id, const BtdrvGattId *char_id, const void *buffer, size_t size, u8 auth_req, bool with_response)
WriteGattCharacteristic.
Result btdrvRegisterAudioControlNotification(BtdrvAddress addr, u32 event_type)
RegisterAudioControlNotification.
Result btdrvGetPendingConnections(void)
GetPendingConnections.
void * btdrvCircularBufferRead(BtdrvCircularBuffer *c)
Read.
Result btdrvGetLatestPlr(BtdrvPlrList *out)
GetLatestPlr.
Result btdrvStartAudioOut(u32 audio_handle, const BtdrvPcmParameter *pcm_param, s64 in_latency, s64 *out_latency, u64 *out1)
StartAudioOut.
Result btdrvConnectGattClient(u8 server_if, BtdrvAddress addr, bool is_direct)
ConnectGattClient.
Result btdrvStopInquiry(void)
This stops Inquiry which was started by btdrvStartInquiry, if it's still active.
Result btdrvAddPairedDeviceInfo(const SetSysBluetoothDevicesSettings *settings)
AddPairedDeviceInfo.
Result btdrvGetHidEventInfo(void *buffer, size_t size, BtdrvHidEventType *type)
GetHidEventInfo.
Result btdrvInitialize(void)
Initialize btdrv.
Result btdrvSetBleScanParameter(u16 scan_interval, u16 scan_window)
SetBleScanParameter.
Result btdrvRegisterGattServer(const BtdrvGattAttributeUuid *uuid)
RegisterGattServer.
Result btdrvIsBluetoothEnabled(bool *out)
IsBluetoothEnabled.
Result btdrvEnableMcMode(bool flag)
EnableMcMode.
Result btdrvGetGattNextCharacteristic(u32 conn_id, const BtdrvGattId *serv_id, bool is_primary, const BtdrvGattId *char_id, const BtdrvGattAttributeUuid *filter_uuid, u8 *out_property, BtdrvGattId *out_char_id)
GetGattNextCharacteristic.
Result btdrvUnregisterGattNotification(u32 connection_handle, bool is_primary, const BtdrvGattId *serv_id, const BtdrvGattId *char_id)
UnregisterGattNotification.
Result btdrvSetBleConnectionParameter(BtdrvAddress addr, const BtdrvBleConnectionParameter *param, bool preference)
SetBleConnectionParameter.
Result btdrvSetLeDefaultConnectionParameter(const BtdrvLeConnectionParams *param)
SetLeDefaultConnectionParameter.
Result btdrvCreateBond(BtdrvAddress addr, u32 type)
CreateBond.
Result btdrvAcquireAudioOutBufferAvailableEvent(u32 audio_handle, Event *out_event, bool autoclear)
AcquireAudioOutBufferAvailableEvent.
Result btdrvCloseAudioConnection(BtdrvAddress addr)
CloseAudioConnection.
Result btdrvRegisterHidReportEvent(Event *out_event)
RegisterHidReportEvent.
Result btdrvSendAudioControlPassthroughCommand(BtdrvAddress addr, u32 op_id, u32 state_type)
SendAudioControlPassthroughCommand.
Result btdrvRegisterGattDataPath(const BtdrvGattAttributeUuid *uuid)
RegisterGattDataPath.
Result btdrvSetBleVisibility(bool discoverable, bool connectable)
SetBleVisibility.
Result btdrvReadGattCharacteristic(u32 connection_handle, bool is_primary, const BtdrvGattId *serv_id, const BtdrvGattId *char_id, u8 auth_req)
ReadGattCharacteristic.
Result btdrvSendAudioData(u32 audio_handle, const void *buffer, size_t size, u64 *transferred_size)
SendAudioData.
Result btdrvEnableBurstMode(BtdrvAddress addr, bool flag)
EnableBurstMode.
Result btdrvEnableBle(void)
EnableBle.
Result btdrvEmulateBluetoothCrash(BtdrvFatalReason reason)
EmulateBluetoothCrash.
Result btdrvGetEventInfo(void *buffer, size_t size, BtdrvEventType *type)
GetEventInfo.
Result btdrvMoveToSecondaryPiconet(BtdrvAddress addr)
MoveToSecondaryPiconet.
Result btdrvGetGattFirstDescriptor(u32 conn_id, const BtdrvGattId *serv_id, bool is_primary, const BtdrvGattId *char_id, const BtdrvGattAttributeUuid *filter_uuid, BtdrvGattId *out_desc_id)
GetGattFirstDescriptor.
Result btdrvReadGattDescriptor(u32 connection_handle, bool is_primary, const BtdrvGattId *serv_id, const BtdrvGattId *char_id, const BtdrvGattId *desc_id, u8 auth_req)
ReadGattDescriptor.
Result btdrvRespondToSspRequest(BtdrvAddress addr, u32 variant, bool accept, u32 passkey)
RespondToSspRequest.
Result btdrvLegacySetAdapterProperty(BtdrvBluetoothPropertyType type, const void *buffer, size_t size)
SetAdapterProperty [1.0.0-11.0.1].
Result btdrvSetVisibility(bool inquiry_scan, bool page_scan)
SetVisibility.
Result btdrvAcquireAudioControlInputStateChangedEvent(Event *out_event, bool autoclear)
AcquireAudioControlInputStateChangedEvent.
Result btdrvRegisterGattManagedDataPath(const BtdrvGattAttributeUuid *uuid)
RegisterGattManagedDataPath.
Result btdrvLegacyStartInquiry(void)
StartInquiry [1.0.0-11.0.1].
Result btdrvSetBleAdvertiseData(const BtdrvBleAdvertisePacketData *data)
SetBleAdvertiseData.
Result btdrvUnregisterGattDataPath(const BtdrvGattAttributeUuid *uuid)
UnregisterGattDataPath.
Result btdrvAcquireAudioOutStateChangedEvent(u32 audio_handle, Event *out_event, bool autoclear)
AcquireAudioOutStateChangedEvent.
Result btdrvGetChannelMap(BtdrvChannelMapList *out)
GetChannelMap.
Result btdrvOpenAudioOut(BtdrvAddress addr, u32 *audio_handle)
OpenAudioOut.
void * btdrvGetHidReportEventInfoSharedmemAddr(void)
Gets the SharedMemory addr for HidReportEventInfo (BtdrvCircularBuffer), only valid when btdrvRegiste...
Result btdrvEnableTxPowerBoostSetting(bool flag)
EnableTxPowerBoostSetting.
Result btdrvGetAdapterProperty(BtdrvAdapterPropertyType type, BtdrvAdapterProperty *property)
GetAdapterProperty [12.0.0+].
Result btdrvGetAudioOutFeedingParameter(u32 audio_handle, BtdrvPcmParameter *out)
GetAudioOutFeedingParameter.
Result btdrvAcquireAudioEvent(Event *out_event, bool autoclear)
AcquireAudioEvent.
Result btdrvDisableBle(void)
DisableBle.
Result btdrvConfigureAttMtu(u32 conn_id, u16 mtu)
ConfigureAttMtu.
Result btdrvFinalizeBluetooth(void)
FinalizeBluetooth.
Result btdrvInitializeBluetooth(Event *out_event)
InitializeBluetooth.
Result btdrvRegisterBleHidEvent(Event *out_event)
RegisterBleHidEvent.
Result btdrvRegisterGattClient(const BtdrvGattAttributeUuid *uuid)
RegisterGattClient.
Result btdrvGetBleChannelMap(BtdrvChannelMapList *out)
GetBleChannelMap.
Result btdrvRegisterGattHidDataPath(const BtdrvGattAttributeUuid *uuid)
RegisterGattHidDataPath.
Result btdrvWriteHidData(BtdrvAddress addr, const BtdrvHidReport *buffer)
This sends a HID DATA transaction packet with report-type Output.
Result btdrvDisableLlrScan(void)
DisableLlrScan.
Result btdrvSetBleAdvertiseParameter(BtdrvAddress addr, u16 min_interval, u16 max_interval)
SetBleAdvertiseParameter.
Result btdrvInitializeHid(Event *out_event)
InitializeHid.
Result btdrvSetTsi(BtdrvAddress addr, u8 tsi)
SetTsi.
Service * btdrvGetServiceSession(void)
Gets the Service object for the actual btdrv service session.
Result btdrvGetAudioOutState(u32 audio_handle, BtdrvAudioOutState *out)
GetAudioOutState.
Result btdrvSetZeroRetransmission(BtdrvAddress addr, u8 *report_ids, u8 count)
SetZeroRetransmission.
Result btdrvGetBleManagedEventInfo(void *buffer, size_t size, BtdrvBleEventType *type)
GetBleManagedEventInfo.
Result btdrvCloseHidConnection(BtdrvAddress addr)
CloseHidConnection.
Result btdrvStopAudioOut(u32 audio_handle)
StopAudioOut.
Result btdrvDeleteBleScanFilter(u8 index)
DeleteBleScanFilter.
Result btdrvEnableGattService(u8 service_id, const BtdrvGattAttributeUuid *uuid)
EnableGattService.
Result btdrvCancelConnectGattServer(u8 client_if, BtdrvAddress addr, bool is_direct)
CancelConnectGattServer.
Result btdrvGetConnectedAudioDevice(BtdrvAddress *addrs, s32 count, s32 *total_out)
GetConnectedAudioDevice.
bool btdrvCircularBufferFree(BtdrvCircularBuffer *c)
Free.
Result btdrvEnableBleScanFilter(bool flag)
EnableBleScanFilter.
Result btdrvRegisterGattNotification(u32 connection_handle, bool is_primary, const BtdrvGattId *serv_id, const BtdrvGattId *char_id)
RegisterGattNotification.
Result btdrvWriteHidData2(BtdrvAddress addr, const void *buffer, size_t size)
WriteHidData2.
Result btdrvGetAdapterProperties(BtdrvAdapterPropertySet *properties)
GetAdapterProperties [12.0.0+].
Result btdrvDisconnectGattClient(u8 conn_id, BtdrvAddress addr)
DisconnectGattClient.
Result btdrvEnableRadio(bool flag)
EnableRadio.
Result btdrvAddBleScanFilterCondition(const BtdrvBleAdvertiseFilter *filter)
AddBleScanFilterCondition.
Result btdrvFinalizeHid(void)
FinalizeHid.
Result btdrvGetGattService(u32 conn_id, const BtdrvGattAttributeUuid *uuid)
GetGattService.
Result btdrvInitializeBle(Event *out_event)
InitializeBle.
Result btdrvGetLeHidEventInfo(void *buffer, size_t size, BtdrvBleEventType *type)
GetLeHidEventInfo.
Result btdrvLegacyRespondToPinRequest(BtdrvAddress addr, bool flag, const BtdrvBluetoothPinCode *pin_code, u8 length)
RespondToPinRequest [1.0.0-11.0.1].
Result btdrvGetAudioEventInfo(void *buffer, size_t size, BtdrvAudioEventType *type)
GetAudioEventInfo.
Result btdrvSendAudioControlSetAbsoluteVolumeCommand(BtdrvAddress addr, s32 val)
SendAudioControlSetAbsoluteVolumeCommand.
Result btdrvDisableBluetooth(void)
DisableBluetooth.
Result btdrvAddGattDescriptor(u8 service_id, const BtdrvGattAttributeUuid *serv_uuid, const BtdrvGattAttributeUuid *desc_uuid, u16 permissions)
AddGattDescriptor.
Result btdrvGetAudioOutFeedingCodec(u32 audio_handle, BtdrvAudioCodec *out)
GetAudioOutFeedingCodec.
Result btdrvIsAfhSettingEnabled(bool *out)
IsAfhSettingEnabled.
Result btdrvRemoveBond(BtdrvAddress addr)
RemoveBond.
Result btdrvGetAudioControlInputState(BtdrvAudioControlButtonState *states, s32 count, s32 *total_out)
GetAudioControlInputState.
Result btdrvUnregisterAllGattClients(void)
UnregisterAllGattClients.
Result btdrvTriggerConnection(BtdrvAddress addr, u16 unk)
TriggerConnection.
Result btdrvLegacyGetAdapterProperties(BtdrvAdapterPropertyOld *properties)
GetAdapterProperties [1.0.0-11.0.1].
Result btdrvLegacyGetAdapterProperty(BtdrvBluetoothPropertyType type, void *buffer, size_t size)
GetAdapterProperty [1.0.0-11.0.1].
void btdrvExit(void)
Exit btdrv.
Result btdrvDeleteBleScanFilterCondition(const BtdrvBleAdvertiseFilter *filter)
DeleteBleScanFilterCondition.
Result btdrvUnregisterGattManagedDataPath(const BtdrvGattAttributeUuid *uuid)
UnregisterGattManagedDataPath.
Result btdrvGetGattFirstCharacteristic(u32 conn_id, const BtdrvGattId *serv_id, bool is_primary, const BtdrvGattAttributeUuid *filter_uuid, u8 *out_property, BtdrvGattId *out_char_id)
GetGattFirstCharacteristic.
Result btdrvIsManufacturingMode(bool *out)
IsManufacturingMode.
Result btdrvAddGattService(u8 server_if, const BtdrvGattAttributeUuid *uuid, u8 num_handle, bool is_primary)
AddGattService.
Result btdrvStopBleScan(void)
StopBleScan.
Result btdrvStartBleScan(void)
StartBleScan.
Result btdrvCancelBond(BtdrvAddress addr)
CancelBond.
Result btdrvStartInquiry(u32 services, s64 duration)
StartInquiry [12.0.0+].
Result btdrvEnableAfhSetting(bool flag)
EnableAfhSetting.
Result btdrvWriteGattDescriptor(u32 connection_handle, bool is_primary, const BtdrvGattId *serv_id, const BtdrvGattId *char_id, const BtdrvGattId *desc_id, const void *buffer, size_t size, u8 auth_req)
WriteGattDescriptor.
Result btdrvSetBleDefaultConnectionParameter(const BtdrvBleConnectionParameter *param)
SetBleDefaultConnectionParameter.
Result btdrvRespondToPinRequest(BtdrvAddress addr, const BtdrvPinCode *pin_code)
RespondToPinRequest [12.0.0+].
Result btdrvEnableTbfcScan(bool flag)
EnableTbfcScan.
Result btdrvSetAdapterProperty(BtdrvAdapterPropertyType type, const BtdrvAdapterProperty *property)
SetAdapterProperty [12.0.0+].
Result btdrvEnableBluetooth(void)
EnableBluetooth.
Result btdrvGetGattNextDescriptor(u32 conn_id, const BtdrvGattId *serv_id, bool is_primary, const BtdrvGattId *char_id, const BtdrvGattId *desc_id, const BtdrvGattAttributeUuid *filter_uuid, BtdrvGattId *out_desc_id)
GetGattNextDescriptor.
Result btdrvEnableLlrScan(void)
EnableLlrScan.
Result btdrvUnregisterGattClient(u8 client_if)
UnregisterGattClient.
Result btdrvCloseAudioControlInput(BtdrvAddress addr)
CloseAudioControlInput.
Result btdrvAddGattCharacteristic(u8 service_id, const BtdrvGattAttributeUuid *serv_uuid, const BtdrvGattAttributeUuid *char_uuid, u8 permissions, u16 property)
AddGattCharacteristic.
BtdrvHidConnectionStatus
HidConnectionStatus [12.0.0+].
Definition: btdrv_types.h:104
BtdrvAudioCodec
AudioCodec.
Definition: btdrv_types.h:209
BtdrvAudioEventType
AudioEventType.
Definition: btdrv_types.h:197
BtdrvAudioOutState
AudioOutState.
Definition: btdrv_types.h:203
BtdrvAdapterPropertyType
AdapterPropertyType [12.0.0+].
Definition: btdrv_types.h:21
BtdrvFatalReason
This determines the u16 data to write into a CircularBuffer.
Definition: btdrv_types.h:117
BtdrvHidEventType
HidEventType.
Definition: btdrv_types.h:88
BtdrvInquiryStatus
BtdrvInquiryStatus.
Definition: btdrv_types.h:54
BtdrvBleEventType
BleEventType.
Definition: btdrv_types.h:127
BtdrvEventType
EventType.
Definition: btdrv_types.h:29
BtdrvBluetoothPropertyType
BluetoothPropertyType [1.0.0-11.0.1].
Definition: btdrv_types.h:12
BtdrvBluetoothHhReportType
BluetoothHhReportType Bit0-1 directly control the HID bluetooth transaction report-type value.
Definition: btdrv_types.h:80
_LOCK_T Mutex
Mutex datatype, defined in newlib.
Definition: mutex.h:12
AdapterProperty [1.0.0-11.0.1].
Definition: btdrv_types.h:224
AdapterPropertySet [12.0.0+].
Definition: btdrv_types.h:239
AdapterProperty [12.0.0+].
Definition: btdrv_types.h:232
Address.
Definition: btdrv_types.h:214
AudioControlButtonState.
Definition: btdrv_types.h:427
BleAdvertiseFilter.
Definition: btdrv_types.h:340
BleAdvertisePacketData.
Definition: btdrv_types.h:313
BleAdvertisement.
Definition: btdrv_types.h:333
BleConnectionParameter [9.0.0+].
Definition: btdrv_types.h:297
Data for btdrvGetBleManagedEventInfo and btdrvGetLeHidEventInfo. The data stored here depends on the ...
Definition: btdrv.h:327
u16 service_id
Service ID.
Definition: btdrv.h:436
u16 slave_latency
Slave latency.
Definition: btdrv.h:358
u16 conn_interval
Connection interval.
Definition: btdrv.h:348
u16 max_conn_interval
Maximum connection interval.
Definition: btdrv.h:357
u8 device_type
Device type. 0 = BD/EDR, 1 = BLE, 2 = Dual Mode.
Definition: btdrv.h:385
u8 status
Registration status. 0 = Unregistered, 1 = Registered.
Definition: btdrv.h:334
u8 is_primary
Is a primary service or not.
Definition: btdrv.h:440
u16 mtu
MTU value.
Definition: btdrv.h:428
u16 attr_id
Attribute ID.
Definition: btdrv.h:437
u8 server_if
Server interface handle. Unused.
Definition: btdrv.h:340
u32 count
Number of attributes below.
Definition: btdrv.h:414
BtdrvAddress address
Device address.
Definition: btdrv.h:368
u8 ble_addr_type
BLE address type. 0 = Public, 1 = Random, 2 = Public ID, 3 = Random ID.
Definition: btdrv.h:386
u16 reason
Disconnection reason.
Definition: btdrv.h:369
u32 action
Scan filter action. 0 = Add, 1 = Delete, 2 = Clear, 3 = Enable, 4 = Disable.
Definition: btdrv.h:395
u8 type
Notification type. 4 = Notification, 5 = Indication.
Definition: btdrv.h:401
u32 server_if
Server interface handle.
Definition: btdrv.h:434
u16 unk_x8
Unknown. Always 0.
Definition: btdrv.h:421
u16 min_conn_interval
Minimum connection interval.
Definition: btdrv.h:356
u8 client_if
Client interface handle.
Definition: btdrv.h:333
u32 result
0 for success, non-zero for error.
Definition: btdrv.h:332
BtdrvGattAttributeUuid serv_uuid
GATT Service UUID BtdrvGattAttributeUuid.
Definition: btdrv.h:403
u16 conn_id
Connection ID.
Definition: btdrv.h:446
u8 property
Characteristic properties. Only set if attr_type is 1 BtdrvGattCharacteristicProperty.
Definition: btdrv.h:439
u8 unk_x6
Unknown. Always 1.
Definition: btdrv.h:447
u16 server_if
Server interface handle.
Definition: btdrv.h:375
u32 conn_id
Connection ID.
Definition: btdrv.h:347
u8 count
Number of entries above.
Definition: btdrv.h:389
u16 supervision_tout
Connection supervision timeout multiplier.
Definition: btdrv.h:350
BtdrvGattAttributeUuid char_uuid
GATT Characteristic UUID BtdrvGattAttributeUuid.
Definition: btdrv.h:404
BtdrvGattAttributeUuid desc_uuid
GATT Descriptor UUID BtdrvGattAttributeUuid.
Definition: btdrv.h:405
u16 size
Size of the below data.
Definition: btdrv.h:406
BtdrvGattAttributeUuid uuid
BtdrvGattAttributeUuid
Definition: btdrv.h:435
s32 rssi
RSSI value.
Definition: btdrv.h:390
u16 conn_latency
Connection latency.
Definition: btdrv.h:349
u8 attr_type
Attribute type BtdrvGattAttributeType.
Definition: btdrv.h:438
u16 offset
Offset.
Definition: btdrv.h:454
BluetoothPinCode [1.0.0-11.0.1].
Definition: btdrv_types.h:246
ChannelMapList.
Definition: btdrv_types.h:279
CircularBuffer.
Definition: btdrv.h:315
void * event_type
Not set with sharedmem.
Definition: btdrv.h:317
ClassOfDevice.
Definition: btdrv_types.h:219
Data for btdrvGetEventInfo. The data stored here depends on the BtdrvEventType.
Definition: btdrv.h:15
BtdrvAddress addr
Device address.
Definition: btdrv.h:27
s32 passkey
Passkey, only set when the above field is value 3.
Definition: btdrv.h:76
u16 reason
BtdrvFatalReason
Definition: btdrv.h:144
u8 flag
bool flag for Just Works. With SSP passkey notification this is always 0.
Definition: btdrv.h:83
u32 status
Status, always 0 except with BtdrvConnectionEventType_Status: 2 = ACL Link is now Resumed,...
Definition: btdrv.h:95
BtdrvInquiryStatus status
BtdrvInquiryStatus
Definition: btdrv.h:51
u32 count
Count value.
Definition: btdrv.h:135
u8 status
BtdrvInquiryStatus
Definition: btdrv.h:55
u32 val
Value.
Definition: btdrv.h:20
BtdrvClassOfDevice class_of_device
Class of Device.
Definition: btdrv.h:29
u8 value
Tsi value, when the above indicates success.
Definition: btdrv.h:117
u32 type
0 = SSP confirm request, 3 = SSP passkey notification.
Definition: btdrv.h:75
u32 service_mask
Services value from btdrvStartInquiry when starting, otherwise this is value 0.
Definition: btdrv.h:57
GattAttributeUuid.
Definition: btdrv_types.h:370
GattAttribute.
Definition: btdrv_types.h:383
GattId.
Definition: btdrv_types.h:376
HidData [1.0.0-8.1.1].
Definition: btdrv_types.h:257
Data for btdrvGetHidEventInfo. The data stored here depends on the BtdrvHidEventType.
Definition: btdrv.h:150
BtdrvAddress addr
Device address.
Definition: btdrv.h:157
BtdrvHidConnectionStatus status
BtdrvHidConnectionStatus
Definition: btdrv.h:159
u32 status
0 for success, non-zero for error.
Definition: btdrv.h:174
u32 type
BtdrvExtEventType, controls which data is stored below.
Definition: btdrv.h:170
u8 flag
Flag.
Definition: btdrv.h:197
u32 count
Count value.
Definition: btdrv.h:204
The raw sharedmem data for HidReportEventInfo.
Definition: btdrv.h:294
u8 type
BtdrvHidEventType
Definition: btdrv.h:296
Data for btdrvGetHidReportEventInfo. The data stored here depends on the BtdrvHidEventType.
Definition: btdrv.h:217
u32 res
Always 0.
Definition: btdrv.h:227
BtdrvHidReport report
BtdrvHidReport
Definition: btdrv.h:248
BtdrvAddress addr
BtdrvAddress
Definition: btdrv.h:225
BtdrvHidData report
BtdrvHidData
Definition: btdrv.h:233
u8 unk_x4
Always 0.
Definition: btdrv.h:245
HidReport [9.0.0+].
Definition: btdrv_types.h:263
LeConnectionParams [5.0.0-8.1.1].
Definition: btdrv_types.h:284
PcmParameter.
Definition: btdrv_types.h:420
BtdrvPinCode [12.0.0+].
Definition: btdrv_types.h:251
PlrList.
Definition: btdrv_types.h:274
Kernel-mode event structure.
Definition: event.h:13
Service object structure.
Definition: service.h:14
BluetoothDevicesSettings.
Definition: set.h:313
int64_t s64
64-bit signed integer.
Definition: types.h:28
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
u32 Result
Function error code result type.
Definition: types.h:44
int32_t s32
32-bit signed integer.
Definition: types.h:27
uint32_t u32
32-bit unsigned integer.
Definition: types.h:21
Data for btdrvGetAudioEventInfo. The data stored here depends on the BtdrvAudioEventType.
Definition: btdrv.h:306
u32 status
Status: 0 = AV connection closed, 1 = AV connection opened, 2 = failed to open AV connection.
Definition: btdrv.h:308
BtdrvAddress addr
Device address.
Definition: btdrv.h:309