Java tutorial
//package com.java2s; //License from project: Open Source License import android.bluetooth.BluetoothGatt; public class Main { 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: return "STATE_UNKNOWN: " + status; } } }