Skip to content

Report a reset fault the way a reset pod does - #32

Open
ps2 wants to merge 1 commit into
mainfrom
reset-fault-counters
Open

ps2 wants to merge 1 commit into
mainfrom
reset-fault-counters

Conversation

@ps2

@ps2 ps2 commented Nov 7, 2026

Copy link
Copy Markdown

A reset fault reported its fault time, total delivered, bolus remaining and minutes since activation like any other fault. OmnipodKit treats a fault that has a fault time as a non-reset fault, so testing a reset fault on the simulator ran the wrong path. For example, a 0x10 during a bolus reported fault time 0012, 2.75 U not delivered and 89 pulses delivered.

What real pods report

45 reset-fault detailed statuses from field reports (0x10, 0x12, 0x22, 0x34, 0xD6 and 0xD7, from DASH, Omnipod 5 and Eros) all show:

  • Fault time: 0000 (FFFF on Eros).
  • Delivered: 0.
  • Bolus not delivered: 0, except two Omnipod 5 0x22 statuses that show the 0x3FF sigil.
  • Minutes active: 0–6, because the count restarts at the reset.

Change

  • SetFault with a reset code: records when the reset happened and sets the fault time to 0. A non-reset code, or clearing the fault, forgets the reset.
  • Detailed status (type 2): a reset pod reports 0 delivered and 0 bolus remaining.
  • Detailed status and type 3: minutes active counts from the reset.
  • Internal accounting: unchanged. The bolus still stops at the fault, as it does since Stop a bolus at a fault and keep reporting what it left undelivered #30.

The 0x3FF sigil for 0x22 isn't simulated, since real pods show it inconsistently.

Testing

go test ./... passes, including two new state tests: a reset fault's marshaled status, and a non-reset fault keeping its time and counters.

A reset fault reported the fault time, total delivered, bolus remaining
and minutes since activation like any other fault, so OmnipodKit took it
for a fault with a known time and never ran its reset handling.

In 45 reset statuses from real pods (DASH, Omnipod 5 and Eros) the fault
time is always zero ($FFFF on Eros), delivered and bolus not delivered are
zero, and minutes active restarts at the reset. The simulator now reports
those after a reset fault, while keeping its own delivery books, with the
bolus stopped at the fault.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant