use of com.nightscout.core.dexcom.records.EGVRecord in project android-uploader by nightscout.
the class EgvRecordTest method shouldParseEgvRecord.
// EGV Record: C4881A0B61341A0B0500583E
// EGV: 5 Trend: NOT_COMPUTABLE display time: 1417056321000, system time: 186288324, display time offset: 186266721, noise level: None
//
// EGV Record: 80BD1A0B1D691A0B7800217D
// EGV: 120 Trend: DOUBLE_UP display time: 1417069821000 system time: 186301824 noise level: None
@Test
public void shouldParseEgvRecord() throws Exception {
byte[] record = new byte[] { (byte) 0xC4, (byte) 0x88, (byte) 0x1A, (byte) 0x0B, (byte) 0x61, (byte) 0x34, (byte) 0x1A, (byte) 0x0B, (byte) 0x05, (byte) 0x00, (byte) 0x58, (byte) 0x3E };
EGVRecord egvRecord = new EGVRecord(record);
assertThat(egvRecord.getBgMgdl(), is(5));
assertThat(egvRecord.getTrend(), is(TrendArrow.NOT_COMPUTABLE));
assertThat(egvRecord.getRawDisplayTimeSeconds(), is(186266721L));
assertThat(egvRecord.getRawSystemTimeSeconds(), is(186288324L));
assertThat(egvRecord.getNoiseMode(), is(G4Noise.NOT_COMPUTED));
}
Aggregations