I am trying to make an app, that when it sees a specific bluetooth device to connect to it and send a command and before loose that connection to send another command. The device is standard bluetooth serial device. Is there a way to check when i am going to loose the connection?