Open tmecklem opened 7 years ago
Two implementations that can serve as a reference for the requested changes:
https://github.com/ps2/rileylink_ios/blob/dev/MinimedKit/GlucosePage.swift https://github.com/ps2/rileylink_ios/tree/dev/MinimedKit/GlucoseEvents
https://github.com/ps2/rileylink_ios/blob/dev/MinimedKitTests/GlucosePageTests.swift https://github.com/ps2/rileylink_ios/tree/dev/MinimedKitTests/GlucoseEvents
New cgm event discoveries from comparison with Excel dumps and decoding various example pages:
0x03
Sensor Calibration0x00
: meter_bg_now0x01
: waiting0x02
: cal_error0x04
Sensor Packet0x02
: init0x??
: pre_init (found in csv but no pages yet obtained with this)0x??
: burst (found in csv but no pages yet obtained with this)0x05
Sensor Error0x01
: end0x06
Sensor Data Low0x07
“Fokko-07” - Sensor Data High0x08
Sensor Timestamp0b01100000
), decoded as:0b00100000
: page_end - written as last event of every page0b01000000
: gap - written whenever there is a gap in the events that require a reference sensor timestamp value0b00000000
: last_rf - written whenever requested via rf command, such as carelink report data upload (this is important later in the algorithm changes)0x0B
Sensor Status0b01100000
), decoded as:0b00000000
: off0b00100000
: on0b01000000
: lost0x0D
Sensor Sync0b01100000
), decoded as:0b01100000
: find0b00100000
: new0b01000000
: old0x0E
Cal BG For GH0b01100000
), decoded as:0b00000000
: rf0x10
“10-Something”0x000001
0x11
,0x12
and0x13
(aka "19-Something")Algorithms discoveries/changes needed:
0x08
) are the only events that serve as a reference for sensor events that follow the 5 minute offset pattern0x02
sensor_weak_signal0x03
sensor_calibration0x04
sensor_packet0x05
sensor_error0x06
sensor_data_low0x07
sensor_data_high>= 0x20
sensor_glucose_value