V4.1.3a - fixed O2sat display in network data source

This commit is contained in:
Graham Jones
2023-02-03 20:38:15 +00:00
parent fe765169d4
commit f4e5db2a44
5 changed files with 11 additions and 2 deletions

View File

@@ -123,7 +123,7 @@ public class SdData implements Parcelable {
/*
* Intialise this SdData object from a JSON String
* FIXME - add O2saturation with checking in case it is not included in the data
*
*/
public boolean fromJSON(String jsonStr) {
Log.v(TAG, "fromJSON() - parsing jsonString - " + jsonStr);
@@ -161,6 +161,13 @@ public class SdData implements Parcelable {
for (int i = 0; i < specArr.length(); i++) {
simpleSpec[i] = specArr.optInt(i);
}
try {
mO2Sat = jo.optDouble("o2Sat");
} catch (Exception e) {
Log.w(TAG,"Error parsing o2Sat value");
mO2Sat = -1;
}
haveData = true;
Log.v(TAG, "fromJSON(): sdData = " + this.toString());
return true;