libnx v4.9.0
Loading...
Searching...
No Matches
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.
15typedef 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.
150typedef 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.
217typedef 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.
294typedef 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.
306typedef 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
315typedef 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.
327typedef 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_attribute; ///< ::BtdrvBleEventType_ServerAddAttribute
443
444 struct {
445 u32 result; ///< 0 for success, non-zero for error.
446 u16 conn_id; ///< Connection ID
447 u8 operation; ///< Operation. 0 = Read, 1 = Write
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 written during write operation
453 u16 size; ///< Size of the above data
454 u16 offset; ///< Offset
455 u8 pad2[2]; ///< Padding
456 } server_attribute_operation; ///< ::BtdrvBleEventType_ServerAttributeOperation
457 };
459
460/// Initialize btdrv.
462
463/// Exit btdrv.
464void 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 */
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 */
549Result 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 */
605Result 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 */
614Result 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 */
651Result 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] timeout [9.0.0+] Host trigger timeout
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 */
705Result 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 */
767Result 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 */
794Result 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 */
883Result 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 */
929Result 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 */
1013Result 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 */
1023Result 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 * @note Event data generated by this call contains uninitialized junk instead of the server_if value received internally.
1062 * @param[in] uuid \ref BtdrvGattAttributeUuid
1063 */
1065
1066/**
1067 * @brief UnregisterGattServer
1068 * @note Only available on [5.0.0+].
1069 * @param[in] server_if Server interface ID
1070 */
1072
1073/**
1074 * @brief ConnectGattClient
1075 * @note Only available on [5.0.0+].
1076 * @param[in] server_if Server interface ID
1077 * @param[in] addr \ref BtdrvAddress
1078 * @param[in] is_direct Whether a direct connection or a background auto connection
1079 */
1080Result btdrvConnectGattClient(u8 server_if, BtdrvAddress addr, bool is_direct);
1081
1082/**
1083 * @brief DisconnectGattClient
1084 * @note Only available on [5.0.0+].
1085 * @param[in] conn_id Connection ID
1086 * @param[in] addr \ref BtdrvAddress, only used on pre-9.0.0.
1087 */
1089
1090/**
1091 * @brief AddGattService
1092 * @note Only available on [5.0.0+].
1093 * @note Broken behaviour due to internal bugs.
1094 * @param[in] server_if Server interface ID
1095 * @param[in] uuid \ref BtdrvGattAttributeUuid
1096 * @param[in] num_handle Number of handles
1097 * @param[in] is_primary Is a primary service or not
1098 */
1099Result btdrvAddGattService(u8 server_if, const BtdrvGattAttributeUuid *uuid, u8 num_handle, bool is_primary);
1100
1101/**
1102 * @brief EnableGattService
1103 * @note Only available on [5.0.0+].
1104 * @note Broken behaviour due to internal bugs.
1105 * @param[in] server_if Server interface ID
1106 * @param[in] uuid \ref BtdrvGattAttributeUuid
1107 */
1109
1110/**
1111 * @brief AddGattCharacteristic
1112 * @note Only available on [5.0.0+].
1113 * @note Broken behaviour due to internal bugs.
1114 * @param[in] server_if Server interface ID
1115 * @param[in] serv_uuid Service UUID \ref BtdrvGattAttributeUuid
1116 * @param[in] char_uuid Characteristic UUID \ref BtdrvGattAttributeUuid
1117 * @param[in] permissions \ref BtdrvGattAttributePermission
1118 * @param[in] property \ref BtdrvGattCharacteristicProperty
1119 */
1120Result btdrvAddGattCharacteristic(u8 server_if, const BtdrvGattAttributeUuid *serv_uuid, const BtdrvGattAttributeUuid *char_uuid, u16 permissions, u8 property);
1121
1122/**
1123 * @brief AddGattDescriptor
1124 * @note Only available on [5.0.0+].
1125 * @note Broken behaviour due to internal bugs.
1126 * @param[in] server_if Server interface ID
1127 * @param[in] serv_uuid Service UUID \ref BtdrvGattAttributeUuid
1128 * @param[in] desc_uuid Descriptor UUID \ref BtdrvGattAttributeUuid
1129 * @param[in] permissions \ref BtdrvGattAttributePermission
1130 */
1131Result btdrvAddGattDescriptor(u8 server_if, const BtdrvGattAttributeUuid *serv_uuid, const BtdrvGattAttributeUuid *desc_uuid, u16 permissions);
1132
1133/**
1134 * @brief GetBleManagedEventInfo
1135 * @note Only available on [5.0.0+].
1136 * @note This is used by btm-sysmodule.
1137 * @param[out] buffer Output buffer. 0x400-bytes from state is written here. See \ref BtdrvBleEventInfo.
1138 * @param[in] size Output buffer size.
1139 * @param[out] type Output BtdrvBleEventType.
1140 */
1141Result btdrvGetBleManagedEventInfo(void* buffer, size_t size, BtdrvBleEventType *type);
1142
1143/**
1144 * @brief GetGattFirstCharacteristic
1145 * @note Only available on [5.0.0+].
1146 * @param[in] conn_id Connection ID
1147 * @param[in] serv_id Service GATT ID \ref BtdrvGattId
1148 * @param[in] is_primary Is a primary service or not
1149 * @param[in] filter_uuid Characteristic filter UUID \ref BtdrvGattAttributeUuid
1150 * @param[out] out_property Output property \ref BtdrvGattCharacteristicProperty
1151 * @param[out] out_char_id Output characteristic GATT ID \ref BtdrvGattId
1152 */
1153Result btdrvGetGattFirstCharacteristic(u32 conn_id, const BtdrvGattId *serv_id, bool is_primary, const BtdrvGattAttributeUuid *filter_uuid, u8 *out_property, BtdrvGattId *out_char_id);
1154
1155/**
1156 * @brief GetGattNextCharacteristic
1157 * @note Only available on [5.0.0+].
1158 * @param[in] conn_id Connection ID
1159 * @param[in] serv_id Service ID \ref BtdrvGattId
1160 * @param[in] is_primary Is a primary service or not
1161 * @param[in] char_id Previous characteristic GATT ID \ref BtdrvGattId
1162 * @param[in] filter_uuid Characteristic filter UUID \ref BtdrvGattAttributeUuid
1163 * @param[out] out_property Output property \ref BtdrvGattCharacteristicProperty
1164 * @param[out] out_char_id Output characteristic GATT ID \ref BtdrvGattId
1165 */
1166Result 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);
1167
1168/**
1169 * @brief GetGattFirstDescriptor
1170 * @note Only available on [5.0.0+].
1171 * @param[in] conn_id Connection ID
1172 * @param[in] serv_id Service GATT ID \ref BtdrvGattId
1173 * @param[in] is_primary Is a primary service or not
1174 * @param[in] char_id Characteristic GATT ID \ref BtdrvGattId
1175 * @param[in] filter_uuid Descriptor filter UUID \ref BtdrvGattAttributeUuid
1176 * @param[out] out_desc_id Output descriptor GATT ID \ref BtdrvGattId
1177 */
1178Result btdrvGetGattFirstDescriptor(u32 conn_id, const BtdrvGattId *serv_id, bool is_primary, const BtdrvGattId *char_id, const BtdrvGattAttributeUuid *filter_uuid, BtdrvGattId *out_desc_id);
1179
1180/**
1181 * @brief GetGattNextDescriptor
1182 * @note Only available on [5.0.0+].
1183 * @param[in] conn_id Connection ID
1184 * @param[in] serv_id Service GATT ID \ref BtdrvGattId
1185 * @param[in] is_primary Is a primary service or not
1186 * @param[in] char_id Characteristic GATT ID \ref BtdrvGattId
1187 * @param[in] desc_id Previous descriptor GATT ID \ref BtdrvGattId
1188 * @param[in] filter_uuid Descriptor filter UUID \ref BtdrvGattAttributeUuid
1189 * @param[out] out_desc_id Output descriptor GATT ID \ref BtdrvGattId
1190 */
1191Result 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);
1192
1193/**
1194 * @brief RegisterGattManagedDataPath
1195 * @note Only available on [5.0.0+].
1196 * @note This is used by btm-sysmodule.
1197 * @param[in] uuid \ref BtdrvGattAttributeUuid
1198 */
1200
1201/**
1202 * @brief UnregisterGattManagedDataPath
1203 * @note Only available on [5.0.0+].
1204 * @param[in] uuid \ref BtdrvGattAttributeUuid
1205 */
1207
1208/**
1209 * @brief RegisterGattHidDataPath
1210 * @note Only available on [5.0.0+].
1211 * @note This is used by btm-sysmodule.
1212 * @param[in] uuid \ref BtdrvGattAttributeUuid
1213 */
1215
1216/**
1217 * @brief UnregisterGattHidDataPath
1218 * @note Only available on [5.0.0+].
1219 * @note This is used by btm-sysmodule.
1220 * @param[in] uuid \ref BtdrvGattAttributeUuid
1221 */
1223
1224/**
1225 * @brief RegisterGattDataPath
1226 * @note Only available on [5.0.0+].
1227 * @note This is used by btm-sysmodule.
1228 * @param[in] uuid \ref BtdrvGattAttributeUuid
1229 */
1231
1232/**
1233 * @brief UnregisterGattDataPath
1234 * @note Only available on [5.0.0+].
1235 * @note This is used by btm-sysmodule.
1236 * @param[in] uuid \ref BtdrvGattAttributeUuid
1237 */
1239
1240/**
1241 * @brief ReadGattCharacteristic
1242 * @note Only available on [5.0.0+].
1243 * @param[in] connection_handle ConnectionHandle
1244 * @param[in] is_primary Is a primary service or not
1245 * @param[in] serv_id Service GATT ID \ref BtdrvGattId
1246 * @param[in] char_id Characteristic GATT ID \ref BtdrvGattId
1247 * @param[in] auth_req \ref BtdrvGattAuthReqType
1248 */
1249Result btdrvReadGattCharacteristic(u32 connection_handle, bool is_primary, const BtdrvGattId *serv_id, const BtdrvGattId *char_id, u8 auth_req);
1250
1251/**
1252 * @brief ReadGattDescriptor
1253 * @note Only available on [5.0.0+].
1254 * @param[in] connection_handle ConnectionHandle
1255 * @param[in] is_primary Is a primary service or not
1256 * @param[in] serv_id Service GATT ID \ref BtdrvGattId
1257 * @param[in] char_id Characteristic GATT ID \ref BtdrvGattId
1258 * @param[in] desc_id Descriptor GATT ID \ref BtdrvGattId
1259 * @param[in] auth_req \ref BtdrvGattAuthReqType
1260 */
1261Result btdrvReadGattDescriptor(u32 connection_handle, bool is_primary, const BtdrvGattId *serv_id, const BtdrvGattId *char_id, const BtdrvGattId *desc_id, u8 auth_req);
1262
1263/**
1264 * @brief WriteGattCharacteristic
1265 * @note Only available on [5.0.0+].
1266 * @param[in] connection_handle ConnectionHandle
1267 * @param[in] is_primary Is a primary service or not
1268 * @param[in] serv_id Service GATT ID \ref BtdrvGattId
1269 * @param[in] char_id Characteristic GATT ID \ref BtdrvGattId
1270 * @param[in] buffer Input buffer.
1271 * @param[in] size Input buffer size, must be <=0x258.
1272 * @param[in] auth_req \ref BtdrvGattAuthReqType
1273 * @param[in] with_response Whether to use Write-With-Response write type or not
1274 */
1275Result 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);
1276
1277/**
1278 * @brief WriteGattDescriptor
1279 * @note Only available on [5.0.0+].
1280 * @param[in] connection_handle ConnectionHandle
1281 * @param[in] is_primary Is a primary service or not
1282 * @param[in] serv_id Service GATT ID \ref BtdrvGattId
1283 * @param[in] char_id Characteristic GATT ID \ref BtdrvGattId
1284 * @param[in] desc_id Descriptor GATT ID \ref BtdrvGattId
1285 * @param[in] buffer Input buffer.
1286 * @param[in] size Input buffer size, must be <=0x258.
1287 * @param[in] auth_req \ref BtdrvGattAuthReqType
1288 */
1289Result 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);
1290
1291/**
1292 * @brief RegisterGattNotification
1293 * @note Only available on [5.0.0+].
1294 * @param[in] connection_handle ConnectionHandle
1295 * @param[in] is_primary Is a primary service or not
1296 * @param[in] serv_id Service GATT ID \ref BtdrvGattId
1297 * @param[in] char_id Characteristic GATT ID \ref BtdrvGattId
1298 */
1299Result btdrvRegisterGattNotification(u32 connection_handle, bool is_primary, const BtdrvGattId *serv_id, const BtdrvGattId *char_id);
1300
1301/**
1302 * @brief UnregisterGattNotification
1303 * @note Only available on [5.0.0+].
1304 * @param[in] connection_handle ConnectionHandle
1305 * @param[in] is_primary Is a primary service or not
1306 * @param[in] serv_id Service GATT ID \ref BtdrvGattId
1307 * @param[in] char_id Characteristic GATT ID \ref BtdrvGattId
1308 */
1309Result btdrvUnregisterGattNotification(u32 connection_handle, bool is_primary, const BtdrvGattId *serv_id, const BtdrvGattId *char_id);
1310
1311/**
1312 * @brief GetLeHidEventInfo
1313 * @note Only available on [5.0.0+].
1314 * @note The state used by this is reset after writing the data to output.
1315 * @param[out] buffer Output buffer. 0x400-bytes from state is written here. See \ref BtdrvBleEventInfo.
1316 * @param[in] size Output buffer size.
1317 * @param[out] type \ref BtdrvBleEventType.
1318 */
1319Result btdrvGetLeHidEventInfo(void* buffer, size_t size, BtdrvBleEventType *type);
1320
1321/**
1322 * @brief RegisterBleHidEvent
1323 * @note Only available on [5.0.0+].
1324 * @note The Event must be closed by the user once finished with it.
1325 * @param[out] out_event Output Event with autoclear=true.
1326 */
1328
1329/**
1330 * @brief SetBleScanParameter
1331 * @note Only available on [5.1.0+].
1332 * @note This is used by btm-sysmodule.
1333 * @param[in] scan_interval Scan interval
1334 * @param[in] scan_window Scan window
1335 */
1336Result btdrvSetBleScanParameter(u16 scan_interval, u16 scan_window);
1337
1338/**
1339 * @brief MoveToSecondaryPiconet
1340 * @note The response will be available via \ref btdrvGetHidEventInfo ([12.0.0+] \ref btdrvGetEventInfo).
1341 * @note Only available on [10.0.0+].
1342 * @param[in] addr \ref BtdrvAddress
1343 */
1345
1346/**
1347 * @brief IsBluetoothEnabled
1348 * @note Only available on [12.0.0+].
1349 * @param[out] out Output flag.
1350 */
1352
1353/**
1354 * @brief AcquireAudioEvent
1355 * @note Only available on [12.0.0+].
1356 * @param[out] out_event Output Event.
1357 * @param[in] autoclear Event autoclear.
1358 */
1359Result btdrvAcquireAudioEvent(Event* out_event, bool autoclear);
1360
1361/**
1362 * @brief GetAudioEventInfo
1363 * @note Only available on [12.0.0+].
1364 * @param[out] buffer Output buffer, see \ref BtdrvAudioEventInfo.
1365 * @param[in] size Output buffer size.
1366 * @param[out] type \ref BtdrvAudioEventType.
1367 */
1368Result btdrvGetAudioEventInfo(void* buffer, size_t size, BtdrvAudioEventType *type);
1369
1370/**
1371 * @brief OpenAudioConnection
1372 * @note Only available on [12.0.0+].
1373 * @param[in] addr \ref BtdrvAddress
1374 */
1376
1377/**
1378 * @brief CloseAudioConnection
1379 * @note Only available on [12.0.0+].
1380 * @param[in] addr \ref BtdrvAddress
1381 */
1383
1384/**
1385 * @brief OpenAudioOut
1386 * @note Only available on [12.0.0+].
1387 * @param[in] addr \ref BtdrvAddress
1388 * @param[out] audio_handle Audio handle.
1389 */
1391
1392/**
1393 * @brief CloseAudioOut
1394 * @note Only available on [12.0.0+].
1395 * @param[in] audio_handle Audio handle from \ref btdrvOpenAudioOut.
1396 */
1398
1399/**
1400 * @brief StartAudioOut
1401 * @note Only available on [12.0.0+].
1402 * @param[in] audio_handle Audio handle from \ref btdrvOpenAudioOut.
1403 * @param[in] pcm_param \ref BtdrvPcmParameter
1404 * @param[in] in_latency Input latency in nanoseconds.
1405 * @param[out] out_latency Output latency in nanoseconds.
1406 * @param[out] out1 Unknown output.
1407 */
1408Result btdrvStartAudioOut(u32 audio_handle, const BtdrvPcmParameter *pcm_param, s64 in_latency, s64 *out_latency, u64 *out1);
1409
1410/**
1411 * @brief StopAudioOut
1412 * @note Only available on [12.0.0+].
1413 * @param[in] audio_handle Audio handle from \ref btdrvOpenAudioOut.
1414 */
1416
1417/**
1418 * @brief GetAudioOutState
1419 * @note Only available on [12.0.0+].
1420 * @param[in] audio_handle Audio handle from \ref btdrvOpenAudioOut.
1421 * @param[out] out \ref BtdrvAudioOutState
1422 */
1424
1425/**
1426 * @brief GetAudioOutFeedingCodec
1427 * @note Only available on [12.0.0+].
1428 * @param[in] audio_handle Audio handle from \ref btdrvOpenAudioOut.
1429 * @param[out] out \ref BtdrvAudioCodec
1430 */
1432
1433/**
1434 * @brief GetAudioOutFeedingParameter
1435 * @note Only available on [12.0.0+].
1436 * @param[in] audio_handle Audio handle from \ref btdrvOpenAudioOut.
1437 * @param[out] out \ref BtdrvPcmParameter
1438 */
1440
1441/**
1442 * @brief AcquireAudioOutStateChangedEvent
1443 * @note Only available on [12.0.0+].
1444 * @param[in] audio_handle Audio handle from \ref btdrvOpenAudioOut.
1445 * @param[out] out_event Output Event.
1446 * @param[in] autoclear Event autoclear.
1447 */
1448Result btdrvAcquireAudioOutStateChangedEvent(u32 audio_handle, Event* out_event, bool autoclear);
1449
1450/**
1451 * @brief AcquireAudioOutBufferAvailableEvent
1452 * @note Only available on [12.0.0+].
1453 * @param[in] audio_handle Audio handle from \ref btdrvOpenAudioOut.
1454 * @param[out] out_event Output Event.
1455 * @param[in] autoclear Event autoclear.
1456 */
1457Result btdrvAcquireAudioOutBufferAvailableEvent(u32 audio_handle, Event* out_event, bool autoclear);
1458
1459/**
1460 * @brief SendAudioData
1461 * @note Only available on [12.0.0+].
1462 * @param[in] audio_handle Audio handle from \ref btdrvOpenAudioOut.
1463 * @param[in] buffer Input buffer.
1464 * @param[in] size Input buffer size.
1465 * @param[out] Output transferred size. This is always either 0 (error occured) or the buffer size.
1466 */
1467Result btdrvSendAudioData(u32 audio_handle, const void* buffer, size_t size, u64 *transferred_size);
1468
1469/**
1470 * @brief AcquireAudioControlInputStateChangedEvent
1471 * @note Only available on [12.0.0+].
1472 * @param[out] out_event Output Event.
1473 * @param[in] autoclear Event autoclear.
1474 */
1476
1477/**
1478 * @brief GetAudioControlInputState
1479 * @note Only available on [12.0.0+].
1480 * @param[out] states Output array of \ref BtdrvAudioControlButtonState.
1481 * @param[in] count Size of the states array in entries, the maximum is 0xF.
1482 * @param[out] total_out Total output entries.
1483 */
1485
1486/**
1487 * @brief AcquireAudioConnectionStateChangedEvent
1488 * @note Only available on [12.0.0-13.2.1].
1489 * @param[out] out_event Output Event.
1490 * @param[in] autoclear Event autoclear.
1491 */
1493
1494/**
1495 * @brief GetConnectedAudioDevice
1496 * @note Only available on [12.0.0-13.2.1].
1497 * @param[out] addrs Output array of \ref BtdrvAddress.
1498 * @param[in] count Size of the addrs array in entries, the maximum is 0x8.
1499 * @param[out] total_out Total output entries.
1500 */
1502
1503/**
1504 * @brief CloseAudioControlInput
1505 * @note Only available on [13.0.0+].
1506 * @param[in] addr \ref BtdrvAddress
1507 */
1509
1510/**
1511 * @brief RegisterAudioControlNotification
1512 * @note Only available on [13.0.0+].
1513 * @param[in] addr \ref BtdrvAddress
1514 * @param[in] event_type AvrcEventType
1515 */
1517
1518/**
1519 * @brief SendAudioControlPassthroughCommand
1520 * @note Only available on [13.0.0+].
1521 * @param[in] addr \ref BtdrvAddress
1522 * @param[in] op_id AvrcOperationId
1523 * @param[in] state_type AvrcStateType
1524 */
1526
1527/**
1528 * @brief SendAudioControlSetAbsoluteVolumeCommand
1529 * @note Only available on [13.0.0+].
1530 * @param[in] addr \ref BtdrvAddress
1531 * @param[in] val Input value
1532 */
1534
1535/**
1536 * @brief IsManufacturingMode
1537 * @note Only available on [5.0.0+].
1538 * @param[out] out Output flag.
1539 */
1541
1542/**
1543 * @brief EmulateBluetoothCrash
1544 * @note Only available on [7.0.0+].
1545 * @param[in] reason \ref BtdrvFatalReason
1546 */
1548
1549/**
1550 * @brief GetBleChannelMap
1551 * @note Only available on [9.0.0+].
1552 * @param[out] out \ref BtdrvChannelMapList
1553 */
1555
1556///@name CircularBuffer
1557///@{
1558
1559/**
1560 * @brief Read
1561 * @note Used by \ref btdrvGetHidReportEventInfo on [7.0.0+].
1562 * @param c \ref BtdrvCircularBuffer
1563 */
1565
1566/**
1567 * @brief Free
1568 * @note Used by \ref btdrvGetHidReportEventInfo on [7.0.0+].
1569 * @param c \ref BtdrvCircularBuffer
1570 */
1572
1573///@}
1574
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 btdrvEnableGattService(u8 server_if, const BtdrvGattAttributeUuid *uuid)
EnableGattService.
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 btdrvTriggerConnection(BtdrvAddress addr, u16 timeout)
TriggerConnection.
Result btdrvGetPendingConnections(void)
GetPendingConnections.
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.
void * btdrvCircularBufferRead(BtdrvCircularBuffer *c)
Read.
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.
Service * btdrvGetServiceSession(void)
Gets the Service object for the actual btdrv service session.
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 btdrvAddGattCharacteristic(u8 server_if, const BtdrvGattAttributeUuid *serv_uuid, const BtdrvGattAttributeUuid *char_uuid, u16 permissions, u8 property)
AddGattCharacteristic.
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.
Result btdrvAddGattDescriptor(u8 server_if, const BtdrvGattAttributeUuid *serv_uuid, const BtdrvGattAttributeUuid *desc_uuid, u16 permissions)
AddGattDescriptor.
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.
void * btdrvGetHidReportEventInfoSharedmemAddr(void)
Gets the SharedMemory addr for HidReportEventInfo (BtdrvCircularBuffer), only valid when btdrvRegiste...
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.
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 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 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 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.
BtdrvHidConnectionStatus
HidConnectionStatus [12.0.0+].
Definition btdrv_types.h:104
BtdrvAudioCodec
AudioCodec.
Definition btdrv_types.h:240
BtdrvAudioEventType
AudioEventType.
Definition btdrv_types.h:228
BtdrvAudioOutState
AudioOutState.
Definition btdrv_types.h:234
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:255
AdapterPropertySet [12.0.0+].
Definition btdrv_types.h:270
AdapterProperty [12.0.0+].
Definition btdrv_types.h:263
Address.
Definition btdrv_types.h:245
AudioControlButtonState.
Definition btdrv_types.h:452
BleAdvertiseFilter.
Definition btdrv_types.h:388
BtdrvBleAdvertisePacketData.
Definition btdrv_types.h:361
BleAdvertisement.
Definition btdrv_types.h:381
BleConnectionParameter [9.0.0+].
Definition btdrv_types.h:351
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
u8 operation
Operation. 0 = Read, 1 = Write.
Definition btdrv.h:447
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
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:277
ChannelMapList.
Definition btdrv_types.h:310
CircularBuffer.
Definition btdrv.h:315
void * event_type
Not set with sharedmem.
Definition btdrv.h:317
ClassOfDevice.
Definition btdrv_types.h:250
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:315
GattAttribute.
Definition btdrv_types.h:328
GattId.
Definition btdrv_types.h:321
HidData [1.0.0-8.1.1].
Definition btdrv_types.h:288
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:294
LeConnectionParams [5.0.0-8.1.1].
Definition btdrv_types.h:338
PcmParameter.
Definition btdrv_types.h:445
BtdrvPinCode [12.0.0+].
Definition btdrv_types.h:282
PlrList.
Definition btdrv_types.h:305
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