question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bonding best practices

See original GitHub issue

I needed to initiate a bond with a peripheral using “Just Works” bonding. This means no exchange of a PIN. I got it to work by simply grabbing the underlying BluetoothDevice and calling createBond(), but I wanted to check to see if this is somehow wrong, and I should be doing something else, or in a more idiomatic way.

val device: RxBleDevice = bluetoothService.getBleDevice(selectedDevice.macAddress)

Observable.fromCallable<RxBleDevice> {
	device.bluetoothDevice.createBond()
	device
}
.flatMap {
	it.establishConnection(false)
}
.doOnNext {
	Timber.e("Connection established.")
}
...

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
craigzourcommented, May 10, 2018

Hello,

Here is a way to implement pairing/bonding with RxAndroidBle. It might be useful for people having to deal with that process.

https://gist.github.com/craigzour/edf7f3bd8bef4b162887b4244e27dc1f

2reactions
dglozanocommented, Nov 22, 2018

I came up with a slightly different helper class based on @craigzour solution. The main difference is that in Craig’s solution, the completable completed successfully if the device was already bonded. In my case, that wasn’t useful, because when I try to read or write the first characteristic to be encrypted, the operation failed anyway. To avoid that, I always unbond and bond again before establishing the connection, so I added an unbonding operation before.

https://gist.github.com/dglozano/9b0ce38a558eeca16137909bd368698c

Read more comments on GitHub >

github_iconTop Results From Across the Web

Linux Channel Bonding Best Practices and Recommendations
This white paper describes channel bonding configurations on different Linux distributions on IBM® Z, and explains the recommended options for the Linux  ......
Read more >
Best Practice in Adhesive Bonding
Outline of service experience with bonded structures and repairs. • Identify safety critical issues. • Major cause of bond failure.
Read more >
7.7. Using Channel Bonding Red Hat Enterprise Linux 7
1. Bonding Module Directives. It is a good idea to test which channel bonding module parameters work best for your bonded interfaces before...
Read more >
Best Practices for Industrial Structural Adhesives - LORD Corp
Joint configuration should be designed so that the basic stress is primarily shear. Tensile, or compressive with cleavage, and peel stresses should be...
Read more >
networking:bonding [Wiki]
A value of 100 is a good starting point. ... There are, essentially, two methods for configuring bonding: with support from the distro's ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found