OSDN Git Service

Gracefully recover on bad attempt to cancel LE connection
authorJakub Pawlowski <jpawlowski@google.com>
Thu, 22 Mar 2018 01:46:14 +0000 (18:46 -0700)
committerJakub Pawlowski <jpawlowski@google.com>
Thu, 22 Mar 2018 20:05:41 +0000 (20:05 +0000)
commitb0a9f9f23f7405bc088695e1d91763aced70b9fd
treecf2454c0a65e76a39727b01cb97de8df6d186d2c
parent9d73f984efd16d894bd0bcc2bb3a3871778ab898
Gracefully recover on bad attempt to cancel LE connection

According to logs some devices are stuck when in BLE_CONN_CANCEL state.
That is they sent "LE Create Connection Cancel" request, and are
awaiting "LE Connection Complete" event with invalid handle forever.
But they wait and wait, and the event never arrive. That's because
"LE Create Connection Cancel" was sent, when connection attempt is not
pending. In such case, we should act upon command complete status, and
decide to leave BLE_CONN_CANCEL state.

To properly fix this issue, one would have to implement a proper queue
for managing LE connection attempt state, preferably for scratch. This
fix just give option of graceful recovery.

Test: sl4a GattConnectTest
Bug: 75290221
Change-Id: I7e7a377c789ac0a587390320fbf504267cca8727
stack/btm/btm_ble_bgconn.cc
stack/btm/btm_int.h
stack/btu/btu_hcif.cc