Skip to content

Support bonding callsbacks and retrying bondings

Scott James Remnant linux-bluetooth 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 2 repliesIn review
  2. v24 patches 5 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4Add support for retrying a bondingsrc/adapter.c src/device.c src/device.h+16 -10 replies
2/4plugin: Add bonding callback support for pluginssrc/device.c src/device.h+27 -04 replies
3/4bonding: retry if callback returns TRUEsrc/device.c+46 -00 replies
4/4bonding: call plugin callback on cancellationsrc/device.c+10 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCHv3 0/4] Support bonding callsbacks and retrying bondings

Rationale: in many pairing scenarios, it's desirable to be automatically provide a PIN (either generated or fixed) for a device and only involve the user if that PIN is rejected by the host.

Both GNOME Bluetooth and Android handle this inside their Agent which means each deployment has to implement its own code to do the same thing. These patches allow this behavior to be common by moving it into BlueZ.

This patch set adds plugin support for a callback called when bonding of a device successfully completes, fails, or is cancelled. In the success and failure cases, the callback may return TRUE to cause the bonding to be retried after a short backoff period.

Backoff drops the ACL connection and reopens again later, this is not only cleaner to implement in the bluetoothd code itself, but matches the behavior of both Android (which implements this in its Agent) and OS X, so is more likely to be compatible with devices out there even though we could theoretically hold the ACL link open.

btsnoop of OS X performing PIN generation and falling back to PIN can be seen here:

http://chromium-os.googlecode.com/issues/attachment?aid=280220006001&
name=BT+Motorola+Wireless+Keyboard.cfa& token=SA_vDEsF87_CU-BcqJ1C8bWd6Zk%3A1333665473760

Scott James Remnant (4):
Add support for retrying a bonding
plugin: Add bonding callback support for plugins
bonding: retry if callback returns TRUE
bonding: call plugin callback on cancellation

 src/adapter.c |    2 +-
 src/device.c  |   89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/device.h  |    9 ++++++
 3 files changed, 99 insertions(+), 1 deletions(-)
Signature · 1 line
1.7.7.3