@Override public SimpleKeysStatus parse(BluetoothGattCharacteristic c) { /* * The key state is encoded into 1 unsigned byte. * bit 0 designates the right key. * bit 1 designates the left key. * bit 2 designates the side key. * * Weird, in the userguide left and right are opposite. */ int encodedInteger = c.getIntValue(FORMAT_UINT8, 0); return SimpleKeysStatus.values()[encodedInteger % 4]; }
@Override public String getDataString() { final SimpleKeysStatus data = getData(); return data.name(); }