Android Question Bluetooth 2.1 events -& asynchstreams delay

Arf

Well-Known Member
Licensed User
Longtime User
My product sends ALIVE packets to the tablet every 200mS.
On the app side, my bluetooth service has a 500ms timer that sets ALIVE_RECEIVED flag to false before exiting the Tick function. On entry to the Tick function, if ALIVE_RECEIVED is still FALSE, the app takes the neccessary steps to handle the situation (the situation being, my product has turned off).
At the beginning of AStream_NewData, I set ALIVE_RECEIVED to true.

This has all worked fine so far, but I do see very occasionally, the unit is found to be disconnected when it's still on. Running in debug, I can see that everything is working correctly, and the only plausible explanation is that the AStream_NewData event has been paused by something and not occur synchronously with the arrival of an ALIVE packet. I do not have any blocking modals and so on, so thats not the problem.

Which gets me to my question: Is there any other event I can somehow set up, that is fired in a more realtime manner than AStream_NewData, when bluetooth data arrives? I don't need access to the data, all I need to know is that there is still bluetooth activity going on.

Thanks.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…