Interesting, we are also working on a Bluetooth li...
# coroutines
s
Interesting, we are also working on a Bluetooth library!
l
@shayla What kind of Bluetooth library? Bluetooth Classic? BluetoothScanner? BluetoothLeScanner? BluetoothGatt? Something more specific? In my case, I'll actually open source two libraries. One for BluetoothGatt with coroutines, another, without coroutines, for scanning Beacons (with initial support for Eddystone-UID and iBeacon), which is based on Android 5.0+ BluetoothLeScanner
s
@louiscad Currently the company I work for has a Swift library: https://github.com/steamclock/bluejay. Goal is to bring some of the convenience of operation queueing and device state management to Android. From a scanning standpoint it supports BluetoothScanner (pre lollipop) and bluetoothLeScanner (post lollipop) as well as a wrapper around BluetoothGatt for read/write/listen functionalities.
Although full disclaimer, this is my first large Bluetooth project, so I am still learning a bunch about the gritty details.
l
@shayla My library may be of great help then for BluetoothGatt. I'll keep you in the loop for when it's on GitHub. Note that the first version will only support read/write/notify, but not write no response and a few other things that I couldn't test, but suggestions will be welcome to get it exhaustive to the BluetoothGatt capabilities on Android
s
That would be great, please do 🙂
o
Consider dropping a note to #opensource
l
@orangy Sure, will do. I'm so excited to open source this work I won't be able to forget. Is cross-posting to #android okay too?
o
I think so
👍🏽 1
d
@louiscad ble api on android is extremely buggy (especially on some samsungs). i wish you lot of patience and luck 🙂
l
@deviant Which Samsungs and other devices exactly? What kind of problem exactly? Personally had no issue testing on a Samsung Galaxy A5 2016. I plan to test it on my Nexus 6P and other devices too
d
the problematic device was S5 (if i'm not mistaken)
also i had random 133 and 22 errors on xiaomi devices
and all known workarounds barely helped
like "wait 600 ms, then reconnect" 😄
l
@deviant Will you be able to test your use case again with the problematic devices with my library when it's released (should be on GitHub by the 26th)? I'm asking because I got 133 errors when using GATT without my library, but I didn't get any (except, consistently when trying reliableWrite, but the device may not support it at all), and this may be because I added mutexes that enforces waiting an operation including it's callback to complete before proceeding with the next operation, so I'd be interested in knowing if it solves your issues
d
unfortunately i don't own any of samsungs right now
(or fortunately :))
😆 1