From c325ba1a22e60ef6ab6624b648d6f41f36f2417a Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Sun, 19 Nov 2017 23:46:24 +0100 Subject: [PATCH] Amazfit Bip: show find phone events (not yet supported) --- .../service/devices/huami/HuamiDeviceEvent.java | 4 +++- .../service/devices/miband2/MiBand2Support.java | 13 ++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/HuamiDeviceEvent.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/HuamiDeviceEvent.java index db087979c..7a643eacf 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/HuamiDeviceEvent.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/HuamiDeviceEvent.java @@ -24,8 +24,10 @@ public class HuamiDeviceEvent { public static final byte BUTTON_PRESSED = 0x04; public static final byte START_NONWEAR = 0x06; public static final byte CALL_REJECT = 0x07; - public static final byte CALL_ACCEPT = 0x09; + public static final byte FIND_PHONE_START = 0x08; + public static final byte CALL_IGNORE = 0x09; public static final byte ALARM_TOGGLED = 0x0a; public static final byte BUTTON_PRESSED_LONG = 0x0b; public static final byte TICK_30MIN = 0x0e; // unsure + public static final byte FIND_PHONE_STOP = 0x0f; } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband2/MiBand2Support.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband2/MiBand2Support.java index e10cd3504..b05bba84a 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband2/MiBand2Support.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband2/MiBand2Support.java @@ -923,9 +923,10 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport { callCmd.event = GBDeviceEventCallControl.Event.REJECT; evaluateGBDeviceEvent(callCmd); break; - case HuamiDeviceEvent.CALL_ACCEPT: - callCmd.event = GBDeviceEventCallControl.Event.ACCEPT; - evaluateGBDeviceEvent(callCmd); + case HuamiDeviceEvent.CALL_IGNORE: + LOG.info("ignore call (not yet supported)"); + //callCmd.event = GBDeviceEventCallControl.Event.IGNORE; + //evaluateGBDeviceEvent(callCmd); break; case HuamiDeviceEvent.BUTTON_PRESSED: LOG.info("button pressed"); @@ -952,6 +953,12 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport { case HuamiDeviceEvent.TICK_30MIN: LOG.info("Tick 30 min (?)"); break; + case HuamiDeviceEvent.FIND_PHONE_START: + LOG.info("find phone started (not yet supported)"); + break; + case HuamiDeviceEvent.FIND_PHONE_STOP: + LOG.info("find phone stopped (not yet supported)"); + break; default: LOG.warn("unhandled event " + value[0]); }