From 1bd32b713acfad7241f74fe0508cbb9aa499c99f Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Sun, 21 Jun 2015 23:53:23 +0200 Subject: [PATCH] Pebble: implement encodeFindDevice() by simulating a call --- .../freeyourgadget/gadgetbridge/pebble/PebbleProtocol.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/pebble/PebbleProtocol.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/pebble/PebbleProtocol.java index 1dcf45ac8..35a7b3cd1 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/pebble/PebbleProtocol.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/pebble/PebbleProtocol.java @@ -173,7 +173,7 @@ public class PebbleProtocol extends GBDeviceProtocol { private MorpheuzSupport mMorpheuzSupport = new MorpheuzSupport(PebbleProtocol.this); private WeatherNeatSupport mWeatherNeatSupport = new WeatherNeatSupport(PebbleProtocol.this); - private static byte[] encodeSimpleMessage( short endpoint, byte command ) { + private static byte[] encodeSimpleMessage(short endpoint, byte command) { ByteBuffer buf = ByteBuffer.allocate(LENGTH_PREFIX + LENGTH_SIMPLEMESSAGE); buf.order(ByteOrder.BIG_ENDIAN); buf.putShort(LENGTH_SIMPLEMESSAGE); @@ -284,6 +284,11 @@ public class PebbleProtocol extends GBDeviceProtocol { return buf.array(); } + @Override + public byte[] encodeFindDevice(boolean start) { + return encodeSetCallState("Where are you?", "Gadgetbridge", start ? GBCommand.CALL_INCOMING : GBCommand.CALL_END); + } + private static byte[] encodeExtensibleNotification(int id, int timestamp, String[] parts) { // Calculate length first byte attributes_count = 0;