I am working with a new version of api for Android 4.3. I can scan, connect, detect etc characteristics from my LE device.
In the case of reading the characteristic value, for some characteristics, I receive answers, and for some others I do not receive an answer. // Assuming this is a device error
The problem is the write operation. The device has 2 recording characteristics. when I try to record them, 2 cases happen in random order -
- onWriteCharacteristic is not called, and the value does not change on the device.
- onWriteCharacteristic is called with a successful status, although WriteType is set to WRITE_TYPE_NO_RESPONSE, but the change in value does not change.
Some non-4.3 applications successfully change characteristic values. So this is not a device error, I think.
Any insights or help would be greatly appreciated.
EDIT 1: Here is a snippet of a log when I try to write a testimonial for a device.
08-26 10:59:49.181: D/BluetoothGatt(13516): writeCharacteristic() - uuid: 00002a06-0000-1000-8000-00805f9b34fb 08-26 10:59:49.181: D/BtGatt.GattService(1082): writeCharacteristic() - address=CC:AB:96:49:4C:9F 08-26 10:59:49.181: D/BtGatt.btif(1082): btif_gattc_write_char 08-26 10:59:49.181: D/BtGatt.btif(1082): btgattc_handle_event: Event 1015 08-26 10:59:49.181: D/BtGatt.btif(1082): btif_gattc_upstreams_evt: Event 4 08-26 10:59:49.181: D/BtGatt.GattService(1082): onWriteCharacteristic() - address=CC:AB:96:49:4C:9F, status=0 08-26 10:59:49.181: I/MainActivity(13516): Writing characteristic Initiated for Alert Level:true 08-26 10:59:49.191: D/BluetoothGatt(13516): onCharacteristicWrite() - Device=CC:AB:96:49:4C:9F UUID=00002a06-0000-1000-8000-00805f9b34fb Status=0 08-26 10:59:49.191: I/MainActivity
WriteType is set to WRITE_TYPE_NO_RESPONSE, but I still get an onWriteCharacteristic call, and yet the value does not change on the device.
Can anyone help please?
EDIT 2: I tested the application using nexus-4 and still have the same problem with this phone, but hey, the code works fine on the Samsung S4 and is able to record the characteristic value on the LE device. Is this a problem with the Nexus-4? but this guy says he could write with the Nexus-4 .
source share