Code example for BluetoothSocket

Methods: close

0
            try { 
                if (mmSocket == null) {
                    Log.e(TAG, "Input stream null. Aborting Cacnel");
                    return; 
                } 
                mmSocket.close();
            } catch (IOException e) {
                Log.e(TAG, "close() of connect socket failed", e);
            } finally { 
                cancelled = true;
                interrupt();
            } 
        } 
    } 
    /* 
     * Thread that starts the connection thread an monitors it. 
     * Thread will be cancelled if timeot occurs 
     */ 
    private class WatchdogThread extends Thread {
        private final BluetoothDevice btdevice;
        private int retries = 0;