I am getting bluetooth connection failed error when try to connect.
Logs
BluetoothSocket.cpp(8398): initSocketNative
BluetoothSocket.cpp(8398): ...fd 53 created (RFCOMM, lm = 0)
BluetoothSocket.cpp(8398): initSocketFromFdNative
BluetoothSocket.cpp(8398): connectNative
BluetoothSocket.cpp(8398): ...connect(53, RFCOMM) = -1 (errno 16)
BluetoothSocket.cpp(8398): abortNative
BluetoothSocket.cpp(8398): ...asocket_abort(53) complete
BluetoothSocket.cpp(8398): destroyNative
BluetoothSocket.cpp(8398): ...asocket_destroy(53) complete
Let me know where I am doing wrong.
My code snippet:
mmSocket = device.createInsecureRfcommSocketToServiceRecord(MY_UUID);
mmSocket.connect();