Example usage for android.bluetooth BluetoothGatt GATT_FAILURE

List of usage examples for android.bluetooth BluetoothGatt GATT_FAILURE

Introduction

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

Prototype

int GATT_FAILURE

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

Click Source Link

Document

A GATT operation failed, errors other than the above

Usage

From source file:Main.java

public static String gattStatusString(int status) {
    switch (status) {
    case BluetoothGatt.GATT_CONNECTION_CONGESTED:
        return "Connection congested";
    case BluetoothGatt.GATT_FAILURE:
        return "Failure";
    case BluetoothGatt.GATT_INSUFFICIENT_AUTHENTICATION:
        return "Insufficient authentication";
    case BluetoothGatt.GATT_INSUFFICIENT_ENCRYPTION:
        return "Insufficient encryption";
    case BluetoothGatt.GATT_INVALID_ATTRIBUTE_LENGTH:
        return "Invalid attribute length";
    case BluetoothGatt.GATT_INVALID_OFFSET:
        return "Invalid offset";
    case BluetoothGatt.GATT_READ_NOT_PERMITTED:
        return "Read not permitted";
    case BluetoothGatt.GATT_REQUEST_NOT_SUPPORTED:
        return "Request not supported";
    case BluetoothGatt.GATT_WRITE_NOT_PERMITTED:
        return "Write not permitted";
    default://from  w w  w  .  jav  a 2  s . com
        return "GATT error with unknown status code: " + status;
    }
}

From source file:Main.java

public static String getGattStatus(int status) {
    switch (status) {
    case BluetoothGatt.GATT_SUCCESS:
        return "GATT_SUCCESS";

    case BluetoothGatt.GATT_READ_NOT_PERMITTED:
        return "GATT_READ_NOT_PERMITTED";

    case BluetoothGatt.GATT_WRITE_NOT_PERMITTED:
        return "GATT_WRITE_NOT_PERMITTED";

    case BluetoothGatt.GATT_INSUFFICIENT_AUTHENTICATION:
        return "GATT_INSUFFICIENT_AUTHENTICATION";

    case BluetoothGatt.GATT_REQUEST_NOT_SUPPORTED:
        return "GATT_REQUEST_NOT_SUPPORTED";

    case BluetoothGatt.GATT_INSUFFICIENT_ENCRYPTION:
        return "GATT_INSUFFICIENT_ENCRYPTION";

    case BluetoothGatt.GATT_INVALID_OFFSET:
        return "GATT_INVALID_OFFSET";

    case BluetoothGatt.GATT_INVALID_ATTRIBUTE_LENGTH:
        return "GATT_INVALID_ATTRIBUTE_LENGTH";

    case BluetoothGatt.GATT_FAILURE:
        return "GATT_FAILURE";

    default:/*from w  w w  . ja v a  2  s  .co m*/
        return "STATE_UNKNOWN: " + status;
    }
}

From source file:Main.java

public static String gattStatusToString(int status) {
    String str = "";
    switch (status) {
    case BluetoothGatt.GATT_SUCCESS:
        str = "GATT_SUCCESS";
        break;/*from   ww w. j a v a2 s .com*/
    case BluetoothGatt.GATT_READ_NOT_PERMITTED:
        str = "GATT_READ_NOT_PERMITTED";
        break;
    case BluetoothGatt.GATT_WRITE_NOT_PERMITTED:
        str = "GATT_WRITE_NOT_PERMITTED";
        break;
    case BluetoothGatt.GATT_INSUFFICIENT_AUTHENTICATION:
        str = "GATT_INSUFFICIENT_AUTHENTICATION";
        break;
    case BluetoothGatt.GATT_REQUEST_NOT_SUPPORTED:
        str = "GATT_REQUEST_NOT_SUPPORTED";
        break;
    case BluetoothGatt.GATT_INSUFFICIENT_ENCRYPTION:
        str = "GATT_INSUFFICIENT_ENCRYPTION";
        break;
    case BluetoothGatt.GATT_INVALID_OFFSET:
        str = "GATT_INVALID_OFFSET";
        break;
    case BluetoothGatt.GATT_INVALID_ATTRIBUTE_LENGTH:
        str = "GATT_INVALID_ATTRIBUTE_LENGTH";
        break;
    case BluetoothGatt.GATT_CONNECTION_CONGESTED:
        str = "GATT_CONNECTION_CONGESTED";
        break;
    case BluetoothGatt.GATT_FAILURE:
        str = "GATT_FAILURE";
        break;
    }

    return str;
}

From source file:com.jameslandrum.bluetoothsmart.actions.LargeSetCharacteristic.java

@Override
public void onCharacteristicWrite(BluetoothGattCharacteristic characteristic, int status) {
    if (status == BluetoothGatt.GATT_FAILURE) {
        mError = new CharacteristicWriteError();
    }/*ww w. j  a va2s  .  c  o  m*/
    synchronized (mHolder) {
        mHolder.notify();
    }
}