Edit
Buscando en los Logs he encontrado este mensaje en un catch
E/Connect->Run: java.io.IOException: read failed, socket might closed or timeout, read ret: -1
Que sale del constructor del Thread de la conexion del socket:
private class ConnectThread extends Thread{
private final BluetoothSocket socket;
private final BluetoothDevice device;
// Constructor del Thread, recibimos un device
public ConnectThread(BluetoothDevice device){
// creamos un socket para el dispositivo remoto a travez de Bluetooth clasico (BD/EDR)
this.device = device;
BluetoothSocket tmp = null;
try{
tmp = device.createRfcommSocketToServiceRecord(APP_UUID);
}catch (IOException e){
Log.e("Connect->constructor", e.toString());
}
socket = tmp;
}
public void run (){
// Intentamos conectar al socket del dispositivo remoto
try{
socket.connect();
}catch (IOException e_){
Log.e("Connect->Run", e_.toString());
try{
Log.d("La ejecucion del trhead ha sido interrumpida",", vamos a cerrar el socket");
socket.close();
}catch (IOException e){
Log.e("Connect->CloseSocket", e.toString());
}
connectionFailed();
return;
}
synchronized (ChatUtils.this){
connectThread = null;
}
// Terminamos de conectar y notificamos al sistema de que estamos conectados
connected(socket,device);
}
public void cancel(){
try {
socket.close();
}catch (IOException e){
Log.e("Connect->Cancel", e.toString());
}
}
}