private static String devName() { return usingG6() ? "G6" : "G5"; } }
private static String devName() { return usingG6() ? "G6" : "G5"; } }
private static String devName() { return usingG6() ? "G6" : "G5"; } }
private static boolean getEGlucose() { // if (android_wear) { return usingG6() && Pref.getBooleanDefaultFalse("show_g_prediction"); // } else { // return usingG6(); // } }
private static boolean getEGlucose() { // if (android_wear) { return usingG6() && Pref.getBooleanDefaultFalse("show_g_prediction"); // } else { // return usingG6(); // } }
private static boolean getEGlucose() { // if (android_wear) { return usingG6() && Pref.getBooleanDefaultFalse("show_g_prediction"); // } else { // return usingG6(); // } }
private void realStartSensor() { if (Ob1G5CollectionService.usingCollector() && Ob1G5StateMachine.usingG6()) { G6CalibrationCodeDialog.ask(this, this::realRealStartSensor); } else { realRealStartSensor(); } }
private void realStartSensor() { if (Ob1G5CollectionService.usingCollector() && Ob1G5StateMachine.usingG6()) { G6CalibrationCodeDialog.ask(this, this::realRealStartSensor); } else { realRealStartSensor(); } }
private static void processSensorRxMessage(SensorRxMessage sensorRx) { if (sensorRx == null) return; // TODO, is this accurate or needed? int sensor_battery_level = 0; if (sensorRx.status == TransmitterStatus.BRICKED) { sensor_battery_level = 206; //will give message "EMPTY" } else if (sensorRx.status == TransmitterStatus.LOW) { sensor_battery_level = 209; //will give message "LOW" } else { sensor_battery_level = 216; //no message, just system status "OK" } UserError.Log.d(TAG, "SUCCESS!! unfiltered: " + sensorRx.unfiltered + " filtered: " + sensorRx.filtered + " timestamp: " + sensorRx.timestamp + " " + JoH.qs((double) sensorRx.timestamp / 86400, 1) + " days :: (" + sensorRx.status + ")"); DexTimeKeeper.updateAge(getTransmitterID(), sensorRx.timestamp); if (sensorRx.unfiltered == 0) { UserError.Log.e(TAG, "Transmitter sent raw sensor value of 0 !! This isn't good. " + JoH.hourMinuteString()); } else { final boolean g6 = usingG6(); final boolean g6r2 = g6 && FirmwareCapability.isTransmitterG6Rev2(getTransmitterID()); processNewTransmitterData(g6 ? (int)(sensorRx.unfiltered * (g6r2 ? G6_REV2_SCALING : G6_SCALING)) : sensorRx.unfiltered, g6 ? (int)(sensorRx.filtered * (g6r2 ? G6_REV2_SCALING : G6_SCALING)) : sensorRx.filtered, sensor_battery_level, new Date().getTime()); } if (WholeHouse.isLive()) { Mimeograph.poll(false); } }
private static void processSensorRxMessage(SensorRxMessage sensorRx) { if (sensorRx == null) return; // TODO, is this accurate or needed? int sensor_battery_level = 0; if (sensorRx.status == TransmitterStatus.BRICKED) { sensor_battery_level = 206; //will give message "EMPTY" } else if (sensorRx.status == TransmitterStatus.LOW) { sensor_battery_level = 209; //will give message "LOW" } else { sensor_battery_level = 216; //no message, just system status "OK" } UserError.Log.d(TAG, "SUCCESS!! unfiltered: " + sensorRx.unfiltered + " filtered: " + sensorRx.filtered + " timestamp: " + sensorRx.timestamp + " " + JoH.qs((double) sensorRx.timestamp / 86400, 1) + " days :: (" + sensorRx.status + ")"); DexTimeKeeper.updateAge(getTransmitterID(), sensorRx.timestamp); if (sensorRx.unfiltered == 0) { UserError.Log.e(TAG, "Transmitter sent raw sensor value of 0 !! This isn't good. " + JoH.hourMinuteString()); } else { final boolean g6 = usingG6(); final boolean g6r2 = g6 && FirmwareCapability.isTransmitterG6Rev2(getTransmitterID()); processNewTransmitterData(g6 ? (int)(sensorRx.unfiltered * (g6r2 ? G6_REV2_SCALING : G6_SCALING)) : sensorRx.unfiltered, g6 ? (int)(sensorRx.filtered * (g6r2 ? G6_REV2_SCALING : G6_SCALING)) : sensorRx.filtered, sensor_battery_level, new Date().getTime()); } if (WholeHouse.isLive()) { Mimeograph.poll(false); } }
private static void processSensorRxMessage(SensorRxMessage sensorRx) { if (sensorRx == null) return; // TODO, is this accurate or needed? int sensor_battery_level = 0; if (sensorRx.status == TransmitterStatus.BRICKED) { sensor_battery_level = 206; //will give message "EMPTY" } else if (sensorRx.status == TransmitterStatus.LOW) { sensor_battery_level = 209; //will give message "LOW" } else { sensor_battery_level = 216; //no message, just system status "OK" } UserError.Log.d(TAG, "SUCCESS!! unfiltered: " + sensorRx.unfiltered + " filtered: " + sensorRx.filtered + " timestamp: " + sensorRx.timestamp + " " + JoH.qs((double) sensorRx.timestamp / 86400, 1) + " days :: (" + sensorRx.status + ")"); DexTimeKeeper.updateAge(getTransmitterID(), sensorRx.timestamp); if (sensorRx.unfiltered == 0) { UserError.Log.e(TAG, "Transmitter sent raw sensor value of 0 !! This isn't good. " + JoH.hourMinuteString()); } else { final boolean g6 = usingG6(); final boolean g6r2 = g6 && FirmwareCapability.isTransmitterG6Rev2(getTransmitterID()); processNewTransmitterData(g6 ? (int)(sensorRx.unfiltered * (g6r2 ? G6_REV2_SCALING : G6_SCALING)) : sensorRx.unfiltered, g6 ? (int)(sensorRx.filtered * (g6r2 ? G6_REV2_SCALING : G6_SCALING)) : sensorRx.filtered, sensor_battery_level, new Date().getTime()); } if (WholeHouse.isLive()) { Mimeograph.poll(false); } }
public static void evaluateG6Settings() { if (haveFirmwareDetails()) { if (FirmwareCapability.isTransmitterG6(getTransmitterID())) { if (!usingG6()) { Ob1G5CollectionService.setG6Defaults(); JoH.showNotification("Enabled G6", "G6 Features and default settings automatically enabled", null, Constants.G6_DEFAULTS_MESSAGE, false, true, false); } else if (!onlyUsingNativeMode() && !Home.get_engineering_mode()) { // TODO revisit this now that there is scaling Ob1G5CollectionService.setG6Defaults(); JoH.showNotification("Enabled G6", "G6 Native mode enabled", null, Constants.G6_DEFAULTS_MESSAGE, false, true, false); } } } }
public static void evaluateG6Settings() { if (haveFirmwareDetails()) { if (FirmwareCapability.isTransmitterG6(getTransmitterID())) { if (!usingG6()) { Ob1G5CollectionService.setG6Defaults(); JoH.showNotification("Enabled G6", "G6 Features and default settings automatically enabled", null, Constants.G6_DEFAULTS_MESSAGE, false, true, false); } else if (!onlyUsingNativeMode() && !Home.get_engineering_mode()) { // TODO revisit this now that there is scaling Ob1G5CollectionService.setG6Defaults(); JoH.showNotification("Enabled G6", "G6 Native mode enabled", null, Constants.G6_DEFAULTS_MESSAGE, false, true, false); } } } }
public static void evaluateG6Settings() { if (haveFirmwareDetails()) { if (FirmwareCapability.isTransmitterG6(getTransmitterID())) { if (!usingG6()) { Ob1G5CollectionService.setG6Defaults(); JoH.showNotification("Enabled G6", "G6 Features and default settings automatically enabled", null, Constants.G6_DEFAULTS_MESSAGE, false, true, false); } else if (!onlyUsingNativeMode() && !Home.get_engineering_mode()) { // TODO revisit this now that there is scaling Ob1G5CollectionService.setG6Defaults(); JoH.showNotification("Enabled G6", "G6 Native mode enabled", null, Constants.G6_DEFAULTS_MESSAGE, false, true, false); } } } }
private static void reprocessTxMessage(BaseMessage tm) { // rewrite session start messages in case our clock was wrong if (tm instanceof SessionStartTxMessage) { final SessionStartTxMessage ssm = (SessionStartTxMessage) tm; if (usingG6()) { final String code = G6CalibrationParameters.getCurrentSensorCode(); if (code == null) { UserError.Log.wtf(TAG, "Cannot reprocess start G6 sensor as calibration code not set!"); } else { // g6 tm.byteSequence = new SessionStartTxMessage(ssm.getStartTime(), DexTimeKeeper.getDexTime(getTransmitterID(), ssm.getStartTime()), code).byteSequence; } } else { // g5 tm.byteSequence = new SessionStartTxMessage(ssm.getStartTime(), DexTimeKeeper.getDexTime(getTransmitterID(), ssm.getStartTime())).byteSequence; } UserError.Log.d(TAG, "New session start: " + ssm.getDexTime() + " for time: " + JoH.dateTimeText(ssm.getStartTime())); if (d) { UserError.Log.d(TAG, "New packet: " + HexDump.dumpHexString(tm.byteSequence)); } } }
private static void reprocessTxMessage(BaseMessage tm) { // rewrite session start messages in case our clock was wrong if (tm instanceof SessionStartTxMessage) { final SessionStartTxMessage ssm = (SessionStartTxMessage) tm; if (usingG6()) { final String code = G6CalibrationParameters.getCurrentSensorCode(); if (code == null) { UserError.Log.wtf(TAG, "Cannot reprocess start G6 sensor as calibration code not set!"); } else { // g6 tm.byteSequence = new SessionStartTxMessage(ssm.getStartTime(), DexTimeKeeper.getDexTime(getTransmitterID(), ssm.getStartTime()), code).byteSequence; } } else { // g5 tm.byteSequence = new SessionStartTxMessage(ssm.getStartTime(), DexTimeKeeper.getDexTime(getTransmitterID(), ssm.getStartTime())).byteSequence; } UserError.Log.d(TAG, "New session start: " + ssm.getDexTime() + " for time: " + JoH.dateTimeText(ssm.getStartTime())); if (d) { UserError.Log.d(TAG, "New packet: " + HexDump.dumpHexString(tm.byteSequence)); } } }
private static void reprocessTxMessage(BaseMessage tm) { // rewrite session start messages in case our clock was wrong if (tm instanceof SessionStartTxMessage) { final SessionStartTxMessage ssm = (SessionStartTxMessage) tm; if (usingG6()) { final String code = G6CalibrationParameters.getCurrentSensorCode(); if (code == null) { UserError.Log.wtf(TAG, "Cannot reprocess start G6 sensor as calibration code not set!"); } else { // g6 tm.byteSequence = new SessionStartTxMessage(ssm.getStartTime(), DexTimeKeeper.getDexTime(getTransmitterID(), ssm.getStartTime()), code).byteSequence; } } else { // g5 tm.byteSequence = new SessionStartTxMessage(ssm.getStartTime(), DexTimeKeeper.getDexTime(getTransmitterID(), ssm.getStartTime())).byteSequence; } UserError.Log.d(TAG, "New session start: " + ssm.getDexTime() + " for time: " + JoH.dateTimeText(ssm.getStartTime())); if (d) { UserError.Log.d(TAG, "New packet: " + HexDump.dumpHexString(tm.byteSequence)); } } }
public static void startSensor(long when) { if (acceptCommands()) { if (msSince(when) > MAX_START_TIME_REWIND) { when = JoH.tsl() - MAX_START_TIME_REWIND; UserError.Log.e(TAG, "Cannot rewind sensor start time beyond: " + JoH.dateTimeText(when)); } if (usingG6()) { final String code = G6CalibrationParameters.getCurrentSensorCode(); if (code == null) { UserError.Log.wtf(TAG, "Cannot start G6 sensor as calibration code not set!"); } else { UserError.Log.ueh(TAG, "Starting G6 sensor using calibration code: " + code); enqueueUniqueCommand(new SessionStartTxMessage(when, DexTimeKeeper.getDexTime(getTransmitterID(), when), code), "Start G6 Sensor"); } } else { UserError.Log.ueh(TAG, "Starting G5 sensor"); enqueueUniqueCommand(new SessionStartTxMessage(when, DexTimeKeeper.getDexTime(getTransmitterID(), when)), "Start G5 Sensor"); } } }
public static void startSensor(long when) { if (acceptCommands()) { if (msSince(when) > MAX_START_TIME_REWIND) { when = JoH.tsl() - MAX_START_TIME_REWIND; UserError.Log.e(TAG, "Cannot rewind sensor start time beyond: " + JoH.dateTimeText(when)); } if (usingG6()) { final String code = G6CalibrationParameters.getCurrentSensorCode(); if (code == null) { UserError.Log.wtf(TAG, "Cannot start G6 sensor as calibration code not set!"); } else { UserError.Log.ueh(TAG, "Starting G6 sensor using calibration code: " + code); enqueueUniqueCommand(new SessionStartTxMessage(when, DexTimeKeeper.getDexTime(getTransmitterID(), when), code), "Start G6 Sensor"); } } else { UserError.Log.ueh(TAG, "Starting G5 sensor"); enqueueUniqueCommand(new SessionStartTxMessage(when, DexTimeKeeper.getDexTime(getTransmitterID(), when)), "Start G5 Sensor"); } } }
public static void startSensor(long when) { if (acceptCommands()) { if (msSince(when) > MAX_START_TIME_REWIND) { when = JoH.tsl() - MAX_START_TIME_REWIND; UserError.Log.e(TAG, "Cannot rewind sensor start time beyond: " + JoH.dateTimeText(when)); } if (usingG6()) { final String code = G6CalibrationParameters.getCurrentSensorCode(); if (code == null) { UserError.Log.wtf(TAG, "Cannot start G6 sensor as calibration code not set!"); } else { UserError.Log.ueh(TAG, "Starting G6 sensor using calibration code: " + code); enqueueUniqueCommand(new SessionStartTxMessage(when, DexTimeKeeper.getDexTime(getTransmitterID(), when), code), "Start G6 Sensor"); } } else { UserError.Log.ueh(TAG, "Starting G5 sensor"); enqueueUniqueCommand(new SessionStartTxMessage(when, DexTimeKeeper.getDexTime(getTransmitterID(), when)), "Start G5 Sensor"); } } }