Android应用程序在0x7F之后不读取值(Android App not reading Values after 0x7F)
我有app从ble设备接收数据。 首先它将数据发送为|0/1|date1|month1|hour1|minute1|date2|month2|hour2|minute2|0x8A|
应用程序读取除0x8A之外的所有值。
当我提到一些网站时,似乎android应用程序只读取standard ASCI ,最高为0x7F 。 如果是,我将如何将数据转换为Extended ASCI ? 我的数据以字符串形式接收。
@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"); }请帮我解决这个问题。
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.
最满意答案
if (ff == '\u008a') {它对我有用
if (ff == '\u008a') {It worked for me
更多推荐
发布评论