I've AsyncStreams Error and Terminated event, but when turn off the other device (broken the connection) the Subs not work.
B4X:
Sub Process_Globals
Dim admin As BluetoothAdmin
Dim serial1 As Serial
Dim AStream As AsyncStreams
End Sub
Sub AStream_Error
ToastMessageShow("Connection is broken.", True)
End Sub
Sub AStream_Terminated
AStream_Error
End Sub
I think you should not only look at your code but also have a look how your "system/app/product" works.
Example:
We have an App receiving food orders from our takeaways App, this App is always screen on and at just one location close to the printer bluetooth, then the bluetooth connexion is never missed.
I think you should not only look at your code but also have a look how your "system/app/product" works.
Example:
We have an App receiving food orders from our takeaways App, this App is always screen on and at just one location close to the printer bluetooth, then the bluetooth connexion is never missed.
Do you have any example. I just saw one about MQTT connect & reconnect. I understand the logic of what you propose and it's fine. I need to know how to send that ping. For example to send I use:
The exact details depend on the messages protocol that you are using. For example, I like to start each message with a byte or int that identifies the message. This way you can create a "ping" type.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.