weliem / blessed-android

BLESSED, a Bluetooth Low Energy (BLE) library for Android
MIT License
557 stars 119 forks source link

WearOS createBond not working as expected #132

Closed HinnaX closed 2 years ago

HinnaX commented 2 years ago

Hey, I'm using your library and it's working very well, good work!!! But for WearOS I've got problems with bonding the Smartwatch to other devices. I call your function connect and receive a onBondingSucceeded callback. I check that bonding with this function: fun isDeviceBonded(peripheralAddress: String): Boolean { val bluetoothManager = context.getSystemService(Context.BLUETOOTH_SERVICE) as BluetoothManager return bluetoothManager.adapter.bondedDevices.map { it.address }.contains(peripheralAddress) } But I've got always false, because the BluetoothManager Adapter bonded devices List not included the expceted peripherialAddress I've created a workaround, which open the Android Bluetooth settings and connect to the device manually before I call this function, This return true and I can you use your library as expected. But this helps not for all devices. Have you a idea or other experiences with WearOS?

HinnaX commented 2 years ago

Problem was not in your library, it was someting I changes on the other site, on BLE device.