From 0ebfc353d4ae3e453c665e743864cf4f36d5a141 Mon Sep 17 00:00:00 2001 From: Bart Sopers Date: Tue, 24 Dec 2019 19:12:39 -0500 Subject: [PATCH] Try to retrieve pulse log before deactivating pod for diagnostics --- .../plugins/pump/omnipod/comm/OmnipodManager.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/OmnipodManager.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/OmnipodManager.java index f82528aa9b..6ba8d2122c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/OmnipodManager.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/OmnipodManager.java @@ -29,6 +29,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.comm.action.service.Prime import info.nightscout.androidaps.plugins.pump.omnipod.comm.action.service.SetTempBasalService; import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.command.CancelDeliveryCommand; import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.StatusResponse; +import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.podinfo.PodInfoRecentHighFlashLogDump; import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.podinfo.PodInfoResponse; import info.nightscout.androidaps.plugins.pump.omnipod.defs.BeepType; import info.nightscout.androidaps.plugins.pump.omnipod.defs.DeliveryStatus; @@ -401,6 +402,18 @@ public class OmnipodManager { logStartingCommandExecution("deactivatePod"); + // Try to get pulse log for diagnostics + // FIXME replace by storing to file + if(isLoggingEnabled()) { + try { + PodInfoResponse podInfoResponse = communicationService.executeAction(new GetPodInfoAction(podState, PodInfoType.RECENT_HIGH_FLASH_LOG_DUMP)); + PodInfoRecentHighFlashLogDump pulseLogInfo = podInfoResponse.getPodInfo(); + LOG.info("Retrieved pulse log from the pod: {}", pulseLogInfo.toString()); + } catch(Exception ex) { + LOG.warn("Failed to retrieve pulse log from the pod", ex); + } + } + try { // Always send acknowledgement beeps here. Matches the PDM's behavior communicationService.executeAction(new DeactivatePodAction(podState, true));