Example usage for android.bluetooth BluetoothGatt GATT_INVALID_ATTRIBUTE_LENGTH

List of usage examples for android.bluetooth BluetoothGatt GATT_INVALID_ATTRIBUTE_LENGTH

Introduction

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

Prototype

int GATT_INVALID_ATTRIBUTE_LENGTH

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

Click Source Link

Document

A write operation exceeds the maximum length of the attribute

Usage

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:// w ww  .  j av a  2 s . c  o  m
        return "STATE_UNKNOWN: " + status;
    }
}

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 .  ja  va  2 s  .c o m*/
        return "GATT error with unknown status code: " + 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 w  ww .jav a  2  s  .c om*/
    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;
}