Example usage for android.bluetooth BluetoothGatt GATT_CONNECTION_CONGESTED

List of usage examples for android.bluetooth BluetoothGatt GATT_CONNECTION_CONGESTED

Introduction

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

Prototype

int GATT_CONNECTION_CONGESTED

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

Click Source Link

Document

A remote device connection is congested.

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  .j  a  v  a2 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;/* w  ww  . j a va  2  s  . c  o m*/
    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;
}