2

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.

Thomas
  • 8,306
  • 8
  • 53
  • 92

1 Answers1

1

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

Thomas
  • 8,306
  • 8
  • 53
  • 92
  • Hi ! On some Samsung device with different android version I have the same problem. Do you Have found a solution? – aeroxr1 Apr 12 '16 at 17:19
  • another thing that helped : issue the reads/writes on the uithread (seems strange but worked) – Thomas Apr 12 '16 at 23:53
  • I already do writes on ui thread but Samsung continue to gives me some problems :/ – aeroxr1 Apr 13 '16 at 00:16