Reedyuk / blue-falcon

A Bluetooth kotlin multiplatform "Cross-Platform" library for iOS and Android
https://bluefalcon.dev
Apache License 2.0
321 stars 43 forks source link

Bonding callback #119

Closed kcn1-71 closed 4 months ago

kcn1-71 commented 4 months ago

Hello guyz! Thank you for this library! It there any way to check if bonding is finished?

Reedyuk commented 4 months ago

There is no official way, someone suggested this for Android

https://stackoverflow.com/questions/33317516/android-ble-how-to-check-if-bonded-ble-device-is-available-to-connect

But I wouldn't want to include this in the library as it's not official and is a bit of a hack. Plus could break with any update of Android.

Then the headache to support it also on iOS too.

kcn1-71 commented 4 months ago

I found out that in onConnected callback, on Android side, peripheral.bluetoothDevice.bondState is available, but I didn't find any ways to implement the same on iOS side :(

Reedyuk commented 4 months ago

Unfortunately i'm not sure there is the equivalent for ios, we would need the same functionality on both platforms, otherwise it shouldn't be implemented.

kcn1-71 commented 4 months ago

Got it... I'll try to make it on server side... maybe some not encrypted characteristic with current authorisation status