kai-morich / SimpleBluetoothTerminal

Android terminal app for Bluetooth classic devices using SPP profile
MIT License
447 stars 166 forks source link

hc-06 connection failed #11

Closed Ardminu closed 4 years ago

Ardminu commented 4 years ago

First I would like to thank you for sharing this code. I have tried to use it with Bluetooth module HC-06, which is a 2.x technology. But I keep getting " connecting .. connection failed: read failed, socket might closed or timeout, read ret:-1"

However, when using your Serial Bluetooth Terminal app, it gets connected normally without any issue.

Any suggestion to overcome this probelm?

Ardminu commented 4 years ago

issue resolved by this change: //socket = device.createRfcommSocketToServiceRecord(BLUETOOTH_SPP); socket = device.createInsecureRfcommSocketToServiceRecord(BLUETOOTH_SPP);

kai-morich commented 4 years ago

strange. my Serial Bluetooth Terminal app also uses createRfcommSocketToServiceRecord