-
Notifications
You must be signed in to change notification settings - Fork 46
Message Types
Messages sent to the Pod are typically referred to as Commands while messages returned from the Pod are typically returned to as Responses. All messages start with a single byte indicating the Command/Response type followed by a length byte except for the 0x1D
Pod Status Response which is the only message with no length byte.
All Pod communication originates from the the controlling software (i.e., a PDM or Loop). The Pod receives a command and then sends back a synchronous response. The 0x1A
Insulin Schedule Command is the only message with an additional sub-message/sub-command immediately following it which is often referred to as the Extra Command.
Each command received from the Pod will generate a response. Once a Pod is successfully paired, the 0x1D
Pod Status is the normal non-error Response for every Command except for a 0x0E
Get Status Command with a non-zero type. An 0x06
Error Response can be returned at any time for a non-fatal Command error (with an important special case of a bad nonce error type 0x14
). An 0x02
, Type 2, Pod Information Response can also be returned at any time for a fatal Pod fault occurring either prior to or during the execution of the command.
Links are provided to the dev
branch source files for various commands, responses and support routines in the OmniKit implementation of Loop as a reference and to aid developers for other platforms. Development of earlier code like commands.py or rtlomni were never completed and links for selected portions are no longer being provided here until someone steps up to finish these efforts.
Response # | Type | Notes | OmniKit Implementation |
---|---|---|---|
0x01 Version |
len==0x1B len==0x15 |
Longer Response for the 0x03 Setup Pod Command Shorter Response for the 0x07 Assign ID Command |
VersionResponse.swift |
0x02 Pod Information |
Common |
Response for 0x0E Get Status Command, Type !0 |
PodInfo.swift |
0x02 Type 1, Pod Information |
1 |
Response for 0x0E Get Status Command, Type 1 |
PodInfoConfiguredAlerts.swift |
0x02 Type 2, Pod Information |
2 |
Response when a Pod is faulted (screaming) or Response for 0x0E Get Status Command, Type 2 |
PodInfoFaultEvent.swift FaultEventCode.swift, LogEventErrorCode.swift |
0x02 Type 3, Pod Information |
3 |
Response for 0x0E Get Status Command, Type 3 |
PodInfoDataLog.swift |
0x02 Type 5, Pod Information |
5 |
Response for 0x0E Get Status Command, Type 5 |
PodInfoFault.swift |
0x02 Type 50, Pod Information |
0x50 |
Response for 0x0E Get Status Command, Type 50 |
PodInfoFlashLogRecent.swift |
0x02 Type 51, Pod Information |
0x51 |
Response for 0x0E Get Status Command, Type 51 |
PodInfoFlashLogRecent.swift |
0x06 Error |
0x14 |
Response for any command with a bad nonce |
ErrorResponse.swift |
0x06 Error |
!0x14 |
Response for any other command request error |
ErrorResponse.swift |
0x1D Pod Status |
No type or length |
Default non-error Response for all Commands except 0x03, 0x07 & 0x0E with a non-zero type |
StatusResponse.swift |