Difference between revisions of "Bluetooth Driver services"

From Nintendo Switch Brew
Jump to navigation Jump to search
 
(27 intermediate revisions by 2 users not shown)
Line 7: Line 7:
  
 
The code seems to be derived from a broadcom stack. A good starting point for similar source code can be found in the MICO project: https://github.com/yinhongxing/mico/tree/ea67ff3659f12d730d4dc3b8d547b093bd2ee2ee/MICO/bluetooth_bte Note that the library files contain many (symbolized) functions which match btdrv.
 
The code seems to be derived from a broadcom stack. A good starting point for similar source code can be found in the MICO project: https://github.com/yinhongxing/mico/tree/ea67ff3659f12d730d4dc3b8d547b093bd2ee2ee/MICO/bluetooth_bte Note that the library files contain many (symbolized) functions which match btdrv.
 +
 +
Support for "nn::bluetooth::*" was added to sdknso with 6.x.
  
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 12: Line 14:
 
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 || InitializeBluetoothDriver
+
| 0 || [[#InitializeBluetoothDriver]]
 
|-
 
|-
| 1 || InitializeBluetooth
+
| 1 || [[#InitializeBluetooth]]
 
|-
 
|-
| 2 || EnableBluetooth
+
| 2 || [[#EnableBluetooth]]
 
|-
 
|-
| 3 || DisableBluetooth
+
| 3 || [[#DisableBluetooth]]
 
|-
 
|-
| 4 || CleanupBluetooth
+
| 4 || [[#FinalizeBluetooth]] ([?-8.1.1] [[#FinalizeBluetooth|CleanupBluetooth]])
 
|-
 
|-
| 5 || GetAdapterProperties
+
| 5 || [[#GetAdapterProperties]]
 
|-
 
|-
| 6 || GetAdapterProperty
+
| 6 || [[#GetAdapterProperty]]
 
|-
 
|-
| 7 || SetAdapterProperty
+
| 7 || [[#SetAdapterProperty]]
 
|-
 
|-
| 8 || StartDiscovery
+
| 8 || [[#StartInquiry]] ([?-8.1.1] [[#StartInquiry|StartDiscovery]])
 
|-
 
|-
| 9 || CancelDiscovery
+
| 9 || [[#StopInquiry]] ([?-8.1.1] [[#StopInquiry|CancelDiscovery]])
 
|-
 
|-
 
| 10 || [[#CreateBond]]
 
| 10 || [[#CreateBond]]
 
|-
 
|-
| 11 || RemoveBond
+
| 11 || [[#RemoveBond]]
 
|-
 
|-
| 12 || CancelBond
+
| 12 || [[#CancelBond]]
 
|-
 
|-
| 13 || PinReply
+
| 13 || [[#RespondToPinRequest]] ([?-8.1.1] [[#RespondToPinRequest|PinReply]])
 
|-
 
|-
| 14 || SspReply
+
| 14 || [[#RespondToSspRequest]] ([?-8.1.1] [[#RespondToSspRequest|SspReply]])
 
|-
 
|-
| 15 || GetEventInfo
+
| 15 || [[#GetEventInfo]]
 
|-
 
|-
| 16 || InitializeHid
+
| 16 || [[#InitializeHid]]
 
|-
 
|-
| 17 || HidConnect
+
| 17 || [[#OpenHidConnection]] ([?-8.1.1] [[#OpenHidConnection|HidConnect]])
 
|-
 
|-
| 18 || HidDisconnect
+
| 18 || [[#CloseHidConnection]] ([?-8.1.1] [[#CloseHidConnection|HidDisconnect]])
 
|-
 
|-
| 19 || HidSendData
+
| 19 || [[#WriteHidData]] ([?-8.1.1] [[#WriteHidData|HidSendData]])
 
|-
 
|-
| 20 || HidSendData2
+
| 20 || [[#WriteHidData2]] ([?-8.1.1] [[#WriteHidData2|HidSendData2]])
 
|-
 
|-
| 21 || HidSetReport
+
| 21 || [[#SetHidReport]] ([?-8.1.1] [[#HidSetReport]])
 
|-
 
|-
| 22 || HidGetReport
+
| 22 || [[#GetHidReport]] ([?-8.1.1] [[#GetHidReport|HidGetReport]])
 
|-
 
|-
| 23 || [[#HidWakeController]]
+
| 23 || [[#TriggerConnection]] ([?-8.1.1] [[#HidWakeController]])
 
|-
 
|-
| 24 || HidAddPairedDevice
+
| 24 || [[#AddPairedDeviceInfo]] ([?-8.1.1] [[#AddPairedDeviceInfo|HidAddPairedDevice]])
 
|-
 
|-
| 25 || HidGetPairedDevice
+
| 25 || [[#GetPairedDeviceInfo]] ([?-8.1.1] [[#GetPairedDeviceInfo|HidGetPairedDevice]])
 
|-
 
|-
| 26 || CleanupHid
+
| 26 || [[#FinalizeHid]] ([?-8.1.1] [[#FinalizeHid|CleanupHid]])
 
|-
 
|-
| 27 || HidGetEventInfo
+
| 27 || [[#GetHidEventInfo]] ([?-8.1.1] [[#GetHidEventInfo|HidGetEventInfo]])
 
|-
 
|-
| 28 || ExtSetTsi
+
| 28 || [[#SetTsi]] ([?-8.1.1]] [[#SetTsi|ExtSetTsi]])
 
|-
 
|-
| 29 || ExtSetBurstMode
+
| 29 || [[#EnableBurstMode]] ([?-8.1.1] [[#EnableBurstMode|ExtSetBurstMode]])
 
|-
 
|-
| 30 || ExtSetZeroRetran
+
| 30 || [[#SetZeroRetransmission]] ([?-8.1.1] [[#SetZeroRetransmission|ExtSetZeroRetran]])
 
|-
 
|-
| 31 || ExtSetMcMode
+
| 31 || [[#EnableMcMode]] ([?-8.1.1] [[#EnableMcMode|ExtSetMcMode]])
 
|-
 
|-
| 32 || ExtStartLlrMode
+
| 32 || [[#EnableLlrScan]] ([?-8.1.1] [[#EnableLlrScan|ExtStartLlrMode]])
 
|-
 
|-
| 33 || ExtExitLlrMode
+
| 33 || [[#DisableLlrScan]] ([?-8.1.1] [[#DisableLlrScan|ExtExitLlrMode]])
 
|-
 
|-
| 34 || ExtSetRadio
+
| 34 || [[#EnableRadio]] ([?-8.1.1] [[#EnableRadio|ExtSetRadio]])
 
|-
 
|-
| 35 || ExtSetVisibility
+
| 35 || [[#SetVisibility]] ([?-8.1.1] [[#SetVisibility|ExtSetVisibility]])
 
|-
 
|-
| 36 || ExtSetTbfcScan
+
| 36 || [[#EnableTbfcScan]] ([?-8.1.1] [[#EnableTbfcScan|ExtSetTbfcScan]])
 
|-
 
|-
| 37 || RegisterHidReportEvent
+
| 37 || [[#RegisterHidReportEvent]]
 
|-
 
|-
| 38 || [[#HidGetReportEventInfo]]
+
| 38 || [[#GetHidReportEventInfo]] ([?-8.1.1] [[#GetHidReportEventInfo|HidGetReportEventInfo]])
 
|-
 
|-
| 39 || GetLatestPlr
+
| 39 || [[#GetLatestPlr]]
 
|-
 
|-
| 40 || [3.0.0+] ExtGetPendingConnections
+
| 40 || [3.0.0+] [[#GetPendingConnections]] ([?-8.1.1] [[#GetPendingConnections|ExtGetPendingConnections]])
 
|-
 
|-
| 41 || [3.0.0+] GetChannelMap
+
| 41 || [3.0.0+] [[#GetChannelMap]]
 
|-
 
|-
| 42 || [3.0.0+] EnableBluetoothBoostSetting
+
| 42 || [3.0.0+] [[#EnableTxPowerBoostSetting]] ([?-8.1.1] [[#EnableTxPowerBoostSetting|EnableBluetoothBoostSetting]])
 
|-
 
|-
| 43 || [3.0.0+] IsBluetoothBoostSettingEnabled
+
| 43 || [3.0.0+] [[#IsTxPowerBoostSettingEnabled]] ([?-8.1.1] [[#IsTxPowerBoostSettingEnabled|IsBluetoothBoostSettingEnabled]])
 
|-
 
|-
| 44 || [3.0.0+] EnableBluetoothAfhSetting
+
| 44 || [3.0.0+] [[#EnableAfhSetting]] ([?-8.1.1] [[#EnableAfhSetting|EnableBluetoothAfhSetting]])
 
|-
 
|-
| 45 || IsBluetoothAfhSettingEnabled
+
| 45 || [[#IsAfhSettingEnabled]] ([?-8.1.1] [[#IsAfhSettingEnabled|IsBluetoothAfhSettingEnabled]])
 
|-
 
|-
| 46 || [5.0.0+] InitializeBluetoothLe
+
| 46 || [5.0.0+] [[#InitializeBle]] ([5.0.0-8.1.1] [[#InitializeBle|InitializeBluetoothLe]])
 
|-
 
|-
| 47 || [5.0.0+] EnableBluetoothLe
+
| 47 || [5.0.0+] [[#EnableBle]] ([5.0.0-8.1.1] [[#EnableBle|EnableBluetoothLe]])
 
|-
 
|-
| 48 || [5.0.0+] DisableBluetoothLe
+
| 48 || [5.0.0+] [[#DisableBle]] ([5.0.0-8.1.1] [[#DisableBle|DisableBluetoothLe]])
 
|-
 
|-
| 49 || [5.0.0+] CleanupBluetoothLe
+
| 49 || [5.0.0+] [[#FinalizeBle]] ([5.0.0-8.1.1] [[#FinalizeBle|CleanupBluetoothLe]])
 
|-
 
|-
| 50 || [5.0.0+] SetLeVisibility
+
| 50 || [5.0.0+] [[#SetBleVisibility]] ([5.0.0-8.1.1] [[#SetBleVisibility|SetLeVisibility]])
 
|-
 
|-
| 51 || [5.0.0+] SetLeConnectionParameter
+
| 51 || [5.0.0+] [[#SetBleConnectionParameter]] ([5.0.0-8.1.1] [[#SetLeConnectionParameter]])
 
|-
 
|-
| 52 || [5.0.0+] [[#SetLeDefaultConnectionParameter]]
+
| 52 || [5.0.0+] [[#SetBleDefaultConnectionParameter]] ([5.0.0-8.1.1] [[#SetLeDefaultConnectionParameter]])
 
|-
 
|-
| 53 || [5.0.0+] SetLeAdvertiseData
+
| 53 || [5.0.0+] [[#SetBleAdvertiseData]] ([5.0.0-8.1.1] [[#SetBleAdvertiseData|SetLeAdvertiseData]])
 
|-
 
|-
| 54 || [5.0.0+] SetLeAdvertiseParameter
+
| 54 || [5.0.0+] [[#SetBleAdvertiseParameter]] ([5.0.0-8.1.1] [[#SetBleAdvertiseParameter|SetLeAdvertiseParameter]])
 
|-
 
|-
| 55 || [5.0.0+] StartLeScan
+
| 55 || [5.0.0+] [[#StartBleScan]] ([5.0.0-8.1.1] [[#StartBleScan|StartLeScan]])
 
|-
 
|-
| 56 || [5.0.0+] StopLeScan
+
| 56 || [5.0.0+] [[#StopBleScan]] ([5.0.0-8.1.1] [[#StopBleScan|StopLeScan]])
 
|-
 
|-
| 57 || [5.0.0+] AddLeScanFilterCondition
+
| 57 || [5.0.0+] [[#AddBleScanFilterCondition]] ([5.0.0-8.1.1] [[#AddBleScanFilterCondition|AddLeScanFilterCondition]])
 
|-
 
|-
| 58 || [5.0.0+] DeleteLeScanFilterCondition
+
| 58 || [5.0.0+] [[#DeleteBleScanFilterCondition]] ([5.0.0-8.1.1] [[#DeleteBleScanFilterCondition|DeleteLeScanFilterCondition]])
 
|-
 
|-
| 59 || [5.0.0+] DeleteLeScanFilter
+
| 59 || [5.0.0+] [[#DeleteBleScanFilter]] ([5.0.0-8.1.1] [[#DeleteBleScanFilter|DeleteLeScanFilter]])
 
|-
 
|-
| 60 || [5.0.0+] ClearLeScanFilters
+
| 60 || [5.0.0+] [[#ClearBleScanFilters]] ([5.0.0-8.1.1] [[#ClearBleScanFilters|ClearLeScanFilters]])
 
|-
 
|-
| 61 || [5.0.0+] EnableLeScanFilter
+
| 61 || [5.0.0+] [[#EnableBleScanFilter]] ([5.0.0-8.1.1] [[#EnableBleScanFilter|EnableLeScanFilter]])
 
|-
 
|-
| 62 || [5.0.0+] RegisterLeClient
+
| 62 || [5.0.0+] [[#RegisterGattClient]] ([5.0.0-8.1.1] [[#RegisterGattClient|RegisterLeClient]])
 
|-
 
|-
| 63 || [5.0.0+] UnregisterLeClient
+
| 63 || [5.0.0+] [[#UnregisterGattClient]] ([5.0.0-8.1.1] [[#UnregisterGattClient|UnregisterLeClient]])
 
|-
 
|-
| 64 || [5.0.0+] UnregisterLeClientAll
+
| 64 || [5.0.0+] [[#UnregisterAllGattClients]] ([5.0.0-8.1.1] [[#UnregisterAllGattClients|UnregisterLeClientAll]])
 
|-
 
|-
| 65 || [5.0.0+] LeClientConnect
+
| 65 || [5.0.0+] [[#ConnectGattServer]] ([5.0.0-8.1.1] [[#ConnectGattServer|LeClientConnect]])
 
|-
 
|-
| 66 || [5.1.0+]
+
| 66 || [5.1.0+] [[#CancelConnectGattServer]] ([5.1.0-8.1.1] [[#CancelConnectGattServer|LeClientCancelConnection]])
 
|-
 
|-
| 67 ([5.0.0-5.0.2] 66) || LeClientCancelConnection
+
| 67 ([5.0.0-5.0.2] 66) || [[#DisconnectGattServer]] ([?-8.1.1] [[#DisconnectGattServer|LeClientCancelConnection]])
 
|-
 
|-
| 68 ([5.0.0-5.0.2] 67) || [5.0.0+] [[#LeClientDisconnect]]
+
| 68 ([5.0.0-5.0.2] 67) || [5.0.0+] [[#GetGattAttribute]] ([5.0.0-8.1.1] [[#GetGattAttribute|LeClientGetAttributes]])
 
|-
 
|-
| 69 ([5.0.0-5.0.2] 68) || [5.0.0+] LeClientGetAttributes
+
| 69 ([5.0.0-5.0.2] 68) || [5.0.0+] [[#GetGattService]] ([5.0.0-8.1.1] [[#GetGattService|LeClientDiscoverService]])
 
|-
 
|-
| 70 ([5.0.0-5.0.2] 69) || [5.0.0+] LeClientDiscoverService
+
| 70 ([5.0.0-5.0.2] 69) || [5.0.0+] [[#ConfigureAttMtu]] ([5.0.0-8.1.1] [[#ConfigureAttMtu|LeClientConfigureMtu]])
 
|-
 
|-
| 71 ([5.0.0-5.0.2] 70) || [5.0.0+] LeClientConfigureMtu
+
| 71 ([5.0.0-5.0.2] 70) || [5.0.0+] [[#RegisterGattServer]] ([5.0.0-8.1.1] [[#RegisterGattServer|RegisterLeServer]])
 
|-
 
|-
| 72 ([5.0.0-5.0.2] 71) || [5.0.0+] RegisterLeServer
+
| 72 ([5.0.0-5.0.2] 71) || [5.0.0+] [[#UnregisterGattServer]] ([5.0.0-8.1.1] [[#UnregisterGattServer|UnregisterLeServer]])
 
|-
 
|-
| 73 ([5.0.0-5.0.2] 72) || [5.0.0+] UnregisterLeServer
+
| 73 ([5.0.0-5.0.2] 72) || [5.0.0+] [[#ConnectGattClient]] ([5.0.0-8.1.1] [[#ConnectGattClient|LeServerConnect]])
 
|-
 
|-
| 74 ([5.0.0-5.0.2] 73) || [5.0.0+] [[#LeServerConnect]]
+
| 74 ([5.0.0-5.0.2] 73) || [5.0.0+] [[#DisconnectGattClient]] ([5.0.0-8.1.1] [[#LeServerDisconnect]])
 
|-
 
|-
| 75 || [5.0.0+] CreateLeService
+
| 75 || [5.0.0+] [[#AddGattService]] ([5.0.0-8.1.1] [[#AddGattService|CreateLeService]])
 
|-
 
|-
| 76 ([5.0.0-5.0.2] 74) || [5.0.0+] LeServerDisconnect
+
| 76 ([5.0.0-5.0.2] 74) || [5.0.0+] [[#EnableGattService]] ([5.0.0-8.1.1] [[#EnableGattService|StartLeService]])
 
|-
 
|-
| 77 || [5.0.0+] AddLeCharacteristic
+
| 77 || [5.0.0+] [[#AddGattCharacteristic]] ([5.0.0-8.1.1] [[#AddGattCharacteristic|AddLeCharacteristic]])
 
|-
 
|-
| 78 ([5.0.0-5.0.2] 76) || [5.0.0+] StartLeService
+
| 78 ([5.0.0-5.0.2] 76) || [5.0.0+] [[#AddGattDescriptor]] ([5.0.0-8.1.1] [[#AddGattDescriptor|AddLeDescriptor]])
 
|-
 
|-
| 79 ([5.0.0-5.0.2] 78) || [5.0.0+] AddLeDescriptor
+
| 79 ([5.0.0-5.0.2] 78) || [5.0.0+] [[#GetBleManagedEventInfo]] ([5.0.0-8.1.1] [[#GetBleManagedEventInfo|GetLeCoreEventInfo]])
 
|-
 
|-
| 80 ([5.0.0-5.0.2] 79) || [5.0.0+] GetLeCoreEventInfo
+
| 80 ([5.0.0-5.0.2] 79) || [5.0.0+] [[#GetGattFirstCharacteristic]] ([5.0.0-8.1.1] [[#GetGattFirstCharacteristic|LeGetFirstCharacteristic]])
 
|-
 
|-
| 81 ([5.0.0-5.0.2] 80) || [5.0.0+] LeGetFirstCharacteristic
+
| 81 ([5.0.0-5.0.2] 80) || [5.0.0+] [[#GetGattNextCharacteristic]] ([5.0.0-8.1.1] [[#GetGattNextCharacteristic|LeGetNextCharacteristic]])
 
|-
 
|-
| 82 ([5.0.0-5.0.2] 81) || [5.0.0+] LeGetNextCharacteristic
+
| 82 ([5.0.0-5.0.2] 81) || [5.0.0+] [[#GetGattFirstDescriptor]] ([5.0.0-8.1.1] [[#GetGattFirstDescriptor|LeGetFirstDescriptor]])
 
|-
 
|-
| 83 ([5.0.0-5.0.2] 82) || [5.0.0+] LeGetFirstDescriptor
+
| 83 ([5.0.0-5.0.2] 82) || [5.0.0+] [[#GetGattNextDescriptor]] ([5.0.0-8.1.1] [[#GetGattNextDescriptor|LeGetNextDescriptor]])
 
|-
 
|-
| 84 || [5.0.0+] RegisterLeCoreDataPath
+
| 84 || [5.0.0+] [[#RegisterGattManagedDataPath]] ([5.0.0-8.1.1] [[#RegisterGattManagedDataPath|RegisterLeCoreDataPath]])
 
|-
 
|-
| 85 || [5.0.0+] UnregisterLeCoreDataPath
+
| 85 || [5.0.0+] [[#UnregisterGattManagedDataPath]] ([5.0.0-8.1.1] [[#UnregisterGattManagedDataPath|UnregisterLeCoreDataPath]])
 
|-
 
|-
| 86 || [5.0.0+] RegisterLeHidDataPath
+
| 86 || [5.0.0+] [[#RegisterGattHidDataPath]] ([5.0.0-8.1.1] [[#RegisterGattHidDataPath|RegisterLeHidDataPath]])
 
|-
 
|-
| 87 || [5.0.0+] UnregisterLeHidDataPath
+
| 87 || [5.0.0+] [[#UnregisterGattHidDataPath]] ([5.0.0-8.1.1] [[#UnregisterGattHidDataPath|UnregisterLeHidDataPath]])
 
|-
 
|-
| 88 || [5.0.0+] RegisterLeDataPath
+
| 88 || [5.0.0+] [[#RegisterGattDataPath]] ([5.0.0-8.1.1] [[#RegisterGattDataPath|RegisterLeDataPath]])
 
|-
 
|-
| 89 ([5.0.0-5.0.2] 83) || [5.0.0+] LeGetNextDescriptor
+
| 89 ([5.0.0-5.0.2] 83) || [5.0.0+] [[#UnregisterGattDataPath]] ([5.0.0-8.1.1] [[#UnregisterGattDataPath|UnregisterLeDataPath]])
 
|-
 
|-
| 90 ([5.0.0-5.0.2] 89) || [5.0.0+] UnregisterLeDataPath
+
| 90 ([5.0.0-5.0.2] 89) || [5.0.0+] [[#ReadGattCharacteristic]] ([5.0.0-8.1.1] [[#ReadGattCharacteristic|LeClientReadCharacteristic]])
 
|-
 
|-
| 91 ([5.0.0-5.0.2] 90) || [5.0.0+] LeClientReadCharacteristic
+
| 91 ([5.0.0-5.0.2] 90) || [5.0.0+] [[#ReadGattDescriptor]] ([5.0.0-8.1.1] [[#ReadGattDescriptor|LeClientReadDescriptor]])
 
|-
 
|-
| 92 ([5.0.0-5.0.2] 91) || [5.0.0+] LeClientReadDescriptor
+
| 92 ([5.0.0-5.0.2] 91) || [5.0.0+] [[#WriteGattCharacteristic]] ([5.0.0-8.1.1] [[#WriteGattCharacteristic|LeClientWriteCharacteristic]])
 
|-
 
|-
| 93 ([5.0.0-5.0.2] 92) || [5.0.0+] LeClientWriteCharacteristic
+
| 93 ([5.0.0-5.0.2] 92) || [5.0.0+] [[#WriteGattDescriptor]] ([5.0.0-8.1.1] [[#WriteGattDescriptor|LeClientWriteDescriptor]])
 
|-
 
|-
| 94 || [5.0.0+] LeClientRegisterNotification
+
| 94 || [5.0.0+] [[#RegisterGattNotification]] ([5.0.0-8.1.1] [[#RegisterGattNotification|LeClientRegisterNotification]])
 
|-
 
|-
| 95 ([5.0.0-5.0.2] 93) || [5.0.0+] LeClientWriteDescriptor
+
| 95 ([5.0.0-5.0.2] 93) || [5.0.0+] [[#UnregisterGattNotification]] ([5.0.0-8.1.1] [[#UnregisterGattNotification|LeClientDeregisterNotification]])
 
|-
 
|-
| 96 ([5.0.0-5.0.2] 95) || [5.0.0+] LeClientDeregisterNotification
+
| 96 ([5.0.0-5.0.2] 95) || [5.0.0+] [[#GetLeHidEventInfo]]
 
|-
 
|-
| 97 ([5.0.0-5.0.2] 96) || [5.0.0+] GetLeHidEventInfo
+
| 97 ([5.0.0-5.0.2] 96) || [5.0.0+] [[#RegisterBleHidEvent]]
 
|-
 
|-
| 97 || [5.0.0-5.0.2] RegisterBleHidEvent
+
| 98 || [5.1.0+] [[#SetBleScanParameter]] ([5.1.0-8.1.1] [[#SetBleScanParameter|SetLeScanParameter]])
 
|-
 
|-
| 98 || [5.1.0+] SetLeScanParameter
+
| 99 || [10.0.0+] [[#MoveToSecondaryPiconet]]
 
|-
 
|-
| 256 || [5.0.0+] GetIsManufacturingMode
+
| 256 || [5.0.0+] [[#IsManufacturingMode]]
 
|-
 
|-
| 257 || [7.0.0+] EmulateBluetoothCrash
+
| 257 || [7.0.0+] [[#EmulateBluetoothCrash]]
 
|-
 
|-
| 258 || [9.0.0+] GetBleChannelMap
+
| 258 || [9.0.0+] [[#GetBleChannelMap]]
 
|}
 
|}
  
 
Various cmdids were moved with [4.0.0+] and [5.0.0+].
 
Various cmdids were moved with [4.0.0+] and [5.0.0+].
 +
 +
== InitializeBluetoothDriver ==
 +
No input/output.
 +
 +
This is the first cmd used during service init.
 +
 +
== InitializeBluetooth ==
 +
No input, returns an output Event handle with EventClearMode=1.
 +
 +
== EnableBluetooth ==
 +
No input/output.
 +
 +
== DisableBluetooth ==
 +
No input/output.
 +
 +
== FinalizeBluetooth ==
 +
No input/output.
 +
 +
== GetAdapterProperties ==
 +
Takes a type-0x1A output buffer containing an [[#AdapterProperty]].
 +
 +
== GetAdapterProperty ==
 +
Takes an input [[#BluetoothPropertyType]] and a type-0xA output buffer.
 +
 +
== SetAdapterProperty ==
 +
Takes an input [[#BluetoothPropertyType]] and a type-0x9 input buffer.
 +
 +
== StartInquiry ==
 +
No input/output.
 +
 +
== StopInquiry ==
 +
No input/output.
  
 
== CreateBond ==
 
== CreateBond ==
Takes a total of 0x6-bytes of input and a type-0x19 input buffer, no output.
+
Takes an input [[#Address]] and a type-0x19 input buffer containing a [[#TransportType]], no output.
 +
 
 +
[9.0.0+] Now only takes an [[#Address]] and a [[#TransportType]] without a buffer, no output.
 +
 
 +
== RemoveBond ==
 +
Takes an input [[#Address]], no output.
 +
 
 +
== CancelBond ==
 +
Takes an input [[#Address]], no output.
 +
 
 +
== RespondToPinRequest ==
 +
Takes an input [[#Address]], a bool, an u8, a [[#BluetoothPinCode]], no output.
 +
 
 +
sdknso uses an user-specified s32 for the u8.
 +
 
 +
== RespondToSspRequest ==
 +
Takes an input [[#Address]], a [[#BluetoothSspVariant]], a bool, an u32, no output.
 +
 
 +
== GetEventInfo ==
 +
Takes a type-0xA output buffer and returns an output [[#EventType]].
 +
 
 +
== InitializeHid ==
 +
Takes an input u16, returns an output Event with EventClearMode=1.
 +
 
 +
Originally sdknso used an user-specified value for the u16, however with [9.0.0+] it uses hard-coded value 0x1 instead.
 +
 
 +
== OpenHidConnection ==
 +
Takes an input [[#Address]], no output.
 +
 
 +
== CloseHidConnection ==
 +
Takes an input [[#Address]], no output.
 +
 
 +
== HidSendData ==
 +
Takes an input [[#Address]] and a type-0x19 input buffer containing a [[#HidData]], no output.
 +
 
 +
== WriteHidData ==
 +
Takes an input [[#Address]] and a type-0x19 input buffer containing a [[#HidReport]], no output.
 +
 
 +
== WriteHidData2 ==
 +
Takes an input [[#Address]] and a type-0x9 input buffer, no output.
  
[9.0.0+] Now only takes a total of 0xC-bytes of input without a buffer, no output.
+
This is internally the same as [[#WriteHidData]], with the input buffer being directly passed to the funcptr instead of a tmp copy of the input [[#HidReport]].
 +
 
 +
== HidSetReport ==
 +
Takes an input [[#Address]], a [[#BluetoothHhReportType]], a type-0x19 input buffer containing a [[#HidData]], no output.
 +
 
 +
== SetHidReport ==
 +
Takes an input [[#Address]], a [[#BluetoothHhReportType]], a type-0x19 input buffer containing a [[#HidReport]], no output.
 +
 
 +
== GetHidReport ==
 +
Takes an input [[#Address]], an u8, a [[#BluetoothHhReportType]], no output.
  
 
== HidWakeController ==
 
== HidWakeController ==
Takes a total of 0x6-bytes of input, no output.
+
Takes an input [[#Address]], no output.
 +
 
 +
== TriggerConnection ==
 +
Takes an input [[#Address]] and an u16, no output.
 +
 
 +
== AddPairedDeviceInfo ==
 +
Takes a type-0x19 input buffer containing [[Settings_services#BluetoothDevicesSettings|BluetoothDevicesSettings]], no output.
 +
 
 +
== GetPairedDeviceInfo ==
 +
Takes an input [[#Address]] and a type-0x1A output buffer containing [[Settings_services#BluetoothDevicesSettings|BluetoothDevicesSettings]].
 +
 
 +
== FinalizeHid ==
 +
No input/output.
 +
 
 +
== GetHidEventInfo ==
 +
Takes a type-0xA output buffer, returns an output [[#HidEventType]].
 +
 
 +
This copies 0x480-bytes from state to the output buffer. [[#HidEventType]] is set to: stateval!=0 ? 7 : 0.
 +
 
 +
== SetTsi ==
 +
Takes an input [[#Address]] and an u8, no output.
 +
 
 +
== EnableBurstMode ==
 +
Takes an input [[#Address]] and a bool, no output.
 +
 
 +
== SetZeroRetransmission ==
 +
Takes an input [[#Address]] and a type-0x9 input buffer containing an array of u8s, no output.
 +
 
 +
== EnableMcMode ==
 +
Takes an input bool, no output.
 +
 
 +
== EnableLlrScan ==
 +
No input/output.
 +
 
 +
== DisableLlrScan ==
 +
No input/output.
 +
 
 +
== EnableRadio ==
 +
Takes an input bool, no output.
 +
 
 +
== SetVisibility ==
 +
Takes two input bools, no output.
 +
 
 +
== EnableTbfcScan ==
 +
Takes an input bool, no output.
 +
 
 +
== RegisterHidReportEvent ==
 +
No input, returns an output Event handle with EventClearMode=1.
 +
 
 +
== GetHidReportEventInfo ==
 +
No input, takes a type-0xA output buffer and returns a [[#HidEventType]].
 +
 
 +
[7.0.0+] No longer takes a buffer or returns output, now returns an output sharedmem handle. sdknso maps this with size=0x3000 and permissions=RW-.
 +
 
 +
Originally this was used in a dedicated sdknso func, with [7.0.0+] this is now used at the start of the sdknso impl for [[#RegisterHidReportEvent]] if the above sharedmem was not mapped yet.
 +
 
 +
The [7.0.0+] GetHidReportEventInfo sdknso func loads data using the above sharedmem.
 +
 
 +
== GetLatestPlr ==
 +
Takes a type-0x16 output buffer containing a [[#PlrList]] ([1.0.0-8.1.1] [[#PlrStatistics]]).
 +
 
 +
== GetPendingConnections ==
 +
No input/output.
 +
 
 +
== GetChannelMap ==
 +
Takes a type-0x16 output buffer containing a [[#ChannelMapList]].
 +
 
 +
== EnableTxPowerBoostSetting ==
 +
Takes an input bool, no output.
 +
 
 +
== IsTxPowerBoostSettingEnabled ==
 +
No input, returns an output bool.
 +
 
 +
sdknso sets the tmpout_bool to 1, and uses that with the cmd. The sdknso func directly returns tmpout_bool, errors from the cmd are ignored.
 +
 
 +
== EnableAfhSetting ==
 +
Takes an input bool, no output.
 +
 
 +
== IsAfhSettingEnabled ==
 +
sdknso sets the tmpout_bool to 1, and uses that with the cmd. The sdknso func directly returns tmpout_bool, errors from the cmd are ignored.
 +
 
 +
== InitializeBle ==
 +
No input, returns an output Event handle with EventClearMode=1.
 +
 
 +
== EnableBle ==
 +
No input/output.
 +
 
 +
== DisableBle ==
 +
No input/output.
 +
 
 +
== FinalizeBle ==
 +
No input/output.
  
[9.0.0+] Now takes a total of 0x8-bytes of input, no output.
+
== SetBleVisibility ==
 +
Takes two input bools, no output.
  
== HidGetReportEventInfo ==
+
== SetLeConnectionParameter ==
No input, takes a type-0xA output buffer and returns 4-bytes of output.
+
Takes a [[#LeConnectionParams]], no output.
  
[7.0.0+] No longer takes a buffer or returns output, now returns an output handle.
+
== SetBleConnectionParameter ==
 +
Takes an input [[#Address]], a bool, a [[#BleConnectionParameter]], no output.
  
 
== SetLeDefaultConnectionParameter ==
 
== SetLeDefaultConnectionParameter ==
Takes a total of 0x14-bytes of input, no output.
+
Takes a [[#LeConnectionParams]], no output.
 +
 
 +
== SetBleDefaultConnectionParameter ==
 +
Takes a [[#BleConnectionParameter]], no output.
 +
 
 +
== SetBleAdvertiseData ==
 +
Takes an input [[#BleAdvertisePacketData]], no output.
 +
 
 +
== SetBleAdvertiseParameter ==
 +
Takes an input [[#Address]], two u16s, no output.
 +
 
 +
== StartBleScan ==
 +
No input/output.
 +
 
 +
== StopBleScan ==
 +
No input/output.
 +
 
 +
== AddBleScanFilterCondition ==
 +
Takes a type-0x19 input buffer containing a [[#BleAdvertiseFilter]], no output.
 +
 
 +
== DeleteBleScanFilterCondition ==
 +
Takes a type-0x19 input buffer containing a [[#BleAdvertiseFilter]], no output.
 +
 
 +
== DeleteBleScanFilter ==
 +
Takes an input u8, no output.
 +
 
 +
Originally the sdknso func used an u8 for the user-specified param, with [9.0.0+] it's a s32.
 +
 
 +
== ClearBleScanFilters ==
 +
No input/output.
 +
 
 +
== EnableBleScanFilter ==
 +
Takes an input bool, no output.
 +
 
 +
== RegisterGattClient ==
 +
Takes an input [[#GattAttributeUuid]], no output.
 +
 
 +
== UnregisterGattClient ==
 +
Takes an input u8, no output.
 +
 
 +
== UnregisterAllGattClients ==
 +
No input/output.
 +
 
 +
== ConnectGattServer ==
 +
Takes an input u8, an [[#Address]], a bool, an [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]], no output.
  
[9.0.0+] Now takes a total of 0xC-bytes of input, no output.
+
== CancelConnectGattServer ==
 +
Takes an input u8, an [[#Address]], a bool, no output.
  
== LeClientDisconnect ==
+
== DisconnectGattServer ==
Takes a total of 0xC-bytes of input, no output.
+
Takes an input u32, no output.
  
[9.0.0+] Now takes a total of 0x4-bytes of input, no output.
+
== GetGattAttribute ==
 +
Takes an [[#Address]] and an u32, no output.
  
== LeServerConnect ==
+
[9.0.0+] Now takes an input u32, no output.
Takes a total of 0x7-bytes of input, no output.
 
  
[9.0.0+] Now takes a total of 1-byte of input, no output.
+
== GetGattService ==
 +
Takes an input u32 and a [[#GattAttributeUuid]], no output.
 +
 
 +
== ConfigureAttMtu ==
 +
Takes an input u16 and u32, no output.
 +
 
 +
== RegisterGattServer ==
 +
Takes an input [[#GattAttributeUuid]], no output.
 +
 
 +
== UnregisterGattServer ==
 +
Takes an input u8, no output.
 +
 
 +
== ConnectGattClient ==
 +
Takes an input u8, an [[#Address]], a bool, no output.
 +
 
 +
== LeServerDisconnect ==
 +
Takes an input u8, an [[#Address]], no output.
 +
 
 +
== DisconnectGattClient ==
 +
Takes an input u8, no output.
 +
 
 +
== AddGattService ==
 +
Takes an input u8, an u8, a bool, a [[#GattAttributeUuid]], no output.
 +
 
 +
Originally sdknso used an user-specified u8 for the second u8, with [9.0.0+] that func param is now a s32.
 +
 
 +
== EnableGattService ==
 +
Takes an input u8, a [[#GattAttributeUuid]], no output.
 +
 
 +
== AddGattCharacteristic ==
 +
Takes an input u8, an u8, an u16, a [[#GattAttributeUuid]], a [[#GattAttributeUuid]], no output.
 +
 
 +
== AddGattDescriptor ==
 +
Takes an input u8, an u16, a [[#GattAttributeUuid]], a [[#GattAttributeUuid]], no output.
 +
 
 +
== GetBleManagedEventInfo ==
 +
Takes a type-0xA output buffer, returns an output [[#BleEventType]].
 +
 
 +
This copies 0x400-bytes from state to the output buffer, and copies the [[#BleEventType]] from state to output.
 +
 
 +
== GetGattFirstCharacteristic ==
 +
Takes an input bool, an u32, a [[#GattId]], a [[#GattAttributeUuid]], returns an output u8 and [[#GattId]].
 +
 
 +
== GetGattNextCharacteristic ==
 +
Takes an input bool, an u32, a [[#GattId]], a [[#GattId]], a [[#GattAttributeUuid]], returns an output u8 and [[#GattId]].
 +
 
 +
== GetGattFirstDescriptor ==
 +
Takes an input bool, an u32, a [[#GattId]], a [[#GattId]], a [[#GattAttributeUuid]], returns an output [[#GattId]].
 +
 
 +
== GetGattNextDescriptor ==
 +
Takes an input bool, an u32, a [[#GattId]], a [[#GattId]], a [[#GattId]], a [[#GattAttributeUuid]], returns an output [[#GattId]].
 +
 
 +
== RegisterGattManagedDataPath ==
 +
Takes an input [[#GattAttributeUuid]], no output.
 +
 
 +
== UnregisterGattManagedDataPath ==
 +
Takes an input [[#GattAttributeUuid]], no output.
 +
 
 +
== RegisterGattHidDataPath ==
 +
Takes an input [[#GattAttributeUuid]], no output.
 +
 
 +
== UnregisterGattHidDataPath ==
 +
Takes an input [[#GattAttributeUuid]], no output.
 +
 
 +
== RegisterGattDataPath ==
 +
Takes an input [[#GattAttributeUuid]], no output.
 +
 
 +
== UnregisterGattDataPath ==
 +
Takes an input [[#GattAttributeUuid]], no output.
 +
 
 +
== ReadGattCharacteristic ==
 +
Takes an input bool, an u8, an u32, a [[#GattId]], a [[#GattId]], no output.
 +
 
 +
== ReadGattDescriptor ==
 +
Takes an input bool, an u8, an u32, a [[#GattId]], a [[#GattId]], a [[#GattId]], no output.
 +
 
 +
== WriteGattCharacteristic ==
 +
Takes a type-0x9 input buffer, a bool, an u8, a bool, an u32, a [[#GattId]], a [[#GattId]], no output.
 +
 
 +
== WriteGattDescriptor ==
 +
Takes a type-0x9 input buffer, a bool, an u8, an u32, a [[#GattId]], a [[#GattId]], a [[#GattId]], no output.
 +
 
 +
== RegisterGattNotification ==
 +
Takes an input bool, an u32, a [[#GattId]], a [[#GattId]], no output.
 +
 
 +
== UnregisterGattNotification ==
 +
Takes an input bool, an u32, a [[#GattId]], a [[#GattId]], no output.
 +
 
 +
== GetLeHidEventInfo ==
 +
Takes a type-0xA output buffer, returns an output [[#BleEventType]].
 +
 
 +
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.
 +
 
 +
== RegisterBleHidEvent ==
 +
No input, returns an output Event handle with EventClearMode=1.
 +
 
 +
== SetBleScanParameter ==
 +
Takes two input u16s, no output.
 +
 
 +
== MoveToSecondaryPiconet ==
 +
Takes an input [[#Address]], no output.
 +
 
 +
== IsManufacturingMode ==
 +
No input, returns an output bool.
 +
 
 +
== EmulateBluetoothCrash ==
 +
Takes an input [[#FatalReason]], no output.
 +
 
 +
sdknso masks the FatalReason with an u16-mask before passing it to the cmd.
 +
 
 +
== GetBleChannelMap ==
 +
Takes a type-0x16 output buffer containing a [[#ChannelMapList]].
  
 
= bt =
 
= bt =
Line 258: Line 589:
 
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 || LeClientReadCharacteristic
+
| 0 || [[#LeClientReadCharacteristic]]
 
|-
 
|-
| 1 || LeClientReadDescriptor
+
| 1 || [[#LeClientReadDescriptor]]
 
|-
 
|-
| 2 || LeClientWriteCharacteristic
+
| 2 || [[#LeClientWriteCharacteristic]]
 
|-
 
|-
| 3 || LeClientWriteDescriptor
+
| 3 || [[#LeClientWriteDescriptor]]
 
|-
 
|-
| 4 || LeClientRegisterNotification
+
| 4 || [[#LeClientRegisterNotification]]
 
|-
 
|-
| 5 || LeClientDeregisterNotification
+
| 5 || [[#LeClientDeregisterNotification]]
 
|-
 
|-
| 6 || SetLeResponse
+
| 6 || [[#SetLeResponse]]
 
|-
 
|-
| 7 || LeSendIndication
+
| 7 || [[#LeSendIndication]]
 
|-
 
|-
| 8 || GetLeEventInfo
+
| 8 || [[#GetLeEventInfo]]
 
|-
 
|-
| 9 || RegisterBleEvent
+
| 9 || [[#RegisterBleEvent]]
 
|}
 
|}
 +
 +
== LeClientReadCharacteristic ==
 +
Takes a PID, a bool, an u8, an u32, a [[#GattId]], a [[#GattId]], an [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]], no output.
 +
 +
== LeClientReadDescriptor ==
 +
Takes a PID, a bool, an u8, an u32, a [[#GattId]], a [[#GattId]], a [[#GattId]], an [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]], no output.
 +
 +
== LeClientWriteCharacteristic ==
 +
Takes a PID, a type-0x9 input buffer, a bool, an u8, a bool, an u32, a [[#GattId]], a [[#GattId]], an [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]], no output.
 +
 +
== LeClientWriteDescriptor ==
 +
Takes a PID, a type-0x9 input buffer, a bool, an u8, an u32, a [[#GattId]], a [[#GattId]], a [[#GattId]], an [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]], no output.
 +
 +
== LeClientRegisterNotification ==
 +
Takes a PID, an input bool, an u32, a [[#GattId]], a [[#GattId]], an [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]], no output.
 +
 +
== LeClientDeregisterNotification ==
 +
Takes a PID, an input bool, an u32, a [[#GattId]], a [[#GattId]], an [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]], no output.
 +
 +
== SetLeResponse ==
 +
Takes a PID, a type-0x9 input buffer, an u8, a [[#GattAttributeUuid]], a [[#GattAttributeUuid]], an [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]], no output.
 +
 +
== LeSendIndication ==
 +
Takes a PID, a type-0x9 input buffer, an u8, a bool, a [[#GattAttributeUuid]], a [[#GattAttributeUuid]], an [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]], no output.
 +
 +
== GetLeEventInfo ==
 +
Takes a PID, a type-0xA output buffer, an [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]], returns an output [[#BleEventType]].
 +
 +
This is identical to [[#GetLeHidEventInfo]] except different state is used.
 +
 +
== RegisterBleEvent ==
 +
Takes a PID, an [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]], returns an output Event handle with EventClearMode=1.
 +
 +
= BluetoothPropertyType =
 +
This is u32 enum "nn::bluetooth::BluetoothPropertyType".
 +
 +
= TransportType =
 +
This is u32 enum "nn::bluetooth::TransportType".
 +
 +
= BluetoothSspVariant =
 +
This is u8 enum "nn::bluetooth::BluetoothSspVariant".
 +
 +
= EventType =
 +
This is u32 enum "nn::bluetooth::EventType".
 +
 +
= BluetoothHhReportType =
 +
This is u32 enum "nn::bluetooth::BluetoothHhReportType".
 +
 +
= HidEventType =
 +
This is u32 enum "nn::bluetooth::HidEventType".
 +
 +
= BleEventType =
 +
This is u32 enum "nn::bluetooth::BleEventType".
 +
 +
= FatalReason =
 +
This is u32 enum "nn::bluetooth::FatalReason".
 +
 +
= AdapterProperty =
 +
This is "nn::bluetooth::AdapterProperty". This is a 0x103-byte struct.
 +
 +
= Address =
 +
This is "nn::bluetooth::Address". This is a 0x6-byte struct with 1-byte alignment.
 +
 +
= BluetoothPinCode =
 +
This is "nn::bluetooth::BluetoothPinCode". This is a 0x10-byte struct with 1-byte alignment.
 +
 +
= HidData =
 +
This is "nn::bluetooth::HidData". This is a 0x282-byte struct.
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset
 +
! Size
 +
! Description
 +
|-
 +
| 0x0 || 0x2 || Size of the following data.
 +
|-
 +
| 0x2 || 0x280 || Data
 +
|}
 +
 +
= HidReport =
 +
This is "nn::bluetooth::HidReport". This is a 0x2BE-byte struct.
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset
 +
! Size
 +
! Description
 +
|-
 +
| 0x0 || 0x2 || Size of the following data.
 +
|-
 +
| 0x2 || 0x2BC || Data
 +
|}
 +
 +
= PlrStatistics =
 +
This is "nn::bluetooth::PlrStatistics". This is a 0x84-byte struct.
 +
 +
= PlrList =
 +
This is "nn::bluetooth::PlrList". This is a 0xA4-byte struct.
 +
 +
= ChannelMapList =
 +
This is "nn::bluetooth::ChannelMapList". This is a 0x88-byte struct.
 +
 +
= LeConnectionParams =
 +
This is "nn::bluetooth::LeConnectionParams". This is a 0x14-byte struct with 2-byte alignment.
 +
 +
= BleConnectionParameter =
 +
This is "nn::bluetooth::BleConnectionParameter". This is a 0xC-byte struct with 2-byte alignment.
 +
 +
= BleAdvertisePacketData =
 +
This is "nn::bluetooth::BleAdvertisePacketData" ([5.0.0-8.1.1] "nn::bluetooth::LeAdvertiseData"). This is a 0xCC-byte struct.
 +
 +
= BleAdvertiseFilter =
 +
This is "nn::bluetooth::BleAdvertiseFilter". This is a 0x3E-byte struct.
 +
 +
= GattAttributeUuid =
 +
This is "nn::bluetooth::GattAttributeUuid". This is a 0x14-byte struct with 4-byte alignment.
 +
 +
= GattId =
 +
This is "nn::bluetooth::GattId". This is a 0x18-byte struct with 4-byte alignment.
  
 
[[Category:Services]]
 
[[Category:Services]]

Latest revision as of 21:40, 11 July 2020

Contents

btdrv

This is "nn::bluetooth::IBluetoothDriver".

The bluetooth driver implements the bluetooth protocol over h4/uart.

It interfaces with the uart service to actually talk with the bluetooth hardware.

The code seems to be derived from a broadcom stack. A good starting point for similar source code can be found in the MICO project: https://github.com/yinhongxing/mico/tree/ea67ff3659f12d730d4dc3b8d547b093bd2ee2ee/MICO/bluetooth_bte Note that the library files contain many (symbolized) functions which match btdrv.

Support for "nn::bluetooth::*" was added to sdknso with 6.x.

Cmd Name
0 #InitializeBluetoothDriver
1 #InitializeBluetooth
2 #EnableBluetooth
3 #DisableBluetooth
4 #FinalizeBluetooth ([?-8.1.1] CleanupBluetooth)
5 #GetAdapterProperties
6 #GetAdapterProperty
7 #SetAdapterProperty
8 #StartInquiry ([?-8.1.1] StartDiscovery)
9 #StopInquiry ([?-8.1.1] CancelDiscovery)
10 #CreateBond
11 #RemoveBond
12 #CancelBond
13 #RespondToPinRequest ([?-8.1.1] PinReply)
14 #RespondToSspRequest ([?-8.1.1] SspReply)
15 #GetEventInfo
16 #InitializeHid
17 #OpenHidConnection ([?-8.1.1] HidConnect)
18 #CloseHidConnection ([?-8.1.1] HidDisconnect)
19 #WriteHidData ([?-8.1.1] HidSendData)
20 #WriteHidData2 ([?-8.1.1] HidSendData2)
21 #SetHidReport ([?-8.1.1] #HidSetReport)
22 #GetHidReport ([?-8.1.1] HidGetReport)
23 #TriggerConnection ([?-8.1.1] #HidWakeController)
24 #AddPairedDeviceInfo ([?-8.1.1] HidAddPairedDevice)
25 #GetPairedDeviceInfo ([?-8.1.1] HidGetPairedDevice)
26 #FinalizeHid ([?-8.1.1] CleanupHid)
27 #GetHidEventInfo ([?-8.1.1] HidGetEventInfo)
28 #SetTsi ([?-8.1.1]] ExtSetTsi)
29 #EnableBurstMode ([?-8.1.1] ExtSetBurstMode)
30 #SetZeroRetransmission ([?-8.1.1] ExtSetZeroRetran)
31 #EnableMcMode ([?-8.1.1] ExtSetMcMode)
32 #EnableLlrScan ([?-8.1.1] ExtStartLlrMode)
33 #DisableLlrScan ([?-8.1.1] ExtExitLlrMode)
34 #EnableRadio ([?-8.1.1] ExtSetRadio)
35 #SetVisibility ([?-8.1.1] ExtSetVisibility)
36 #EnableTbfcScan ([?-8.1.1] ExtSetTbfcScan)
37 #RegisterHidReportEvent
38 #GetHidReportEventInfo ([?-8.1.1] HidGetReportEventInfo)
39 #GetLatestPlr
40 [3.0.0+] #GetPendingConnections ([?-8.1.1] ExtGetPendingConnections)
41 [3.0.0+] #GetChannelMap
42 [3.0.0+] #EnableTxPowerBoostSetting ([?-8.1.1] EnableBluetoothBoostSetting)
43 [3.0.0+] #IsTxPowerBoostSettingEnabled ([?-8.1.1] IsBluetoothBoostSettingEnabled)
44 [3.0.0+] #EnableAfhSetting ([?-8.1.1] EnableBluetoothAfhSetting)
45 #IsAfhSettingEnabled ([?-8.1.1] IsBluetoothAfhSettingEnabled)
46 [5.0.0+] #InitializeBle ([5.0.0-8.1.1] InitializeBluetoothLe)
47 [5.0.0+] #EnableBle ([5.0.0-8.1.1] EnableBluetoothLe)
48 [5.0.0+] #DisableBle ([5.0.0-8.1.1] DisableBluetoothLe)
49 [5.0.0+] #FinalizeBle ([5.0.0-8.1.1] CleanupBluetoothLe)
50 [5.0.0+] #SetBleVisibility ([5.0.0-8.1.1] SetLeVisibility)
51 [5.0.0+] #SetBleConnectionParameter ([5.0.0-8.1.1] #SetLeConnectionParameter)
52 [5.0.0+] #SetBleDefaultConnectionParameter ([5.0.0-8.1.1] #SetLeDefaultConnectionParameter)
53 [5.0.0+] #SetBleAdvertiseData ([5.0.0-8.1.1] SetLeAdvertiseData)
54 [5.0.0+] #SetBleAdvertiseParameter ([5.0.0-8.1.1] SetLeAdvertiseParameter)
55 [5.0.0+] #StartBleScan ([5.0.0-8.1.1] StartLeScan)
56 [5.0.0+] #StopBleScan ([5.0.0-8.1.1] StopLeScan)
57 [5.0.0+] #AddBleScanFilterCondition ([5.0.0-8.1.1] AddLeScanFilterCondition)
58 [5.0.0+] #DeleteBleScanFilterCondition ([5.0.0-8.1.1] DeleteLeScanFilterCondition)
59 [5.0.0+] #DeleteBleScanFilter ([5.0.0-8.1.1] DeleteLeScanFilter)
60 [5.0.0+] #ClearBleScanFilters ([5.0.0-8.1.1] ClearLeScanFilters)
61 [5.0.0+] #EnableBleScanFilter ([5.0.0-8.1.1] EnableLeScanFilter)
62 [5.0.0+] #RegisterGattClient ([5.0.0-8.1.1] RegisterLeClient)
63 [5.0.0+] #UnregisterGattClient ([5.0.0-8.1.1] UnregisterLeClient)
64 [5.0.0+] #UnregisterAllGattClients ([5.0.0-8.1.1] UnregisterLeClientAll)
65 [5.0.0+] #ConnectGattServer ([5.0.0-8.1.1] LeClientConnect)
66 [5.1.0+] #CancelConnectGattServer ([5.1.0-8.1.1] LeClientCancelConnection)
67 ([5.0.0-5.0.2] 66) #DisconnectGattServer ([?-8.1.1] LeClientCancelConnection)
68 ([5.0.0-5.0.2] 67) [5.0.0+] #GetGattAttribute ([5.0.0-8.1.1] LeClientGetAttributes)
69 ([5.0.0-5.0.2] 68) [5.0.0+] #GetGattService ([5.0.0-8.1.1] LeClientDiscoverService)
70 ([5.0.0-5.0.2] 69) [5.0.0+] #ConfigureAttMtu ([5.0.0-8.1.1] LeClientConfigureMtu)
71 ([5.0.0-5.0.2] 70) [5.0.0+] #RegisterGattServer ([5.0.0-8.1.1] RegisterLeServer)
72 ([5.0.0-5.0.2] 71) [5.0.0+] #UnregisterGattServer ([5.0.0-8.1.1] UnregisterLeServer)
73 ([5.0.0-5.0.2] 72) [5.0.0+] #ConnectGattClient ([5.0.0-8.1.1] LeServerConnect)
74 ([5.0.0-5.0.2] 73) [5.0.0+] #DisconnectGattClient ([5.0.0-8.1.1] #LeServerDisconnect)
75 [5.0.0+] #AddGattService ([5.0.0-8.1.1] CreateLeService)
76 ([5.0.0-5.0.2] 74) [5.0.0+] #EnableGattService ([5.0.0-8.1.1] StartLeService)
77 [5.0.0+] #AddGattCharacteristic ([5.0.0-8.1.1] AddLeCharacteristic)
78 ([5.0.0-5.0.2] 76) [5.0.0+] #AddGattDescriptor ([5.0.0-8.1.1] AddLeDescriptor)
79 ([5.0.0-5.0.2] 78) [5.0.0+] #GetBleManagedEventInfo ([5.0.0-8.1.1] GetLeCoreEventInfo)
80 ([5.0.0-5.0.2] 79) [5.0.0+] #GetGattFirstCharacteristic ([5.0.0-8.1.1] LeGetFirstCharacteristic)
81 ([5.0.0-5.0.2] 80) [5.0.0+] #GetGattNextCharacteristic ([5.0.0-8.1.1] LeGetNextCharacteristic)
82 ([5.0.0-5.0.2] 81) [5.0.0+] #GetGattFirstDescriptor ([5.0.0-8.1.1] LeGetFirstDescriptor)
83 ([5.0.0-5.0.2] 82) [5.0.0+] #GetGattNextDescriptor ([5.0.0-8.1.1] LeGetNextDescriptor)
84 [5.0.0+] #RegisterGattManagedDataPath ([5.0.0-8.1.1] RegisterLeCoreDataPath)
85 [5.0.0+] #UnregisterGattManagedDataPath ([5.0.0-8.1.1] UnregisterLeCoreDataPath)
86 [5.0.0+] #RegisterGattHidDataPath ([5.0.0-8.1.1] RegisterLeHidDataPath)
87 [5.0.0+] #UnregisterGattHidDataPath ([5.0.0-8.1.1] UnregisterLeHidDataPath)
88 [5.0.0+] #RegisterGattDataPath ([5.0.0-8.1.1] RegisterLeDataPath)
89 ([5.0.0-5.0.2] 83) [5.0.0+] #UnregisterGattDataPath ([5.0.0-8.1.1] UnregisterLeDataPath)
90 ([5.0.0-5.0.2] 89) [5.0.0+] #ReadGattCharacteristic ([5.0.0-8.1.1] LeClientReadCharacteristic)
91 ([5.0.0-5.0.2] 90) [5.0.0+] #ReadGattDescriptor ([5.0.0-8.1.1] LeClientReadDescriptor)
92 ([5.0.0-5.0.2] 91) [5.0.0+] #WriteGattCharacteristic ([5.0.0-8.1.1] LeClientWriteCharacteristic)
93 ([5.0.0-5.0.2] 92) [5.0.0+] #WriteGattDescriptor ([5.0.0-8.1.1] LeClientWriteDescriptor)
94 [5.0.0+] #RegisterGattNotification ([5.0.0-8.1.1] LeClientRegisterNotification)
95 ([5.0.0-5.0.2] 93) [5.0.0+] #UnregisterGattNotification ([5.0.0-8.1.1] LeClientDeregisterNotification)
96 ([5.0.0-5.0.2] 95) [5.0.0+] #GetLeHidEventInfo
97 ([5.0.0-5.0.2] 96) [5.0.0+] #RegisterBleHidEvent
98 [5.1.0+] #SetBleScanParameter ([5.1.0-8.1.1] SetLeScanParameter)
99 [10.0.0+] #MoveToSecondaryPiconet
256 [5.0.0+] #IsManufacturingMode
257 [7.0.0+] #EmulateBluetoothCrash
258 [9.0.0+] #GetBleChannelMap

Various cmdids were moved with [4.0.0+] and [5.0.0+].

InitializeBluetoothDriver

No input/output.

This is the first cmd used during service init.

InitializeBluetooth

No input, returns an output Event handle with EventClearMode=1.

EnableBluetooth

No input/output.

DisableBluetooth

No input/output.

FinalizeBluetooth

No input/output.

GetAdapterProperties

Takes a type-0x1A output buffer containing an #AdapterProperty.

GetAdapterProperty

Takes an input #BluetoothPropertyType and a type-0xA output buffer.

SetAdapterProperty

Takes an input #BluetoothPropertyType and a type-0x9 input buffer.

StartInquiry

No input/output.

StopInquiry

No input/output.

CreateBond

Takes an input #Address and a type-0x19 input buffer containing a #TransportType, no output.

[9.0.0+] Now only takes an #Address and a #TransportType without a buffer, no output.

RemoveBond

Takes an input #Address, no output.

CancelBond

Takes an input #Address, no output.

RespondToPinRequest

Takes an input #Address, a bool, an u8, a #BluetoothPinCode, no output.

sdknso uses an user-specified s32 for the u8.

RespondToSspRequest

Takes an input #Address, a #BluetoothSspVariant, a bool, an u32, no output.

GetEventInfo

Takes a type-0xA output buffer and returns an output #EventType.

InitializeHid

Takes an input u16, returns an output Event with EventClearMode=1.

Originally sdknso used an user-specified value for the u16, however with [9.0.0+] it uses hard-coded value 0x1 instead.

OpenHidConnection

Takes an input #Address, no output.

CloseHidConnection

Takes an input #Address, no output.

HidSendData

Takes an input #Address and a type-0x19 input buffer containing a #HidData, no output.

WriteHidData

Takes an input #Address and a type-0x19 input buffer containing a #HidReport, no output.

WriteHidData2

Takes an input #Address and a type-0x9 input buffer, no output.

This is internally the same as #WriteHidData, with the input buffer being directly passed to the funcptr instead of a tmp copy of the input #HidReport.

HidSetReport

Takes an input #Address, a #BluetoothHhReportType, a type-0x19 input buffer containing a #HidData, no output.

SetHidReport

Takes an input #Address, a #BluetoothHhReportType, a type-0x19 input buffer containing a #HidReport, no output.

GetHidReport

Takes an input #Address, an u8, a #BluetoothHhReportType, no output.

HidWakeController

Takes an input #Address, no output.

TriggerConnection

Takes an input #Address and an u16, no output.

AddPairedDeviceInfo

Takes a type-0x19 input buffer containing BluetoothDevicesSettings, no output.

GetPairedDeviceInfo

Takes an input #Address and a type-0x1A output buffer containing BluetoothDevicesSettings.

FinalizeHid

No input/output.

GetHidEventInfo

Takes a type-0xA output buffer, returns an output #HidEventType.

This copies 0x480-bytes from state to the output buffer. #HidEventType is set to: stateval!=0 ? 7 : 0.

SetTsi

Takes an input #Address and an u8, no output.

EnableBurstMode

Takes an input #Address and a bool, no output.

SetZeroRetransmission

Takes an input #Address and a type-0x9 input buffer containing an array of u8s, no output.

EnableMcMode

Takes an input bool, no output.

EnableLlrScan

No input/output.

DisableLlrScan

No input/output.

EnableRadio

Takes an input bool, no output.

SetVisibility

Takes two input bools, no output.

EnableTbfcScan

Takes an input bool, no output.

RegisterHidReportEvent

No input, returns an output Event handle with EventClearMode=1.

GetHidReportEventInfo

No input, takes a type-0xA output buffer and returns a #HidEventType.

[7.0.0+] No longer takes a buffer or returns output, now returns an output sharedmem handle. sdknso maps this with size=0x3000 and permissions=RW-.

Originally this was used in a dedicated sdknso func, with [7.0.0+] this is now used at the start of the sdknso impl for #RegisterHidReportEvent if the above sharedmem was not mapped yet.

The [7.0.0+] GetHidReportEventInfo sdknso func loads data using the above sharedmem.

GetLatestPlr

Takes a type-0x16 output buffer containing a #PlrList ([1.0.0-8.1.1] #PlrStatistics).

GetPendingConnections

No input/output.

GetChannelMap

Takes a type-0x16 output buffer containing a #ChannelMapList.

EnableTxPowerBoostSetting

Takes an input bool, no output.

IsTxPowerBoostSettingEnabled

No input, returns an output bool.

sdknso sets the tmpout_bool to 1, and uses that with the cmd. The sdknso func directly returns tmpout_bool, errors from the cmd are ignored.

EnableAfhSetting

Takes an input bool, no output.

IsAfhSettingEnabled

sdknso sets the tmpout_bool to 1, and uses that with the cmd. The sdknso func directly returns tmpout_bool, errors from the cmd are ignored.

InitializeBle

No input, returns an output Event handle with EventClearMode=1.

EnableBle

No input/output.

DisableBle

No input/output.

FinalizeBle

No input/output.

SetBleVisibility

Takes two input bools, no output.

SetLeConnectionParameter

Takes a #LeConnectionParams, no output.

SetBleConnectionParameter

Takes an input #Address, a bool, a #BleConnectionParameter, no output.

SetLeDefaultConnectionParameter

Takes a #LeConnectionParams, no output.

SetBleDefaultConnectionParameter

Takes a #BleConnectionParameter, no output.

SetBleAdvertiseData

Takes an input #BleAdvertisePacketData, no output.

SetBleAdvertiseParameter

Takes an input #Address, two u16s, no output.

StartBleScan

No input/output.

StopBleScan

No input/output.

AddBleScanFilterCondition

Takes a type-0x19 input buffer containing a #BleAdvertiseFilter, no output.

DeleteBleScanFilterCondition

Takes a type-0x19 input buffer containing a #BleAdvertiseFilter, no output.

DeleteBleScanFilter

Takes an input u8, no output.

Originally the sdknso func used an u8 for the user-specified param, with [9.0.0+] it's a s32.

ClearBleScanFilters

No input/output.

EnableBleScanFilter

Takes an input bool, no output.

RegisterGattClient

Takes an input #GattAttributeUuid, no output.

UnregisterGattClient

Takes an input u8, no output.

UnregisterAllGattClients

No input/output.

ConnectGattServer

Takes an input u8, an #Address, a bool, an AppletResourceUserId, no output.

CancelConnectGattServer

Takes an input u8, an #Address, a bool, no output.

DisconnectGattServer

Takes an input u32, no output.

GetGattAttribute

Takes an #Address and an u32, no output.

[9.0.0+] Now takes an input u32, no output.

GetGattService

Takes an input u32 and a #GattAttributeUuid, no output.

ConfigureAttMtu

Takes an input u16 and u32, no output.

RegisterGattServer

Takes an input #GattAttributeUuid, no output.

UnregisterGattServer

Takes an input u8, no output.

ConnectGattClient

Takes an input u8, an #Address, a bool, no output.

LeServerDisconnect

Takes an input u8, an #Address, no output.

DisconnectGattClient

Takes an input u8, no output.

AddGattService

Takes an input u8, an u8, a bool, a #GattAttributeUuid, no output.

Originally sdknso used an user-specified u8 for the second u8, with [9.0.0+] that func param is now a s32.

EnableGattService

Takes an input u8, a #GattAttributeUuid, no output.

AddGattCharacteristic

Takes an input u8, an u8, an u16, a #GattAttributeUuid, a #GattAttributeUuid, no output.

AddGattDescriptor

Takes an input u8, an u16, a #GattAttributeUuid, a #GattAttributeUuid, no output.

GetBleManagedEventInfo

Takes a type-0xA output buffer, returns an output #BleEventType.

This copies 0x400-bytes from state to the output buffer, and copies the #BleEventType from state to output.

GetGattFirstCharacteristic

Takes an input bool, an u32, a #GattId, a #GattAttributeUuid, returns an output u8 and #GattId.

GetGattNextCharacteristic

Takes an input bool, an u32, a #GattId, a #GattId, a #GattAttributeUuid, returns an output u8 and #GattId.

GetGattFirstDescriptor

Takes an input bool, an u32, a #GattId, a #GattId, a #GattAttributeUuid, returns an output #GattId.

GetGattNextDescriptor

Takes an input bool, an u32, a #GattId, a #GattId, a #GattId, a #GattAttributeUuid, returns an output #GattId.

RegisterGattManagedDataPath

Takes an input #GattAttributeUuid, no output.

UnregisterGattManagedDataPath

Takes an input #GattAttributeUuid, no output.

RegisterGattHidDataPath

Takes an input #GattAttributeUuid, no output.

UnregisterGattHidDataPath

Takes an input #GattAttributeUuid, no output.

RegisterGattDataPath

Takes an input #GattAttributeUuid, no output.

UnregisterGattDataPath

Takes an input #GattAttributeUuid, no output.

ReadGattCharacteristic

Takes an input bool, an u8, an u32, a #GattId, a #GattId, no output.

ReadGattDescriptor

Takes an input bool, an u8, an u32, a #GattId, a #GattId, a #GattId, no output.

WriteGattCharacteristic

Takes a type-0x9 input buffer, a bool, an u8, a bool, an u32, a #GattId, a #GattId, no output.

WriteGattDescriptor

Takes a type-0x9 input buffer, a bool, an u8, an u32, a #GattId, a #GattId, a #GattId, no output.

RegisterGattNotification

Takes an input bool, an u32, a #GattId, a #GattId, no output.

UnregisterGattNotification

Takes an input bool, an u32, a #GattId, a #GattId, no output.

GetLeHidEventInfo

Takes a type-0xA output buffer, returns an output #BleEventType.

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.

RegisterBleHidEvent

No input, returns an output Event handle with EventClearMode=1.

SetBleScanParameter

Takes two input u16s, no output.

MoveToSecondaryPiconet

Takes an input #Address, no output.

IsManufacturingMode

No input, returns an output bool.

EmulateBluetoothCrash

Takes an input #FatalReason, no output.

sdknso masks the FatalReason with an u16-mask before passing it to the cmd.

GetBleChannelMap

Takes a type-0x16 output buffer containing a #ChannelMapList.

bt

This is "nn::bluetooth::IBluetoothUser".

Cmd Name
0 #LeClientReadCharacteristic
1 #LeClientReadDescriptor
2 #LeClientWriteCharacteristic
3 #LeClientWriteDescriptor
4 #LeClientRegisterNotification
5 #LeClientDeregisterNotification
6 #SetLeResponse
7 #LeSendIndication
8 #GetLeEventInfo
9 #RegisterBleEvent

LeClientReadCharacteristic

Takes a PID, a bool, an u8, an u32, a #GattId, a #GattId, an AppletResourceUserId, no output.

LeClientReadDescriptor

Takes a PID, a bool, an u8, an u32, a #GattId, a #GattId, a #GattId, an AppletResourceUserId, no output.

LeClientWriteCharacteristic

Takes a PID, a type-0x9 input buffer, a bool, an u8, a bool, an u32, a #GattId, a #GattId, an AppletResourceUserId, no output.

LeClientWriteDescriptor

Takes a PID, a type-0x9 input buffer, a bool, an u8, an u32, a #GattId, a #GattId, a #GattId, an AppletResourceUserId, no output.

LeClientRegisterNotification

Takes a PID, an input bool, an u32, a #GattId, a #GattId, an AppletResourceUserId, no output.

LeClientDeregisterNotification

Takes a PID, an input bool, an u32, a #GattId, a #GattId, an AppletResourceUserId, no output.

SetLeResponse

Takes a PID, a type-0x9 input buffer, an u8, a #GattAttributeUuid, a #GattAttributeUuid, an AppletResourceUserId, no output.

LeSendIndication

Takes a PID, a type-0x9 input buffer, an u8, a bool, a #GattAttributeUuid, a #GattAttributeUuid, an AppletResourceUserId, no output.

GetLeEventInfo

Takes a PID, a type-0xA output buffer, an AppletResourceUserId, returns an output #BleEventType.

This is identical to #GetLeHidEventInfo except different state is used.

RegisterBleEvent

Takes a PID, an AppletResourceUserId, returns an output Event handle with EventClearMode=1.

BluetoothPropertyType

This is u32 enum "nn::bluetooth::BluetoothPropertyType".

TransportType

This is u32 enum "nn::bluetooth::TransportType".

BluetoothSspVariant

This is u8 enum "nn::bluetooth::BluetoothSspVariant".

EventType

This is u32 enum "nn::bluetooth::EventType".

BluetoothHhReportType

This is u32 enum "nn::bluetooth::BluetoothHhReportType".

HidEventType

This is u32 enum "nn::bluetooth::HidEventType".

BleEventType

This is u32 enum "nn::bluetooth::BleEventType".

FatalReason

This is u32 enum "nn::bluetooth::FatalReason".

AdapterProperty

This is "nn::bluetooth::AdapterProperty". This is a 0x103-byte struct.

Address

This is "nn::bluetooth::Address". This is a 0x6-byte struct with 1-byte alignment.

BluetoothPinCode

This is "nn::bluetooth::BluetoothPinCode". This is a 0x10-byte struct with 1-byte alignment.

HidData

This is "nn::bluetooth::HidData". This is a 0x282-byte struct.

Offset Size Description
0x0 0x2 Size of the following data.
0x2 0x280 Data

HidReport

This is "nn::bluetooth::HidReport". This is a 0x2BE-byte struct.

Offset Size Description
0x0 0x2 Size of the following data.
0x2 0x2BC Data

PlrStatistics

This is "nn::bluetooth::PlrStatistics". This is a 0x84-byte struct.

PlrList

This is "nn::bluetooth::PlrList". This is a 0xA4-byte struct.

ChannelMapList

This is "nn::bluetooth::ChannelMapList". This is a 0x88-byte struct.

LeConnectionParams

This is "nn::bluetooth::LeConnectionParams". This is a 0x14-byte struct with 2-byte alignment.

BleConnectionParameter

This is "nn::bluetooth::BleConnectionParameter". This is a 0xC-byte struct with 2-byte alignment.

BleAdvertisePacketData

This is "nn::bluetooth::BleAdvertisePacketData" ([5.0.0-8.1.1] "nn::bluetooth::LeAdvertiseData"). This is a 0xCC-byte struct.

BleAdvertiseFilter

This is "nn::bluetooth::BleAdvertiseFilter". This is a 0x3E-byte struct.

GattAttributeUuid

This is "nn::bluetooth::GattAttributeUuid". This is a 0x14-byte struct with 4-byte alignment.

GattId

This is "nn::bluetooth::GattId". This is a 0x18-byte struct with 4-byte alignment.