BTM services: Difference between revisions
No edit summary |
|||
Line 166: | Line 166: | ||
== SetSlotMode == | == SetSlotMode == | ||
Takes a type-0x19 input buffer containing a [[#DeviceSlotModeList]], no output. | Takes a type-0x19 input buffer containing a [[#DeviceSlotModeList]], no output. | ||
Sends a request which is then handled as follows: | |||
* Calls a func for getting the data from [[#DeviceSlotModeList]] etc for passing to another func, that func then does the following: | |||
* Goes through multiple arrays of [[#BdAddress|BdAddress]]. | |||
** First array: | |||
*** Validates the [[#BdAddress|BdAddress]] with state, skipping it if not found. | |||
*** Calls the SetTsi wrapper func described below, with the above [[#BdAddress|BdAddress]] and tsi=0xFF (Exit). If this returns false, [[Bluetooth_Driver_services#CloseHidConnection|CloseHidConnection]] is used with the [[#BdAddress|BdAddress]]. | |||
** Second array: | |||
*** Validates the [[#BdAddress|BdAddress]] with state, skipping it if not found. | |||
*** Uses [[Bluetooth_Driver_services#SetBleConnectionParameter|SetBleConnectionParameter]] with bool=true. Then the required EventInfo is loaded, {...}. | |||
** Then it goes through the first array again, except here it does the following: | |||
*** Calls the same func for validating the [[#BdAddress|BdAddress]] with state, skipping it if not found. It is also skipped if the u32 at Address+0x8 is value 0x3. | |||
*** Determines what Tsi value to use, on failure [[Bluetooth_Driver_services#CloseHidConnection|CloseHidConnection]] is used and the loop is continued. | |||
*** Calls the SetTsi wrapper func described below, with the [[#BdAddress|BdAddress]] and the above Tsi value. If this returns false, [[Bluetooth_Driver_services#CloseHidConnection|CloseHidConnection]] is used with the [[#BdAddress|BdAddress]]. | |||
** It then goes through various arrays again for updating state. | |||
** {...} | |||
The SetTsi wrapper func is implemented as follows: | |||
* Uses [[Bluetooth_Driver_services#SetTsi|SetTsi]], on failure true is returned. | |||
* Gets the required EventInfo, returning false if a match wasn't found / EventInfo status indicates failure. True is returned for success. | |||
== SetBluetoothMode == | == SetBluetoothMode == | ||
Line 391: | Line 411: | ||
Takes a 0x44-byte input struct, no output. | Takes a 0x44-byte input struct, no output. | ||
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]]. | |||
The input struct has the following structure: | |||
{| 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 == | == Cmd62 == |