From 603d31a59e7418bc668bb64609b5db378faf4cab Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Sat, 30 May 2015 21:52:29 +0200 Subject: [PATCH] add some constants to GBActivitySample --- .../freeyourgadget/gadgetbridge/GBActivitySample.java | 6 ++++++ .../freeyourgadget/gadgetbridge/pebble/MorpheuzSupport.java | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBActivitySample.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBActivitySample.java index 5348b6de..2e4ae9cc 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBActivitySample.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBActivitySample.java @@ -1,6 +1,12 @@ package nodomain.freeyourgadget.gadgetbridge; public class GBActivitySample { + public static final byte PROVIDER_MIBAND = 0; + public static final byte PROVIDER_PEBBLE_MORPHEUZ = 1; + + public static final byte TYPE_SLEEP = 0; //FIXME: we could just adapt to Mi Band (Dont know the correct values) + // add more here + private final int timestamp; private final byte provider; private final short intensity; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/pebble/MorpheuzSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/pebble/MorpheuzSupport.java index 203ffba9..7c83fe1e 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/pebble/MorpheuzSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/pebble/MorpheuzSupport.java @@ -11,6 +11,7 @@ import java.util.SimpleTimeZone; import java.util.TimeZone; import java.util.UUID; +import nodomain.freeyourgadget.gadgetbridge.GBActivitySample; import nodomain.freeyourgadget.gadgetbridge.GBApplication; import nodomain.freeyourgadget.gadgetbridge.protocol.GBDeviceCommand; import nodomain.freeyourgadget.gadgetbridge.protocol.GBDeviceCommandSendBytes; @@ -100,7 +101,7 @@ public class MorpheuzSupport { short data = (short) ((int) pair.second & 0xffff); LOG.info("got point:" + index + " " + data); if (index >= 0 && index < 54) { - GBApplication.getActivityDatabaseHandler().addGBActivitySample(recording_base_timestamp + index * 600, (byte) 1, data, (byte) 0, (byte) 0); + GBApplication.getActivityDatabaseHandler().addGBActivitySample(recording_base_timestamp + index * 600, GBActivitySample.PROVIDER_PEBBLE_MORPHEUZ, data, (byte) 0, GBActivitySample.TYPE_SLEEP); } ctrl_message = MorpheuzSupport.CTRL_VERSION_DONE | MorpheuzSupport.CTRL_SET_LAST_SENT | MorpheuzSupport.CTRL_DO_NEXT;