mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-25 01:55:50 +01:00
change some more short and byte to int regarding Morpheuz
This commit is contained in:
parent
9adae3b538
commit
fc464d112d
@ -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;
|
||||
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user