Pebble 2: work around FW installation problems

Wait a 0.5s after each complete Pebble packet and do not longer wait at all after a completed GATT package chunk (was 0.1s)
Big outgoing messages will be now much faster such as firmware installations but smaller take more time than before.

(This is not the proper fix but I could update the firmware this way, failed 10 times before after a few percent)
This commit is contained in:
Andreas Shimokawa 2016-11-24 18:52:58 +01:00
parent 5b804effa4
commit 381323011e
2 changed files with 5 additions and 5 deletions

View File

@ -57,12 +57,7 @@ class PebbleGATTServer extends BluetoothGattServerCallback {
LOG.info("send data to pebble " + GB.hexdump(data, 0, -1));
writeCharacteristics.setValue(data.clone());
mBluetoothGattServer.notifyCharacteristicChanged(mBtDevice, writeCharacteristics, false);
try {
Thread.sleep(100); // FIXME: bad bad, I mean BAAAD
} catch (InterruptedException ignore) {
}
}
synchronized private void sendAckToPebble(int serial) {

View File

@ -126,6 +126,11 @@ public class PebbleLESupport {
payloadToSend -= chunkSize;
}
try {
Thread.sleep(500); // FIXME ugly wait 0.5s after each pebble package send to the pebble (we do not wait for the GATT chunks)
} catch (InterruptedException ignore) {
}
} catch (IOException e) {
LOG.warn("IO exception");
mQuit = true;