MMasmoudi
MMasmoudi

Reputation: 550

Strange BLE connection state

Sometimes, the onConnectionStateChange() callback is called with status 22.
It is said to be a "Bond" error.

But what could be the cause behind it?
And how to avoid it?

Upvotes: 1

Views: 2072

Answers (1)

Emil
Emil

Reputation: 18497

22 just means "connection terminated by local host" (defined by the Bluetooth specification). Some examples why the host terminates:

  1. You call disconnect().
  2. The GATT timer times out, which happens if the remote device doesn't respond to a request in 30 seconds.
  3. The SMP timer times out, which happens if the pairing process doesn't make any progress in 30 seconds.

Upvotes: 4

Related Questions