android-lib/src/main/java/io/v/android/impl/google/discovery/plugins/ble/GattReader.java
/**
     * Closes the Gatt reader cancelling the current read and deleting all pending requests.
     */
Closes the Gatt reader cancelling the current read and deleting all pending requests.
Closes the Gatt reader cancelling the current read and deleting all pending requests .
synchronized void close(boolean graceful) {
        mPendingReads.clear();
        if (graceful) {
            while (mCurrentDevice != null) {
                try {
                    wait();
                } catch (InterruptedException e) {
                    break;
                }
            }
        }
        mExecutor.shutdown();
        if (mCurrentGatt != null) {
            mCurrentGatt.close();
        }
    }
synchronized void close ( boolean graceful ) { mPendingReads . clear ( ) ; if ( graceful ) { while ( mCurrentDevice != null ) { try { wait ( ) ; } catch ( InterruptedException e ) { break ; } } } mExecutor . shutdown ( ) ; if ( mCurrentGatt != null ) { mCurrentGatt . close ( ) ; } }
Closes the Gatt reader cancelling the current read and deleting all pending requests.
Closes the Gatt reader cancelling the current read and deleting all pending requests .
// Wait until the current read finishes to avoid messing up the Bluetooth stack.