diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pebble/MorpheuzSampleProvider.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pebble/MorpheuzSampleProvider.java index bbe0a331..1867c341 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pebble/MorpheuzSampleProvider.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pebble/MorpheuzSampleProvider.java @@ -5,10 +5,10 @@ import nodomain.freeyourgadget.gadgetbridge.model.ActivityKind; public class MorpheuzSampleProvider implements SampleProvider { // raw types - public static final byte TYPE_DEEP_SLEEP = 5; - public static final byte TYPE_LIGHT_SLEEP = 4; - public static final byte TYPE_ACTIVITY = -1; - public static final byte TYPE_UNKNOWN = -1; + public static final int TYPE_DEEP_SLEEP = 5; + public static final int TYPE_LIGHT_SLEEP = 4; + public static final int TYPE_ACTIVITY = -1; + public static final int TYPE_UNKNOWN = -1; protected float movementDivisor = 5000f; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/AppMessageHandlerMorpheuz.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/AppMessageHandlerMorpheuz.java index 3d22a4d1..3c6517d6 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/AppMessageHandlerMorpheuz.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/AppMessageHandlerMorpheuz.java @@ -80,10 +80,10 @@ public class AppMessageHandlerMorpheuz extends AppMessageHandler { // we have no base timestamp but received points, stop this ctrl_message = AppMessageHandlerMorpheuz.CTRL_VERSION_DONE | AppMessageHandlerMorpheuz.CTRL_GONEOFF_DONE | AppMessageHandlerMorpheuz.CTRL_TRANSMIT_DONE | AppMessageHandlerMorpheuz.CTRL_SET_LAST_SENT; } else { - short index = (short) ((int) pair.second >> 16); - short intensity = (short) ((int) pair.second & 0xffff); + int index = ((int) pair.second >> 16); + int intensity = ((int) pair.second & 0xffff); LOG.info("got point:" + index + " " + intensity); - byte type = MorpheuzSampleProvider.TYPE_UNKNOWN; + int type = MorpheuzSampleProvider.TYPE_UNKNOWN; if (intensity <= 120) { type = MorpheuzSampleProvider.TYPE_DEEP_SLEEP; } else if (intensity <= 1000) { @@ -93,7 +93,7 @@ public class AppMessageHandlerMorpheuz extends AppMessageHandler { DBHandler db = null; try { db = GBApplication.acquireDB(); - db.addGBActivitySample(recording_base_timestamp + index * 600, SampleProvider.PROVIDER_PEBBLE_MORPHEUZ, intensity, (byte) 0, type, (short) 0); + db.addGBActivitySample(recording_base_timestamp + index * 600, SampleProvider.PROVIDER_PEBBLE_MORPHEUZ, intensity, 0, type, 0); } catch (GBException e) { LOG.error("Error acquiring database", e); } finally {