Pebble 2/LE: try to improve pairing results by setting another unknown flag

This might help with "bad pairing" where a pebble wont connect anymore after toggling bluetooth on the watch
A workaround was to scan bluetooth before connecting after toggling bluetooth on the watch
master
Andreas Shimokawa 2017-05-28 23:43:37 +02:00
parent 737578debc
commit 05a4486277
1 changed files with 8 additions and 1 deletions

View File

@ -164,7 +164,14 @@ class PebbleGATTClient extends BluetoothGattCallback {
if (doPairing) {
BluetoothGattCharacteristic characteristic = gatt.getService(SERVICE_UUID).getCharacteristic(PAIRING_TRIGGER_CHARACTERISTIC);
if ((characteristic.getProperties() & PROPERTY_WRITE) != 0) {
characteristic.setValue(new byte[]{1});
LOG.info("This seems to be a >=4.0 FW Pebble, writing to pairing trigger");
// flags:
// 0 - always 1
// 1 - unknown
// 2 - always 0
// 3 - unknown, set on kitkat (seems to help to get a "better" pairing)
// 4 - unknown, set on some phones
characteristic.setValue(new byte[]{9});
gatt.writeCharacteristic(characteristic);
} else {
LOG.info("This seems to be some <4.0 FW Pebble, reading pairing trigger");