Bluetooth Driver services: Difference between revisions
No edit summary |
|||
Line 10: | Line 10: | ||
Support for "nn::bluetooth::*" was added to sdknso with 6.x. | Support for "nn::bluetooth::*" was added to sdknso with 6.x. | ||
btdrv appears to be designed to only be used by the two sysmodules which use it, hid and btm. This service uses global state, nothing service-session-specific. | btdrv appears to be designed to only be used by the two sysmodules which use it, [[HID_services|hid]] and [[BTM_services|btm]]. This service uses global state, nothing service-session-specific. | ||
This has max_sessions 30. IPC handling is done by the main-thread. | This has max_sessions 30. IPC handling is done by the main-thread. | ||
Line 237: | Line 237: | ||
No input, returns an output Event handle with EventClearMode=1. | No input, returns an output Event handle with EventClearMode=1. | ||
This is used by btm, this should not be used by other processes. | This is used by [[BTM_services|btm]], this should not be used by other processes. | ||
== EnableBluetooth == | == EnableBluetooth == | ||
No input/output. | No input/output. | ||
This is used by [[BTM_services|btm]]. | |||
== DisableBluetooth == | == DisableBluetooth == | ||
No input/output. | No input/output. | ||
This is used by [[BTM_services|btm]]. | |||
== FinalizeBluetooth == | == FinalizeBluetooth == | ||
No input/output. | No input/output. | ||
Not used by btm, other processes should not use this. | Not used by [[BTM_services|btm]], other processes should not use this. | ||
== GetAdapterProperties == | == GetAdapterProperties == | ||
Takes a type-0x1A output buffer containing an [[#AdapterProperty]]. | Takes a type-0x1A output buffer containing an [[#AdapterProperty]]. | ||
This is used by [[BTM_services|btm]]. | |||
== GetAdapterProperty == | == GetAdapterProperty == | ||
Line 261: | Line 267: | ||
== StartInquiry == | == StartInquiry == | ||
No input/output. | No input/output. | ||
This is used by [[BTM_services|btm]]. | |||
== StopInquiry == | == StopInquiry == | ||
No input/output. | No input/output. | ||
This is used by [[BTM_services|btm]]. | |||
== CreateBond == | == CreateBond == | ||
Line 269: | Line 279: | ||
[9.0.0+] Now only takes an [[#Address]] and a [[#TransportType]] without a buffer, no output. | [9.0.0+] Now only takes an [[#Address]] and a [[#TransportType]] without a buffer, no output. | ||
This is used by [[BTM_services|btm]]. | |||
== RemoveBond == | == RemoveBond == | ||
Takes an input [[#Address]], no output. | Takes an input [[#Address]], no output. | ||
This is used by [[BTM_services|btm]]. | |||
== CancelBond == | == CancelBond == | ||
Takes an input [[#Address]], no output. | Takes an input [[#Address]], no output. | ||
This is used by [[BTM_services|btm]]. | |||
== RespondToPinRequest == | == RespondToPinRequest == | ||
Line 283: | Line 299: | ||
== RespondToSspRequest == | == RespondToSspRequest == | ||
Takes an input [[#Address]], a [[#BluetoothSspVariant]], a bool, an u32, no output. | Takes an input [[#Address]], a [[#BluetoothSspVariant]], a bool, an u32, no output. | ||
This is used by [[BTM_services|btm]]. | |||
== GetEventInfo == | == GetEventInfo == | ||
Line 289: | Line 307: | ||
This copies 0x400-bytes from state to the output buffer, copies the [[#EventType]] from state to output, and signals an event. | This copies 0x400-bytes from state to the output buffer, copies the [[#EventType]] from state to output, and signals an event. | ||
This is used by btm. | This is used by [[BTM_services|btm]]. | ||
== InitializeHid == | == InitializeHid == | ||
Line 296: | Line 314: | ||
Originally sdknso used an user-specified value for the u16, however with [9.0.0+] it uses hard-coded value 0x1 instead. | Originally sdknso used an user-specified value for the u16, however with [9.0.0+] it uses hard-coded value 0x1 instead. | ||
This is used by btm, this should not be used by other processes. | This is used by [[BTM_services|btm]], this should not be used by other processes. | ||
== OpenHidConnection == | == OpenHidConnection == | ||
Line 302: | Line 320: | ||
This just returns 0. | This just returns 0. | ||
This is used by [[BTM_services|btm]]. | |||
== CloseHidConnection == | == CloseHidConnection == | ||
Takes an input [[#Address]], no output. | Takes an input [[#Address]], no output. | ||
This is used by [[BTM_services|btm]]. | |||
== HidSendData == | == HidSendData == | ||
Line 311: | Line 333: | ||
== WriteHidData == | == WriteHidData == | ||
Takes an input [[#Address]] and a type-0x19 input buffer containing a [[#HidReport]], no output. | Takes an input [[#Address]] and a type-0x19 input buffer containing a [[#HidReport]], no output. | ||
This is used by [[HID_services|hid]]. | |||
== WriteHidData2 == | == WriteHidData2 == | ||
Line 322: | Line 346: | ||
== SetHidReport == | == SetHidReport == | ||
Takes an input [[#Address]], a [[#BluetoothHhReportType]], a type-0x19 input buffer containing a [[#HidReport]], no output. | Takes an input [[#Address]], a [[#BluetoothHhReportType]], a type-0x19 input buffer containing a [[#HidReport]], no output. | ||
This is used by [[HID_services|hid]]. | |||
== GetHidReport == | == GetHidReport == | ||
Takes an input [[#Address]], an u8, a [[#BluetoothHhReportType]], no output. | Takes an input [[#Address]], an u8, a [[#BluetoothHhReportType]], no output. | ||
This is used by [[HID_services|hid]]. | |||
== HidWakeController == | == HidWakeController == | ||
Line 331: | Line 359: | ||
== TriggerConnection == | == TriggerConnection == | ||
Takes an input [[#Address]] and an u16, no output. | Takes an input [[#Address]] and an u16, no output. | ||
This is used by [[BTM_services|btm]]. | |||
== AddPairedDeviceInfo == | == AddPairedDeviceInfo == | ||
Takes a type-0x19 input buffer containing [[Settings_services#BluetoothDevicesSettings|BluetoothDevicesSettings]], no output. | Takes a type-0x19 input buffer containing [[Settings_services#BluetoothDevicesSettings|BluetoothDevicesSettings]], no output. | ||
This is used by [[BTM_services|btm]]. | |||
== GetPairedDeviceInfo == | == GetPairedDeviceInfo == | ||
Takes an input [[#Address]] and a type-0x1A output buffer containing [[Settings_services#BluetoothDevicesSettings|BluetoothDevicesSettings]]. | Takes an input [[#Address]] and a type-0x1A output buffer containing [[Settings_services#BluetoothDevicesSettings|BluetoothDevicesSettings]]. | ||
This is used by [[BTM_services|btm]]. | |||
== FinalizeHid == | == FinalizeHid == | ||
No input/output. | No input/output. | ||
Not used by btm, other processes should not use this. | Not used by [[BTM_services|btm]], other processes should not use this. | ||
== GetHidEventInfo == | == GetHidEventInfo == | ||
Line 347: | Line 381: | ||
This copies 0x480-bytes from state to the output buffer. [[#HidEventType]] is set to: stateval!=0 ? 7 : 0. Once finished, this signals an event. | This copies 0x480-bytes from state to the output buffer. [[#HidEventType]] is set to: stateval!=0 ? 7 : 0. Once finished, this signals an event. | ||
This is used by [[BTM_services|btm]]. | |||
== SetTsi == | == SetTsi == | ||
Takes an input [[#Address]] and an u8, no output. | Takes an input [[#Address]] and an u8, no output. | ||
This is used by [[BTM_services|btm]]. | |||
== EnableBurstMode == | == EnableBurstMode == | ||
Takes an input [[#Address]] and a bool, no output. | Takes an input [[#Address]] and a bool, no output. | ||
This is used by [[BTM_services|btm]]. | |||
== SetZeroRetransmission == | == SetZeroRetransmission == | ||
Line 359: | Line 399: | ||
The entry-count is clamped to a maximum of 5, the count can be 0. | The entry-count is clamped to a maximum of 5, the count can be 0. | ||
This is used by btm. | This is used by [[BTM_services|btm]]. | ||
== EnableMcMode == | == EnableMcMode == | ||
Takes an input bool, no output. | Takes an input bool, no output. | ||
This is used by [[BTM_services|btm]]. | |||
== EnableLlrScan == | == EnableLlrScan == | ||
No input/output. | No input/output. | ||
This is used by [[BTM_services|btm]]. | |||
== DisableLlrScan == | == DisableLlrScan == | ||
No input/output. | No input/output. | ||
This is used by [[BTM_services|btm]]. | |||
== EnableRadio == | == EnableRadio == | ||
Takes an input bool, no output. | Takes an input bool, no output. | ||
This is used by [[BTM_services|btm]]. | |||
== SetVisibility == | == SetVisibility == | ||
Takes two input bools, no output. | Takes two input bools, no output. | ||
This is used by [[BTM_services|btm]]. | |||
== EnableTbfcScan == | == EnableTbfcScan == | ||
Takes an input bool, no output. | Takes an input bool, no output. | ||
This is used by [[BTM_services|btm]]. | |||
== RegisterHidReportEvent == | == RegisterHidReportEvent == | ||
Line 383: | Line 435: | ||
This gets the Event handle for a previously created Event. | This gets the Event handle for a previously created Event. | ||
This is used by [[HID_services|hid]]. | |||
== GetHidReportEventInfo == | == GetHidReportEventInfo == | ||
Line 392: | Line 446: | ||
The [7.0.0+] GetHidReportEventInfo sdknso func loads data using the above sharedmem. | The [7.0.0+] GetHidReportEventInfo sdknso func loads data using the above sharedmem. | ||
This is used by [[HID_services|hid]]. | |||
== GetLatestPlr == | == GetLatestPlr == | ||
Line 398: | Line 454: | ||
== GetPendingConnections == | == GetPendingConnections == | ||
No input/output. | No input/output. | ||
This is used by [[BTM_services|btm]]. | |||
== GetChannelMap == | == GetChannelMap == | ||
Line 418: | Line 476: | ||
== InitializeBle == | == InitializeBle == | ||
No input, returns an output Event handle with EventClearMode=1. | No input, returns an output Event handle with EventClearMode=1. | ||
This is used by [[BTM_services|btm]]. | |||
== EnableBle == | == EnableBle == | ||
No input/output. | No input/output. | ||
This is used by [[BTM_services|btm]]. | |||
== DisableBle == | == DisableBle == | ||
No input/output. | No input/output. | ||
This is used by [[BTM_services|btm]]. | |||
== FinalizeBle == | == FinalizeBle == | ||
Line 436: | Line 500: | ||
== SetBleConnectionParameter == | == SetBleConnectionParameter == | ||
Takes an input [[#Address]], a bool, a [[#BleConnectionParameter]], no output. | Takes an input [[#Address]], a bool, a [[#BleConnectionParameter]], no output. | ||
This is used by [[BTM_services|btm]]. | |||
== SetLeDefaultConnectionParameter == | == SetLeDefaultConnectionParameter == | ||
Line 442: | Line 508: | ||
== SetBleDefaultConnectionParameter == | == SetBleDefaultConnectionParameter == | ||
Takes a [[#BleConnectionParameter]], no output. | Takes a [[#BleConnectionParameter]], no output. | ||
This is used by [[BTM_services|btm]]. | |||
== SetBleAdvertiseData == | == SetBleAdvertiseData == | ||
Line 451: | Line 519: | ||
== StartBleScan == | == StartBleScan == | ||
No input/output. | No input/output. | ||
This is used by [[BTM_services|btm]]. | |||
== StopBleScan == | == StopBleScan == | ||
No input/output. | No input/output. | ||
This is used by [[BTM_services|btm]]. | |||
== AddBleScanFilterCondition == | == AddBleScanFilterCondition == | ||
Takes a type-0x19 input buffer containing a [[#BleAdvertiseFilter]], no output. | Takes a type-0x19 input buffer containing a [[#BleAdvertiseFilter]], no output. | ||
This is used by [[BTM_services|btm]]. | |||
== DeleteBleScanFilterCondition == | == DeleteBleScanFilterCondition == | ||
Takes a type-0x19 input buffer containing a [[#BleAdvertiseFilter]], no output. | Takes a type-0x19 input buffer containing a [[#BleAdvertiseFilter]], no output. | ||
This is used by [[BTM_services|btm]]. | |||
== DeleteBleScanFilter == | == DeleteBleScanFilter == | ||
Line 468: | Line 544: | ||
== ClearBleScanFilters == | == ClearBleScanFilters == | ||
No input/output. | No input/output. | ||
This is used by [[BTM_services|btm]]. | |||
== EnableBleScanFilter == | == EnableBleScanFilter == | ||
Takes an input bool, no output. | Takes an input bool, no output. | ||
This is used by [[BTM_services|btm]]. | |||
== RegisterGattClient == | == RegisterGattClient == | ||
Takes an input [[#GattAttributeUuid]], no output. | Takes an input [[#GattAttributeUuid]], no output. | ||
This is used by [[BTM_services|btm]]. | |||
== UnregisterGattClient == | == UnregisterGattClient == | ||
Line 483: | Line 565: | ||
== ConnectGattServer == | == ConnectGattServer == | ||
Takes an input u8, an [[#Address]], a bool, an [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]], no output. | Takes an input u8, an [[#Address]], a bool, an [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]], no output. | ||
This is used by [[BTM_services|btm]]. | |||
== CancelConnectGattServer == | == CancelConnectGattServer == | ||
Takes an input u8, an [[#Address]], a bool, no output. | Takes an input u8, an [[#Address]], a bool, no output. | ||
This is used by [[BTM_services|btm]]. | |||
== DisconnectGattServer == | == DisconnectGattServer == | ||
Takes an input u32, no output. | Takes an input u32, no output. | ||
This is used by [[BTM_services|btm]]. | |||
== GetGattAttribute == | == GetGattAttribute == | ||
Line 500: | Line 588: | ||
== ConfigureAttMtu == | == ConfigureAttMtu == | ||
Takes an input u16 and u32, no output. | Takes an input u16 and u32, no output. | ||
This is used by [[BTM_services|btm]]. | |||
== RegisterGattServer == | == RegisterGattServer == | ||
Line 534: | Line 624: | ||
This copies 0x400-bytes from state to the output buffer, and copies the [[#BleEventType]] from state to output. | This copies 0x400-bytes from state to the output buffer, and copies the [[#BleEventType]] from state to output. | ||
This is used by [[BTM_services|btm]]. | |||
== GetGattFirstCharacteristic == | == GetGattFirstCharacteristic == | ||
Line 549: | Line 641: | ||
== RegisterGattManagedDataPath == | == RegisterGattManagedDataPath == | ||
Takes an input [[#GattAttributeUuid]], no output. | Takes an input [[#GattAttributeUuid]], no output. | ||
This is used by [[BTM_services|btm]]. | |||
== UnregisterGattManagedDataPath == | == UnregisterGattManagedDataPath == | ||
Line 555: | Line 649: | ||
== RegisterGattHidDataPath == | == RegisterGattHidDataPath == | ||
Takes an input [[#GattAttributeUuid]], no output. | Takes an input [[#GattAttributeUuid]], no output. | ||
This is used by [[BTM_services|btm]]. | |||
== UnregisterGattHidDataPath == | == UnregisterGattHidDataPath == | ||
Takes an input [[#GattAttributeUuid]], no output. | Takes an input [[#GattAttributeUuid]], no output. | ||
This is used by [[BTM_services|btm]]. | |||
== RegisterGattDataPath == | == RegisterGattDataPath == | ||
Takes an input [[#GattAttributeUuid]], no output. | Takes an input [[#GattAttributeUuid]], no output. | ||
This is used by [[BTM_services|btm]]. | |||
== UnregisterGattDataPath == | == UnregisterGattDataPath == | ||
Takes an input [[#GattAttributeUuid]], no output. | Takes an input [[#GattAttributeUuid]], no output. | ||
This is used by [[BTM_services|btm]]. | |||
== ReadGattCharacteristic == | == ReadGattCharacteristic == | ||
Takes an input bool, an u8, an u32, a [[#GattId]], a [[#GattId]], no output. | Takes an input bool, an u8, an u32, a [[#GattId]], a [[#GattId]], no output. | ||
This is used by [[HID_services|hid]] and [[BTM_services|btm]]. | |||
== ReadGattDescriptor == | == ReadGattDescriptor == | ||
Takes an input bool, an u8, an u32, a [[#GattId]], a [[#GattId]], a [[#GattId]], no output. | Takes an input bool, an u8, an u32, a [[#GattId]], a [[#GattId]], a [[#GattId]], no output. | ||
This is used by [[HID_services|hid]]. | |||
== WriteGattCharacteristic == | == WriteGattCharacteristic == | ||
Line 575: | Line 681: | ||
The buffer size must be <=0x258. | The buffer size must be <=0x258. | ||
This is used by [[HID_services|hid]] and [[BTM_services|btm]]. | |||
== WriteGattDescriptor == | == WriteGattDescriptor == | ||
Line 580: | Line 688: | ||
The buffer size must be <=0x258. | The buffer size must be <=0x258. | ||
This is used by [[HID_services|hid]] and [[BTM_services|btm]]. | |||
== RegisterGattNotification == | == RegisterGattNotification == | ||
Takes an input bool, an u32, a [[#GattId]], a [[#GattId]], no output. | Takes an input bool, an u32, a [[#GattId]], a [[#GattId]], no output. | ||
This is used by [[HID_services|hid]] and [[BTM_services|btm]]. | |||
== UnregisterGattNotification == | == UnregisterGattNotification == | ||
Takes an input bool, an u32, a [[#GattId]], a [[#GattId]], no output. | Takes an input bool, an u32, a [[#GattId]], a [[#GattId]], no output. | ||
This is used by [[HID_services|hid]]. | |||
== GetLeHidEventInfo == | == GetLeHidEventInfo == | ||
Line 591: | Line 705: | ||
This copies 0x400-bytes from state to the output buffer, and copies the [[#BleEventType]] from state to output. This also resets the state which was used for the outbuf-copy. Once finished, this signals an event. | This copies 0x400-bytes from state to the output buffer, and copies the [[#BleEventType]] from state to output. This also resets the state which was used for the outbuf-copy. Once finished, this signals an event. | ||
This is used by [[HID_services|hid]]. | |||
== RegisterBleHidEvent == | == RegisterBleHidEvent == | ||
No input, returns an output Event handle with EventClearMode=1. | No input, returns an output Event handle with EventClearMode=1. | ||
This is used by [[HID_services|hid]]. | |||
== SetBleScanParameter == | == SetBleScanParameter == | ||
Takes two input u16s, no output. | Takes two input u16s, no output. | ||
This is used by [[BTM_services|btm]]. | |||
== MoveToSecondaryPiconet == | == MoveToSecondaryPiconet == | ||
Line 603: | Line 723: | ||
== IsManufacturingMode == | == IsManufacturingMode == | ||
No input, returns an output bool. | No input, returns an output bool. | ||
This is used by [[BTM_services|btm]]. | |||
== EmulateBluetoothCrash == | == EmulateBluetoothCrash == |