Search in sources :

Example 11 with EGVRecord

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));
}
Also used : EGVRecord(com.nightscout.core.dexcom.records.EGVRecord) Test(org.junit.Test)

Aggregations

EGVRecord (com.nightscout.core.dexcom.records.EGVRecord)11 Test (org.junit.Test)5 SensorRecord (com.nightscout.core.dexcom.records.SensorRecord)3 ArrayList (java.util.ArrayList)3 Date (java.util.Date)3 CalRecord (com.nightscout.core.dexcom.records.CalRecord)2 MeterRecord (com.nightscout.core.dexcom.records.MeterRecord)2 DownloadResults (com.nightscout.core.model.DownloadResults)2 G4Download (com.nightscout.core.model.G4Download)2 PowerManager (android.os.PowerManager)1 HitBuilders (com.google.android.gms.analytics.HitBuilders)1 Tracker (com.google.android.gms.analytics.Tracker)1 CdcAcmSerialDriver (com.nightscout.android.drivers.USB.CdcAcmSerialDriver)1 AndroidPreferences (com.nightscout.android.preferences.AndroidPreferences)1 Uploader (com.nightscout.android.upload.Uploader)1 CRCFailError (com.nightscout.core.dexcom.CRCFailError)1 InvalidRecordLengthException (com.nightscout.core.dexcom.InvalidRecordLengthException)1 GlucoseDataSet (com.nightscout.core.dexcom.records.GlucoseDataSet)1 PageHeader (com.nightscout.core.dexcom.records.PageHeader)1 AbstractDevice (com.nightscout.core.drivers.AbstractDevice)1