views:

72

answers:

2

Is there a way to figure out if you are connected to a Bluetooth Device?

I have my app connecting, sending/receiving just fine. However I need a way to see if I'm still connected say.. if I walk out of range and walk back into range.

I noticed there isnt an isConnected function in the Bluetooth Socket, like there is in the TCP stuff... is there a way to see if you are connected, or communicating to the device you're supposed to be connected with?

A: 

The only way I was able to get around this was to send a "heartbeat" message once per second. If it doesn't go through, then I assume Bluetooth is disconnected.

Aaron C
A: 

Send the smallest amount of data that you can and see if you get a response. If you don't, well, you don't have a connection.

Ed Swangren