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:
parent
5b804effa4
commit
381323011e
|
@ -57,12 +57,7 @@ class PebbleGATTServer extends BluetoothGattServerCallback {
|
||||||
LOG.info("send data to pebble " + GB.hexdump(data, 0, -1));
|
LOG.info("send data to pebble " + GB.hexdump(data, 0, -1));
|
||||||
writeCharacteristics.setValue(data.clone());
|
writeCharacteristics.setValue(data.clone());
|
||||||
|
|
||||||
|
|
||||||
mBluetoothGattServer.notifyCharacteristicChanged(mBtDevice, writeCharacteristics, false);
|
mBluetoothGattServer.notifyCharacteristicChanged(mBtDevice, writeCharacteristics, false);
|
||||||
try {
|
|
||||||
Thread.sleep(100); // FIXME: bad bad, I mean BAAAD
|
|
||||||
} catch (InterruptedException ignore) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized private void sendAckToPebble(int serial) {
|
synchronized private void sendAckToPebble(int serial) {
|
||||||
|
|
|
@ -126,6 +126,11 @@ public class PebbleLESupport {
|
||||||
payloadToSend -= chunkSize;
|
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) {
|
} catch (IOException e) {
|
||||||
LOG.warn("IO exception");
|
LOG.warn("IO exception");
|
||||||
mQuit = true;
|
mQuit = true;
|
||||||
|
|
Loading…
Reference in New Issue