Example usage for android.bluetooth BluetoothGatt GATT_SUCCESS

List of usage examples for android.bluetooth BluetoothGatt GATT_SUCCESS

Introduction

In this page you can find the example usage for android.bluetooth BluetoothGatt GATT_SUCCESS.

Prototype

int GATT_SUCCESS

To view the source code for android.bluetooth BluetoothGatt GATT_SUCCESS.

Click Source Link

Document

A GATT operation completed successfully

Usage

From source file:com.android.dragonkeyboardfirmwareupdater.KeyboardFirmwareUpdateService.java

private boolean checkOperationStatus(int status) {
    mGattOperationStatus = status;//from w  ww  .  jav a2s .  c o  m
    if (mGattOperationStatus != BluetoothGatt.GATT_SUCCESS) {
        Log.d(TAG, "BluetoothGattCallback: GATT operation failure: " + mGattOperationStatus);
        return false;
    }
    return true;
}

From source file:nodomain.freeyourgadget.gadgetbridge.service.devices.miband2.MiBand2Support.java

private void handleBatteryInfo(byte[] value, int status) {
    if (status == BluetoothGatt.GATT_SUCCESS) {
        BatteryInfo info = new BatteryInfo(value);
        batteryCmd.level = ((short) info.getLevelInPercent());
        batteryCmd.state = info.getState();
        batteryCmd.lastChargeTime = info.getLastChargeTime();
        batteryCmd.numCharges = info.getNumCharges();
        handleGBDeviceEvent(batteryCmd);
    }/*from   w  ww  .jav  a 2s .c o m*/
}