CalibrationState calibrationState() { return CalibrationState.parse(state); }
CalibrationState calibrationState() { return CalibrationState.parse(state); }
public static CalibrationState parse(int state) { return parse((byte) state); }
public static CalibrationState parse(int state) { return parse((byte) state); }
CalibrationState calibrationState() { return CalibrationState.parse(state); }
public static CalibrationState parse(int state) { return parse((byte) state); }
public GlucoseRxMessage(byte[] packet) { UserError.Log.d(TAG, "GlucoseRX dbg: " + JoH.bytesToHex(packet)); if (packet.length >= 14) { data = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN); if ((data.get() == opcode) && checkCRC(packet)) { data = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN); status_raw = data.get(1); status = TransmitterStatus.getBatteryLevel(data.get(1)); sequence = data.getInt(2); timestamp = data.getInt(6); int glucoseBytes = data.getShort(10); // check signed vs unsigned!! glucoseIsDisplayOnly = (glucoseBytes & 0xf000) > 0; glucose = glucoseBytes & 0xfff; state = data.get(12); trend = data.get(13); if (glucose > 13) { unfiltered = glucose * 1000; filtered = glucose * 1000; } else { filtered = glucose; unfiltered = glucose; } UserError.Log.d(TAG, "GlucoseRX: seq:" + sequence + " ts:" + timestamp + " sg:" + glucose + " do:" + glucoseIsDisplayOnly + " ss:" + status + " sr:" + status_raw + " st:" + CalibrationState.parse(state) + " tr:" + getTrend()); } } else { UserError.Log.d(TAG, "GlucoseRxMessage packet length received wrong: " + packet.length); } }
private static CalibrationState getStoredCalibrationState() { if (JoH.msSince(PersistentStore.getLong(OB1G5_STATESTORE_TIME)) < HOUR_IN_MS * 2) { return CalibrationState.parse(PersistentStore.getByte(OB1G5_STATESTORE)); } return CalibrationState.Unknown; }
private static CalibrationState getStoredCalibrationState() { if (JoH.msSince(PersistentStore.getLong(OB1G5_STATESTORE_TIME)) < HOUR_IN_MS * 2) { return CalibrationState.parse(PersistentStore.getByte(OB1G5_STATESTORE)); } return CalibrationState.Unknown; }
private static CalibrationState getStoredCalibrationState() { if (JoH.msSince(PersistentStore.getLong(OB1G5_STATESTORE_TIME)) < HOUR_IN_MS * 2) { return CalibrationState.parse(PersistentStore.getByte(OB1G5_STATESTORE)); } return CalibrationState.Unknown; }
public GlucoseRxMessage(byte[] packet) { UserError.Log.d(TAG, "GlucoseRX dbg: " + JoH.bytesToHex(packet)); if (packet.length >= 14) { data = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN); if ((data.get() == opcode) && checkCRC(packet)) { data = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN); status_raw = data.get(1); status = TransmitterStatus.getBatteryLevel(data.get(1)); sequence = data.getInt(2); timestamp = data.getInt(6); int glucoseBytes = data.getShort(10); // check signed vs unsigned!! glucoseIsDisplayOnly = (glucoseBytes & 0xf000) > 0; glucose = glucoseBytes & 0xfff; state = data.get(12); trend = data.get(13); if (glucose > 13) { unfiltered = glucose * 1000; filtered = glucose * 1000; } else { filtered = glucose; unfiltered = glucose; } UserError.Log.d(TAG, "GlucoseRX: seq:" + sequence + " ts:" + timestamp + " sg:" + glucose + " do:" + glucoseIsDisplayOnly + " ss:" + status + " sr:" + status_raw + " st:" + CalibrationState.parse(state) + " tr:" + getTrend()); } } else { UserError.Log.d(TAG, "GlucoseRxMessage packet length received wrong: " + packet.length); } }
public GlucoseRxMessage(byte[] packet) { UserError.Log.d(TAG, "GlucoseRX dbg: " + JoH.bytesToHex(packet)); if (packet.length >= 14) { data = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN); if ((data.get() == opcode) && checkCRC(packet)) { data = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN); status_raw = data.get(1); status = TransmitterStatus.getBatteryLevel(data.get(1)); sequence = data.getInt(2); timestamp = data.getInt(6); int glucoseBytes = data.getShort(10); // check signed vs unsigned!! glucoseIsDisplayOnly = (glucoseBytes & 0xf000) > 0; glucose = glucoseBytes & 0xfff; state = data.get(12); trend = data.get(13); if (glucose > 13) { unfiltered = glucose * 1000; filtered = glucose * 1000; } else { filtered = glucose; unfiltered = glucose; } UserError.Log.d(TAG, "GlucoseRX: seq:" + sequence + " ts:" + timestamp + " sg:" + glucose + " do:" + glucoseIsDisplayOnly + " ss:" + status + " sr:" + status_raw + " st:" + CalibrationState.parse(state) + " tr:" + getTrend()); } } else { UserError.Log.d(TAG, "GlucoseRxMessage packet length received wrong: " + packet.length); } }
public EGlucoseRxMessage(byte[] packet) { UserError.Log.d(TAG, "EGlucoseRX dbg: " + JoH.bytesToHex(packet)); if (packet.length >= 14) { data = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN); if ((data.get() == opcode) && checkCRC(packet)) { //status_raw = data.get(); status = TransmitterStatus.getBatteryLevel(data.get()); // ?? sequence = data.getInt(); timestamp = data.getInt(); int glucoseBytes = data.getShort(); // check signed vs unsigned!! glucoseIsDisplayOnly = (glucoseBytes & 0xf000) > 0; glucose = glucoseBytes & 0xfff; state = data.get(); trend = data.get(); if (glucose > 13) { unfiltered = glucose * 1000; filtered = glucose * 1000; } else { filtered = glucose; unfiltered = glucose; } predicted_glucose = data.getShort() & 0x03ff; // needs mask??? // remaining bits?? UserError.Log.d(TAG, "EGlucoseRX: seq:" + sequence + " ts:" + timestamp + " sg:" + glucose + " psg: " + predicted_glucose + " do:" + glucoseIsDisplayOnly + " ss:" + status + " sr:" + status_raw + " st:" + CalibrationState.parse(state) + " tr:" + getTrend()); } } else { UserError.Log.d(TAG, "GlucoseRxMessage packet length received wrong: " + packet.length); } }
public EGlucoseRxMessage(byte[] packet) { UserError.Log.d(TAG, "EGlucoseRX dbg: " + JoH.bytesToHex(packet)); if (packet.length >= 14) { data = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN); if ((data.get() == opcode) && checkCRC(packet)) { //status_raw = data.get(); status = TransmitterStatus.getBatteryLevel(data.get()); // ?? sequence = data.getInt(); timestamp = data.getInt(); int glucoseBytes = data.getShort(); // check signed vs unsigned!! glucoseIsDisplayOnly = (glucoseBytes & 0xf000) > 0; glucose = glucoseBytes & 0xfff; state = data.get(); trend = data.get(); if (glucose > 13) { unfiltered = glucose * 1000; filtered = glucose * 1000; } else { filtered = glucose; unfiltered = glucose; } predicted_glucose = data.getShort() & 0x03ff; // needs mask??? // remaining bits?? UserError.Log.d(TAG, "EGlucoseRX: seq:" + sequence + " ts:" + timestamp + " sg:" + glucose + " psg: " + predicted_glucose + " do:" + glucoseIsDisplayOnly + " ss:" + status + " sr:" + status_raw + " st:" + CalibrationState.parse(state) + " tr:" + getTrend()); } } else { UserError.Log.d(TAG, "GlucoseRxMessage packet length received wrong: " + packet.length); } }
public EGlucoseRxMessage(byte[] packet) { UserError.Log.d(TAG, "EGlucoseRX dbg: " + JoH.bytesToHex(packet)); if (packet.length >= 14) { data = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN); if ((data.get() == opcode) && checkCRC(packet)) { //status_raw = data.get(); status = TransmitterStatus.getBatteryLevel(data.get()); // ?? sequence = data.getInt(); timestamp = data.getInt(); int glucoseBytes = data.getShort(); // check signed vs unsigned!! glucoseIsDisplayOnly = (glucoseBytes & 0xf000) > 0; glucose = glucoseBytes & 0xfff; state = data.get(); trend = data.get(); if (glucose > 13) { unfiltered = glucose * 1000; filtered = glucose * 1000; } else { filtered = glucose; unfiltered = glucose; } predicted_glucose = data.getShort() & 0x03ff; // needs mask??? // remaining bits?? UserError.Log.d(TAG, "EGlucoseRX: seq:" + sequence + " ts:" + timestamp + " sg:" + glucose + " psg: " + predicted_glucose + " do:" + glucoseIsDisplayOnly + " ss:" + status + " sr:" + status_raw + " st:" + CalibrationState.parse(state) + " tr:" + getTrend()); } } else { UserError.Log.d(TAG, "GlucoseRxMessage packet length received wrong: " + packet.length); } }
final byte trend = data.get(); final CalibrationState state = CalibrationState.parse(type);
final byte trend = data.get(); final CalibrationState state = CalibrationState.parse(type);
final byte trend = data.get(); final CalibrationState state = CalibrationState.parse(type);
Ob1G5CollectionService.processCalibrationState(CalibrationState.parse(calibration_state)); Ob1G5StateMachine.injectDexTime(dataMap.getString("dextime", null));
Ob1G5CollectionService.processCalibrationState(CalibrationState.parse(calibration_state)); Ob1G5StateMachine.injectDexTime(dataMap.getString("dextime", null));