Skip to content

Status fields

Bench hardware only. Everything here can start or change insulin delivery. Use it only with pump hardware that is not connected to any living subject. See bench testing.

5. Status broadcasts

While a peer is connected the pump pushes sealed status frames every few seconds. That stream is the pump's only "screen".

Opcode Name Notes
0x0200 pumpStatus ~92–96 bytes; mode, alarms, alerts, battery, self-test, reservoir, therapy counters, closed-loop flag, bolus progress, priming, notices, …
0x8304 cgmStatus Presence alone does not mean a CGM is delivering: it also arrives as a 102-byte payload with no glucose data at all (an idle pattern); whether a pump that never had a CGM paired pushes it is unconfirmed (see State model). Layout: a 46-byte fixed part — glucoseRate i16, glucoseValue u16, glucoseTimestamp u32, cgmAlertBitField u32, cgmUrgentAlertBitField u16, eight u8 state fields, warmupTimeRemaining_minutes u16, wearTimeRemaining_minutes u16, sensorErrorTimeCheck_minutes u16, manualGlucoseValue u16, manualGlucoseTimestamp u32, two u8, disqualifiedGlucoseInfo u16, currentCgmSequenceNumber u32, cgmNoticeBitfield u32, cgmGlucoseAlertValue u16 — then 56 bytes of strings (sensor id, provenance, transmitter firmware) whose split is ⛔ TBD. Not needed by a dumb-pump driver; TwiistOff stores it raw.
0x8705 loopStatus closed-loop state; a 27-byte payload, layout below.

TwiistOff decrypts them. Answering each with opcode + 0x80 and its seq, on the next packet number, is optional — a client that never answers still works — but the pump sends one push at a time and resends it about every 5 s until it is answered. Unanswered, the pumpStatus push repeats every 5 s with fresh content and the cgmStatus and loopStatus pushes never come out; with only the pumpStatus push answered, the cgmStatus push is resent every 5 s and no new status follows.

Events and correlation (State model): on the command channel the pump sends nothing except these three pushes and request | 0x80 responses (plus 0xFF80 NACKs); no pump-initiated alarm/event frame exists there. Alarms, alerts and set-change state surface as pumpStatus bits, and history through the log counter at bytes 16–19 (getLogRecord 0x0502). Other characteristics do carry unprompted traffic (e5332023 re-key, e5332001 RIS block, e5332025 RPC pushes — §1, §2.1). Responses echo the request's seq; pushes carry an independent per-connection counter in the same field. Push cadence is about every 5 s on an armed TwiistOff link; GET /pump/observed records the intervals.

loopStatus layout (0x8705)

27 bytes, every offset known; there is no reserved byte on the wire. Little-endian.

Byte Field
0 ringColor (u8): 0 gray, 1 green
1 ringGrayReason (u8): 0 Initializing, 1 Basal Idle, 2 Waiting for Loop Complete, 3 Waiting for Glucose, 4 N/A
2 calculationStage (u8): 0 completed, 1 calculating
3 loopError (u8)
4–5 / 6–7 / 8–9 loop notice / alert / urgent-alert bit fields (u16)
10 / 11 workout preset active / pre-meal preset active (u8)
12–15 glucose target override start (u32, 2008 epoch)
16–17 / 18–19 / 20–21 override duration (minutes) / override low / override high (u16; mg/dL × 100)
22–25 lastLoopCompleteTime_UTC (u32, 2008 epoch)
26 notificationAudioBitField (u8): what the loop is sounding, same bits as pumpStatus byte 91

The layout was fitted on 2,342 pushes with the closed loop off, so the fields between byte 4 and byte 21 were 0 throughout: decode them, but do not gate therapy on them. With the loop on, a push 2 s after switching it on reads gray / Waiting for Loop Complete / calculating, and the next one, once the loop has decided, green / N/A / completed, with lastLoopCompleteTime = the time of the pump's loop-complete log record. TwiistOff decodes every field (protocol/StatusPushes.kt); the Monitor page shows ring colour, gray reason and calculation stage.

RIS version block (e5332001)

Not a status push but a GATT characteristic (read / indicate) that the pump re-announces when it restarts: 10 bytes, five u16 LE values.

Bytes Field
0–1 / 2–3 RIS messages version, major / minor
4–5 / 6–7 RIS events version, major / minor
8–9 operating mode: 0 = bootloader, 1 = full application

Versions compare as major × 1000 + minor (13.76 → 13076). TwiistOff reads the block after every arm and on every indication, shows the messages and events versions on the Monitor page and in Pump tools, warns on any firmware other than the tested 13.76 / 14.32 (Tested firmware), and gates firmware-dependent commands on it (Command catalogue).

pumpStatus field map (verified offsets)

Payload length is 92 bytes (one variant) or 96 bytes (the variant this unit uses; the extra 4 bytes at the end are cassetteChangeTime_UTC). The commandId field is not serialized.

Byte Field
0–1 pumpState (u16 bitfield; per-bit working names in ProtocolStatus.PUMP_STATE_BITS: 0x0001 base, 0x0002 configured, 0x0008 cassette attached, 0x0010 prime done, 0x0020 self-test passed, 0x0040 therapy-ready, 0x0400 cassette-change mode, 0x0800 boot. Byte 1 is the high byte of this u16, not a separate enum: a 4 there is bit 0x0400. 0x0001 appears both as normal idle and on a fresh-paired pump with no cassette, so the raw value is not a readiness signal.)
2–3 / 4–5 / 6–7 alarmNotificationBits / alertNotificationBits / firstReportedAlarmInfoCode (the info code is the numeric suffix of the alarm's display id, e.g. 0x24C3 = 9411 for 106-9411). Bit map: Alarm, alert and notice bits. Raised live on the bench: alarm bit 6 baseDetached (cassette removed while delivering), alarm bit 8 occlusion; alert bit 0 reattachCassette, bit 3 bolusStopped, bit 6 pumpIdle
8–11 currentTimeDate_UTC (seconds since 2008-01-01)
12–13 nextValidTherapyNumber (Therapy-command prefix)
14 / 15 battery % / self-test %
16–19 / 20–21 latest therapy event id (u32) / number available (u16)
22–23 volumeRemainingInCassetteUE2 (0.01 U)
24–25 / 26–29 / 30–31 sessionID / therapyState / resetCount. therapyState is a bitset of what is running: 0x01 self-test, 0x02 cannula fill, 0x04 basal pattern (set in a 0.00 U/h slot too), 0x08 temp basal, 0x20 normal bolus, 0x0100 extended bolus, 0x0400 loop override, 0x0800 auto mode, 0x2000 priming or a stop in progress (after stopBasal it can stay set for about 10 s), 0x4000 closed loop on (an override runs on for about 4 s after the loop is switched off); 0 = nothing running
32–35 / 36–37 latest engineering event / number available
38–39 / 40 / 41 cassette age (min) / insulin remaining % / net basal rate % (i8) against the current slot's scheduled rate (reads 0 in a 0.00 U/h slot, stopped or not)
42–43 basalRate_UE2 (0.01 U/h)
44–45 closedLoopLocked / reason bitfield. Byte 44 = 1 when the pump's closed loop is off, 0 when it is on (seen on the bench when the loop was switched on and off); byte 45 reads 1 with the loop off, its bits are not mapped
46–47 / 48–49 / 50–51 tempBasalDurationRequested_minutes / tempBasalDurationRemaining_minutes / tempBasalModifier_percent (0 for an absolute 0x8102 override)
52–57 normal bolus / cannula-prime id, requested UE2, delivered UE2
58–67 extended bolus: id (58), requested 0.01 U (60), delivered 0.01 U (62), requested minutes (64), remaining minutes (66); after stopExtendedBolus the remaining minutes read 0 while the id and the requested amount stay
68–69 netBasalRate_UE2PerHour (i16): actual minus the current slot's scheduled rate
70–71 / 72–75 / 76 last bolus volume UE2 (delivered amount of the last ended bolus, a stopped one included — 0 after an occlusion that delivered nothing) / time UTC / BolusCategory (not OreoBolusType. 5 = manualBolus — every 0x8400/0x8401 bolus, not primeBolus; 1 = oneButtonBolus. Changes only when a bolus ends and equalled the pump-log category at 3 of 3 ends; cannula fills never update bytes 70–76.)
77–78 one-button bolus state / volume
79 / 80–81 priming status / prime volume UE2
82–83 / 84–85 noticeBitfield (bit map) / time offset (i16, minutes)
86–89 / 90 / 91 configuration state (u32; 0x1FFF = configured, 0 = unconfigured; TwiistOff blocks every delivery start until it reads 0x1FFF) / alarmResetSupported (1 while a resettable alarm is active — alarmReset is accepted only then) / notificationAudioBitField: what the pump is sounding — 0x01 alert, 0x02 urgent alert, 0x04 alarm audio playing (an unhandled baseDetached turned it 0 → 4 after exactly 10 min). The loop and the CGM status carry their own audio byte (loopStatus byte 26). TwiistOff shows it as words ("alarm, alert") on the Monitor page
92–95 cassetteChangeTime_UTC (96-byte variant only)

Alarm / alert / notice bit names and titles live in protocol/ProtocolStatus.kt and protocol/PumpMessages.kt. Units on the wire are typically UE2 = 0.01 U (and 0.01 U/h for rates). Time is seconds since 2008-01-01 UTC.

Partly-decoded fields (⛔ TBD). The offsets above are measured, but a few blocks are reserved by position without confirmed field semantics, and a driver should not rely on them yet:

  • bytes 38–39 cassette age and 86–89 configuration state — the configuration-state value is used as the delivery gate (§6: 0x0000 vs 0x1FFF observed) but the per-bit meaning is not mapped. Observed progression while configuring: 0 → 0x1F31 → 0x1F7F → 0x1FFF (fill and prime do not move it; reboots and battery changes keep it). Bits 1 and 2 (0x0006) are the two blocks of the glucose-target pattern (setGlucoseTargetPattern, 0x800D): with every other write accepted and 0x800D refused, the state stops at 0x1FF9 and verify answers 00. Which write sets each other bit is ⛔ TBD. Cassette-age units are inferred, not confirmed (it resets to 0 on a new-cassette fill).
  • byte 44 closed-loop flag — see the table: semantics unconfirmed.

Per-bit pumpState (✅ measured 2026-12-02, working names). Gate on bits, never on a whole raw value:

Bit Working meaning
0x0001 base (always on after boot; meaning unknown)
0x0002 configured (⇔ configurationState == 0x1FFF in every frame seen)
0x0008 cassette attached (cleared on physical removal)
0x0010 prime done (cleared by cassetteChange and resetPrime; kept across an alarmReset reboot)
0x0020 self-test passed (cleared by any reboot; re-set by the boot self-test)
0x0040 therapy-ready: only ever set with configured + cassette + primed + self-test
0x0400 cassette-change mode (set by cassetteChange or by the pump itself on a cassette removal; cleared only by a reboot)
0x0800 firmware start-up (first boot frame)

Common composed values: 0x0001 fresh-paired / no cassette / unconfigured · 0x0029 unconfigured, cassette self-tested · 0x0039 unconfigured, primed · 0x007B therapy-ready (says nothing about whether basal runs) · 0x0433 cassette removed · 0x043B cassette reattached without a reboot (fail-safe) · 0x002B configured, new cassette self-tested, not primed. "Can deliver" = bit 0x0040 (+ no alarm, not change mode); "is delivering" = basal rate (bytes 42–43) > 0 — the pump sits at 0x007B with basal stopped after a reboot, so model the two separately. A fresh pump is recognised by configurationState == 0 plus alert pumpIdle, not by 0x0001 alone. - bytes 24–31 sessionID / therapyState / resetCount and 32–37 engineering-event counters — read and passed through, semantics only partially understood.

Everything a dumb-pump driver needs (state, battery, reservoir, self-test, basal/temp-basal, bolus progress, clock, therapy counters) is ✅ Verified; the TBD fields above are advisory extras — except the closed-loop flag, which is safety-relevant: until byte 44 is confirmed, do not rely on it alone to know the pump's own loop is off (the loop setting is written with setClosedLoop 0x8009).