From 2f2c9d00c12ad496cae5645874442288e1d37ad1 Mon Sep 17 00:00:00 2001 From: Navid Date: Fri, 17 Nov 2023 12:12:10 -0500 Subject: [PATCH 1/2] Don't offer initial calibration to G7 --- .../java/com/eveningoutpost/dexdrip/NavDrawerBuilder.java | 2 +- .../dexdrip/g5model/FirmwareCapability.java | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/NavDrawerBuilder.java b/app/src/main/java/com/eveningoutpost/dexdrip/NavDrawerBuilder.java index 11f290f10e..4a378041e3 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/NavDrawerBuilder.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/NavDrawerBuilder.java @@ -90,7 +90,7 @@ public NavDrawerBuilder(final Context context) { } } else { //If there haven't been two initial calibrations if (BgReading.isDataSuitableForDoubleCalibration() || Ob1G5CollectionService.isG5WantingInitialCalibration()) { - if (FirmwareCapability.isTransmitterRawIncapable(getTransmitterID()) && last_two_bgReadings.size() > 1) { //A Firefly G6 after third reading + if ((FirmwareCapability.isTransmitterRawIncapable(getTransmitterID()) && last_two_bgReadings.size() > 1) || FirmwareCapability.isDeviceG7(getTransmitterID()) ) { //A Firefly G6 after third reading this.nav_drawer_options.add(context.getString(R.string.add_calibration)); this.nav_drawer_intents.add(new Intent(context, AddCalibration.class)); } else { //G5 or non-Firefly G6 or Firefly G6 in no-code mode, after warm-up before initial calibration diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/g5model/FirmwareCapability.java b/app/src/main/java/com/eveningoutpost/dexdrip/g5model/FirmwareCapability.java index a33a1aa2ed..6665a1b8b4 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/g5model/FirmwareCapability.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/g5model/FirmwareCapability.java @@ -79,6 +79,10 @@ static boolean isFirmwarePreemptiveRestartCapable(final String version) { return isFirmwareRawCapable(version); // hang off this for now as they are currently the same } + static boolean isG7Firmware(final String version) { + return KNOWN_ALT_FIRMWARES.contains(version); + } + public static boolean isTransmitterPredictiveCapable(final String tx_id) { return isG6Firmware(getRawFirmwareVersionString(tx_id)); } @@ -98,6 +102,10 @@ public static boolean isTransmitterStandardFirefly(final String tx_id) { // Fire return false; } + public static boolean isDeviceG7(final String tx_id) { + return isG7Firmware(getRawFirmwareVersionString(tx_id)); + } + public static boolean isTransmitterG5(final String tx_id) { return isG5Firmware(getRawFirmwareVersionString(tx_id)); } From 63dd2022f0be81353996b27596c8884f3ab40737 Mon Sep 17 00:00:00 2001 From: Navid Date: Fri, 17 Nov 2023 12:14:27 -0500 Subject: [PATCH 2/2] Comment --- .../main/java/com/eveningoutpost/dexdrip/NavDrawerBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/NavDrawerBuilder.java b/app/src/main/java/com/eveningoutpost/dexdrip/NavDrawerBuilder.java index 4a378041e3..42a6bcf17b 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/NavDrawerBuilder.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/NavDrawerBuilder.java @@ -90,7 +90,7 @@ public NavDrawerBuilder(final Context context) { } } else { //If there haven't been two initial calibrations if (BgReading.isDataSuitableForDoubleCalibration() || Ob1G5CollectionService.isG5WantingInitialCalibration()) { - if ((FirmwareCapability.isTransmitterRawIncapable(getTransmitterID()) && last_two_bgReadings.size() > 1) || FirmwareCapability.isDeviceG7(getTransmitterID()) ) { //A Firefly G6 after third reading + if ((FirmwareCapability.isTransmitterRawIncapable(getTransmitterID()) && last_two_bgReadings.size() > 1) || FirmwareCapability.isDeviceG7(getTransmitterID()) ) { //A Firefly G6 after third reading or a G7 this.nav_drawer_options.add(context.getString(R.string.add_calibration)); this.nav_drawer_intents.add(new Intent(context, AddCalibration.class)); } else { //G5 or non-Firefly G6 or Firefly G6 in no-code mode, after warm-up before initial calibration