I'm creating insecure rfcomm connection from my HTC One X to SENA bluetooth ESD110 Serial module with this code:
BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(addr);
BluetoothSocket socket = null;
try{
socket = device.createInsecureRfcommSocketToServiceRecord(UUID.fromString(SERVICE_UUID));
mBluetoothAdapter.cancelDiscovery();
socket.connect();
sendMessage(socket,"working!");
socket.close();
The point here is to connect to the module with auto paring, and it's all working, but it's taking about 15 seconds for the connection to be established.
The debug remains at:
socket.connect();
for 15 seconds and only after that connecting and transfering the string to the module (takes 1 sec for that).
Is it possible that the phone is processing some other data (services discovery and more) before connecting to the MAC-address and how will I make it connect FASTER? Or can it be HTC hardware issue?