Android应用程序在0x7F之后不读取值(Android App not reading Values after 0x7F)

编程入门 行业动态 更新时间:2024-10-26 19:26:37
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

更多推荐

本文发布于:2023-07-30 01:26:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1321372.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   x7F   Android   Values   reading

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!