Ignore PodFaultException when deactivating pod
This commit is contained in:
parent
29d12eeb26
commit
057927d24e
3 changed files with 16 additions and 5 deletions
|
@ -43,6 +43,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.exception.IllegalDelivery
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.exception.IllegalSetupProgressException;
|
import info.nightscout.androidaps.plugins.pump.omnipod.exception.IllegalSetupProgressException;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.exception.NonceOutOfSyncException;
|
import info.nightscout.androidaps.plugins.pump.omnipod.exception.NonceOutOfSyncException;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.exception.OmnipodException;
|
import info.nightscout.androidaps.plugins.pump.omnipod.exception.OmnipodException;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.exception.PodFaultException;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.util.OmnipodConst;
|
import info.nightscout.androidaps.plugins.pump.omnipod.util.OmnipodConst;
|
||||||
import info.nightscout.androidaps.utils.SP;
|
import info.nightscout.androidaps.utils.SP;
|
||||||
import io.reactivex.Completable;
|
import io.reactivex.Completable;
|
||||||
|
@ -286,7 +287,13 @@ public class OmnipodManager {
|
||||||
throw new IllegalSetupProgressException(SetupProgress.ADDRESS_ASSIGNED, null);
|
throw new IllegalSetupProgressException(SetupProgress.ADDRESS_ASSIGNED, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
executeAndVerify(() -> communicationService.executeAction(new DeactivatePodAction(podState, acknowledgementBeep)));
|
executeAndVerify(() -> communicationService.executeAction(new DeactivatePodAction(podState, acknowledgementBeep)));
|
||||||
|
} catch (PodFaultException ex) {
|
||||||
|
if (isLoggingEnabled()) {
|
||||||
|
LOG.info("Ignoring PodFaultException in deactivatePod", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
resetPodState();
|
resetPodState();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.omnipod.defs;
|
package info.nightscout.androidaps.plugins.pump.omnipod.defs;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
public enum FaultEventCode {
|
public enum FaultEventCode {
|
||||||
NO_FAULTS((byte) 0x00),
|
NO_FAULTS((byte) 0x00),
|
||||||
FAILED_FLASH_ERASE((byte) 0x01),
|
FAILED_FLASH_ERASE((byte) 0x01),
|
||||||
|
@ -138,4 +140,9 @@ public enum FaultEventCode {
|
||||||
public byte getValue() {
|
public byte getValue() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return String.format(Locale.getDefault(), "Pod fault (%d): %s", value, name());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,12 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.omnipod.exception;
|
package info.nightscout.androidaps.plugins.pump.omnipod.exception;
|
||||||
|
|
||||||
import java.util.Locale;
|
|
||||||
|
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.podinfo.PodInfoFaultEvent;
|
import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.podinfo.PodInfoFaultEvent;
|
||||||
|
|
||||||
public class PodFaultException extends OmnipodException {
|
public class PodFaultException extends OmnipodException {
|
||||||
private final PodInfoFaultEvent faultEvent;
|
private final PodInfoFaultEvent faultEvent;
|
||||||
|
|
||||||
public PodFaultException(PodInfoFaultEvent faultEvent) {
|
public PodFaultException(PodInfoFaultEvent faultEvent) {
|
||||||
super(String.format(Locale.getDefault(), "Pod fault (%d): %s", faultEvent.getFaultEventCode().getValue(),
|
super(faultEvent.getFaultEventCode().toString(), true);
|
||||||
faultEvent.getFaultEventCode().toString()), true);
|
|
||||||
this.faultEvent = faultEvent;
|
this.faultEvent = faultEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue