diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/action/PrimeAction.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/action/PrimeAction.java index 65d250e399..9dc154134e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/action/PrimeAction.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/action/PrimeAction.java @@ -30,7 +30,7 @@ public class PrimeAction implements OmnipodAction { } public static void updatePrimingStatus(PodSessionState podState, StatusResponse statusResponse) { - if (podState.getSetupProgress().equals(SetupProgress.PRIMING) && statusResponse.getPodProgressStatus().equals(PodProgressStatus.READY_FOR_BASAL_SCHEDULE)) { + if (podState.getSetupProgress().equals(SetupProgress.PRIMING) && statusResponse.getPodProgressStatus().equals(PodProgressStatus.PRIMING_COMPLETED)) { if (LOG.isDebugEnabled()) { LOG.debug("Updating SetupProgress from PRIMING to PRIMING_FINISHED"); } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/action/SetupPodAction.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/action/SetupPodAction.java index b6c81196c6..45cc9fc76e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/action/SetupPodAction.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/action/SetupPodAction.java @@ -56,8 +56,8 @@ public class SetupPodAction implements OmnipodAction { if(setupPodResponse.getAddress() != podState.getAddress()) { throw new IllegalMessageAddressException(podState.getAddress(), setupPodResponse.getAddress()); } - if (setupPodResponse.getPodProgressStatus() != PodProgressStatus.PAIRING_SUCCESS) { - throw new IllegalPodProgressException(PodProgressStatus.PAIRING_SUCCESS, setupPodResponse.getPodProgressStatus()); + if (setupPodResponse.getPodProgressStatus() != PodProgressStatus.PAIRING_COMPLETED) { + throw new IllegalPodProgressException(PodProgressStatus.PAIRING_COMPLETED, setupPodResponse.getPodProgressStatus()); } podState.setSetupProgress(SetupProgress.POD_CONFIGURED); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/PodProgressStatus.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/PodProgressStatus.java index 4bd9780118..1ee1307bd4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/PodProgressStatus.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/PodProgressStatus.java @@ -1,22 +1,22 @@ package info.nightscout.androidaps.plugins.pump.omnipod.defs; public enum PodProgressStatus { - INITIAL_VALUE((byte) 0x00), - TANK_POWER_ACTIVATED((byte) 0x01), - TANK_FILL_COMPLETED((byte) 0x02), - PAIRING_SUCCESS((byte) 0x03), + INITIALIZED((byte) 0x00), + MEMORY_INITIALIZED((byte) 0x01), + REMINDER_INITIALIZED((byte) 0x02), + PAIRING_COMPLETED((byte) 0x03), PRIMING((byte) 0x04), - READY_FOR_BASAL_SCHEDULE((byte) 0x05), - READY_FOR_CANNULA_INSERTION((byte) 0x06), - CANNULA_INSERTING((byte) 0x07), - RUNNING_ABOVE_FIFTY_UNITS((byte) 0x08), - RUNNING_BELOW_FIFTY_UNITS((byte) 0x09), - ONE_NOT_USED_BUT_IN_33((byte) 0x0a), - TWO_NOT_USED_BUT_IN_33((byte) 0x0b), - THREE_NOT_USED_BUT_IN_33((byte) 0x0c), - FAULT_EVENT_OCCURRED((byte) 0x0d), - FAILED_TO_INITIALIZE_IN_TIME((byte) 0x0e), - INACTIVE((byte) 0x0f); + PRIMING_COMPLETED((byte) 0x05), + BASAL_INITIALIZED((byte) 0x06), + INSERTING_CANNULA((byte) 0x07), + ABOVE_FIFTY_UNITS((byte) 0x08), + FIFTY_OR_LESS_UNITS((byte) 0x09), + ONE_NOT_USED((byte) 0x0a), + TWO_NOT_USED((byte) 0x0b), + THREE_NOT_USED((byte) 0x0c), + FAULT_EVENT_OCCURRED((byte) 0x0d), // Fault event occurred (a "screamer") + ACTIVATION_TIME_EXCEEDED((byte) 0x0e), // Took > 2 hours from progress 2 to 3 or > 1 hour from 3 to 8 + INACTIVE((byte) 0x0f); // Pod deactivated or a fatal packet state error private byte value; @@ -38,6 +38,6 @@ public enum PodProgressStatus { } public boolean isReadyForDelivery() { - return this == RUNNING_ABOVE_FIFTY_UNITS || this == RUNNING_BELOW_FIFTY_UNITS; + return this == ABOVE_FIFTY_UNITS || this == FIFTY_OR_LESS_UNITS; } } diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/ErrorResponseTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/ErrorResponseTest.java index 84697c0462..e2bf96ffde 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/ErrorResponseTest.java +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/ErrorResponseTest.java @@ -45,7 +45,7 @@ public class ErrorResponseTest { ErrorResponse errorResponse = new ErrorResponse(ByteUtil.fromHexString("0603101308")); assertEquals(0x10, errorResponse.getErrorResponseCode()); assertEquals(FaultEventCode.MESSAGE_LENGTH_TOO_LONG, errorResponse.getFaultEventCode()); - assertEquals(PodProgressStatus.RUNNING_ABOVE_FIFTY_UNITS, errorResponse.getPodProgressStatus()); + assertEquals(PodProgressStatus.ABOVE_FIFTY_UNITS, errorResponse.getPodProgressStatus()); assertNull(errorResponse.getNonceSearchKey()); } diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/StatusResponseTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/StatusResponseTest.java index d5a79e9ffd..a931ad7b1d 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/StatusResponseTest.java +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/StatusResponseTest.java @@ -42,7 +42,7 @@ public class StatusResponseTest { StatusResponse statusResponse = new StatusResponse(bytes); assertEquals(DeliveryStatus.NORMAL, statusResponse.getDeliveryStatus()); - assertEquals(PodProgressStatus.RUNNING_ABOVE_FIFTY_UNITS, statusResponse.getPodProgressStatus()); + assertEquals(PodProgressStatus.ABOVE_FIFTY_UNITS, statusResponse.getPodProgressStatus()); assertNull("Reservoir level should be null", statusResponse.getReservoirLevel()); assertEquals(Duration.standardMinutes(1307).getMillis(), statusResponse.getTimeActive().getMillis()); assertEquals(60.05, statusResponse.getInsulinDelivered(), 0.000001); @@ -59,7 +59,7 @@ public class StatusResponseTest { StatusResponse statusResponse = new StatusResponse(bytes); assertEquals(DeliveryStatus.NORMAL, statusResponse.getDeliveryStatus()); - assertEquals(PodProgressStatus.RUNNING_BELOW_FIFTY_UNITS, statusResponse.getPodProgressStatus()); + assertEquals(PodProgressStatus.FIFTY_OR_LESS_UNITS, statusResponse.getPodProgressStatus()); assertEquals(24.4, statusResponse.getReservoirLevel(), 0.000001); assertEquals(Duration.standardMinutes(4261).getMillis(), statusResponse.getTimeActive().getMillis()); assertEquals(156.7, statusResponse.getInsulinDelivered(), 0.000001); @@ -93,7 +93,7 @@ public class StatusResponseTest { assertTrue(Duration.standardMinutes(3547).isEqual(statusResponse.getTimeActive())); assertEquals(DeliveryStatus.NORMAL, statusResponse.getDeliveryStatus()); - assertEquals(PodProgressStatus.RUNNING_BELOW_FIFTY_UNITS, statusResponse.getPodProgressStatus()); + assertEquals(PodProgressStatus.FIFTY_OR_LESS_UNITS, statusResponse.getPodProgressStatus()); assertEquals(129.45, statusResponse.getInsulinDelivered(), 0.00001); assertEquals(46.00, statusResponse.getReservoirLevel(), 0.00001); assertEquals(2.2, statusResponse.getInsulinNotDelivered(), 0.0001); diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/VersionResponseTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/VersionResponseTest.java index 891ad81329..4ef96e38ed 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/VersionResponseTest.java +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/VersionResponseTest.java @@ -72,7 +72,7 @@ public class VersionResponseTest { assertEquals(0x1f00ee87, versionResponse.getAddress()); assertEquals(41847, versionResponse.getLot()); assertEquals(240439, versionResponse.getTid()); - assertEquals(PodProgressStatus.PAIRING_SUCCESS, versionResponse.getPodProgressStatus()); + assertEquals(PodProgressStatus.PAIRING_COMPLETED, versionResponse.getPodProgressStatus()); assertEquals("2.7.0", versionResponse.getPiVersion().toString()); assertEquals("2.7.0", versionResponse.getPmVersion().toString()); assertNull(versionResponse.getRssi()); diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoFaultEventTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoFaultEventTest.java index 528ac6a9a5..4a1893b23f 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoFaultEventTest.java +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoFaultEventTest.java @@ -20,7 +20,7 @@ public class PodInfoFaultEventTest { public void testPodInfoFaultEventNoFaultAlerts() { PodInfoFaultEvent podInfoFaultEvent = new PodInfoFaultEvent(ByteUtil.fromHexString("02080100000a003800000003ff008700000095ff0000")); - assertEquals(PodProgressStatus.RUNNING_ABOVE_FIFTY_UNITS, podInfoFaultEvent.getPodProgressStatus()); + assertEquals(PodProgressStatus.ABOVE_FIFTY_UNITS, podInfoFaultEvent.getPodProgressStatus()); assertEquals(DeliveryStatus.NORMAL, podInfoFaultEvent.getDeliveryStatus()); assertEquals(0, podInfoFaultEvent.getInsulinNotDelivered(), 0.000001); assertEquals(0x0a, podInfoFaultEvent.getPodMessageCounter()); @@ -51,7 +51,7 @@ public class PodInfoFaultEventTest { assertEquals(0, podInfoFaultEvent.getUnacknowledgedAlerts().getRawValue()); assertFalse(podInfoFaultEvent.isFaultAccessingTables()); assertEquals(LogEventErrorCode.NONE, podInfoFaultEvent.getLogEventErrorType()); - assertEquals(PodProgressStatus.READY_FOR_BASAL_SCHEDULE, podInfoFaultEvent.getPodProgressStatusAtTimeOfFirstLoggedFaultEvent()); + assertEquals(PodProgressStatus.PRIMING_COMPLETED, podInfoFaultEvent.getPodProgressStatusAtTimeOfFirstLoggedFaultEvent()); assertEquals(2, podInfoFaultEvent.getReceiverLowGain()); assertEquals(46, podInfoFaultEvent.getRadioRSSI()); } @@ -71,7 +71,7 @@ public class PodInfoFaultEventTest { assertEquals(0, podInfoFaultEvent.getUnacknowledgedAlerts().getRawValue()); assertFalse(podInfoFaultEvent.isFaultAccessingTables()); assertEquals(LogEventErrorCode.NONE, podInfoFaultEvent.getLogEventErrorType()); - assertEquals(PodProgressStatus.RUNNING_ABOVE_FIFTY_UNITS, podInfoFaultEvent.getPodProgressStatusAtTimeOfFirstLoggedFaultEvent()); + assertEquals(PodProgressStatus.ABOVE_FIFTY_UNITS, podInfoFaultEvent.getPodProgressStatusAtTimeOfFirstLoggedFaultEvent()); assertEquals(0, podInfoFaultEvent.getReceiverLowGain()); assertEquals(35, podInfoFaultEvent.getRadioRSSI()); } @@ -91,7 +91,7 @@ public class PodInfoFaultEventTest { assertEquals(0, podInfoFaultEvent.getUnacknowledgedAlerts().getRawValue()); assertFalse(podInfoFaultEvent.isFaultAccessingTables()); assertEquals(LogEventErrorCode.INTERNAL_2_BIT_VARIABLE_SET_AND_MANIPULATED_IN_MAIN_LOOP_ROUTINES_2, podInfoFaultEvent.getLogEventErrorType()); - assertEquals(PodProgressStatus.RUNNING_ABOVE_FIFTY_UNITS, podInfoFaultEvent.getPodProgressStatusAtTimeOfFirstLoggedFaultEvent()); + assertEquals(PodProgressStatus.ABOVE_FIFTY_UNITS, podInfoFaultEvent.getPodProgressStatusAtTimeOfFirstLoggedFaultEvent()); assertEquals(2, podInfoFaultEvent.getReceiverLowGain()); assertEquals(39, podInfoFaultEvent.getRadioRSSI()); } @@ -111,7 +111,7 @@ public class PodInfoFaultEventTest { assertEquals(0, podInfoFaultEvent.getUnacknowledgedAlerts().getRawValue()); assertFalse(podInfoFaultEvent.isFaultAccessingTables()); assertEquals(LogEventErrorCode.INTERNAL_2_BIT_VARIABLE_SET_AND_MANIPULATED_IN_MAIN_LOOP_ROUTINES_2, podInfoFaultEvent.getLogEventErrorType()); - assertEquals(PodProgressStatus.RUNNING_ABOVE_FIFTY_UNITS, podInfoFaultEvent.getPodProgressStatusAtTimeOfFirstLoggedFaultEvent()); + assertEquals(PodProgressStatus.ABOVE_FIFTY_UNITS, podInfoFaultEvent.getPodProgressStatusAtTimeOfFirstLoggedFaultEvent()); assertEquals(2, podInfoFaultEvent.getReceiverLowGain()); assertEquals(39, podInfoFaultEvent.getRadioRSSI()); }