I am getting a issue to send Commands from my android device to Bluetooth device.
Bluetooth is associated with a micro-controller. My effort is below:
As you have mentioned that the issue is there on mmSocket.connect();
line hence, the problem is not while you are sending the command but creating a connection i.e. you are not able to retrieve a BluetoothSocket
in opened or connected state.
What should you do ?
Try to use the below code with UUID , its valid for my bluetooth dongles.
UUID MY_UUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
createInsecureRfcommSocketToServiceRecord(MY_UUID)
Let me know if this works for you.
Also check, https://stackoverflow.com/a/18786701/1503130