Example usage for android.bluetooth BluetoothGatt GATT_INSUFFICIENT_ENCRYPTION

List of usage examples for android.bluetooth BluetoothGatt GATT_INSUFFICIENT_ENCRYPTION

Introduction

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

Prototype

int GATT_INSUFFICIENT_ENCRYPTION

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

Click Source Link

Document

Insufficient encryption for a given operation

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:/*from www  . j  a va 2s .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  www  . ja  v  a  2  s  . co 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  w  w  .  j  a  v  a 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;
}