bitQuit_Android/app/src/main/java/com/tonydicola/bletest/app/MainActivity.java
@Override
        public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) {
            super.onConnectionStateChange(gatt, status, newState);
            if (newState == BluetoothGatt.STATE_CONNECTED) {
//                writeLine("Connected!");
                // Discover services.
                if (!gatt.discoverServices()) {
//                    writeLine("Failed to start discovering services!");
                }
            } else if (newState == BluetoothGatt.STATE_DISCONNECTED) {
//                writeLine("Disconnected!");
            } else {
//                writeLine("Connection state changed.  New state: " + newState);
            }
        }
// Called whenever the device connection state changes, i.e. from disconnected to connected.
Called whenever the device connection state changes, i.e. from disconnected to connected.
Called whenever the device connection state changes i . e . from disconnected to connected .
@Override
        public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) {
            super.onConnectionStateChange(gatt, status, newState);
            if (newState == BluetoothGatt.STATE_CONNECTED) {
                if (!gatt.discoverServices()) {
                }
            } else if (newState == BluetoothGatt.STATE_DISCONNECTED) {
            } else {
            }
        }
@ Override public void onConnectionStateChange ( BluetoothGatt gatt , int status , int newState ) { super . onConnectionStateChange ( gatt , status , newState ) ; if ( newState == BluetoothGatt . STATE_CONNECTED ) { if ( ! gatt . discoverServices ( ) ) { } } else if ( newState == BluetoothGatt . STATE_DISCONNECTED ) { } else { } }
Called whenever the device connection state changes, i.e.
Called whenever the device connection state changes i . e .
//                writeLine("Connected!"); // Discover services. //                    writeLine("Failed to start discovering services!"); //                writeLine("Disconnected!"); //                writeLine("Connection state changed.  New state: " + newState);