BTM services: Difference between revisions

No edit summary
Line 390: Line 390:
== Cmd61 ==
== Cmd61 ==
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:
* Goes through multiple arrays of [[Bluetooth_Driver_services#Address|Address]].
** First array:
*** Validates the [[Bluetooth_Driver_services#Address|Address]] with state, skipping it if not found.
*** Calls the SetTsi wrapper func described below, with the above [[Bluetooth_Driver_services#Address|Address]] and tsi=0xFF (Exit). If this returns false, [[Bluetooth_Driver_services#CloseHidConnection|CloseHidConnection]] is used with the [[Bluetooth_Driver_services#Address|Address]].
** Second array:
*** Validates the [[Bluetooth_Driver_services#Address|Address]] 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 [[Bluetooth_Driver_services#Address|Address]] 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 [[Bluetooth_Driver_services#Address|Address]] and the above Tsi value. If this returns false, [[Bluetooth_Driver_services#CloseHidConnection|CloseHidConnection]] is used with the [[Bluetooth_Driver_services#Address|Address]].
** 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.


== Cmd62 ==
== Cmd62 ==