Mark Read Well-Known Member Licensed User Longtime User Feb 1, 2016 #1 When using a RPi connected to another device via bluetooth, is there a way to detect the loss of bluetooth connection from the RPi side? Maybe ChangeOfState or similar? Many thanks.
When using a RPi connected to another device via bluetooth, is there a way to detect the loss of bluetooth connection from the RPi side? Maybe ChangeOfState or similar? Many thanks.
Erel B4X founder Staff member Licensed User Longtime User Feb 1, 2016 #2 You need to handle AStream_Error and AStream_Terminated events. Upvote 0
Mark Read Well-Known Member Licensed User Longtime User Feb 1, 2016 #3 Okay. I can imagine that the Astream_Error would be called if data cannot be sent to the client but when is Astream_Terminated called? Upvote 0
Okay. I can imagine that the Astream_Error would be called if data cannot be sent to the client but when is Astream_Terminated called?
Erel B4X founder Staff member Licensed User Longtime User Feb 1, 2016 #4 Terminated is called when the connection is closed by the other side. Practically you should handle both cases in the same way. Upvote 0
Terminated is called when the connection is closed by the other side. Practically you should handle both cases in the same way.
Mark Read Well-Known Member Licensed User Longtime User Feb 1, 2016 #5 So to sum up: RPi sends data continuously to a tablet. Tablet listens for data. RPi cannot send data over bluetooth - AStreams_Error will be called on RPi. Tablet closes bluetooth - AStreams_Terminated is called on RPi. Correct? What error deos the tablet generate? Thanks Erel. Upvote 0
So to sum up: RPi sends data continuously to a tablet. Tablet listens for data. RPi cannot send data over bluetooth - AStreams_Error will be called on RPi. Tablet closes bluetooth - AStreams_Terminated is called on RPi. Correct? What error deos the tablet generate? Thanks Erel.
Erel B4X founder Staff member Licensed User Longtime User Feb 1, 2016 #6 Yes (errors can happen even if nothing is written). mark35at said: What error deos the tablet generate? Click to expand... Exactly the same. Upvote 0
Yes (errors can happen even if nothing is written). mark35at said: What error deos the tablet generate? Click to expand... Exactly the same.
Mark Read Well-Known Member Licensed User Longtime User Feb 2, 2016 #7 Thanks for the clear explanation Erel. Have added the two subs on my tablet and RPi. Now I can reconnect if the bluetooth connection is lost, without restarting both Apps! Upvote 0
Thanks for the clear explanation Erel. Have added the two subs on my tablet and RPi. Now I can reconnect if the bluetooth connection is lost, without restarting both Apps!