Add logging in OmnipodManager.resetPodState and fix NonceState.toString

This commit is contained in:
Bart Sopers 2020-01-22 23:45:42 +01:00
parent 93e7eb518f
commit f5af607125
3 changed files with 9 additions and 4 deletions

View file

@ -446,10 +446,13 @@ public class OmnipodManager {
logCommandExecutionFinished("deactivatePod");
}
resetPodState();
resetPodState(false);
}
public void resetPodState() {
public void resetPodState(boolean forcedByUser) {
if(isLoggingEnabled()) {
LOG.warn("resetPodState has been called. forcedByUser={}", forcedByUser);
}
podState = null;
SP.remove(OmnipodConst.Prefs.PodState);
}

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.defs;
import java.util.Arrays;
public class NonceState {
private final long[] table = new long[21];
private int index;
@ -44,7 +46,7 @@ public class NonceState {
@Override
public String toString() {
return "NonceState{" +
"currentNonce=" + getCurrentNonce() +
"table=" + Arrays.toString(table) +
", index=" + index +
'}';
}

View file

@ -266,7 +266,7 @@ public class AapsOmnipodManager implements OmnipodCommunicationManagerInterface
@Override
public PumpEnactResult resetPodStatus() {
delegate.resetPodState();
delegate.resetPodState(true);
reportImplicitlyCanceledTbr();