E/DEMO_APP: Socket connection failed on device
java.io.IOException: read failed, socket might closed or timeout, read ret: -1
The android phone is paired with the bluetooth device, I see it when scanning paired devices, I connect to the device I want based on Mac address and the device object I pass is correct. But the connection always fails, I want to have my android mobile app connect and be able to receive messages from the bluetooth device so it can execute code on the mobile app based on actions done on the bluetooth device. I've tried many things and the connection always fails. I sampled code off the android developer docs.
I also tried using my car as a test bluetooth device since the phone is paired, connects to it, and I should be able to read in data from the car but that fails too trying to use both client / server socket code, accept() ends up stalling then failing as well when trying the other way: tmp2 = Bluetooth.bluetoothAdapter.listenUsingRfcommWithServiceRecord("testing", mmUUID); and my car gives me a uuid to read in and use..so must be my connection code if nothing is working even with a real working bt device.