writeCharacteristic error on Redmi or Xiaomi devices

98 Views Asked by At

I make an app that read and write some chars in BLE.

My operation are there:

  • connect to gatt
  • discover service
  • read char
  • write char

Everything is ok on each device except that for some xiaomi and redmi device. I have a problem on writeCharacteristic, i dont have a response and device don't write nothing on LE periph. After read a characteristics (so into "onCharacteristicRead" callback) I call a write

final BluetoothGattCharacteristic characteristicBadge = mBluetoothGattService.getCharacteristic(UUID_CHARSBADGE);
characteristicBadge.setValue(resultBadge); //resultBadge is an array
characteristicBadge.setWriteType(BluetoothGattCharacteristic.WRITE_TYPE_DEFAULT);
mBluetoothGatt.writeCharacteristic(characteristicBadge);

but i don't have any response, onCharacteristicWrite is never called. I tried everything, connectGatt with autoconnection or not.

Is there anyone with the same problem? I'll be crazy soon..

0

There are 0 best solutions below