https://kotlinlang.org logo
#juul-libraries
Title
# juul-libraries
r

Ruyman

10/19/2021, 9:12 AM
hi guys! I can't find a way for getting notified (maybe in the connection state) when the OS request a pairing process with a bluetooth device, do you know if it's possible? I have a bluetooth module with encryption enabled and before to handle any communication, I need to do a pair with the device.
t

travis

10/24/2021, 1:14 AM
Sorry, I'm not familiar with the process you're describing. Are you referring to "pairing" with a device through Android settings?
r

Ruyman

10/25/2021, 7:15 AM
Well, once you try to connect with a bt module with data encryption, the android OS will show you a popup for "creating a bond" between the mobile and the bt device. Sometimes the bond that you can see in the bluetooth android settings, can be deleted by the OS due to a failed handshake. So, a way to know if the device is bounded or not, is to take a look to the BluetoothDevice inside the package android.bluetooth.le and see if the state is NONE, BOND, BONDING
this is the popup
t

travis

10/25/2021, 7:54 AM
I'm not super familiar with bonding, so I can't say for certain how tightly this needs to be integrated into Kable itself. In other words, I'm not sure if you can handle bonding outside of Kable then hand off the
BluetoothDevice
to Kable after bonding. As Kable does not currently have any internal support for bonding. This feature has been requested: https://github.com/JuulLabs/kable/issues/111 I just haven't had the time to work on it yet.
r

Ruyman

10/25/2021, 9:16 AM
I will subscribe to the issue because I think is related to what I was saying, thanks!!
👍 1
2 Views