Search code examples
androidbluetooth-lowenergysamsung-mobile-sdk

BLE Samsung : problems writing to characteristic


I have some simple code that runs fine on Android 4.3 (non samsung). When translating to Samsung's BLE SDK for < 4.3, I find that I can read and be notified but I can't write to my characteristic

BluetoothGattCharacteristic characteristic = mBluetoothGatt.getService(device_, UUID_SERVICE).getCharacteristic(UUID_CHARACTERISTIC);
characteristic.setValue(new byte[]{0x01});
mBluetoothGatt.writeCharacteristic(characteristic);

Any idea what's wrong ? I don't get any error/exception. onCharacteristicWrite is not called either, and when checking with the 4.3 device I see the characteristic hasn't changed.


Solution

  • What was wrong : I had to space read and writes more (200 ms seemed to work)