1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2025-01-13 11:17:33 +01:00

InfiniTime: Implement find device by simulating a phone call

This commit is contained in:
Andreas Shimokawa 2021-04-05 17:33:23 +02:00
parent 787216f1bc
commit b7e0e6e44d

View File

@ -405,9 +405,10 @@ public class PineTimeJFSupport extends AbstractBTLEDeviceSupport implements DfuL
@Override
public void onFindDevice(boolean start) {
TransactionBuilder builder = new TransactionBuilder("Enable alert");
builder.write(getCharacteristic(GattCharacteristic.UUID_CHARACTERISTIC_ALERT_LEVEL), new byte[]{(byte) (start ? 0x01 : 0x00)});
builder.queue(getQueue());
CallSpec callSpec = new CallSpec();
callSpec.command = start ? CallSpec.CALL_INCOMING : CallSpec.CALL_END;
callSpec.name = "Gadgetbridge";
onSetCallState(callSpec);
}
@Override