Skip to content

History and log records

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.

8. History (getLogRecord 0x0502)

  • Simple command. Payload is exactly 6 bytes, no therapy-number prefix: logfileNumber (u16 LE) || eventID (u32 LE).
  • logfile 0 = therapy log, 1 = engineering log.
  • Pick the event ID from the live counters in pumpStatus (bytes 16–19 / 20–21 for therapy; 32–35 / 36–37 for engineering). Newest-first: request latest*. Full sync: walk backwards (or ascend from latest − count + 1, handling wrap).
  • Responses (0x0582) carry a compact record: type, size, log file, event ID, timestamp (seconds since 2008), offset, reset count, then payload data. Reads are slow (~0.3 s each).
  • TwiistOff caches decoded rows in SQLite (pump/PumpHistoryStore.kt) so the History tab is instant across restarts.
  • Known event-type names and English summaries: protocol/EventTypes.kt. Around 55 named types; layouts verified for the delivery / alarm / settings families observed on the bench. Record types without a name are hidden in the History list rather than guessed at. The full catalogue and the command → record map follow the layouts a driver needs:
type layout (LE) notes
0x0059 bolus started (11 B) requested u16 \| bolusId u16 \| carbs g u16 \| mealId u16 \| u16 0 \| BolusCategory u8 the meal id is the event id of that meal's 0x007E record
0x005A bolus stopped early (16 B) delivered u16 \| requested u16 \| bolusId u16 \| BolusCategory u8 \| partOfDual u8 \| duration_s u16 \| carbs g u16 | mealId u16 | u16 0\| carbs u16 the delivered amount of a stopped bolus comes from here; status zeroes its bolus fields on a reboot
0x005B bolus completed (16 B) same as 0x005A, delivered == requested
BolusCategory 5 manualBolus (a calculator bolus with no BG and no carbs), 1 oneButtonBolus (pump button), 3 BG only, 2 carbs only, 4 BG + carbs the pump derives it from the calculator fields; also status byte 76
0x0004 alarm (14 B) alarmBit u16 \| infoCode u16 \| char[8] display id \| pad 106-9411 Cassette Not Attached (baseDetached), 108-6100 Line Blocked (occlusion)
0x0003 alert (15 B) value1 u16 \| value2 u16 \| alertID u8 \| char[8] display id \| pad 409-0003 Interrupted Bolus (bolusStopped), 409-0006 Pump Inactive (pumpIdle)
0x0099 notice (12 B) noticeID u16 \| char[8] display id \| pad 509-0004 System Time Updated (utcTimeChanged)
0x00E9 quiet mode (2 B) quiet u8 \| flag u8 flag 1 on setting writes, 0 on boot (meaning hyp)
0x00E4 audio level (6 B) oldLevel u8 \| newLevel u8 \| oldGain u16 \| newGain u16 level 1/2/3 = low/medium/high, gain 0x20/0x50/0x100
0x0096 10-min snapshot (20 B) +0 basal running u8, +4 basal rate u16, +8 reservoir u16 (0.01 U), +10 lastBolus u16, +12 lastBolusTime u32, +16 BolusCategory u8 the History list collapses runs of it
  • Record-type catalogue. 143 record types have been seen on a pump. The table lists every type with a known meaning (✅ layout confirmed by two independent sources or by the pump's event definitions; 🟡 one source, many consistent samples; ⛔ a likely meaning only). Sizes are payload bytes; "log" is the logfile it appears in (therapy 0, engineering 1, or both).
Type Size Log State Meaning / layout (LE)
0x0001 8 both ⛔ likely clock set: two pump-epoch u32 (old, new)
0x0003 15 both ✅ alert: value1 u16 \| value2 u16 \| alertID u8 \| char[8] display id
0x0004 14 both ✅ alarm: alarmBit u16 \| infoCode u16 \| char[8] display id
0x0007 23 both ⛔ likely boot record; tail = RIS versions
0x0008 16 both 🟡 pump serial (ASCII)
0x000C 24–28 engineering 🟡 engineering text message (ASCII)
0x0018 10 both ✅ loop configuration: the loopSetConfig 0x8700 value, verbatim
0x0025 10 both ⛔ likely loop configuration without its first u16
0x0027 0 both 🟡 empty marker logged just before an alarm record
0x0039 0 both ⛔ likely empty marker; precedes a prime reset
0x003D 0 both ✅ prime started (startCassettePrime 0x8900)
0x003E 2 both ✅ prime stopped (stopPrime 0x8901): u16 volume primed, 0.01 U
0x003F 2 both ✅ prime complete (primeComplete 0x8902): u16 volume primed, 0.01 U
0x0048 1 both ✅ insulin model (setInsulinModel 0x800C value)
0x004A 17 both ✅ correction bolus calculator: the 0x8400 payload
0x004B 23 both ✅ meal bolus calculator: the 0x8401 payload
0x0050 2 both ✅ basal pattern stored: u16 pattern CRC16 (the CRC sent in 0x8019)
0x0051 2 both ✅ basal started: u16 basal pattern CRC16
0x0052 2 both ✅ basal stopped: u16 basal pattern CRC16
0x0053 18 both 🟡 basal state change: rate u16 \| mode u16 \| programmed u16 \| …
0x0055 4 both 🟡 temp basal override (0x8102) started: rate u16 \| minutes u16
0x0056 4 both 🟡 temp basal modify (0x8101) started: percent u16 \| minutes u16
0x0057 2 both 🟡 temp basal ended (0000)
0x0059 11 both ✅ bolus started (layout above)
0x005A 16 both ✅ bolus stopped early (layout above)
0x005B 16 both ✅ bolus completed (layout above)
0x005F 5 both ✅ cannula fill started (startCannulaFill 0x820A): requested u16 \| id u16 \| flag u8
0x0061 4 both ✅ cannula fill completed: delivered u16 \| id u16
0x0064 2 both 🟡 logged with prime start (u16, always 0 so far)
0x0069 26 engineering 🟡 pump identity: serial + part number (ASCII)
0x006F 16 both 🟡 identity fragment (ASCII)
0x0070 16 both 🟡 part number (ASCII)
0x0075 2 both ✅ cassette fill volume (setStartingCassetteVolume 0x8003): u16, 0.01 U (3075 = 300 U)
0x0076 2 both ⛔ likely cassette-volume related (3075 = 300 U)
0x0077 0 both ✅ prime reset (resetPrime 0x8903)
0x007C 10 both ✅ current basal rate: rate u16 \| mode u16 \| programmed u16 \| temp remaining s u32; also every 30 min
0x0084 2 both ⛔ likely alert cleared: u16 alert mask (0x0040 pumpIdle at a basal start)
0x0086 2 both ✅ cassette-change reminder (setCassetteChangeReminder 0x8017 value)
0x0089 25 both ✅ basal pattern block: block u8 (0–3) \| 12 × rate u16 (0.01 U/h)
0x008C 7 both 🟡 boot default CGM low/high alert (mg/dL × 100)
0x008E 4 both ✅ glucose display range (setGlucoseDisplayRange 0x8014 value, mg/dL × 100)
0x0090 2 both ✅ low-insulin alert (setLowInsulinAlert 0x8004 value)
0x0091 2 both ✅ max basal, 0.01 U/h (from 0x8019 / 0x800A)
0x0092 2 both ✅ max bolus, 0.01 U (from setDeliveryLimits 0x800A)
0x0093 1 both ✅ walk-away timeout (setWalkawayTimeout 0x8007 value)
0x0094 1 both ✅ one-button bolus (setOneButtonBolus 0x8008 value)
0x0096 20 both ✅ 10-minute therapy snapshot (layout above)
0x0099 12 both ✅ notice: noticeID u16 \| char[8] display id
0x009B 2 both ⛔ likely max basal (older variant of 0x0091)
0x009C 2 both ⛔ likely max bolus (older variant of 0x0092)
0x009D 28 both ✅ carb-ratio pattern block (0x801D): block u16 \| 12 × u16
0x009E 28 both ✅ ISF pattern block (0x801B): block u16 \| 12 × u16
0x009F 2 both ✅ pump-idle alert duration (setPumpIdleAlertDuration 0x8000 value, minutes)
0x00A1 28 engineering 🟡 engineering text (ASCII)
0x00A5 26 engineering 🟡 engineering text (ASCII)
0x00DC 28 both ✅ glucose target pattern block, low (0x800D)
0x00DD 28 both ✅ glucose target pattern block, high (0x800D)
0x00DF 9 both ✅ CGM alert state, one per 0x8011/0x8012/0x8013: lowEn u8 \| highEn u8 \| low u16 \| high u16 \| lossMin u16 \| lossEn u8
0x00E2 2 both ⛔ likely delivery state: 1 at startBasal, 2 then 0 at an alarm stop
0x00E4 6 both ✅ audio level change (layout above)
0x00E5 2 both 🟡 time-zone offset, i16 minutes
0x00E9 2 both ✅ quiet mode (layout above)
0x0102 16 both ✅ RIS versions (v2)
0x0106 9 both ✅ CGM sleep settings (setCGMSleepSettings 0x801F value, verbatim)
0x010B 24 both ⛔ likely 5-minute engineering snapshot

No meaning known yet (78 types, almost all engineering-log only): 0x0000, 0x0002, 0x0005, 0x0009–0x000B, 0x000D, 0x000E, 0x0010, 0x0011, 0x0013, 0x0014, 0x0017, 0x0019, 0x001B, 0x001C, 0x0021, 0x0022, 0x0026, 0x0029, 0x002C, 0x002D, 0x0030, 0x0031, 0x0033, 0x0035–0x0038, 0x003A–0x003C, 0x0040, 0x0049, 0x004E, 0x004F, 0x0054, 0x0062, 0x0063, 0x0065–0x0068, 0x006A–0x006D, 0x0071, 0x0074, 0x0078, 0x007A, 0x007B, 0x007D, 0x008B, 0x0095, 0x0097, 0x009A, 0x00A0, 0x00A3, 0x00AC, 0x00AD, 0x00DE, 0x00E0, 0x00E1, 0x00E3, 0x00E6–0x00E8, 0x00EA–0x00EF, 0x0100, 0x0103, 0x010A, 0x010D.

  • What a driver's own commands write to the log (each record within a second of its command):
Command Record(s)
0x8000 / 0x8004 / 0x8007 / 0x8008 / 0x8017 / 0x8014 / 0x801F / 0x8700 / 0x800C 0x009F / 0x0090 / 0x0093 / 0x0094 / 0x0086 / 0x008E / 0x0106 / 0x0018 / 0x0048
0x8016 audio 0x00E9 + 0x00E4
0x8011 / 0x8012 / 0x8013 CGM alerts one 0x00DF each
0x8019 basal pattern 4 × 0x0089 + 0x0050 + 0x007C + 0x0091
0x801B / 0x801D / 0x800D patterns 4 × 0x009E / 4 × 0x009D / 4 × 0x00DC + 4 × 0x00DD
0x800A delivery limits 0x0091 + 0x0092
0x8009 closed loop (unchanged), 0x8310 CGM info none seen
0x8903 / 0x8003 / 0x8900 / 0x8901 / 0x8902 0x0077 / 0x0075 / 0x003D + 0x0064 / 0x003E / 0x003F
0x8100 start basal 4 × 0x0089 + 0x0051 + 0x00E2 0100 + 0x0053 + 0x007C (+ 0x0084 4000 when pumpIdle clears)
0x820A cannula fill 0x005F … 0x0061
0x8400 / 0x8401 bolus 0x004A / 0x004B + 0x0059 … 0x005A or 0x005B
a calculator bolus with a BG / with carbs 0x0082 (BG mg/dL×100, calc time) / 0x007E (carbs g×100, 180, meal time; its event id is the meal id), before 0x0059
0x8202 stop cannula fill 0x0060 = delivered u16 \| requested u16 \| id u16
0x0400 clear pump alert 0x0084 = the cleared alert mask
temp basal ran to its end / 0x8104 cancel 0x0058 = minutes completed / 0x0057 0000; a 0 % temp also writes one 0x0065
0x8009 pump loop on / off 0x00E1 (byte 0 = on 1 / off 0), 0x00E2 9; the loop's decision 0x00F2 = rate u16 \| minutes u16 \| programmed u16 \| u16; off: 0x00F4
walk-away timeout expires 0x0003 alert bit 4 noRemoteInterface (409-0004)
link drop / session armed again 0x003A / 0x0039 (empty markers)
alarm stop (cassette removed / line blocked) 0x0027 (cassette removal only) + 0x0004 + 0x00E2 0200 + 0x0052 + 0x00E2 0000 + 0x0053 + 0x007C (+ 0x005A + 0x0003 if a bolus was running)

Every reboot writes the same boot set within one second: 0x0100, 0x00E5, 0x007C, 0x0033, 0x0038, 0x00E8, 0x002D, 0x0106, 0x00E7, 0x0007, 0x006A, 0x00E6 (the pump reloading its defaults).

  • The pump also writes a settings snapshot to its log on every settings write, on boot and at local midnight. Reconstructing that block reproduces the five patterns and every scalar and rebuilds the 42-byte verification record byte-for-byte (pump/SettingsLogReader.kt). Caveats: the newest block can be thousands of records back; boot blocks can be zeroed; a few fields only appear in write-echo records.
  • The boot records are not a restart marker. The pump writes the same set (and a daily block: 0x0054, 0x0068, 0x0097, 0x00EA–0x00EF, 0x0066, 0x0014, 0x0102) at its local midnight with no restart (resetCount unchanged). Detect a restart from resetCount and the status-seq restart, never from these records.