Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jamorham committed Oct 17, 2023
2 parents 7ea96e5 + 498f06b commit 330f63b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ public class Ob1G5StateMachine {
private static volatile BgReading lastGlucoseBgReading;
private static volatile AuthRequestTxMessage lastAuthPacket;
private static volatile boolean backup_loaded = false;
private static final int OLDEST_RAW = 300 * 24 * 60 * 60; // 300 days

// Auth Check + Request
@SuppressLint("CheckResult")
Expand Down Expand Up @@ -1609,8 +1610,13 @@ private static void processSensorRxMessage(SensorRxMessage sensorRx) {
}

UserError.Log.d(TAG, "SUCCESS!! unfiltered: " + sensorRx.unfiltered + " filtered: " + sensorRx.filtered + " timestamp: " + sensorRx.timestamp + " " + JoH.qs((double) sensorRx.timestamp / 86400, 1) + " days :: (" + sensorRx.status + ")");
DexTimeKeeper.updateAge(getTransmitterID(), sensorRx.timestamp);
Ob1G5CollectionService.setLast_transmitter_timestamp(sensorRx.timestamp);
if (FirmwareCapability.isTransmitterModified(getTransmitterID()) && sensorRx.timestamp > OLDEST_RAW) { // Raw timestamp reported by a mod TX is incorrect until after sensor start.
UserError.Log.d(TAG, "Will not update age since raw timestamp is incorrect.");
Ob1G5CollectionService.setLast_transmitter_timestamp(0);
} else { // Update age, based on the raw timestamp, only if the raw timestamp is correct.
DexTimeKeeper.updateAge(getTransmitterID(), sensorRx.timestamp);
Ob1G5CollectionService.setLast_transmitter_timestamp(sensorRx.timestamp);
}
if (sensorRx.unfiltered == 0) {
UserError.Log.e(TAG, "Transmitter sent raw sensor value of 0 !! This isn't good. " + JoH.hourMinuteString());
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ public void checkWasBuggy() {
public static boolean isSamsung() {
return Build.MANUFACTURER.toLowerCase().contains("samsung")
|| Build.MANUFACTURER.toLowerCase().contains("xiaomi")
|| Build.MANUFACTURER.toLowerCase().contains("oneplus"); // experimental test
|| Build.MANUFACTURER.toLowerCase().contains("oneplus") // experimental test
|| Build.MANUFACTURER.toLowerCase().contains("oppo"); // experimental test
}

}

0 comments on commit 330f63b

Please sign in to comment.