0

I have paired and connected Bluetooth device with C# application which is working fine but I need to detect when even device is out of range or disconnected.

I have found Connected Property of BluetoothClient class but that doesn't becomes false when ever device is disconnected.

I have triggered a timer tick event on every second to check whether BluetoothClient connected property becomes false and show msgbox that device is disconnected.

But the problem is connected property doesn't change its state to false, could you please suggest the way how to detect when Bluetooth device is disconnected.

John Thoits
  • 335
  • 1
  • 11
Khan Engineer
  • 416
  • 5
  • 20

1 Answers1

0

I have used some work around to solve this problem,

When devices connects with the application, I started to send some empty string and check whether the data is received or not, so when ever this data wasn't send it raise an exception, I caught that exception and call a function to log out the user.

Khan Engineer
  • 416
  • 5
  • 20