Skip to content

Commit

Permalink
DismissNotification/AlertResponseType description
Browse files Browse the repository at this point in the history
  • Loading branch information
jwoglom committed Dec 31, 2024
1 parent 3bca5c8 commit 841aa19
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ public enum AlertResponseType {
SENSOR_EXPIRING_ALERT(22),
PUMP_REBOOTING_ALERT(23),
DEVICE_CONNECTION_ERROR(24),
CGM_GRAPH_REMOVED(25),
CGM_GRAPH_REMOVED(25,
"It has been 24 hours since your last sensor session ended, so your " +
"current glucose reading now displays the last glucose value entered in the bolus calculator."),
MIN_BASAL_ALERT2(26),
INCOMPLETE_CALIBRATION(27),
CALIBRATION_TIMEOUT(28),
Expand Down Expand Up @@ -115,14 +117,25 @@ public enum AlertResponseType {
;

private final int bitmask;
private final String description;
AlertResponseType(int bitmask) {
this.bitmask = bitmask;
this.description = null;
}

AlertResponseType(int bitmask, String description) {
this.bitmask = bitmask;
this.description = description;
}

public int bitmask() {
return bitmask;
}

public String getDescription() {
return description;
}

public String toString() {
return name();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,25 @@ public void testDismissNotificationRequest_SiteChangeNotification() throws Decod

assertHexEquals(expected.getCargo(), parsedReq.getCargo());
}


@Test
public void testDismissNotificationRequest_alert_CGM_GRAPH_REMOVED() throws DecoderException {
initPumpState(PacketArrayList.IGNORE_INVALID_HMAC, 0L);

DismissNotificationRequest expected = new DismissNotificationRequest(
new byte[]{25,0,0,0,1,0}
);

DismissNotificationRequest parsedReq = (DismissNotificationRequest) MessageTester.test(
"01ddb8dd1e1900000001001b92f41f4ebdd42d94",
-35,
1,
CharacteristicUUID.CONTROL_CHARACTERISTICS,
expected,
"00dd71575252fcc1476112db4196041031cf27"
);

assertHexEquals(expected.getCargo(), parsedReq.getCargo());
}
}

0 comments on commit 841aa19

Please sign in to comment.