libnx  v4.2.1
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. The data stored here depends on the \ref BtdrvBleEventType.
327 typedef struct {
328  union {
329  u8 data[0x400];
330 
331  struct {
332  u32 status;
333  u8 handle;
334  u8 registered;
335  } type0;
336 
337  struct {
338  u32 status;
339  u32 conn_id;
340  u32 unk_x8;
341  u32 unk_xC;
342  } type2;
343 
344  struct {
345  u32 conn_id;
346  u16 min_interval;
347  u16 max_interval;
348  u16 slave_latency;
349  u16 timeout_multiplier;
350  } type3; ///< Connection params?
351 
352  struct {
353  u32 status;
354  u8 unk_x4;
355  u8 unk_x5;
356  u8 unk_x6;
357  u8 unk_x7;
358  u32 conn_id;
359  BtdrvAddress address;
360  u16 unk_x12;
361  } type4; ///< Connection status?
362 
363  struct {
364  u32 status;
365  u8 unk_x4;
366  u8 unk_x5;
367  u8 unk_x6;
368  BtdrvAddress address;
370  u8 count;
371  u32 unk_x144;
372  } type6; ///< Scan result?
373 
374  struct {
375  u32 status;
376  u32 conn_id;
377  } type7;
378 
379  struct {
380  u32 status;
381  u8 interface;
382  u8 unk_x5;
383  u16 unk_x6;
384  u32 unk_x8;
385  BtdrvGattAttributeUuid svc_uuid;
386  BtdrvGattAttributeUuid char_uuid;
387  BtdrvGattAttributeUuid descr_uuid;
388  u16 size;
389  u8 data[0x202];
390  } type8; ///< Notification?
391 
392  struct {
393  u32 status;
394  u32 conn_id;
395  u32 unk_x8;
396  u8 unk_xC[0x140];
397  } type9;
398 
399  struct {
400  u32 status;
401  u32 conn_id;
402  u8 unk_x8[0x24];
403  u32 unk_x2C;
404  u8 unk_x30[0x11c];
405  } type10;
406 
407  struct {
408  u32 status;
409  u32 conn_id;
410  u16 unk_x8;
411  } type11;
412 
413  struct {
414  u8 unk_x0[0x218];
415  } type13;
416  };
418 
419 /// Initialize btdrv.
420 Result btdrvInitialize(void);
421 
422 /// Exit btdrv.
423 void btdrvExit(void);
424 
425 /// Gets the Service object for the actual btdrv service session.
427 
428 /**
429  * @brief InitializeBluetooth
430  * @note This is used by btm-sysmodule, this should not be used by other processes.
431  * @note The Event must be closed by the user once finished with it.
432  * @param[out] out_event Output Event with autoclear=true.
433  */
435 
436 /**
437  * @brief EnableBluetooth
438  * @note This is used by btm-sysmodule.
439  */
441 
442 /**
443  * @brief DisableBluetooth
444  * @note This is used by btm-sysmodule.
445  */
447 
448 /**
449  * @brief FinalizeBluetooth
450  * @note This is not used by btm-sysmodule, this should not be used by other processes.
451  */
453 
454 /**
455  * @brief GetAdapterProperties [1.0.0-11.0.1]
456  * @param[out] properties \ref BtdrvAdapterPropertyOld
457  */
459 
460 /**
461  * @brief GetAdapterProperties [12.0.0+]
462  * @param[out] properties \ref BtdrvAdapterPropertySet
463  */
465 
466 /**
467  * @brief GetAdapterProperty [1.0.0-11.0.1]
468  * @param[in] type \ref BtdrvBluetoothPropertyType
469  * @param[out] buffer Output buffer, see \ref BtdrvBluetoothPropertyType for the contents.
470  * @param[in] size Output buffer size.
471  */
472 Result btdrvLegacyGetAdapterProperty(BtdrvBluetoothPropertyType type, void* buffer, size_t size);
473 
474 /**
475  * @brief GetAdapterProperty [12.0.0+]
476  * @param[in] type \ref BtdrvAdapterPropertyType
477  * @param[in] property \ref BtdrvAdapterProperty
478  */
480 
481 /**
482  * @brief SetAdapterProperty [1.0.0-11.0.1]
483  * @param[in] type \ref BtdrvBluetoothPropertyType
484  * @param[in] buffer Input buffer, see \ref BtdrvBluetoothPropertyType for the contents.
485  * @param[in] size Input buffer size.
486  */
487 Result btdrvLegacySetAdapterProperty(BtdrvBluetoothPropertyType type, const void* buffer, size_t size);
488 
489 /**
490  * @brief SetAdapterProperty [12.0.0+]
491  * @param[in] type \ref BtdrvAdapterPropertyType
492  * @param[in] property \ref BtdrvAdapterProperty
493  */
495 
496 /**
497  * @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.
498  * @note This is used by btm-sysmodule.
499  */
501 
502 /**
503  * @brief StartInquiry [12.0.0+]. This starts Inquiry, the output data will be available via \ref btdrvGetEventInfo.
504  * @param[in] services Bitfield of allowed services. When -1 the original defaults from pre-12.0.0 are used.
505  * @param[in] duration Inquiry duration in nanoseconds.
506  * @note This is used by btm-sysmodule.
507  */
508 Result btdrvStartInquiry(u32 services, s64 duration);
509 
510 /**
511  * @brief This stops Inquiry which was started by \ref btdrvStartInquiry, if it's still active.
512  * @note This is used by btm-sysmodule.
513  */
515 
516 /**
517  * @brief CreateBond
518  * @note This is used by btm-sysmodule.
519  * @param[in] addr \ref BtdrvAddress
520  * @param[in] type TransportType
521  */
523 
524 /**
525  * @brief RemoveBond
526  * @note This is used by btm-sysmodule.
527  * @param[in] addr \ref BtdrvAddress
528  */
530 
531 /**
532  * @brief CancelBond
533  * @note This is used by btm-sysmodule.
534  * @param[in] addr \ref BtdrvAddress
535  */
537 
538 /**
539  * @brief RespondToPinRequest [1.0.0-11.0.1]
540  * @note The official sysmodule only uses the input \ref BtdrvAddress.
541  * @param[in] addr \ref BtdrvAddress
542  * @param[in] flag Flag
543  * @param[in] pin_code \ref BtdrvBluetoothPinCode
544  * @param[in] length Length of pin_code
545  */
546 Result btdrvLegacyRespondToPinRequest(BtdrvAddress addr, bool flag, const BtdrvBluetoothPinCode *pin_code, u8 length);
547 
548 /**
549  * @brief RespondToPinRequest [12.0.0+]
550  * @param[in] addr \ref BtdrvAddress
551  * @param[in] pin_code \ref BtdrvPinCode
552  */
554 
555 /**
556  * @brief RespondToSspRequest
557  * @note The official sysmodule only uses the input \ref BtdrvAddress and the flag.
558  * @note This is used by btm-sysmodule.
559  * @param[in] addr \ref BtdrvAddress
560  * @param[in] variant BluetoothSspVariant
561  * @param[in] accept Whether the request is accepted.
562  * @param[in] passkey Passkey.
563  */
564 Result btdrvRespondToSspRequest(BtdrvAddress addr, u32 variant, bool accept, u32 passkey);
565 
566 /**
567  * @brief GetEventInfo
568  * @note This is used by btm-sysmodule.
569  * @param[out] buffer Output buffer, see \ref BtdrvEventInfo.
570  * @param[in] size Output buffer size.
571  * @param[out] type Output BtdrvEventType.
572  */
573 Result btdrvGetEventInfo(void* buffer, size_t size, BtdrvEventType *type);
574 
575 /**
576  * @brief InitializeHid
577  * @note This is used by btm-sysmodule, this should not be used by other processes.
578  * @note The Event must be closed by the user once finished with it.
579  * @param[out] out_event Output Event with autoclear=true.
580  */
581 Result btdrvInitializeHid(Event* out_event);
582 
583 /**
584  * @brief OpenHidConnection
585  * @note This is used by btm-sysmodule.
586  * @param[in] addr \ref BtdrvAddress
587  */
589 
590 /**
591  * @brief CloseHidConnection
592  * @note This is used by btm-sysmodule.
593  * @param[in] addr \ref BtdrvAddress
594  */
596 
597 /**
598  * @brief This sends a HID DATA transaction packet with report-type Output.
599  * @param[in] addr \ref BtdrvAddress
600  * @param[in] buffer Input \ref BtdrvHidReport, on pre-9.0.0 this is \ref BtdrvHidData.
601  */
603 
604 /**
605  * @brief WriteHidData2
606  * @param[in] addr \ref BtdrvAddress
607  * @param[in] buffer Input buffer, same as the buffer for \ref btdrvWriteHidData.
608  * @param[in] size Input buffer size.
609  */
610 Result btdrvWriteHidData2(BtdrvAddress addr, const void* buffer, size_t size);
611 
612 /**
613  * @brief This sends a HID SET_REPORT transaction packet.
614  * @param[in] addr \ref BtdrvAddress
615  * @param[in] type \ref BtdrvBluetoothHhReportType
616  * @param[in] buffer Input \ref BtdrvHidReport, on pre-9.0.0 this is \ref BtdrvHidData.
617  */
619 
620 /**
621  * @brief This sends a HID GET_REPORT transaction packet.
622  * @param[in] addr \ref BtdrvAddress
623  * @param[in] report_id This is sent in the packet for the Report Id, when non-zero.
624  * @param[in] type \ref BtdrvBluetoothHhReportType
625  */
627 
628 /**
629  * @brief TriggerConnection
630  * @note This is used by btm-sysmodule.
631  * @param[in] addr \ref BtdrvAddress
632  * @param[in] unk [9.0.0+] Unknown
633  */
635 
636 /**
637  * @brief AddPairedDeviceInfo
638  * @note This is used by btm-sysmodule.
639  * @param[in] settings \ref SetSysBluetoothDevicesSettings
640  */
642 
643 /**
644  * @brief GetPairedDeviceInfo
645  * @note This is used by btm-sysmodule.
646  * @param[in] addr \ref BtdrvAddress
647  * @param[out] settings \ref SetSysBluetoothDevicesSettings
648  */
650 
651 /**
652  * @brief FinalizeHid
653  * @note This is not used by btm-sysmodule, this should not be used by other processes.
654  */
656 
657 /**
658  * @brief GetHidEventInfo
659  * @note This is used by btm-sysmodule.
660  * @param[out] buffer Output buffer, see \ref BtdrvHidEventInfo.
661  * @param[in] size Output buffer size.
662  * @param[out] type \ref BtdrvHidEventType, always ::BtdrvHidEventType_Connection or ::BtdrvHidEventType_Ext.
663  */
664 Result btdrvGetHidEventInfo(void* buffer, size_t size, BtdrvHidEventType *type);
665 
666 /**
667  * @brief SetTsi
668  * @note The response will be available via \ref btdrvGetHidEventInfo ([12.0.0+] \ref btdrvGetEventInfo).
669  * @note This is used by btm-sysmodule.
670  * @param[in] addr \ref BtdrvAddress
671  * @param[in] tsi Tsi: non-value-0xFF to Set, value 0xFF to Exit. See also \ref BtmTsiMode.
672  */
673 Result btdrvSetTsi(BtdrvAddress addr, u8 tsi);
674 
675 /**
676  * @brief EnableBurstMode
677  * @note The response will be available via \ref btdrvGetHidEventInfo ([12.0.0+] \ref btdrvGetEventInfo).
678  * @note This is used by btm-sysmodule.
679  * @param[in] addr \ref BtdrvAddress
680  * @param[in] flag Flag: true = Set, false = Exit.
681  */
682 Result btdrvEnableBurstMode(BtdrvAddress addr, bool flag);
683 
684 /**
685  * @brief SetZeroRetransmission
686  * @note The response will be available via \ref btdrvGetHidEventInfo ([12.0.0+] \ref btdrvGetEventInfo).
687  * @note This is used by btm-sysmodule.
688  * @param[in] addr \ref BtdrvAddress
689  * @param[in] report_ids Input buffer containing an array of u8s.
690  * @param[in] count Total u8s in the input buffer. This can be 0, the max is 5.
691  */
692 Result btdrvSetZeroRetransmission(BtdrvAddress addr, u8 *report_ids, u8 count);
693 
694 /**
695  * @brief EnableMcMode
696  * @note This is used by btm-sysmodule.
697  * @param[in] flag Flag
698  */
699 Result btdrvEnableMcMode(bool flag);
700 
701 /**
702  * @brief EnableLlrScan
703  * @note This is used by btm-sysmodule.
704  */
706 
707 /**
708  * @brief DisableLlrScan
709  * @note This is used by btm-sysmodule.
710  */
712 
713 /**
714  * @brief EnableRadio
715  * @note This is used by btm-sysmodule.
716  * @param[in] flag Flag
717  */
718 Result btdrvEnableRadio(bool flag);
719 
720 /**
721  * @brief SetVisibility
722  * @note This is used by btm-sysmodule.
723  * @param[in] inquiry_scan Controls Inquiry Scan, whether the device can be discovered during Inquiry.
724  * @param[in] page_scan Controls Page Scan, whether the device accepts connections.
725  */
726 Result btdrvSetVisibility(bool inquiry_scan, bool page_scan);
727 
728 /**
729  * @brief EnableTbfcScan
730  * @note Only available on [4.0.0+].
731  * @note This is used by btm-sysmodule.
732  * @param[in] flag Flag
733  */
734 Result btdrvEnableTbfcScan(bool flag);
735 
736 /**
737  * @brief RegisterHidReportEvent
738  * @note This also does sharedmem init/handling if needed, on [7.0.0+].
739  * @note The Event must be closed by the user once finished with it.
740  * @param[out] out_event Output Event with autoclear=true. This is signaled when data is available with \ref btdrvGetHidReportEventInfo.
741  */
743 
744 /**
745  * @brief GetHidReportEventInfo
746  * @note \ref btdrvRegisterHidReportEvent must be used before this, on [7.0.0+].
747  * @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.
748  * @note [7.0.0+] When data isn't available, the type is set to ::BtdrvHidEventType_Data, with the buffer cleared to all-zero.
749  * @param[out] buffer Output buffer, see \ref BtdrvHidReportEventInfo.
750  * @param[in] size Output buffer size.
751  * @oaram[out] type \ref BtdrvHidEventType
752  */
753 Result btdrvGetHidReportEventInfo(void* buffer, size_t size, BtdrvHidEventType *type);
754 
755 /// Gets the SharedMemory addr for HidReportEventInfo (\ref BtdrvCircularBuffer), only valid when \ref btdrvRegisterHidReportEvent was previously used, on [7.0.0+].
757 
758 /**
759  * @brief GetLatestPlr
760  * @param[out] out Output \ref BtdrvPlrList, on pre-9.0.0 this is \ref BtdrvPlrStatistics.
761  */
763 
764 /**
765  * @brief GetPendingConnections
766  * @note The output data will be available via \ref btdrvGetHidEventInfo ([12.0.0+] \ref btdrvGetEventInfo).
767  * @note This is used by btm-sysmodule.
768  * @note Only available on [3.0.0+].
769  */
771 
772 /**
773  * @brief GetChannelMap
774  * @note Only available on [3.0.0+].
775  * @param[out] out \ref BtdrvChannelMapList
776  */
778 
779 /**
780  * @brief EnableTxPowerBoostSetting
781  * @note Only available on [3.0.0+].
782  * @param[in] flag Input flag.
783  */
785 
786 /**
787  * @brief IsTxPowerBoostSettingEnabled
788  * @note Only available on [3.0.0+].
789  * @param[out] out Output flag.
790  */
792 
793 /**
794  * @brief EnableAfhSetting
795  * @note Only available on [3.0.0+].
796  * @param[in] flag Input flag.
797  */
798 Result btdrvEnableAfhSetting(bool flag);
799 
800 /**
801  * @brief IsAfhSettingEnabled
802  * @note Only available on [3.0.0+].
803  * @param[out] out Output flag.
804  */
806 
807 /**
808  * @brief InitializeBle
809  * @note Only available on [5.0.0+].
810  * @note This is used by btm-sysmodule.
811  * @note The Event must be closed by the user once finished with it.
812  * @param[out] out_event Output Event with autoclear=true.
813  */
814 Result btdrvInitializeBle(Event* out_event);
815 
816 /**
817  * @brief EnableBle
818  * @note Only available on [5.0.0+].
819  * @note This is used by btm-sysmodule.
820  */
821 Result btdrvEnableBle(void);
822 
823 /**
824  * @brief DisableBle
825  * @note Only available on [5.0.0+].
826  * @note This is used by btm-sysmodule.
827  */
828 Result btdrvDisableBle(void);
829 
830 /**
831  * @brief FinalizeBle
832  * @note Only available on [5.0.0+].
833  */
835 
836 /**
837  * @brief SetBleVisibility
838  * @note Only available on [5.0.0+].
839  * @param[in] discoverable Whether the BLE device is discoverable.
840  * @param[in] connectable Whether the BLE device is connectable.
841  */
842 Result btdrvSetBleVisibility(bool discoverable, bool connectable);
843 
844 /**
845  * @brief SetLeConnectionParameter
846  * @note Only available on [5.0.0-8.1.1]. This is the older version of \ref btdrvSetBleConnectionParameter.
847  * @param[in] param \ref BtdrvLeConnectionParams
848  */
850 
851 /**
852  * @brief SetBleConnectionParameter
853  * @note Only available on [9.0.0+]. This is the newer version of \ref btdrvSetLeConnectionParameter.
854  * @param[in] addr \ref BtdrvAddress
855  * @param[in] param \ref BtdrvBleConnectionParameter
856  * @param[in] flag Flag
857  */
859 
860 /**
861  * @brief SetLeDefaultConnectionParameter
862  * @note Only available on [5.0.0-8.1.1]. This is the older version of \ref btdrvSetBleDefaultConnectionParameter.
863  * @param[in] param \ref BtdrvLeConnectionParams
864  */
866 
867 /**
868  * @brief SetBleDefaultConnectionParameter
869  * @note Only available on [9.0.0+]. This is the newer version of \ref btdrvSetLeDefaultConnectionParameter.
870  * @param[in] param \ref BtdrvBleConnectionParameter
871  */
873 
874 /**
875  * @brief SetBleAdvertiseData
876  * @note Only available on [5.0.0+].
877  * @param[in] data \ref BtdrvBleAdvertisePacketData
878  */
880 
881 /**
882  * @brief SetBleAdvertiseParameter
883  * @note Only available on [5.0.0+].
884  * @param[in] addr \ref BtdrvAddress
885  * @param[in] unk0 Unknown
886  * @param[in] unk1 Unknown
887  */
889 
890 /**
891  * @brief StartBleScan
892  * @note Only available on [5.0.0+].
893  * @note This is used by btm-sysmodule.
894  */
896 
897 /**
898  * @brief StopBleScan
899  * @note Only available on [5.0.0+].
900  * @note This is used by btm-sysmodule.
901  */
903 
904 /**
905  * @brief AddBleScanFilterCondition
906  * @note Only available on [5.0.0+].
907  * @note This is used by btm-sysmodule.
908  * @param[in] filter \ref BtdrvBleAdvertiseFilter
909  */
911 
912 /**
913  * @brief DeleteBleScanFilterCondition
914  * @note Only available on [5.0.0+].
915  * @note This is used by btm-sysmodule.
916  * @param[in] filter \ref BtdrvBleAdvertiseFilter
917  */
919 
920 /**
921  * @brief DeleteBleScanFilter
922  * @note Only available on [5.0.0+].
923  * @param[in] unk Unknown
924  */
926 
927 /**
928  * @brief ClearBleScanFilters
929  * @note Only available on [5.0.0+].
930  * @note This is used by btm-sysmodule.
931  */
933 
934 /**
935  * @brief EnableBleScanFilter
936  * @note Only available on [5.0.0+].
937  * @note This is used by btm-sysmodule.
938  * @param[in] flag Flag
939  */
941 
942 /**
943  * @brief RegisterGattClient
944  * @note Only available on [5.0.0+].
945  * @note This is used by btm-sysmodule.
946  * @param[in] uuid \ref BtdrvGattAttributeUuid
947  */
949 
950 /**
951  * @brief UnregisterGattClient
952  * @note Only available on [5.0.0+].
953  * @param[in] unk Unknown
954  */
956 
957 /**
958  * @brief UnregisterAllGattClients
959  * @note Only available on [5.0.0+].
960  */
962 
963 /**
964  * @brief ConnectGattServer
965  * @note Only available on [5.0.0+].
966  * @note This is used by btm-sysmodule.
967  * @param[in] unk Unknown
968  * @param[in] addr \ref BtdrvAddress
969  * @param[in] flag Flag
970  * @param[in] AppletResourceUserId AppletResourceUserId
971  */
972 Result btdrvConnectGattServer(u8 unk, BtdrvAddress addr, bool flag, u64 AppletResourceUserId);
973 
974 /**
975  * @brief CancelConnectGattServer
976  * @note Only available on [5.1.0+].
977  * @note This is used by btm-sysmodule.
978  * @param[in] unk Unknown
979  * @param[in] addr \ref BtdrvAddress
980  * @param[in] flag Flag
981  */
982 Result btdrvCancelConnectGattServer(u8 unk, BtdrvAddress addr, bool flag);
983 
984 /**
985  * @brief DisconnectGattServer
986  * @note Only available on [5.0.0+].
987  * @note This is used by btm-sysmodule.
988  * @param[in] unk Unknown
989  */
991 
992 /**
993  * @brief GetGattAttribute
994  * @note Only available on [5.0.0+].
995  * @param[in] addr \ref BtdrvAddress, only used on pre-9.0.0.
996  * @param[in] unk Unknown
997  */
999 
1000 /**
1001  * @brief GetGattService
1002  * @note Only available on [5.0.0+].
1003  * @param[in] unk Unknown
1004  * @param[in] uuid \ref BtdrvGattAttributeUuid
1005  */
1007 
1008 /**
1009  * @brief ConfigureAttMtu
1010  * @note Only available on [5.0.0+].
1011  * @note This is used by btm-sysmodule.
1012  * @param[in] unk Unknown
1013  * @param[in] mtu MTU
1014  */
1016 
1017 /**
1018  * @brief RegisterGattServer
1019  * @note Only available on [5.0.0+].
1020  * @param[in] uuid \ref BtdrvGattAttributeUuid
1021  */
1023 
1024 /**
1025  * @brief UnregisterGattServer
1026  * @note Only available on [5.0.0+].
1027  * @param[in] unk Unknown
1028  */
1030 
1031 /**
1032  * @brief ConnectGattClient
1033  * @note Only available on [5.0.0+].
1034  * @param[in] unk Unknown
1035  * @param[in] addr \ref BtdrvAddress
1036  * @param[in] flag Flag
1037  */
1038 Result btdrvConnectGattClient(u8 unk, BtdrvAddress addr, bool flag);
1039 
1040 /**
1041  * @brief DisconnectGattClient
1042  * @note Only available on [5.0.0+].
1043  * @param[in] unk Unknown
1044  * @param[in] addr \ref BtdrvAddress, only used on pre-9.0.0.
1045  */
1047 
1048 /**
1049  * @brief AddGattService
1050  * @note Only available on [5.0.0+].
1051  * @param[in] unk0 Unknown
1052  * @param[in] uuid \ref BtdrvGattAttributeUuid
1053  * @param[in] unk1 Unknown
1054  * @param[in] flag Flag
1055  */
1056 Result btdrvAddGattService(u8 unk0, const BtdrvGattAttributeUuid *uuid, u8 unk1, bool flag);
1057 
1058 /**
1059  * @brief EnableGattService
1060  * @note Only available on [5.0.0+].
1061  * @param[in] unk Unknown
1062  * @param[in] uuid \ref BtdrvGattAttributeUuid
1063  */
1065 
1066 /**
1067  * @brief AddGattCharacteristic
1068  * @note Only available on [5.0.0+].
1069  * @param[in] unk0 Unknown
1070  * @param[in] uuid0 \ref BtdrvGattAttributeUuid
1071  * @param[in] uuid1 \ref BtdrvGattAttributeUuid
1072  * @param[in] unk1 Unknown
1073  * @param[in] unk2 Unknown
1074  */
1075 Result btdrvAddGattCharacteristic(u8 unk0, const BtdrvGattAttributeUuid *uuid0, const BtdrvGattAttributeUuid *uuid1, u8 unk1, u16 unk2);
1076 
1077 /**
1078  * @brief AddGattDescriptor
1079  * @note Only available on [5.0.0+].
1080  * @param[in] unk0 Unknown
1081  * @param[in] uuid0 \ref BtdrvGattAttributeUuid
1082  * @param[in] uuid1 \ref BtdrvGattAttributeUuid
1083  * @param[in] unk1 Unknown
1084  */
1085 Result btdrvAddGattDescriptor(u8 unk0, const BtdrvGattAttributeUuid *uuid0, const BtdrvGattAttributeUuid *uuid1, u16 unk1);
1086 
1087 /**
1088  * @brief GetBleManagedEventInfo
1089  * @note Only available on [5.0.0+].
1090  * @note This is used by btm-sysmodule.
1091  * @param[out] buffer Output buffer. 0x400-bytes from state is written here.
1092  * @param[in] size Output buffer size.
1093  * @oaram[out] type Output BtdrvBleEventType.
1094  */
1095 Result btdrvGetBleManagedEventInfo(void* buffer, size_t size, BtdrvBleEventType *type);
1096 
1097 /**
1098  * @brief GetGattFirstCharacteristic
1099  * @note Only available on [5.0.0+].
1100  * @param[in] unk Unknown
1101  * @param[in] id \ref BtdrvGattId
1102  * @param[in] flag Flag
1103  * @param[in] uuid \ref BtdrvGattAttributeUuid
1104  * @param[out] out_property Output Property.
1105  * @param[out] out_char_id Output CharacteristicId \ref BtdrvGattId
1106  */
1107 Result btdrvGetGattFirstCharacteristic(u32 unk, const BtdrvGattId *id, bool flag, const BtdrvGattAttributeUuid *uuid, u8 *out_property, BtdrvGattId *out_char_id);
1108 
1109 /**
1110  * @brief GetGattNextCharacteristic
1111  * @note Only available on [5.0.0+].
1112  * @param[in] unk Unknown
1113  * @param[in] id0 \ref BtdrvGattId
1114  * @param[in] flag Flag
1115  * @param[in] id1 \ref BtdrvGattId
1116  * @param[in] uuid \ref BtdrvGattAttributeUuid
1117  * @param[out] out_property Output Property.
1118  * @param[out] out_char_id Output CharacteristicId \ref BtdrvGattId
1119  */
1120 Result btdrvGetGattNextCharacteristic(u32 unk, const BtdrvGattId *id0, bool flag, const BtdrvGattId *id1, const BtdrvGattAttributeUuid *uuid, u8 *out_property, BtdrvGattId *out_char_id);
1121 
1122 /**
1123  * @brief GetGattFirstDescriptor
1124  * @note Only available on [5.0.0+].
1125  * @param[in] unk Unknown
1126  * @param[in] id0 \ref BtdrvGattId
1127  * @param[in] flag Flag
1128  * @param[in] id1 \ref BtdrvGattId
1129  * @param[in] uuid \ref BtdrvGattAttributeUuid
1130  * @param[out] out_desc_id Output DescriptorId \ref BtdrvGattId
1131  */
1132 Result btdrvGetGattFirstDescriptor(u32 unk, const BtdrvGattId *id0, bool flag, const BtdrvGattId *id1, const BtdrvGattAttributeUuid *uuid, BtdrvGattId *out_desc_id);
1133 
1134 /**
1135  * @brief GetGattNextDescriptor
1136  * @note Only available on [5.0.0+].
1137  * @param[in] unk Unknown
1138  * @param[in] id0 \ref BtdrvGattId
1139  * @param[in] flag Flag
1140  * @param[in] id1 \ref BtdrvGattId
1141  * @param[in] id2 \ref BtdrvGattId
1142  * @param[in] uuid \ref BtdrvGattAttributeUuid
1143  * @param[out] out_desc_id Output DescriptorId \ref BtdrvGattId
1144  */
1145 Result btdrvGetGattNextDescriptor(u32 unk, const BtdrvGattId *id0, bool flag, const BtdrvGattId *id1, const BtdrvGattId *id2, const BtdrvGattAttributeUuid *uuid, BtdrvGattId *out_desc_id);
1146 
1147 /**
1148  * @brief RegisterGattManagedDataPath
1149  * @note Only available on [5.0.0+].
1150  * @note This is used by btm-sysmodule.
1151  * @param[in] uuid \ref BtdrvGattAttributeUuid
1152  */
1154 
1155 /**
1156  * @brief UnregisterGattManagedDataPath
1157  * @note Only available on [5.0.0+].
1158  * @param[in] uuid \ref BtdrvGattAttributeUuid
1159  */
1161 
1162 /**
1163  * @brief RegisterGattHidDataPath
1164  * @note Only available on [5.0.0+].
1165  * @note This is used by btm-sysmodule.
1166  * @param[in] uuid \ref BtdrvGattAttributeUuid
1167  */
1169 
1170 /**
1171  * @brief UnregisterGattHidDataPath
1172  * @note Only available on [5.0.0+].
1173  * @note This is used by btm-sysmodule.
1174  * @param[in] uuid \ref BtdrvGattAttributeUuid
1175  */
1177 
1178 /**
1179  * @brief RegisterGattDataPath
1180  * @note Only available on [5.0.0+].
1181  * @note This is used by btm-sysmodule.
1182  * @param[in] uuid \ref BtdrvGattAttributeUuid
1183  */
1185 
1186 /**
1187  * @brief UnregisterGattDataPath
1188  * @note Only available on [5.0.0+].
1189  * @note This is used by btm-sysmodule.
1190  * @param[in] uuid \ref BtdrvGattAttributeUuid
1191  */
1193 
1194 /**
1195  * @brief ReadGattCharacteristic
1196  * @note Only available on [5.0.0+].
1197  * @param[in] connection_handle ConnectionHandle
1198  * @param[in] primary_service PrimaryService
1199  * @param[in] id0 \ref BtdrvGattId
1200  * @param[in] id1 \ref BtdrvGattId
1201  * @param[in] unk Unknown
1202  */
1203 Result btdrvReadGattCharacteristic(u32 connection_handle, bool primary_service, const BtdrvGattId *id0, const BtdrvGattId *id1, u8 unk);
1204 
1205 /**
1206  * @brief ReadGattDescriptor
1207  * @note Only available on [5.0.0+].
1208  * @param[in] connection_handle ConnectionHandle
1209  * @param[in] primary_service PrimaryService
1210  * @param[in] id0 \ref BtdrvGattId
1211  * @param[in] id1 \ref BtdrvGattId
1212  * @param[in] id2 \ref BtdrvGattId
1213  * @param[in] unk Unknown
1214  */
1215 Result btdrvReadGattDescriptor(u32 connection_handle, bool primary_service, const BtdrvGattId *id0, const BtdrvGattId *id1, const BtdrvGattId *id2, u8 unk);
1216 
1217 /**
1218  * @brief WriteGattCharacteristic
1219  * @note Only available on [5.0.0+].
1220  * @param[in] connection_handle ConnectionHandle
1221  * @param[in] primary_service PrimaryService
1222  * @param[in] id0 \ref BtdrvGattId
1223  * @param[in] id1 \ref BtdrvGattId
1224  * @param[in] buffer Input buffer.
1225  * @param[in] size Input buffer size, must be <=0x258.
1226  * @param[in] unk Unknown
1227  * @param[in] flag Flag
1228  */
1229 Result btdrvWriteGattCharacteristic(u32 connection_handle, bool primary_service, const BtdrvGattId *id0, const BtdrvGattId *id1, const void* buffer, size_t size, u8 unk, bool flag);
1230 
1231 /**
1232  * @brief WriteGattDescriptor
1233  * @note Only available on [5.0.0+].
1234  * @param[in] connection_handle ConnectionHandle
1235  * @param[in] primary_service PrimaryService
1236  * @param[in] id0 \ref BtdrvGattId
1237  * @param[in] id1 \ref BtdrvGattId
1238  * @param[in] id2 \ref BtdrvGattId
1239  * @param[in] buffer Input buffer.
1240  * @param[in] size Input buffer size, must be <=0x258.
1241  * @param[in] unk Unknown
1242  */
1243 Result btdrvWriteGattDescriptor(u32 connection_handle, bool primary_service, const BtdrvGattId *id0, const BtdrvGattId *id1, const BtdrvGattId *id2, const void* buffer, size_t size, u8 unk);
1244 
1245 /**
1246  * @brief RegisterGattNotification
1247  * @note Only available on [5.0.0+].
1248  * @param[in] connection_handle ConnectionHandle
1249  * @param[in] primary_service PrimaryService
1250  * @param[in] id0 \ref BtdrvGattId
1251  * @param[in] id1 \ref BtdrvGattId
1252  */
1253 Result btdrvRegisterGattNotification(u32 connection_handle, bool primary_service, const BtdrvGattId *id0, const BtdrvGattId *id1);
1254 
1255 /**
1256  * @brief UnregisterGattNotification
1257  * @note Only available on [5.0.0+].
1258  * @param[in] connection_handle ConnectionHandle
1259  * @param[in] primary_service PrimaryService
1260  * @param[in] id0 \ref BtdrvGattId
1261  * @param[in] id1 \ref BtdrvGattId
1262  */
1263 Result btdrvUnregisterGattNotification(u32 connection_handle, bool primary_service, const BtdrvGattId *id0, const BtdrvGattId *id1);
1264 
1265 /**
1266  * @brief GetLeHidEventInfo
1267  * @note Only available on [5.0.0+].
1268  * @note The state used by this is reset after writing the data to output.
1269  * @param[out] buffer Output buffer. 0x400-bytes from state is written here. See \ref BtdrvLeEventInfo.
1270  * @param[in] size Output buffer size.
1271  * @oaram[out] type Output BleEventType.
1272  */
1273 Result btdrvGetLeHidEventInfo(void* buffer, size_t size, u32 *type);
1274 
1275 /**
1276  * @brief RegisterBleHidEvent
1277  * @note Only available on [5.0.0+].
1278  * @note The Event must be closed by the user once finished with it.
1279  * @param[out] out_event Output Event with autoclear=true.
1280  */
1282 
1283 /**
1284  * @brief SetBleScanParameter
1285  * @note Only available on [5.1.0+].
1286  * @note This is used by btm-sysmodule.
1287  * @param[in] unk0 Unknown
1288  * @param[in] unk1 Unknown
1289  */
1291 
1292 /**
1293  * @brief MoveToSecondaryPiconet
1294  * @note The response will be available via \ref btdrvGetHidEventInfo ([12.0.0+] \ref btdrvGetEventInfo).
1295  * @note Only available on [10.0.0+].
1296  * @param[in] addr \ref BtdrvAddress
1297  */
1299 
1300 /**
1301  * @brief IsBluetoothEnabled
1302  * @note Only available on [12.0.0+].
1303  * @param[out] out Output flag.
1304  */
1305 Result btdrvIsBluetoothEnabled(bool *out);
1306 
1307 /**
1308  * @brief AcquireAudioEvent
1309  * @note Only available on [12.0.0+].
1310  * @param[out] out_event Output Event.
1311  * @param[in] autoclear Event autoclear.
1312  */
1313 Result btdrvAcquireAudioEvent(Event* out_event, bool autoclear);
1314 
1315 /**
1316  * @brief GetAudioEventInfo
1317  * @note Only available on [12.0.0+].
1318  * @param[out] buffer Output buffer, see \ref BtdrvAudioEventInfo.
1319  * @param[in] size Output buffer size.
1320  * @param[out] type \ref BtdrvAudioEventType.
1321  */
1322 Result btdrvGetAudioEventInfo(void* buffer, size_t size, BtdrvAudioEventType *type);
1323 
1324 /**
1325  * @brief OpenAudioConnection
1326  * @note Only available on [12.0.0+].
1327  * @param[in] addr \ref BtdrvAddress
1328  */
1330 
1331 /**
1332  * @brief CloseAudioConnection
1333  * @note Only available on [12.0.0+].
1334  * @param[in] addr \ref BtdrvAddress
1335  */
1337 
1338 /**
1339  * @brief OpenAudioOut
1340  * @note Only available on [12.0.0+].
1341  * @param[in] addr \ref BtdrvAddress
1342  * @param[out] audio_handle Audio handle.
1343  */
1344 Result btdrvOpenAudioOut(BtdrvAddress addr, u32 *audio_handle);
1345 
1346 /**
1347  * @brief CloseAudioOut
1348  * @note Only available on [12.0.0+].
1349  * @param[in] audio_handle Audio handle from \ref btdrvOpenAudioOut.
1350  */
1351 Result btdrvCloseAudioOut(u32 audio_handle);
1352 
1353 /**
1354  * @brief StartAudioOut
1355  * @note Only available on [12.0.0+].
1356  * @param[in] audio_handle Audio handle from \ref btdrvOpenAudioOut.
1357  * @param[in] pcm_param \ref BtdrvPcmParameter
1358  * @param[in] in_latency Input latency in nanoseconds.
1359  * @param[out] out_latency Output latency in nanoseconds.
1360  * @param[out] out1 Unknown output.
1361  */
1362 Result btdrvStartAudioOut(u32 audio_handle, const BtdrvPcmParameter *pcm_param, s64 in_latency, s64 *out_latency, u64 *out1);
1363 
1364 /**
1365  * @brief StopAudioOut
1366  * @note Only available on [12.0.0+].
1367  * @param[in] audio_handle Audio handle from \ref btdrvOpenAudioOut.
1368  */
1369 Result btdrvStopAudioOut(u32 audio_handle);
1370 
1371 /**
1372  * @brief GetAudioOutState
1373  * @note Only available on [12.0.0+].
1374  * @param[in] audio_handle Audio handle from \ref btdrvOpenAudioOut.
1375  * @param[out] out \ref BtdrvAudioOutState
1376  */
1378 
1379 /**
1380  * @brief GetAudioOutFeedingCodec
1381  * @note Only available on [12.0.0+].
1382  * @param[in] audio_handle Audio handle from \ref btdrvOpenAudioOut.
1383  * @param[out] out \ref BtdrvAudioCodec
1384  */
1386 
1387 /**
1388  * @brief GetAudioOutFeedingParameter
1389  * @note Only available on [12.0.0+].
1390  * @param[in] audio_handle Audio handle from \ref btdrvOpenAudioOut.
1391  * @param[out] out \ref BtdrvPcmParameter
1392  */
1394 
1395 /**
1396  * @brief AcquireAudioOutStateChangedEvent
1397  * @note Only available on [12.0.0+].
1398  * @param[in] audio_handle Audio handle from \ref btdrvOpenAudioOut.
1399  * @param[out] out_event Output Event.
1400  * @param[in] autoclear Event autoclear.
1401  */
1402 Result btdrvAcquireAudioOutStateChangedEvent(u32 audio_handle, Event* out_event, bool autoclear);
1403 
1404 /**
1405  * @brief AcquireAudioOutBufferAvailableEvent
1406  * @note Only available on [12.0.0+].
1407  * @param[in] audio_handle Audio handle from \ref btdrvOpenAudioOut.
1408  * @param[out] out_event Output Event.
1409  * @param[in] autoclear Event autoclear.
1410  */
1411 Result btdrvAcquireAudioOutBufferAvailableEvent(u32 audio_handle, Event* out_event, bool autoclear);
1412 
1413 /**
1414  * @brief SendAudioData
1415  * @note Only available on [12.0.0+].
1416  * @param[in] audio_handle Audio handle from \ref btdrvOpenAudioOut.
1417  * @param[in] buffer Input buffer.
1418  * @param[in] size Input buffer size.
1419  * @param[out] Output transferred size. This is always either 0 (error occured) or the buffer size.
1420  */
1421 Result btdrvSendAudioData(u32 audio_handle, const void* buffer, size_t size, u64 *transferred_size);
1422 
1423 /**
1424  * @brief AcquireAudioControlInputStateChangedEvent
1425  * @note Only available on [12.0.0+].
1426  * @param[out] out_event Output Event.
1427  * @param[in] autoclear Event autoclear.
1428  */
1429 Result btdrvAcquireAudioControlInputStateChangedEvent(Event* out_event, bool autoclear);
1430 
1431 /**
1432  * @brief GetAudioControlInputState
1433  * @note Only available on [12.0.0+].
1434  * @param[out] states Output array of \ref BtdrvAudioControlButtonState.
1435  * @param[in] count Size of the states array in entries, the maximum is 0xF.
1436  * @param[out] total_out Total output entries.
1437  */
1439 
1440 /**
1441  * @brief AcquireAudioConnectionStateChangedEvent
1442  * @note Only available on [12.0.0-13.2.1].
1443  * @param[out] out_event Output Event.
1444  * @param[in] autoclear Event autoclear.
1445  */
1446 Result btdrvAcquireAudioConnectionStateChangedEvent(Event* out_event, bool autoclear);
1447 
1448 /**
1449  * @brief GetConnectedAudioDevice
1450  * @note Only available on [12.0.0-13.2.1].
1451  * @param[out] addrs Output array of \ref BtdrvAddress.
1452  * @param[in] count Size of the addrs array in entries, the maximum is 0x8.
1453  * @param[out] total_out Total output entries.
1454  */
1455 Result btdrvGetConnectedAudioDevice(BtdrvAddress *addrs, s32 count, s32 *total_out);
1456 
1457 /**
1458  * @brief CloseAudioControlInput
1459  * @note Only available on [13.0.0+].
1460  * @param[in] addr \ref BtdrvAddress
1461  */
1463 
1464 /**
1465  * @brief RegisterAudioControlNotification
1466  * @note Only available on [13.0.0+].
1467  * @param[in] addr \ref BtdrvAddress
1468  * @param[in] event_type AvrcEventType
1469  */
1471 
1472 /**
1473  * @brief SendAudioControlPassthroughCommand
1474  * @note Only available on [13.0.0+].
1475  * @param[in] addr \ref BtdrvAddress
1476  * @param[in] op_id AvrcOperationId
1477  * @param[in] state_type AvrcStateType
1478  */
1480 
1481 /**
1482  * @brief SendAudioControlSetAbsoluteVolumeCommand
1483  * @note Only available on [13.0.0+].
1484  * @param[in] addr \ref BtdrvAddress
1485  * @param[in] val Input value
1486  */
1488 
1489 /**
1490  * @brief IsManufacturingMode
1491  * @note Only available on [5.0.0+].
1492  * @param[out] out Output flag.
1493  */
1494 Result btdrvIsManufacturingMode(bool *out);
1495 
1496 /**
1497  * @brief EmulateBluetoothCrash
1498  * @note Only available on [7.0.0+].
1499  * @param[in] reason \ref BtdrvFatalReason
1500  */
1502 
1503 /**
1504  * @brief GetBleChannelMap
1505  * @note Only available on [9.0.0+].
1506  * @param[out] out \ref BtdrvChannelMapList
1507  */
1509 
1510 ///@name CircularBuffer
1511 ///@{
1512 
1513 /**
1514  * @brief Read
1515  * @note Used by \ref btdrvGetHidReportEventInfo on [7.0.0+].
1516  * @param c \ref BtdrvCircularBuffer
1517  */
1519 
1520 /**
1521  * @brief Free
1522  * @note Used by \ref btdrvGetHidReportEventInfo on [7.0.0+].
1523  * @param c \ref BtdrvCircularBuffer
1524  */
1526 
1527 ///@}
1528 
btdrvUnregisterGattNotification
Result btdrvUnregisterGattNotification(u32 connection_handle, bool primary_service, const BtdrvGattId *id0, const BtdrvGattId *id1)
UnregisterGattNotification.
BtdrvHidReportEventInfoBufferData::type
u8 type
BtdrvHidEventType
Definition: btdrv.h:296
s64
int64_t s64
64-bit signed integer.
Definition: types.h:28
btdrvDisconnectGattClient
Result btdrvDisconnectGattClient(u8 unk, BtdrvAddress addr)
DisconnectGattClient.
btdrvSendAudioControlSetAbsoluteVolumeCommand
Result btdrvSendAudioControlSetAbsoluteVolumeCommand(BtdrvAddress addr, s32 val)
SendAudioControlSetAbsoluteVolumeCommand.
btdrvSetLeConnectionParameter
Result btdrvSetLeConnectionParameter(const BtdrvLeConnectionParams *param)
SetLeConnectionParameter.
BtdrvCircularBuffer
CircularBuffer.
Definition: btdrv.h:315
btdrvSendAudioData
Result btdrvSendAudioData(u32 audio_handle, const void *buffer, size_t size, u64 *transferred_size)
SendAudioData.
btdrvStartAudioOut
Result btdrvStartAudioOut(u32 audio_handle, const BtdrvPcmParameter *pcm_param, s64 in_latency, s64 *out_latency, u64 *out1)
StartAudioOut.
SetSysBluetoothDevicesSettings
BluetoothDevicesSettings.
Definition: set.h:313
btdrvInitializeBluetooth
Result btdrvInitializeBluetooth(Event *out_event)
InitializeBluetooth.
btdrvAcquireAudioOutStateChangedEvent
Result btdrvAcquireAudioOutStateChangedEvent(u32 audio_handle, Event *out_event, bool autoclear)
AcquireAudioOutStateChangedEvent.
btdrvGetBleManagedEventInfo
Result btdrvGetBleManagedEventInfo(void *buffer, size_t size, BtdrvBleEventType *type)
GetBleManagedEventInfo.
BtdrvEventInfo::flag
u8 flag
bool flag for Just Works. With SSP passkey notification this is always 0.
Definition: btdrv.h:83
btdrvCloseAudioControlInput
Result btdrvCloseAudioControlInput(BtdrvAddress addr)
CloseAudioControlInput.
BtdrvEventInfo::type
u32 type
0 = SSP confirm request, 3 = SSP passkey notification.
Definition: btdrv.h:75
BtdrvHidReportEventInfo
Data for btdrvGetHidReportEventInfo. The data stored here depends on the BtdrvHidEventType.
Definition: btdrv.h:217
btdrvEmulateBluetoothCrash
Result btdrvEmulateBluetoothCrash(BtdrvFatalReason reason)
EmulateBluetoothCrash.
btdrvSetBleScanParameter
Result btdrvSetBleScanParameter(u16 unk0, u16 unk1)
SetBleScanParameter.
btdrvStopAudioOut
Result btdrvStopAudioOut(u32 audio_handle)
StopAudioOut.
btdrvCancelConnectGattServer
Result btdrvCancelConnectGattServer(u8 unk, BtdrvAddress addr, bool flag)
CancelConnectGattServer.
btdrvDisconnectGattServer
Result btdrvDisconnectGattServer(u32 unk)
DisconnectGattServer.
BtdrvEventInfo::status
u8 status
BtdrvInquiryStatus
Definition: btdrv.h:55
btdrvDeleteBleScanFilter
Result btdrvDeleteBleScanFilter(u8 unk)
DeleteBleScanFilter.
BtdrvHidData
HidData [1.0.0-8.1.1].
Definition: btdrv_types.h:204
btdrvLegacyRespondToPinRequest
Result btdrvLegacyRespondToPinRequest(BtdrvAddress addr, bool flag, const BtdrvBluetoothPinCode *pin_code, u8 length)
RespondToPinRequest [1.0.0-11.0.1].
u8
uint8_t u8
8-bit unsigned integer.
Definition: types.h:19
btdrvExit
void btdrvExit(void)
Exit btdrv.
btdrvInitializeBle
Result btdrvInitializeBle(Event *out_event)
InitializeBle.
btdrvSetBleConnectionParameter
Result btdrvSetBleConnectionParameter(BtdrvAddress addr, const BtdrvBleConnectionParameter *param, bool flag)
SetBleConnectionParameter.
BtdrvAudioOutState
BtdrvAudioOutState
AudioOutState.
Definition: btdrv_types.h:150
btdrvIsAfhSettingEnabled
Result btdrvIsAfhSettingEnabled(bool *out)
IsAfhSettingEnabled.
btdrvGetAudioOutFeedingParameter
Result btdrvGetAudioOutFeedingParameter(u32 audio_handle, BtdrvPcmParameter *out)
GetAudioOutFeedingParameter.
Event
Kernel-mode event structure.
Definition: event.h:13
btdrvDisableBle
Result btdrvDisableBle(void)
DisableBle.
BtdrvEventInfo::value
u8 value
Tsi value, when the above indicates success.
Definition: btdrv.h:117
btdrvGetLatestPlr
Result btdrvGetLatestPlr(BtdrvPlrList *out)
GetLatestPlr.
btdrvGetGattFirstDescriptor
Result btdrvGetGattFirstDescriptor(u32 unk, const BtdrvGattId *id0, bool flag, const BtdrvGattId *id1, const BtdrvGattAttributeUuid *uuid, BtdrvGattId *out_desc_id)
GetGattFirstDescriptor.
BtdrvEventInfo::count
u32 count
Count value.
Definition: btdrv.h:135
BtdrvBluetoothPropertyType
BtdrvBluetoothPropertyType
BluetoothPropertyType [1.0.0-11.0.1].
Definition: btdrv_types.h:11
btdrvConfigureAttMtu
Result btdrvConfigureAttMtu(u32 unk, u16 mtu)
ConfigureAttMtu.
btdrvConnectGattServer
Result btdrvConnectGattServer(u8 unk, BtdrvAddress addr, bool flag, u64 AppletResourceUserId)
ConnectGattServer.
BtdrvHidReportEventInfoBufferData
The raw sharedmem data for HidReportEventInfo.
Definition: btdrv.h:294
BtdrvCircularBuffer::event_type
void * event_type
Not set with sharedmem.
Definition: btdrv.h:317
btdrvEnableMcMode
Result btdrvEnableMcMode(bool flag)
EnableMcMode.
BtdrvPcmParameter
PcmParameter.
Definition: btdrv_types.h:339
btdrvEnableAfhSetting
Result btdrvEnableAfhSetting(bool flag)
EnableAfhSetting.
btdrvGetGattAttribute
Result btdrvGetGattAttribute(BtdrvAddress addr, u32 unk)
GetGattAttribute.
btdrvReadGattDescriptor
Result btdrvReadGattDescriptor(u32 connection_handle, bool primary_service, const BtdrvGattId *id0, const BtdrvGattId *id1, const BtdrvGattId *id2, u8 unk)
ReadGattDescriptor.
btdrvDisableBluetooth
Result btdrvDisableBluetooth(void)
DisableBluetooth.
BtdrvBleAdvertiseFilter
BleAdvertiseFilter.
Definition: btdrv_types.h:273
btdrvUnregisterGattDataPath
Result btdrvUnregisterGattDataPath(const BtdrvGattAttributeUuid *uuid)
UnregisterGattDataPath.
btdrvGetBleChannelMap
Result btdrvGetBleChannelMap(BtdrvChannelMapList *out)
GetBleChannelMap.
btdrvGetGattNextDescriptor
Result btdrvGetGattNextDescriptor(u32 unk, const BtdrvGattId *id0, bool flag, const BtdrvGattId *id1, const BtdrvGattId *id2, const BtdrvGattAttributeUuid *uuid, BtdrvGattId *out_desc_id)
GetGattNextDescriptor.
s32
int32_t s32
32-bit signed integer.
Definition: types.h:27
btdrvOpenAudioConnection
Result btdrvOpenAudioConnection(BtdrvAddress addr)
OpenAudioConnection.
BtdrvEventInfo::val
u32 val
Value.
Definition: btdrv.h:20
BtdrvAudioControlButtonState
AudioControlButtonState.
Definition: btdrv_types.h:346
BtdrvHidReport
HidReport [9.0.0+].
Definition: btdrv_types.h:210
btdrvRemoveBond
Result btdrvRemoveBond(BtdrvAddress addr)
RemoveBond.
btdrvSetBleAdvertiseParameter
Result btdrvSetBleAdvertiseParameter(BtdrvAddress addr, u16 unk0, u16 unk1)
SetBleAdvertiseParameter.
BtdrvClassOfDevice
ClassOfDevice.
Definition: btdrv_types.h:166
btdrvGetChannelMap
Result btdrvGetChannelMap(BtdrvChannelMapList *out)
GetChannelMap.
btdrvInitializeHid
Result btdrvInitializeHid(Event *out_event)
InitializeHid.
btdrvGetPairedDeviceInfo
Result btdrvGetPairedDeviceInfo(BtdrvAddress addr, SetSysBluetoothDevicesSettings *settings)
GetPairedDeviceInfo.
btdrvEnableTbfcScan
Result btdrvEnableTbfcScan(bool flag)
EnableTbfcScan.
btdrvAddBleScanFilterCondition
Result btdrvAddBleScanFilterCondition(const BtdrvBleAdvertiseFilter *filter)
AddBleScanFilterCondition.
btdrvCloseHidConnection
Result btdrvCloseHidConnection(BtdrvAddress addr)
CloseHidConnection.
btdrvGetAudioOutFeedingCodec
Result btdrvGetAudioOutFeedingCodec(u32 audio_handle, BtdrvAudioCodec *out)
GetAudioOutFeedingCodec.
BtdrvHidEventInfo::count
u32 count
Count value.
Definition: btdrv.h:204
btdrvConnectGattClient
Result btdrvConnectGattClient(u8 unk, BtdrvAddress addr, bool flag)
ConnectGattClient.
btdrvCancelBond
Result btdrvCancelBond(BtdrvAddress addr)
CancelBond.
btdrvGetAudioOutState
Result btdrvGetAudioOutState(u32 audio_handle, BtdrvAudioOutState *out)
GetAudioOutState.
btdrvCircularBufferRead
void * btdrvCircularBufferRead(BtdrvCircularBuffer *c)
Read.
btdrvSetLeDefaultConnectionParameter
Result btdrvSetLeDefaultConnectionParameter(const BtdrvLeConnectionParams *param)
SetLeDefaultConnectionParameter.
btdrvRespondToPinRequest
Result btdrvRespondToPinRequest(BtdrvAddress addr, const BtdrvPinCode *pin_code)
RespondToPinRequest [12.0.0+].
btdrvStopBleScan
Result btdrvStopBleScan(void)
StopBleScan.
btdrvGetEventInfo
Result btdrvGetEventInfo(void *buffer, size_t size, BtdrvEventType *type)
GetEventInfo.
btdrvSetBleVisibility
Result btdrvSetBleVisibility(bool discoverable, bool connectable)
SetBleVisibility.
btdrvEnableBleScanFilter
Result btdrvEnableBleScanFilter(bool flag)
EnableBleScanFilter.
BtdrvHidReportEventInfo::unk_x4
u8 unk_x4
Always 0.
Definition: btdrv.h:245
BtdrvHidEventInfo::status
u32 status
0 for success, non-zero for error.
Definition: btdrv.h:174
btdrvIsManufacturingMode
Result btdrvIsManufacturingMode(bool *out)
IsManufacturingMode.
btdrvFinalizeHid
Result btdrvFinalizeHid(void)
FinalizeHid.
btdrvLegacySetAdapterProperty
Result btdrvLegacySetAdapterProperty(BtdrvBluetoothPropertyType type, const void *buffer, size_t size)
SetAdapterProperty [1.0.0-11.0.1].
btdrvGetGattNextCharacteristic
Result btdrvGetGattNextCharacteristic(u32 unk, const BtdrvGattId *id0, bool flag, const BtdrvGattId *id1, const BtdrvGattAttributeUuid *uuid, u8 *out_property, BtdrvGattId *out_char_id)
GetGattNextCharacteristic.
btdrvEnableRadio
Result btdrvEnableRadio(bool flag)
EnableRadio.
btdrvAcquireAudioControlInputStateChangedEvent
Result btdrvAcquireAudioControlInputStateChangedEvent(Event *out_event, bool autoclear)
AcquireAudioControlInputStateChangedEvent.
btdrvIsBluetoothEnabled
Result btdrvIsBluetoothEnabled(bool *out)
IsBluetoothEnabled.
BtdrvLeConnectionParams
LeConnectionParams.
Definition: btdrv_types.h:231
BtdrvHidEventInfo::status
BtdrvHidConnectionStatus status
BtdrvHidConnectionStatus
Definition: btdrv.h:159
btdrvWriteHidData
Result btdrvWriteHidData(BtdrvAddress addr, const BtdrvHidReport *buffer)
This sends a HID DATA transaction packet with report-type Output.
BtdrvBleAdvertisementData
Definition: btdrv_types.h:266
u32
uint32_t u32
32-bit unsigned integer.
Definition: types.h:21
btdrvInitialize
Result btdrvInitialize(void)
Initialize btdrv.
btdrvUnregisterAllGattClients
Result btdrvUnregisterAllGattClients(void)
UnregisterAllGattClients.
BtdrvFatalReason
BtdrvFatalReason
This determines the u16 data to write into a CircularBuffer.
Definition: btdrv_types.h:116
btdrvGetAdapterProperty
Result btdrvGetAdapterProperty(BtdrvAdapterPropertyType type, BtdrvAdapterProperty *property)
GetAdapterProperty [12.0.0+].
btdrvFinalizeBle
Result btdrvFinalizeBle(void)
FinalizeBle.
btdrvRegisterGattDataPath
Result btdrvRegisterGattDataPath(const BtdrvGattAttributeUuid *uuid)
RegisterGattDataPath.
btdrvStartBleScan
Result btdrvStartBleScan(void)
StartBleScan.
btdrvMoveToSecondaryPiconet
Result btdrvMoveToSecondaryPiconet(BtdrvAddress addr)
MoveToSecondaryPiconet.
btdrvUnregisterGattClient
Result btdrvUnregisterGattClient(u8 unk)
UnregisterGattClient.
btdrvSetHidReport
Result btdrvSetHidReport(BtdrvAddress addr, BtdrvBluetoothHhReportType type, const BtdrvHidReport *buffer)
This sends a HID SET_REPORT transaction packet.
BtdrvAdapterPropertySet
AdapterPropertySet [12.0.0+].
Definition: btdrv_types.h:186
btdrvRegisterGattHidDataPath
Result btdrvRegisterGattHidDataPath(const BtdrvGattAttributeUuid *uuid)
RegisterGattHidDataPath.
BtdrvHidEventInfo::flag
u8 flag
Flag.
Definition: btdrv.h:197
u64
uint64_t u64
64-bit unsigned integer.
Definition: types.h:22
btdrvRespondToSspRequest
Result btdrvRespondToSspRequest(BtdrvAddress addr, u32 variant, bool accept, u32 passkey)
RespondToSspRequest.
BtdrvAudioCodec
BtdrvAudioCodec
AudioCodec.
Definition: btdrv_types.h:156
btdrvLegacyStartInquiry
Result btdrvLegacyStartInquiry(void)
StartInquiry [1.0.0-11.0.1].
btdrvRegisterGattNotification
Result btdrvRegisterGattNotification(u32 connection_handle, bool primary_service, const BtdrvGattId *id0, const BtdrvGattId *id1)
RegisterGattNotification.
btdrvCreateBond
Result btdrvCreateBond(BtdrvAddress addr, u32 type)
CreateBond.
Mutex
_LOCK_T Mutex
Mutex datatype, defined in newlib.
Definition: mutex.h:12
btdrvUnregisterGattHidDataPath
Result btdrvUnregisterGattHidDataPath(const BtdrvGattAttributeUuid *uuid)
UnregisterGattHidDataPath.
btdrvGetAudioControlInputState
Result btdrvGetAudioControlInputState(BtdrvAudioControlButtonState *states, s32 count, s32 *total_out)
GetAudioControlInputState.
btdrvAddGattDescriptor
Result btdrvAddGattDescriptor(u8 unk0, const BtdrvGattAttributeUuid *uuid0, const BtdrvGattAttributeUuid *uuid1, u16 unk1)
AddGattDescriptor.
btdrvTriggerConnection
Result btdrvTriggerConnection(BtdrvAddress addr, u16 unk)
TriggerConnection.
BtdrvHidReportEventInfo::report
BtdrvHidReport report
BtdrvHidReport
Definition: btdrv.h:248
Result
u32 Result
Function error code result type.
Definition: types.h:44
BtdrvAudioEventInfo
Data for btdrvGetAudioEventInfo. The data stored here depends on the BtdrvAudioEventType.
Definition: btdrv.h:306
btdrvEnableBurstMode
Result btdrvEnableBurstMode(BtdrvAddress addr, bool flag)
EnableBurstMode.
btdrvStartInquiry
Result btdrvStartInquiry(u32 services, s64 duration)
StartInquiry [12.0.0+].
BtdrvBluetoothHhReportType
BtdrvBluetoothHhReportType
BluetoothHhReportType Bit0-1 directly control the HID bluetooth transaction report-type value.
Definition: btdrv_types.h:79
btdrvSetZeroRetransmission
Result btdrvSetZeroRetransmission(BtdrvAddress addr, u8 *report_ids, u8 count)
SetZeroRetransmission.
btdrvEnableGattService
Result btdrvEnableGattService(u8 unk, const BtdrvGattAttributeUuid *uuid)
EnableGattService.
btdrvLegacyGetAdapterProperty
Result btdrvLegacyGetAdapterProperty(BtdrvBluetoothPropertyType type, void *buffer, size_t size)
GetAdapterProperty [1.0.0-11.0.1].
btdrvWriteHidData2
Result btdrvWriteHidData2(BtdrvAddress addr, const void *buffer, size_t size)
WriteHidData2.
BtdrvGattAttributeUuid
GattAttributeUuid.
Definition: btdrv_types.h:299
btdrvUnregisterGattManagedDataPath
Result btdrvUnregisterGattManagedDataPath(const BtdrvGattAttributeUuid *uuid)
UnregisterGattManagedDataPath.
btdrvLegacyGetAdapterProperties
Result btdrvLegacyGetAdapterProperties(BtdrvAdapterPropertyOld *properties)
GetAdapterProperties [1.0.0-11.0.1].
btdrvEnableLlrScan
Result btdrvEnableLlrScan(void)
EnableLlrScan.
btdrvSetVisibility
Result btdrvSetVisibility(bool inquiry_scan, bool page_scan)
SetVisibility.
BtdrvBluetoothPinCode
BluetoothPinCode [1.0.0-11.0.1].
Definition: btdrv_types.h:193
btdrvClearBleScanFilters
Result btdrvClearBleScanFilters(void)
ClearBleScanFilters.
btdrvFinalizeBluetooth
Result btdrvFinalizeBluetooth(void)
FinalizeBluetooth.
btdrvEnableBluetooth
Result btdrvEnableBluetooth(void)
EnableBluetooth.
btdrvSetBleAdvertiseData
Result btdrvSetBleAdvertiseData(const BtdrvBleAdvertisePacketData *data)
SetBleAdvertiseData.
btdrvWriteGattCharacteristic
Result btdrvWriteGattCharacteristic(u32 connection_handle, bool primary_service, const BtdrvGattId *id0, const BtdrvGattId *id1, const void *buffer, size_t size, u8 unk, bool flag)
WriteGattCharacteristic.
BtdrvBleEventType
BtdrvBleEventType
BleEventType.
Definition: btdrv_types.h:126
btdrvIsTxPowerBoostSettingEnabled
Result btdrvIsTxPowerBoostSettingEnabled(bool *out)
IsTxPowerBoostSettingEnabled.
BtdrvAdapterPropertyOld
AdapterProperty [1.0.0-11.0.1].
Definition: btdrv_types.h:171
BtdrvHidEventInfo::addr
BtdrvAddress addr
Device address.
Definition: btdrv.h:157
BtdrvEventInfo::class_of_device
BtdrvClassOfDevice class_of_device
Class of Device.
Definition: btdrv.h:29
BtdrvHidEventType
BtdrvHidEventType
HidEventType.
Definition: btdrv_types.h:87
btdrvSetBleDefaultConnectionParameter
Result btdrvSetBleDefaultConnectionParameter(const BtdrvBleConnectionParameter *param)
SetBleDefaultConnectionParameter.
BtdrvEventInfo::service_mask
u32 service_mask
Services value from btdrvStartInquiry when starting, otherwise this is value 0.
Definition: btdrv.h:57
BtdrvChannelMapList
ChannelMapList.
Definition: btdrv_types.h:226
btdrvGetGattService
Result btdrvGetGattService(u32 unk, const BtdrvGattAttributeUuid *uuid)
GetGattService.
btdrvGetHidReport
Result btdrvGetHidReport(BtdrvAddress addr, u8 report_id, BtdrvBluetoothHhReportType type)
This sends a HID GET_REPORT transaction packet.
btdrvEnableBle
Result btdrvEnableBle(void)
EnableBle.
BtdrvGattId
GattId.
Definition: btdrv_types.h:305
BtdrvAudioEventInfo::status
u32 status
Status: 0 = AV connection closed, 1 = AV connection opened, 2 = failed to open AV connection.
Definition: btdrv.h:308
BtdrvEventInfo::status
u32 status
Status, always 0 except with BtdrvConnectionEventType_Status: 2 = ACL Link is now Resumed,...
Definition: btdrv.h:95
BtdrvEventType
BtdrvEventType
EventType.
Definition: btdrv_types.h:28
BtdrvBleEventInfo
Data for btdrvGetBleManagedEventInfo. The data stored here depends on the BtdrvBleEventType.
Definition: btdrv.h:327
btdrvDeleteBleScanFilterCondition
Result btdrvDeleteBleScanFilterCondition(const BtdrvBleAdvertiseFilter *filter)
DeleteBleScanFilterCondition.
btdrvOpenHidConnection
Result btdrvOpenHidConnection(BtdrvAddress addr)
OpenHidConnection.
btdrvRegisterAudioControlNotification
Result btdrvRegisterAudioControlNotification(BtdrvAddress addr, u32 event_type)
RegisterAudioControlNotification.
btdrvGetServiceSession
Service * btdrvGetServiceSession(void)
Gets the Service object for the actual btdrv service session.
btdrvStopInquiry
Result btdrvStopInquiry(void)
This stops Inquiry which was started by btdrvStartInquiry, if it's still active.
BtdrvEventInfo::status
BtdrvInquiryStatus status
BtdrvInquiryStatus
Definition: btdrv.h:51
btdrvGetLeHidEventInfo
Result btdrvGetLeHidEventInfo(void *buffer, size_t size, u32 *type)
GetLeHidEventInfo.
BtdrvInquiryStatus
BtdrvInquiryStatus
BtdrvInquiryStatus.
Definition: btdrv_types.h:53
BtdrvAdapterPropertyType
BtdrvAdapterPropertyType
AdapterPropertyType [12.0.0+].
Definition: btdrv_types.h:20
btdrvCloseAudioConnection
Result btdrvCloseAudioConnection(BtdrvAddress addr)
CloseAudioConnection.
btdrvSetTsi
Result btdrvSetTsi(BtdrvAddress addr, u8 tsi)
SetTsi.
btdrvCloseAudioOut
Result btdrvCloseAudioOut(u32 audio_handle)
CloseAudioOut.
BtdrvAddress
Address.
Definition: btdrv_types.h:161
BtdrvPlrList
PlrList.
Definition: btdrv_types.h:221
BtdrvPinCode
BtdrvPinCode [12.0.0+].
Definition: btdrv_types.h:198
BtdrvBleAdvertisePacketData
BleAdvertisePacketData.
Definition: btdrv_types.h:247
btdrvRegisterGattManagedDataPath
Result btdrvRegisterGattManagedDataPath(const BtdrvGattAttributeUuid *uuid)
RegisterGattManagedDataPath.
BtdrvHidEventInfo::type
u32 type
BtdrvExtEventType, controls which data is stored below.
Definition: btdrv.h:170
btdrvGetHidReportEventInfoSharedmemAddr
void * btdrvGetHidReportEventInfoSharedmemAddr(void)
Gets the SharedMemory addr for HidReportEventInfo (BtdrvCircularBuffer), only valid when btdrvRegiste...
Service
Service object structure.
Definition: service.h:13
btdrvEnableTxPowerBoostSetting
Result btdrvEnableTxPowerBoostSetting(bool flag)
EnableTxPowerBoostSetting.
BtdrvHidEventInfo
Data for btdrvGetHidEventInfo. The data stored here depends on the BtdrvHidEventType.
Definition: btdrv.h:150
BtdrvBleConnectionParameter
BleConnectionParameter.
Definition: btdrv_types.h:236
btdrvGetAudioEventInfo
Result btdrvGetAudioEventInfo(void *buffer, size_t size, BtdrvAudioEventType *type)
GetAudioEventInfo.
btdrvOpenAudioOut
Result btdrvOpenAudioOut(BtdrvAddress addr, u32 *audio_handle)
OpenAudioOut.
btdrvAcquireAudioEvent
Result btdrvAcquireAudioEvent(Event *out_event, bool autoclear)
AcquireAudioEvent.
btdrvReadGattCharacteristic
Result btdrvReadGattCharacteristic(u32 connection_handle, bool primary_service, const BtdrvGattId *id0, const BtdrvGattId *id1, u8 unk)
ReadGattCharacteristic.
btdrvGetAdapterProperties
Result btdrvGetAdapterProperties(BtdrvAdapterPropertySet *properties)
GetAdapterProperties [12.0.0+].
btdrvDisableLlrScan
Result btdrvDisableLlrScan(void)
DisableLlrScan.
btdrvGetConnectedAudioDevice
Result btdrvGetConnectedAudioDevice(BtdrvAddress *addrs, s32 count, s32 *total_out)
GetConnectedAudioDevice.
BtdrvAudioEventInfo::addr
BtdrvAddress addr
Device address.
Definition: btdrv.h:309
btdrvGetGattFirstCharacteristic
Result btdrvGetGattFirstCharacteristic(u32 unk, const BtdrvGattId *id, bool flag, const BtdrvGattAttributeUuid *uuid, u8 *out_property, BtdrvGattId *out_char_id)
GetGattFirstCharacteristic.
btdrvGetPendingConnections
Result btdrvGetPendingConnections(void)
GetPendingConnections.
btdrvRegisterGattClient
Result btdrvRegisterGattClient(const BtdrvGattAttributeUuid *uuid)
RegisterGattClient.
btdrvGetHidReportEventInfo
Result btdrvGetHidReportEventInfo(void *buffer, size_t size, BtdrvHidEventType *type)
GetHidReportEventInfo.
btdrvAddPairedDeviceInfo
Result btdrvAddPairedDeviceInfo(const SetSysBluetoothDevicesSettings *settings)
AddPairedDeviceInfo.
btdrvCircularBufferFree
bool btdrvCircularBufferFree(BtdrvCircularBuffer *c)
Free.
btdrvGetHidEventInfo
Result btdrvGetHidEventInfo(void *buffer, size_t size, BtdrvHidEventType *type)
GetHidEventInfo.
BtdrvEventInfo::addr
BtdrvAddress addr
Device address.
Definition: btdrv.h:27
btdrvSetAdapterProperty
Result btdrvSetAdapterProperty(BtdrvAdapterPropertyType type, const BtdrvAdapterProperty *property)
SetAdapterProperty [12.0.0+].
BtdrvEventInfo::passkey
s32 passkey
Passkey, only set when the above field is value 3.
Definition: btdrv.h:76
BtdrvHidReportEventInfo::report
BtdrvHidData report
BtdrvHidData
Definition: btdrv.h:233
btdrvAddGattService
Result btdrvAddGattService(u8 unk0, const BtdrvGattAttributeUuid *uuid, u8 unk1, bool flag)
AddGattService.
btdrvAcquireAudioOutBufferAvailableEvent
Result btdrvAcquireAudioOutBufferAvailableEvent(u32 audio_handle, Event *out_event, bool autoclear)
AcquireAudioOutBufferAvailableEvent.
BtdrvEventInfo
Data for btdrvGetEventInfo. The data stored here depends on the BtdrvEventType.
Definition: btdrv.h:15
BtdrvHidReportEventInfo::addr
BtdrvAddress addr
BtdrvAddress
Definition: btdrv.h:225
btdrvSendAudioControlPassthroughCommand
Result btdrvSendAudioControlPassthroughCommand(BtdrvAddress addr, u32 op_id, u32 state_type)
SendAudioControlPassthroughCommand.
BtdrvHidReportEventInfo::res
u32 res
Always 0.
Definition: btdrv.h:227
btdrvRegisterGattServer
Result btdrvRegisterGattServer(const BtdrvGattAttributeUuid *uuid)
RegisterGattServer.
btdrvAcquireAudioConnectionStateChangedEvent
Result btdrvAcquireAudioConnectionStateChangedEvent(Event *out_event, bool autoclear)
AcquireAudioConnectionStateChangedEvent.
BtdrvAudioEventType
BtdrvAudioEventType
AudioEventType.
Definition: btdrv_types.h:144
btdrvRegisterBleHidEvent
Result btdrvRegisterBleHidEvent(Event *out_event)
RegisterBleHidEvent.
btdrvRegisterHidReportEvent
Result btdrvRegisterHidReportEvent(Event *out_event)
RegisterHidReportEvent.
u16
uint16_t u16
16-bit unsigned integer.
Definition: types.h:20
BtdrvHidConnectionStatus
BtdrvHidConnectionStatus
HidConnectionStatus [12.0.0+].
Definition: btdrv_types.h:103
BtdrvEventInfo::reason
u16 reason
BtdrvFatalReason
Definition: btdrv.h:144
btdrvWriteGattDescriptor
Result btdrvWriteGattDescriptor(u32 connection_handle, bool primary_service, const BtdrvGattId *id0, const BtdrvGattId *id1, const BtdrvGattId *id2, const void *buffer, size_t size, u8 unk)
WriteGattDescriptor.
BtdrvAdapterProperty
AdapterProperty [12.0.0+].
Definition: btdrv_types.h:179
btdrvUnregisterGattServer
Result btdrvUnregisterGattServer(u8 unk)
UnregisterGattServer.
btdrvAddGattCharacteristic
Result btdrvAddGattCharacteristic(u8 unk0, const BtdrvGattAttributeUuid *uuid0, const BtdrvGattAttributeUuid *uuid1, u8 unk1, u16 unk2)
AddGattCharacteristic.