Fix race condition around Le Start Encryption handling.
When sending Le Start Encryption, it's possible that at the same exact moment the connection was disconnected, and there is an incoming "Disconnection Complete Event". The controller would send error 0x02 "unknown connection identifier" in such case. This can happen sporadically when reconnecting device multiple times. Currently, we don't handle this error code. This lead to the timeout when waiting for "Encryption Complete", and unbonding of the device. From now on, if 0x02 error code is returned, we'll cancel current SMP operation, which is the "LE Start Encryption". This will stop the SMP timer, and make sure the bond to remote device is not lost. Test: Manual test reconnecting with HID device multiple time in a row, causing the link drop right after connection, by removing battery, or closing the shield box. Bug: 113652889 Change-Id: I2ff9c13dbc8e7b71505908996e26b89fa1ea6a42
Loading
Please register or sign in to comment