I'm very new to bluetooth, so forgive my ignorance...
# juul-libraries
e
I'm very new to bluetooth, so forgive my ignorance. So far, this library has been very helpful but I'm trying to understand peripheral state. So far, peripheral.connect seems to enable the firing of the OS pair dialog if a device hasn't been paired. However, if you never click to accept the pair, State.Connected will still be reported. So, it seems like State.Connected doesn't actually concern itself with the status of pairing. So, is there a common way that people check if a device has been paired? Sorry if I'm misunderstanding the basics.
t
Which OS (platform) are you trying to work with?
e
Sorry, Android
My bluetooth device self reports whether it requires pairing or not, so I can ultimately just check that once I'm connected but I was curious how this is typically handled
t
It sounds like you're describing BLE bonding? If so, then it isn't yet supported in Kable: https://github.com/JuulLabs/kable/issues/111
I haven't worked with the OS pair dialog. We've always scanned for advertisements and connected via that mechanism, so I'm not super familiar with the pairing dialog. If that isn't bonding, then let me know and I can look into it further why it may be misreporting connection state.
e
I'm working to understand the difference between bonding and pairing so, I'll get into it more tonight. I'll talk to the firmware team and see what they say, as well. Thanks for the help!
So, as of right now, this does not seem to be bonding. I'm about to read the BLE spec for this device but bonding seems to be a permanent exchange of keys, which it doesn't seem like this device does unless the OS is obfuscating it away. Instead, this device seems to only require pairing, which does pop a dialog that doesn't require that you enter a key. However, if you don't click Pair on the dialog, you can't establish a connection to the bluetooth device's limited functionality. So, this device lets you do some things in open mode (prior to pairing) like get the mac address but won't let you write to characteristics, for example. So, State.Connected disregards the paired dialog and reports connected, which might not even be fundamentally wrong
I take back everything I said after speaking with the firmware team. They use pairing and bonding interchangeably but the auth mode actually is "bond" in the firmware. So, you're right it is bonding
Interestingly, the OS isn't asking me to type in anything in the Pair dialog, which is part of what confused me
t
Thanks for following up. So, it does sound like Kable will need to support bonding in order for you to get the full functionality you need. I've been swamped on other work projects, but have been long meaning to start working on the Kable bonding support. I'm hopeful I'll start having some time in the coming weeks to start investigating what it might take to add bonding to Kable.
🙌 1
r
@travis if you need help with the bounding, in this GitHub project, you can find a way to do that -> https://github.com/SiliconLabs/wireless-xpress
t
This will be super helpful. Thanks @Ruyman!
r
In our company, we're working on this so when we have a final solution, I will try to share our implementation with you
🙌 2