Hi!
Last year we upgraded our Android app to use android.ble.ktx:2.7.5 to communicate with sensors we develop. We are working on upgrading to 2.9.0 but there are a few extra changes we have to do on our side.
Recently we've noticed an increase on delays in the communication and discovered that most of the time some packages are going missing.
We decided to use asFlow to get notifications from the sensor like this:
notificationsFlow = setNotificationCallback(readCharacteristic).asFlow()
enableNotifications(readCharacteristic).enqueue()
which we call in the initialize function.
In our app, we scan for the sensor, connect to it and then we request some information from the sensor which we collect from notificationsFlow. For some reason, the first packet we are expecting, sometimes is not received. Is there an specific way of doing this?
I haven't found an example using asFlow(), could somebody maybe send across an example or is it not reliable to be use as it's annotated with @ExperimentalCoroutinesApi?
Thanks!
Nbl
Hi!
Last year we upgraded our Android app to use android.ble.ktx:2.7.5 to communicate with sensors we develop. We are working on upgrading to 2.9.0 but there are a few extra changes we have to do on our side.
Recently we've noticed an increase on delays in the communication and discovered that most of the time some packages are going missing.
We decided to use asFlow to get notifications from the sensor like this:
notificationsFlow = setNotificationCallback(readCharacteristic).asFlow() enableNotifications(readCharacteristic).enqueue()which we call in the initialize function.
In our app, we scan for the sensor, connect to it and then we request some information from the sensor which we collect from
notificationsFlow. For some reason, the first packet we are expecting, sometimes is not received. Is there an specific way of doing this?I haven't found an example using
asFlow(), could somebody maybe send across an example or is it not reliable to be use as it's annotated with@ExperimentalCoroutinesApi?Thanks!
Nbl