问题描述
我执行一个简单的写命令
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 回调函数中得到响应。
这是无代码应用程序的链接:
http://lpccs-docs.dialog-semiconductor.com/UM-140-DA145x-CodeLess/howToUse.html#software-setup
解决方法
我已经解决了这个问题。问题要简单得多。是我没有在每个“AT”命令后发送空格。所以命令需要特别采用这种格式:“AT” 每个后面都有空格。