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"); 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; podState = null;
SP.remove(OmnipodConst.Prefs.PodState); SP.remove(OmnipodConst.Prefs.PodState);
} }

View file

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

View file

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