Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue when only one record is returned in CGMS profile.
ContinuousGlucoseMeasurementResponse class on..Received() method can be invoked multiple times but the class can only store a single record. As a result old values were lost. To save all the values the class has been modified to use ArrayList as a values storage.
- Loading branch information
Sylwester Zieliński
committed
Feb 16, 2022
1 parent
8602225
commit 0148398
Showing
2 changed files
with
157 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
.../nordicsemi/android/ble/common/callback/cgm/ContinuousGlucoseMeasurementResponseItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package no.nordicsemi.android.ble.common.callback.cgm; | ||
|
||
import androidx.annotation.Nullable; | ||
|
||
import no.nordicsemi.android.ble.common.profile.cgm.CGMTypes; | ||
|
||
public class ContinuousGlucoseMeasurementResponseItem { | ||
private float glucoseConcentration; | ||
@Nullable | ||
private Float trend; | ||
@Nullable | ||
private Float quality; | ||
@Nullable | ||
private CGMTypes.CGMStatus status; | ||
private int timeOffset; | ||
|
||
ContinuousGlucoseMeasurementResponseItem() { } | ||
|
||
public ContinuousGlucoseMeasurementResponseItem( | ||
float glucoseConcentration, | ||
@Nullable Float trend, | ||
@Nullable Float quality, | ||
@Nullable CGMTypes.CGMStatus status, | ||
int timeOffset | ||
) { | ||
this.glucoseConcentration = glucoseConcentration; | ||
this.trend = trend; | ||
this.quality = quality; | ||
this.status = status; | ||
this.timeOffset = timeOffset; | ||
} | ||
|
||
|
||
public float getGlucoseConcentration() { | ||
return glucoseConcentration; | ||
} | ||
|
||
@Nullable | ||
public Float getTrend() { | ||
return trend; | ||
} | ||
|
||
@Nullable | ||
public Float getQuality() { | ||
return quality; | ||
} | ||
|
||
@Nullable | ||
public CGMTypes.CGMStatus getStatus() { | ||
return status; | ||
} | ||
|
||
public int getTimeOffset() { | ||
return timeOffset; | ||
} | ||
|
||
public void setGlucoseConcentration(float glucoseConcentration) { | ||
this.glucoseConcentration = glucoseConcentration; | ||
} | ||
|
||
public void setTrend(Float trend) { | ||
this.trend = trend; | ||
} | ||
|
||
public void setQuality(Float quality) { | ||
this.quality = quality; | ||
} | ||
|
||
public void setStatus(CGMTypes.CGMStatus status) { | ||
this.status = status; | ||
} | ||
|
||
public void setTimeOffset(int timeOffset) { | ||
this.timeOffset = timeOffset; | ||
} | ||
|
||
} |