Pebble 2/LE: only notify once when first PP packets are incoming

This commit is contained in:
Andreas Shimokawa 2016-12-02 08:50:02 +01:00
parent bc9041a4c9
commit ae2c107ed1
1 changed files with 5 additions and 3 deletions

View File

@ -103,10 +103,12 @@ class PebbleGATTServer extends BluetoothGattServerCallback {
LOG.warn("unexpected write request"); LOG.warn("unexpected write request");
return; return;
} }
if (!mPebbleLESupport.mIsConnected) {
mPebbleLESupport.mIsConnected = true; mPebbleLESupport.mIsConnected = true;
synchronized (mPebbleLESupport) { synchronized (mPebbleLESupport) {
mPebbleLESupport.notify(); mPebbleLESupport.notify();
} }
}
LOG.info("write request: offset = " + offset + " value = " + GB.hexdump(value, 0, -1)); LOG.info("write request: offset = " + offset + " value = " + GB.hexdump(value, 0, -1));
int header = value[0] & 0xff; int header = value[0] & 0xff;
int command = header & 7; int command = header & 7;