Hello, well I use the BLE manager to connect to my device, I am connected with success but if I plug the device (cause a disconnect) I have'nt a message to say "You are disconnect".Are you connecting to the BLE peripheral from your app? You need to handle the Connected and Disconnected events.
Sub Manager_StateChanged (State As Int)
'Log("DANS STARTER StateChanged")
Select State
Case manager.STATE_POWERED_OFF
currentStateText = "POWERED OFF"
Case manager.STATE_POWERED_ON
currentStateText = "POWERED ON"
Case manager.STATE_UNSUPPORTED
currentStateText = "UNSUPPORTED"
End Select
currentState = State
CallSub(page_creation_compte, "StateModification")
End Sub
My understanding that if you are connected and then later on by some reason connection breaks, StateChanged event will be raised and your 'StateModification' sub will be called. I use primitive HomTom HT3 device and sometimes by some unknown reason it loses connection and then restores it, and I always see 'POWERED ON' popping up in my log in the middle of normal program execution.Hello, well I use the BLE manager to connect to my device, I am connected with success but if I plug the device (cause a disconnect) I have'nt a message to say "You are disconnect".
I use this to check but I would like to check my state everywhere in my app. It's clear or not ? Cause maybe I forget something.B4X:Sub Manager_StateChanged (State As Int) 'Log("DANS STARTER StateChanged") Select State Case manager.STATE_POWERED_OFF currentStateText = "POWERED OFF" Case manager.STATE_POWERED_ON currentStateText = "POWERED ON" Case manager.STATE_UNSUPPORTED currentStateText = "UNSUPPORTED" End Select currentState = State CallSub(page_creation_compte, "StateModification") End Sub
Thanks =)