whilu/LMBluetoothSdk

STATE_LISTEN

Opened this issue · 3 comments

I do not use startAsServer() method but sometimes I got STATE_LISTEN after STATE_CONNECTING in onBluetoothServiceStateChanged. In that case, I cannot connect to my target device (microcontroller). disconnect() and reconnect() does not help. What should I do? Is it a bug?

whilu commented

Thanks! Your target device (microcontroller) is BLE device? If you use BLE
device sdk, STATE_LISTEN is no use, it's only sent on
BluetoothService.

2016-03-21 21:56 GMT+08:00 Near1999 notifications@github.com:

I do not use startAsServer() method but sometimes I got STATE_LISTEN in
onBluetoothServiceStateChanged. In that case, I cannot connect to my
target device. disconnect() and reconnect() does not help. What should I
do? Is it a bug?


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#8

No, bluetooth 3.0

I found block of code that changes to STATE_LISTEN after STATE_CONNECTING and there is try_catch block that catches IOException. I think this link might help http://stackoverflow.com/questions/18657427/ioexception-read-failed-socket-might-closed-bluetooth-on-android-4-3