Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
MPPT 751 15通过VE连接。直接连接到Raspberry Pi 3(Android of Things),但数据无法读取_Android_Raspberry Pi3_Android Things - Fatal编程技术网

MPPT 751 15通过VE连接。直接连接到Raspberry Pi 3(Android of Things),但数据无法读取

MPPT 751 15通过VE连接。直接连接到Raspberry Pi 3(Android of Things),但数据无法读取,android,raspberry-pi3,android-things,Android,Raspberry Pi3,Android Things,在缓冲区中,我得到了无法转换为文本或十六进制的值,[98 63 65-128 3 0-94….] 有人知道一些Java/Android阅读示例或将结果转换为文本 提前谢谢 while ((count = uart.read(buffer, buffer.length)) > 0) { Log.d(TAG, "Read " + count + " bytes from peripheral"); byte[] lectura=new byte[count]; for

在缓冲区中,我得到了无法转换为文本或十六进制的值,[98 63 65-128 3 0-94….]

有人知道一些Java/Android阅读示例或将结果转换为文本

提前谢谢

while ((count = uart.read(buffer, buffer.length)) > 0) {
    Log.d(TAG, "Read " + count + " bytes from peripheral");
    byte[] lectura=new byte[count];

    for(int i=0;i<count;i++){
        lectura[i]= (buffer[i]);
        Log.w(TAG,lectura[i] + " | " + buffer[i]);
    }
while((count=uart.read(buffer,buffer.length))>0){
Log.d(标记,“从外围设备读取”+计数+”字节);
字节[]a=新字节[计数];

对于(inti=0;i您不仅需要从Raspberry UART读取原始数据,还需要实现VE.Direct协议(接收和解析整个消息)(这两个链接都来自文章)。还需要检查,以及类似的示例。实际上,您需要将类似Android的东西转换为Java

UPD:也是一个很好的例子(您需要将文件转换为java)