Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/317.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
Java 无代码的Android-BLE特性总是返回相同的值_Java_Android_Bluetooth_Bluetooth Lowenergy - Fatal编程技术网

Java 无代码的Android-BLE特性总是返回相同的值

Java 无代码的Android-BLE特性总是返回相同的值,java,android,bluetooth,bluetooth-lowenergy,Java,Android,Bluetooth,Bluetooth Lowenergy,我执行一个简单的写命令 atWriteCharacteristic.setWriteType(BluetoothGattCharacteristic.WRITE_TYPE_DEFAULT); atWriteCharacteristic.setValue("ATI"); // no matter what value I put here always same response boolean didWrite = bluetoothGatt.writ

我执行一个简单的写命令

    atWriteCharacteristic.setWriteType(BluetoothGattCharacteristic.WRITE_TYPE_DEFAULT);
    atWriteCharacteristic.setValue("ATI"); // no matter what value I put here always same response
    boolean didWrite = bluetoothGatt.writeCharacteristic(atWriteCharacteristic);
但当我试图通过以下方式阅读时:

    bluetoothGatt.readCharacteristic(atReadCharacteristic);
我总是得到同样的回答“OK”,这是不正确的,应该给我一个应用程序版本。我在onCharacteristicRead回调函数中得到响应。
以下是指向无代码应用程序的链接:
我已经解决了这个问题。问题简单得多。是我没有在每次“AT”命令后发送空格。因此,命令需要采用这种格式:“AT” 每一个后面都有空格