diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java index 1c3f0930f3..48a09b51f3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java @@ -45,8 +45,6 @@ public class ComboPlugin implements PluginBase, PumpInterface { private boolean fragmentEnabled = false; private boolean fragmentVisible = false; - private boolean initialized = false; - private PumpDescription pumpDescription = new PumpDescription(); @NonNull @@ -180,7 +178,7 @@ public class ComboPlugin implements PluginBase, PumpInterface { @Override public boolean isInitialized() { - return initialized; + return pump.initialized; } @Override @@ -193,13 +191,11 @@ public class ComboPlugin implements PluginBase, PumpInterface { return ruffyScripter.isPumpBusy() && !pump.state.suspended; } - // TODO @Override public int setNewBasalProfile(Profile profile) { return FAILED; } - // TODO @Override public boolean isThisProfileSet(Profile profile) { return false; @@ -215,7 +211,7 @@ public class ComboPlugin implements PluginBase, PumpInterface { public synchronized void refreshDataFromPump(String reason) { log.debug("RefreshDataFromPump called"); - if (!initialized) { + if (!pump.initialized) { runCommand(MainApp.sResources.getString(R.string.connecting), new CommandExecution() { @Override public CommandResult execute() { @@ -223,7 +219,7 @@ public class ComboPlugin implements PluginBase, PumpInterface { } }); checkPumpHistory(); - initialized = true; + pump.initialized = true; } else { runCommand(MainApp.sResources.getString(R.string.combo_action_refreshing), new CommandExecution() { @Override diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPump.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPump.java index 27b064ef1c..b7e9c65504 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPump.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPump.java @@ -9,6 +9,8 @@ import de.jotomo.ruffy.spi.history.PumpHistory; class ComboPump { // TODO actually ... this isn't about successful command execution, but whether we could connect to the pump at all + boolean initialized = false; + volatile long lastSuccessfulConnection; volatile long lastConnectionAttempt; @Nullable diff --git a/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/PumpState.java b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/PumpState.java index 2eeb4a5995..3305150ba1 100644 --- a/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/PumpState.java +++ b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/PumpState.java @@ -18,6 +18,7 @@ public class PumpState { * longer to read that and the pump connection gets interrupted if we're not * reacting quickly. */ + // TODO pump errors (EXX) vs. errors talking to the pump public String errorMsg; public boolean suspended;