BTM services: Difference between revisions

No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 40: Line 40:
| 12 || [[#IncreaseDeviceInfoOrder]]
| 12 || [[#IncreaseDeviceInfoOrder]]
|-
|-
| 13 || [[#LlrNotify]]
| 13 || [9.0.0+] TriggerConnection ([1.0.0-8.1.1] [[#LlrNotify]])
|-
|-
| 14 || [[#EnableRadio]]
| 14 || [[#EnableRadio]]
Line 52: Line 52:
| 18 || [2.0.0+] [[#AcquireAwakeReqEvent]]
| 18 || [2.0.0+] [[#AcquireAwakeReqEvent]]
|-
|-
| 19 || [4.0.0+] [[#AcquireLlrStateEvent]]
| 19 || [9.0.0+] AcquireConnectionTriggerEvent ([4.0.0-8.1.1] [[#AcquireLlrStateEvent]])
|-
|-
| 20 || [4.0.0+] [[#IsLlrStarted]]
| 20 || [9.0.0+] IsConnectionTriggered ([4.0.0-8.1.1] [[#IsLlrStarted]])
|-
|-
| 21 || [4.0.0+] [[#EnableSlotSaving]]
| 21 || [4.0.0+] [[#EnableSlotSaving]]
Line 134: Line 134:
| 59 ([5.0.0-5.0.2] 42) || [5.0.0+] [[#SetAppletResourceUserId]]
| 59 ([5.0.0-5.0.2] 42) || [5.0.0+] [[#SetAppletResourceUserId]]
|-
|-
| 60 || [8.0.0+]  
| 60 || [8.0.0+] [[#AcquireBleConnectionParameterUpdateEvent]]
|-
|-
| 61 || [8.0.0+]  
| 61 || [8.0.0+] [[#SetCeLength]]
|-
|-
| 62 || [9.0.0+]  
| 62 || [9.0.0+] [[#EnsureSlotExpansion]]
|-
|-
| 63 || [9.0.0+]  
| 63 || [9.0.0+] [[#IsSlotExpansionEnsured]]
|-
|-
| 64 || [10.0.0+]  
| 64 || [10.0.0+] [[#CancelConnectionTrigger]]
|-
|-
| 65 || [13.0.0+]  
| 65 || [13.0.0+] GetConnectionCapacity
|-
|-
| 66 || [13.0.0+]  
| 66 || [13.0.0+] GetWlanMode
|-
|-
| 67 || [13.0.0+]  
| 67 || [13.0.0+] IsSlotSavingEnabled
|-
|-
| 68 || [13.0.0+]  
| 68 || [13.0.0+] IsSlotSavingForPairingEnabled
|-
|-
| 69 || [13.0.0+] AcquireAudioDeviceConnectionEvent
| 69 || [13.0.0+] AcquireAudioDeviceConnectionEvent
Line 156: Line 156:
| 70 || [13.0.0+] GetConnectedAudioDevices
| 70 || [13.0.0+] GetConnectedAudioDevices
|-
|-
| 71 || [13.0.0+]  
| 71 || [13.0.0+] SetAudioSourceVolume
|-
|-
| 72 || [13.0.0+]  
| 72 || [13.0.0+] GetAudioSourceVolume
|-
|-
| 73 || [13.0.0+] RequestAudioDeviceConnectionRejection
| 73 || [13.0.0+] RequestAudioDeviceConnectionRejection
Line 166: Line 166:
| 75 || [13.0.0+] GetPairedAudioDevices
| 75 || [13.0.0+] GetPairedAudioDevices
|-
|-
| 76 || [13.1.0+]  
| 76 || [13.1.0+] SetWlanModeWithOption
|-
|-
| 100 || [13.0.0+]  
| 100 || [13.0.0+] AcquireConnectionDisallowedEvent
|-
|-
| 101 || [13.0.0+]  
| 101 || [13.0.0+] GetUsecaseViolationFactor
|-
|-
| 110 || [13.0.0+] GetShortenedDeviceInfo
| 110 || [13.0.0+] GetShortenedDeviceInfo
|-
|-
| 111 || [13.0.0+]  
| 111 || [13.0.0+] AcquirePairingCountUpdateEvent
|-
|-
| 112 || [14.0.0-14.1.2]  
| 112 || [14.0.0-14.1.2]  
Line 180: Line 180:
| 113 || [14.0.0-14.1.2]  
| 113 || [14.0.0-14.1.2]  
|-
|-
| 114 || [14.0.0+]  
| 114 || [14.0.0+] IsFirstAudioControlConnection
|-
|-
| 115 || [14.0.0+] GetShortenedDeviceCondition
| 115 || [14.0.0+] GetShortenedDeviceCondition
|-
|-
| 116 || [15.0.0+]  
| 116 || [15.0.0+] SetAudioSinkVolume
|-
|-
| 117 || [15.0.0+]  
| 117 || [15.0.0+] GetAudioSinkVolume
|}
|}


Line 479: Line 479:
Takes an input [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]]. No output.
Takes an input [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]]. No output.


== Cmd60 ==
== AcquireBleConnectionParameterUpdateEvent ==
No input. Returns an output Event handle with EventClearMode=1.
No input. Returns an output Event handle with EventClearMode=1.


== Cmd61 ==
== SetCeLength ==
Takes a 0x44-byte input struct. No output.
Takes an input [[#DeviceCeLengthList|DeviceCeLengthList]]. No output.


Sends a request which is then handled as follows:
Sends a request which is then handled as follows:
* Calls a func for getting the data from the input struct etc for passing to another func, that func is the same one called by [[#SetSlotMode]].
* Calls a func for getting the data from the input struct etc for passing to another func, that func is the same one called by [[#SetSlotMode]].


The input struct has the following structure:
== EnsureSlotExpansion ==
 
{| class="wikitable" border="1"
|-
! Offset
! Size
! Description
|-
| 0x0 || 0x10 * 4 || Array of the below struct.
|-
| 0x40 || 0x4 || s32 count, for the array at +0.
|}
 
Struct for the above array:
 
{| class="wikitable" border="1"
|-
! Offset
! Size
! Description
|-
| 0x0 || 0x6 || [[#BdAddress|BdAddress]]
|-
| 0x6 || 0x6 || Unused
|-
| 0xC || 0x1 || Used to determine data which is then used for [[Bluetooth_Driver_services#BleConnectionParameter|BleConnectionParameter]].
|-
| 0xD || 0x3 || Padding
|}
 
== Cmd62 ==
Takes an input bool. No output.
Takes an input bool. No output.


Sends a request which is handled as follows: writes the flag into state if needed.
Sends a request which is handled as follows: writes the flag into state if needed.


== Cmd63 ==
== IsSlotExpansionEnsured ==
No input. Returns an output bool.
No input. Returns an output bool.


This gets the flag used by [[#Cmd62]].
This gets the flag used by [[#EnsureSlotExpansion]].


== Cmd64 ==
== CancelConnectionTrigger ==
No input/output.
No input/output.


Line 537: Line 507:


This has max_sessions 6. IPC is handled by 2 threads shared with all services.
This has max_sessions 6. IPC is handled by 2 threads shared with all services.
[12.0.0+] Cmds input/output were changed / cmdids were moved around.
[13.0.0+] Cmd4 now takes a type-0xA output buffer, returns a total of 4-bytes of output.


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 552: Line 518:
| 2 || [[#CancelDiscovery]]
| 2 || [[#CancelDiscovery]]
|-
|-
| 3 || [[#GetDeviceProperty]]
| 3 || [12.0.0+] IsDiscoveryEnabled ([1.0.0-11.0.1] [[#GetDeviceProperty]])
|-
|-
| 4 || [[#CreateBond]]
| 4 || [[#CreateBond]]
Line 572: Line 538:
| 12 || [5.1.0+] [[#GetBleConnectionParameterRequest]]
| 12 || [5.1.0+] [[#GetBleConnectionParameterRequest]]
|-
|-
| 13 || [12.0.0+]
| 13 || [12.0.0+] GetDiscoveredDevice
|-
|-
| 14 || [15.0.0+]
| 14 || [15.0.0+] SleepAwakeLoopTest
|-
|-
| 15 || [15.0.0+]
| 15 || [15.0.0+] SleepTest
|-
|-
| 16 || [15.0.0+]
| 16 || [15.0.0+] MinimumAwakeTest
|-
|-
| 17 || [15.0.0+]
| 17 || [15.0.0+] ForceEnableBtm
|}
|}


Line 599: Line 565:
== CreateBond ==
== CreateBond ==
Takes an input [[#BdAddress|BdAddress]]. No output.
Takes an input [[#BdAddress|BdAddress]]. No output.
[13.0.0+] Now takes a type-0xA output buffer, returns a total of 4-bytes of output.


== CancelBond ==
== CancelBond ==
Line 759: Line 727:
| 0 || [[#AcquireBleScanEvent_2|AcquireBleScanEvent]]
| 0 || [[#AcquireBleScanEvent_2|AcquireBleScanEvent]]
|-
|-
| 1 || [[#GetBleScanFilterParameter]]
| 1 || [[#GetBleScanFilterParameter|GetBleScanFilterParameter]]
|-
|-
| 2 || [[#GetBleScanFilterParameter2]]
| 2 || [[#GetBleScanFilterParameter2|GetBleScanFilterParameter2]]
|-
|-
| 3 || [[#StartBleScanForGeneral_2|StartBleScanForGeneral]]
| 3 || [[#StartBleScanForGeneral_2|StartBleScanForGeneral]]
Line 793: Line 761:
| 23 || [[#BleUnPairDevice_2|BleUnPairDevice]]
| 23 || [[#BleUnPairDevice_2|BleUnPairDevice]]
|-
|-
| 24 || [[#BleUnPairDevice2]]
| 24 || [[#BleUnPairDevice2|BleUnPairDevice2]]
|-
|-
| 25 || [[#BleGetPairedDevices]]
| 25 || [[#BleGetPairedDevices|BleGetPairedDevices]]
|-
|-
| 26 || [[#AcquireBleServiceDiscoveryEvent_2|AcquireBleServiceDiscoveryEvent]]
| 26 || [[#AcquireBleServiceDiscoveryEvent_2|AcquireBleServiceDiscoveryEvent]]
Line 805: Line 773:
| 29 || [[#GetGattIncludedServices_2|GetGattIncludedServices]]
| 29 || [[#GetGattIncludedServices_2|GetGattIncludedServices]]
|-
|-
| 30 || [[#GetBelongingGattService]]
| 30 || [[#GetBelongingGattService|GetBelongingGattService]]
|-
|-
| 31 || [[#GetGattCharacteristics_2|GetGattCharacteristics]]
| 31 || [[#GetGattCharacteristics_2|GetGattCharacteristics]]
Line 1,344: Line 1,312:
|-
|-
| 0x1 || 0x29 * 15 || Array of [[#DeviceProperty|DeviceProperty]]
| 0x1 || 0x29 * 15 || Array of [[#DeviceProperty|DeviceProperty]]
|}
= DeviceCeLength =
This is "nn::btm::DeviceCeLength". This is a 0x10-byte struct.
{| class="wikitable" border="1"
|-
! Offset
! Size
! Description
|-
| 0x0 || 0x6 || [[#BdAddress|BdAddress]]
|-
| 0x6 || 0x6 || Reserved
|-
| 0xC || 0x1 || CeLength (used for [[Bluetooth_Driver_services#BleConnectionParameter|BleConnectionParameter]])
|-
| 0xD || 0x3 || Reserved
|}
= DeviceCeLengthList =
This is "nn::btm::DeviceCeLengthList". This is a 0x44-byte struct.
{| class="wikitable" border="1"
|-
! Offset
! Size
! Description
|-
| 0x0 || 0x10 * 4 || Array of [[#DeviceCeLength|DeviceCeLength]]
|-
| 0x40 || 0x4 || DeviceCount
|}
|}