diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/Home.java b/app/src/main/java/com/eveningoutpost/dexdrip/Home.java index b60b0f3e9e..e0a8c51dec 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/Home.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/Home.java @@ -1,6 +1,7 @@ package com.eveningoutpost.dexdrip; import static android.Manifest.permission.WRITE_EXTERNAL_STORAGE; +import static com.eveningoutpost.dexdrip.g5model.Ob1G5StateMachine.shortTxId; import static com.eveningoutpost.dexdrip.models.JoH.msSince; import static com.eveningoutpost.dexdrip.models.JoH.quietratelimit; import static com.eveningoutpost.dexdrip.models.JoH.tsl; @@ -2692,7 +2693,7 @@ private void updateCurrentBgInfoCommon(DexCollectionType collector, TextView not // TODO this logic needed a rework even a year ago, now its a lot more confused with the additional complexity of native mode if (Ob1G5CollectionService.isG5ActiveButUnknownState() && Calibration.latestValid(2).size() < 2) { // TODO use format string - notificationText.setText(String.format(gs(R.string.state_not_currently_known), (Ob1G5StateMachine.usingG6() ? "G6" : "G5"))); + notificationText.setText(String.format(gs(R.string.state_not_currently_known), (Ob1G5StateMachine.usingG6() ? (shortTxId() ? "G7" : "G6") : "G5"))); showUncalibratedSlope(); } else { diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/g5model/Ob1G5StateMachine.java b/app/src/main/java/com/eveningoutpost/dexdrip/g5model/Ob1G5StateMachine.java index 918da6e539..d0e6073427 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/g5model/Ob1G5StateMachine.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/g5model/Ob1G5StateMachine.java @@ -668,7 +668,7 @@ public static boolean doGetData(Ob1G5CollectionService parent, RxBleConnection c if (connection == null) return false; // TODO switch modes depending on conditions as to whether we are using internal final boolean use_g5_internal_alg = Pref.getBooleanDefaultFalse("ob1_g5_use_transmitter_alg"); - UserError.Log.d(TAG, use_g5_internal_alg ? ("Requesting Glucose Data " + (usingG6() ? "G6" : "G5")) : "Requesting Sensor Data"); + UserError.Log.d(TAG, use_g5_internal_alg ? ("Requesting Glucose Data " + (usingG6() ? (shortTxId() ? "G7" : "G6") : "G5")) : "Requesting Sensor Data"); if (!use_g5_internal_alg) { parent.lastSensorStatus = null; // not applicable diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/models/BgReading.java b/app/src/main/java/com/eveningoutpost/dexdrip/models/BgReading.java index b4137dd6b3..c2a1afd48f 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/models/BgReading.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/models/BgReading.java @@ -1,5 +1,6 @@ package com.eveningoutpost.dexdrip.models; +import static com.eveningoutpost.dexdrip.g5model.Ob1G5StateMachine.shortTxId; import static com.eveningoutpost.dexdrip.importedlibraries.dexcom.Dex_Constants.TREND_ARROW_VALUES.NOT_COMPUTABLE; import static com.eveningoutpost.dexdrip.importedlibraries.dexcom.Dex_Constants.TREND_ARROW_VALUES.getTrend; import static com.eveningoutpost.dexdrip.calibrations.PluggableCalibration.getCalibrationPluginFromPreferences; @@ -1122,7 +1123,11 @@ public static synchronized BgReading bgReadingInsertFromG5(double calculated_val bgr.calculated_value = calculated_value; bgr.raw_data = SPECIAL_G5_PLACEHOLDER; // placeholder if (Ob1G5CollectionService.usingG6()) { - bgr.appendSourceInfo("G6 Native"); + if (shortTxId()) { // If using G7 + bgr.appendSourceInfo("G7"); + } else { + bgr.appendSourceInfo("G6 Native"); + } } else { bgr.appendSourceInfo("G5 Native"); } diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/BroadcastGlucose.java b/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/BroadcastGlucose.java index 3c3cc73957..b9fb7b7e4d 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/BroadcastGlucose.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/BroadcastGlucose.java @@ -63,7 +63,7 @@ public static void sendLocalBroadcast(final BgReading bgReading) { UserError.Log.i("SENSOR QUEUE:", "Broadcast data"); String collectorName = DexCollectionType.getBestCollectorHardwareName(); - if (collectorName.equals("G6 Native")) { + if (collectorName.equals("G6 Native") || collectorName.equals("G7")) { collectorName += " / G5 Native"; // compatibility for older AAPS } bundle.putString(Intents.XDRIP_DATA_SOURCE_DESCRIPTION, collectorName); diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/NightscoutBatteryDevice.java b/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/NightscoutBatteryDevice.java index 507af48bf9..164b44180d 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/NightscoutBatteryDevice.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/NightscoutBatteryDevice.java @@ -1,6 +1,8 @@ package com.eveningoutpost.dexdrip.utilitymodels; +import static com.eveningoutpost.dexdrip.g5model.Ob1G5StateMachine.shortTxId; + import android.content.Context; import android.content.Intent; import android.content.IntentFilter; @@ -143,6 +145,9 @@ boolean alwaysSendBattery() { @Override String getDeviceName() { if (Ob1G5StateMachine.usingG6()) { + if (shortTxId()) { // If using G7 + return "G7 Device"; + } return "G6 Transmitter"; } return "G5 Transmitter"; diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/utils/DexCollectionType.java b/app/src/main/java/com/eveningoutpost/dexdrip/utils/DexCollectionType.java index e26e38fafd..5fc20f886c 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/utils/DexCollectionType.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/utils/DexCollectionType.java @@ -14,6 +14,8 @@ import com.eveningoutpost.dexdrip.cgm.webfollow.WebFollowService; import com.eveningoutpost.dexdrip.cgm.carelinkfollow.CareLinkFollowService; +import static com.eveningoutpost.dexdrip.g5model.Ob1G5StateMachine.shortTxId; + import java.lang.reflect.Method; import java.util.Collections; import java.util.HashMap; @@ -276,7 +278,7 @@ public static String getBestCollectorHardwareName() { return "Network G4 and Classic xDrip"; case DexcomG5: if (Ob1G5CollectionService.usingNativeMode()) { - return Ob1G5CollectionService.usingG6() ? "G6 Native" : "G5 Native"; + return Ob1G5CollectionService.usingG6() ? (shortTxId() ? "G7" : "G6 Native") : "G5 Native"; } return dct.name(); case LibreWifi: diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1bc6d01081..beb0a4e0f3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -726,8 +726,8 @@ Use any-tag optimized reading method Low level diagnostic/prototype value ID of your Dexcom Transmitter, e.g. 12AB3 - Advanced G5 settings for rare situations - G5/G6/Dex1 Debug Settings + Advanced Dexcom settings for rare situations + G5/G6/G7/Dex1 Debug Settings Some devices work better when scanning constantly, others do not. If reading is reliable when this setting is not selected, you should have improved battery life. Normally best to keep this disabled Scan for G5 constantly This is crucial for some Android devices to properly connect, but can cause missed readings when other UI intensive activities are in use. @@ -1213,7 +1213,7 @@ Send your bridge battery level to Nightscout. Uncheck if your battery sensor is broken. Upload bridge battery Send Dexcom transmitter battery statistics to Nightscout. Includes all of the data shown on the Collector Status screen. - Upload OB1G5/G6 transmitter battery + Upload OB1G5/G6/G7/1 transmitter battery Send treatment data to Nightscout. Uncheck if your careportal is broken. Upload treatments Display and sound a notification if Nightscout upload is failing. @@ -1381,14 +1381,14 @@ Fallback to xDrip Use heuristics to minimize Bluetooth scanning + save power Minimize Scanning - I am using a G6 or Dexcom 1 Sensor - G6/Dex1 Support + I am using a G6, G7 or Dexcom 1 Sensor + G6/G7/Dex1 Support OB1 collector can unbond if it thinks the encryption has failed. If you get problems with it unpairing then disable this option. If you then totally lose connection, make sure this is enabled. Allow OB1 unbonding OB1 collector can initiate bonding. Allow OB1 initiate bonding Old G5 Collector Settings - G5/G6 battery options + G5/G6/G7/1 battery options Adjust battery warning level Plugins and Features Heart rate monitor @@ -1400,8 +1400,8 @@ Graph Settings Show TBR information from external status Show Basal TBR - Show G6 predictive glucose dots - G6 Prediction + Show G6/G7 predictive glucose dots + G6/G7 Prediction Declutter graph with treatment icons for small boluses Show micro bolus icons Show alternate glucose dots