Search code examples
androidasciibluetooth-lowenergyextended-asciiandroid-ble

Android App not reading Values after 0x7F


I have app that receives data from a ble device. first it sends data as |0/1|date1|month1|hour1|minute1|date2|month2|hour2|minute2|0x8A|

App reads every values except 0x8A.

When i referred some sites it seems that android app reads only standard ASCI which is upto 0x7F. If yes How will i convert the data to Extended ASCI ? My Data is received as a String .

 @Override
        public void onCharacteristicRead(BluetoothGatt gatt,
                                         BluetoothGattCharacteristic characteristic, int status) {
            if (status == BluetoothGatt.GATT_SUCCESS) if (BleUuid.READ_TIME
                    .equalsIgnoreCase(characteristic.getUuid().toString())) {
                final String names = characteristic.getStringValue(0);
                runOnUiThread(new Runnable() {
                    public void run() {
                        char ff;
                        ff = names.charAt(9);
                        if (ff ==0x8a) {
                            line1.setText("Yes");
                        } else {
                            line1.setText("No");
                        }

plz Help me to figure this out.


Solution

  • if (ff == '\u008a') { 
    

    It worked for me