-
Notifications
You must be signed in to change notification settings - Fork 46
Message Structure
Messages are assembled from one or more packets. Here's an example of a series of packets that make up a temp basal being issued.
First packet from PDM to POD: 1f07b1eeb91f07b1ee30201a0ebee0a2d001007d01384000020002160e40000015051be550
is decoded as ID1:1f07b1ee PTYPE:PDM SEQ:25 Contents:1f07b1ee30321a0ebee0a2d001007d01384000020002160e40000015051be5 CRC:50
Then the POD acks with: 1f07b1ee5a1f07b1ee30
Second packet from PDM to POD is a CON packet 1f07b1ee9b6d0015051be56d8137f3
, which is decoded as ID1:1f07b1ee PTYPE:CON SEQ:27 CON:6d0015051be56d8137 CRC:f3
The final message is 1f07b1ee30201a0ebee0a2d001007d01384000020002160e40000015051be56d0015051be56d8137
.
Let's break the above message down into parts, in order:
- Pod ID (4 bytes):
1f07b1ee
. This is assigned by the PDM, often in an incrementing fashion, with each pod getting a subsequent id. - B9 (1 byte):
30
. Bit format: ABCCCCLL. Bits A and B have unknown meaning. Bits CCCC are a 4-bit counter. Bits LL are the top bits of the message body length. - BLEN (1 byte):
20
. Bits LL and BLEN specify the total length of the message body. - Body (variable, up to 201 bytes):
1a0ebee0a2d001007d01384000020002160e40000015051be56d0015051be56d
- The first byte (
1a
) indicates the message type
- The first byte (
- CRC16 (2 bytes):
8137
. This is a pseudo CRC16
The length of the message type + body above is 0x20 bytes, matching the BLEN.
Message sequence number is usually incremented by PDM and POD. But there are some cases where it is not. For example when nonce fake resync (# is the message sequence):
#3 PDM 1a(14)->Insulin Schedule:Nonce:851072aa(-1) Type:02 Bolus CheckSum:0088/0088 Duration:01(30 minutes) FiledA:0320 UnitRate:0032(2.5U) UnitRateSchedule:0032(2.5U)
#3 PDM 17(13)->InsulinExtra(short):Immediate
#4 POD 06(3)->POD Error:Type:14 Nonce ErrorHx=85ab Seed request :3
#3 PDM 1a(14)->Insulin Schedule:Seed(3)Nonce:436a5bb5(0) Type:02 Bolus CheckSum:0088/0088 Duration:01(30 minutes) FiledA:0320 UnitRate:0032(2.5U) UnitRateSchedule:0032(2.5U)
#3 PDM 17(13)->InsulinExtra(short):Immediate
But appears also when some particular status from POD
#8 PDM 0e(1)->Get Status type 00
#9 POD 02(22)->Resp02:020d00001406077318117f0000117f0000195709030d
#8 PDM 0e(1)->Get Status type 01
#9 POD 02(19)->Resp02:01000000000000000000000000000000000000
#8 PDM 0e(1)->Get Status type 46
#9 POD 02(124)->Resp02:4600791f10895a1f10895ae000e0001818117f117f0000ffffffffff090507730773ff0a1e110b110000a84800066aac0000ffffffffffffff32cd50af0ff014eb01fe01fe06f9ff00ff0002fd649b14eb14eb07f83cc332cd05fa02fd58a700ffffffffffffffffffffffffffffffffffffffffffffffffffffff2e
#8 PDM 0e(1)->Get Status type 50
#9 POD 02(203)->Resp02:5007733172570134734401397359013c7342014172590144724301497257014c7341015172550154734101597356815c734481617356810073438005725680087343800d7355801073458015735180187346801d734f802073498025735200287344002d7351003072450035725300387243003d7251004073450045725100487344004d7250005072430055724f00587248805d73508060734a8001734e800472448009724e800c72448011724d801473438019724c801c72428021734c002472470029724f002c714900
#8 PDM 0e(1)->Get Status type 51
#8 PDM 0e(1)->Get Status type 51
#9 POD 02(203)->Resp02:5100323172510034724400397252003c7246004173530044724800497251004c7343005173500054724680597253805c734580017254bf047247bf097254bf0c724bbf117253bf147146bf197450bf1c7247bf21734ebf247344bf2973503f2c73473f31734f3f3473493f3972513f3c73483f4172523f4473483f4973523f4c73453f5172523f5473433f5973533f5c7346bf613254bf647345bf0172548104704681097552810c7245811172538114724281197352811c7243812172568124734101297259012c734301
#9 PDM 1c(4)->CancelPOD Nonce 851072aa(-1)
#10 POD 06(3)->POD Error:Type:14 Nonce ErrorHx=85f7 Seed request :35
- PDM (0e01) (Status Request)
- POD (1d18) (Status Response)
- ACK
- PDM (0e01) (Status Request)
- POD (1d18) (Status Response)
- ACK
- PDM (1a0e) (Bolus Request)
- ACK
- CON
- POD (1d**) (Delivery Confirmation??)
- CON
- PDM (0e01) (Status Request)
- POD (1d18) (Status Response)
- ACK
- PDM (1a0e) (Basal Change Request)
- ACK
- CON
- POD (1d**) (Basal Confirmation)
- ACK