Does anyone know how to use the BleGattCoroutines ...
# android
d
Does anyone know how to use the BleGattCoroutines notifications? I can't find any example of it. Normally you'll have a BluetoothGattCallback to intercept a notification change and can read the data there. Don't see how this is done with BleGattCoroutines though.
l
Look at the
GattConnection
interface, and search for "notification", you'll find two ways to do it. I'll update it to kotlinx.coroutines 1.3.0-M2 later today BTW.
d
Thank you Louis
l
Sorry for being late, I still plan to update kotlinx.coroutines. You can "Watch releases" on GitHub to be notified about it.
d
I just checked it. Thanks for letting me know. I'll do that.
l
I wasn't sure but I didn't use
Flow
preview in BleGattCoroutines, so I don't need to update it. I'll probably add support for it in 1.3.0 though. I hope it's working well for you.
d
I ended up rolling my own for most of the reading, but I am using it for discovery and printing/debugging. That Print is a great tool to see what's going on. I'll probably refactor to fully integrate with BleCoroutines in the future. I just had the examples I needed in place using the callback so it was quicker to get going (tight deadline for that part).