From a79a1c1108676c31d3d2b2a97f392d5a53cdf928 Mon Sep 17 00:00:00 2001 From: Bart Sopers Date: Sat, 28 Dec 2019 21:56:10 -0500 Subject: [PATCH] Rename PodInfo*HighFlashLogDump to PodInfo*PulseLog and don't show spaces in hex string when showing the response of these commands (as per suggested by @itsmojo) --- .../plugins/pump/common/utils/ByteUtil.java | 15 +++++++++++++ .../pump/omnipod/OmnipodPumpPlugin.java | 5 ++--- .../pump/omnipod/comm/OmnipodManager.java | 6 ++--- ...LogDump.java => PodInfoOlderPulseLog.java} | 22 ++++++++++++++----- ...ogDump.java => PodInfoRecentPulseLog.java} | 13 ++++++----- .../OmnipodCommunicationManagerInterface.java | 4 ++-- .../pump/omnipod/defs/PodInfoType.java | 16 +++++++------- .../driver/comm/AapsOmnipodManager.java | 6 ++--- .../comm/OmnipodDashCommunicationManager.java | 4 ++-- ...est.java => PodInfoOlderPulseLogTest.java} | 2 +- .../PodInfoRecentHighFlashLogDumpTest.java | 16 -------------- .../podinfo/PodInfoRecentPulseLogTest.java | 16 ++++++++++++++ 12 files changed, 75 insertions(+), 50 deletions(-) rename app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/{PodInfoOlderHighFlashLogDump.java => PodInfoOlderPulseLog.java} (67%) rename app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/{PodInfoRecentHighFlashLogDump.java => PodInfoRecentPulseLog.java} (80%) rename app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/{PodInfoOlderHighFlashLogDumpTest.java => PodInfoOlderPulseLogTest.java} (68%) delete mode 100644 app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoRecentHighFlashLogDumpTest.java create mode 100644 app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoRecentPulseLogTest.java diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ByteUtil.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ByteUtil.java index ea42cef210..6923b42020 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ByteUtil.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ByteUtil.java @@ -116,6 +116,21 @@ public class ByteUtil { return rval; } + public static String shortHexStringWithoutSpaces(byte[] byteArray) { + String hexString = ""; + if (byteArray == null) { + return hexString; + } + if (byteArray.length == 0) { + return hexString; + } + for (byte b : byteArray) { + hexString = hexString + HEX_DIGITS[(b & 0xF0) >> 4]; + hexString = hexString + HEX_DIGITS[(b & 0x0F)]; + } + return hexString; + } + public static String shortHexString(List list) { byte[] abyte0 = getByteArrayFromList(list); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java index 455311a399..8b7af06915 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java @@ -48,7 +48,7 @@ import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.ResetRileyLinkConfigurationTask; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.ServiceTaskExecutor; -import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.podinfo.PodInfoRecentHighFlashLogDump; +import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.podinfo.PodInfoRecentPulseLog; import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodCommandType; import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodCommunicationManagerInterface; import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodCustomActionType; @@ -67,7 +67,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.util.OmnipodConst; import info.nightscout.androidaps.plugins.pump.omnipod.util.OmnipodUtil; import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin; import info.nightscout.androidaps.utils.FabricPrivacy; -import info.nightscout.androidaps.utils.OKDialog; import info.nightscout.androidaps.utils.SP; import io.reactivex.disposables.CompositeDisposable; import io.reactivex.schedulers.Schedulers; @@ -377,7 +376,7 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump if (omnipodStatusRequest==OmnipodStatusRequest.GetPodPulseLog) { OmnipodUITask omnipodUITask = omnipodUIComm.executeCommand(omnipodStatusRequest.getCommandType()); - PodInfoRecentHighFlashLogDump result = (PodInfoRecentHighFlashLogDump)omnipodUITask.returnDataObject; + PodInfoRecentPulseLog result = (PodInfoRecentPulseLog)omnipodUITask.returnDataObject; if (result==null) { LOG.warn("Result was null."); 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 a8973a2791..92bb4db134 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 @@ -28,7 +28,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.comm.action.service.Inser import info.nightscout.androidaps.plugins.pump.omnipod.comm.action.service.PrimeService; 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.PodInfoRecentPulseLog; 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; @@ -408,8 +408,8 @@ public class OmnipodManager { // 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(); + PodInfoResponse podInfoResponse = communicationService.executeAction(new GetPodInfoAction(podState, PodInfoType.RECENT_PULSE_LOG)); + PodInfoRecentPulseLog 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); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoOlderHighFlashLogDump.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoOlderPulseLog.java similarity index 67% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoOlderHighFlashLogDump.java rename to app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoOlderPulseLog.java index 3292679cc1..c36b053cce 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoOlderHighFlashLogDump.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoOlderPulseLog.java @@ -1,5 +1,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.podinfo; +import android.text.TextUtils; + import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -7,12 +9,12 @@ import java.util.List; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodInfoType; -public class PodInfoOlderHighFlashLogDump extends PodInfo { +public class PodInfoOlderPulseLog extends PodInfo { private static final int MINIMUM_MESSAGE_LENGTH = 3; private final ArrayList dwords; - public PodInfoOlderHighFlashLogDump(byte[] encodedData) { + public PodInfoOlderPulseLog(byte[] encodedData) { super(encodedData); if (encodedData.length < MINIMUM_MESSAGE_LENGTH) { @@ -30,7 +32,7 @@ public class PodInfoOlderHighFlashLogDump extends PodInfo { @Override public PodInfoType getType() { - return PodInfoType.OLDER_HIGH_FLASH_LOG_DUMP; + return PodInfoType.OLDER_PULSE_LOG; } public List getDwords() { @@ -39,8 +41,16 @@ public class PodInfoOlderHighFlashLogDump extends PodInfo { @Override public String toString() { - return "PodInfoOlderHighFlashLogDump{" + - "dwords=" + dwords + - '}'; + String out = "PodInfoOlderPulseLog{" + + "dwords=["; + + List hexDwords = new ArrayList<>(); + for (byte[] dword : dwords) { + hexDwords.add(ByteUtil.shortHexStringWithoutSpaces(dword)); + } + out += TextUtils.join(", ", hexDwords); + out += "]}"; + + return out; } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoRecentHighFlashLogDump.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoRecentPulseLog.java similarity index 80% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoRecentHighFlashLogDump.java rename to app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoRecentPulseLog.java index 2e50369136..1008cca689 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoRecentHighFlashLogDump.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoRecentPulseLog.java @@ -9,14 +9,14 @@ import java.util.List; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodInfoType; -public class PodInfoRecentHighFlashLogDump extends PodInfo { +public class PodInfoRecentPulseLog extends PodInfo { private static final int MINIMUM_MESSAGE_LENGTH = 3; private final ArrayList dwords; private final int lastEntryIndex; - public PodInfoRecentHighFlashLogDump(byte[] encodedData, int bodyLength) { + public PodInfoRecentPulseLog(byte[] encodedData, int bodyLength) { super(encodedData); if (encodedData.length < MINIMUM_MESSAGE_LENGTH) { @@ -36,7 +36,7 @@ public class PodInfoRecentHighFlashLogDump extends PodInfo { @Override public PodInfoType getType() { - return PodInfoType.RECENT_HIGH_FLASH_LOG_DUMP; + return PodInfoType.RECENT_PULSE_LOG; } public List getDwords() { @@ -49,14 +49,15 @@ public class PodInfoRecentHighFlashLogDump extends PodInfo { @Override public String toString() { - String out = "PodInfoRecentHighFlashLogDump{" + + String out = "PodInfoRecentPulseLog{" + "lastEntryIndex=" + lastEntryIndex + ",dwords=["; + List hexDwords = new ArrayList<>(); for (byte[] dword : dwords) { - hexDwords.add(ByteUtil.shortHexString(dword)); + hexDwords.add(ByteUtil.shortHexStringWithoutSpaces(dword)); } - out += TextUtils.join(",", hexDwords); + out += TextUtils.join(", ", hexDwords); out += "]}"; return out; } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/OmnipodCommunicationManagerInterface.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/OmnipodCommunicationManagerInterface.java index 844b6a14fa..01d25c8763 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/OmnipodCommunicationManagerInterface.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/OmnipodCommunicationManagerInterface.java @@ -3,7 +3,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.defs; import info.nightscout.androidaps.data.Profile; import info.nightscout.androidaps.data.PumpEnactResult; import info.nightscout.androidaps.plugins.pump.common.data.TempBasalPair; -import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.podinfo.PodInfoRecentHighFlashLogDump; +import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.podinfo.PodInfoRecentPulseLog; import info.nightscout.androidaps.plugins.pump.omnipod.driver.OmnipodPumpStatus; public interface OmnipodCommunicationManagerInterface { @@ -74,5 +74,5 @@ public interface OmnipodCommunicationManagerInterface { void setPumpStatus(OmnipodPumpStatus pumpStatusLocal); - PodInfoRecentHighFlashLogDump readPulseLog(); + PodInfoRecentPulseLog readPulseLog(); } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/PodInfoType.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/PodInfoType.java index 374ca53b6a..3ff630ea6a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/PodInfoType.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/PodInfoType.java @@ -6,8 +6,8 @@ import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.pod import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.podinfo.PodInfoFaultAndInitializationTime; import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.podinfo.PodInfoFaultEvent; import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.podinfo.PodInfoLowFlashLogDump; -import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.podinfo.PodInfoOlderHighFlashLogDump; -import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.podinfo.PodInfoRecentHighFlashLogDump; +import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.podinfo.PodInfoOlderPulseLog; +import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.podinfo.PodInfoRecentPulseLog; import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.podinfo.PodInfoTestValues; public enum PodInfoType { @@ -18,8 +18,8 @@ public enum PodInfoType { FAULT_AND_INITIALIZATION_TIME((byte) 0x05), HARDCODED_TEST_VALUES((byte) 0x06), LOW_FLASH_DUMP_LOG((byte) 0x46), // Starting at $4000 - RECENT_HIGH_FLASH_LOG_DUMP((byte) 0x50), // Starting at $4200 - OLDER_HIGH_FLASH_LOG_DUMP((byte) 0x51); // Starting at $4200 but dumps entries before the last 50 + RECENT_PULSE_LOG((byte) 0x50), // Starting at $4200 + OLDER_PULSE_LOG((byte) 0x51); // Starting at $4200 but dumps entries before the last 50 private final byte value; @@ -58,10 +58,10 @@ public enum PodInfoType { return new PodInfoTestValues(encodedData); case LOW_FLASH_DUMP_LOG: return new PodInfoLowFlashLogDump(encodedData); - case RECENT_HIGH_FLASH_LOG_DUMP: - return new PodInfoRecentHighFlashLogDump(encodedData, bodyLength); - case OLDER_HIGH_FLASH_LOG_DUMP: - return new PodInfoOlderHighFlashLogDump(encodedData); + case RECENT_PULSE_LOG: + return new PodInfoRecentPulseLog(encodedData, bodyLength); + case OLDER_PULSE_LOG: + return new PodInfoOlderPulseLog(encodedData); default: throw new IllegalArgumentException("Cannot decode " + this.name()); } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/comm/AapsOmnipodManager.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/comm/AapsOmnipodManager.java index d9d1c58365..f13ce0bc52 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/comm/AapsOmnipodManager.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/comm/AapsOmnipodManager.java @@ -35,7 +35,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.comm.OmnipodCommunication import info.nightscout.androidaps.plugins.pump.omnipod.comm.OmnipodManager; import info.nightscout.androidaps.plugins.pump.omnipod.comm.SetupActionResult; 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.PodInfoRecentPulseLog; import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.podinfo.PodInfoResponse; import info.nightscout.androidaps.plugins.pump.omnipod.defs.AlertSlot; import info.nightscout.androidaps.plugins.pump.omnipod.defs.AlertType; @@ -443,8 +443,8 @@ public class AapsOmnipodManager implements OmnipodCommunicationManagerInterface return new PumpEnactResult().success(true).enacted(true); } - public PodInfoRecentHighFlashLogDump readPulseLog() { - PodInfoResponse response = delegate.getPodInfo(PodInfoType.RECENT_HIGH_FLASH_LOG_DUMP); + public PodInfoRecentPulseLog readPulseLog() { + PodInfoResponse response = delegate.getPodInfo(PodInfoType.RECENT_PULSE_LOG); return response.getPodInfo(); } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod_dash/comm/OmnipodDashCommunicationManager.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod_dash/comm/OmnipodDashCommunicationManager.java index 116d44ea6b..ee8d9212c4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod_dash/comm/OmnipodDashCommunicationManager.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod_dash/comm/OmnipodDashCommunicationManager.java @@ -11,7 +11,7 @@ import info.nightscout.androidaps.logging.L; import info.nightscout.androidaps.plugins.pump.common.data.TempBasalPair; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RFSpy; -import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.podinfo.PodInfoRecentHighFlashLogDump; +import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.podinfo.PodInfoRecentPulseLog; import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodCommunicationManagerInterface; import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodInitActionType; import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodInitReceiver; @@ -118,7 +118,7 @@ public class OmnipodDashCommunicationManager implements OmnipodCommunicationMana } @Override - public PodInfoRecentHighFlashLogDump readPulseLog() { + public PodInfoRecentPulseLog readPulseLog() { return null; } diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoOlderHighFlashLogDumpTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoOlderPulseLogTest.java similarity index 68% rename from app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoOlderHighFlashLogDumpTest.java rename to app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoOlderPulseLogTest.java index 088cb4c977..7397491880 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoOlderHighFlashLogDumpTest.java +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoOlderPulseLogTest.java @@ -1,5 +1,5 @@ package info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.podinfo; -public class PodInfoOlderHighFlashLogDumpTest { +public class PodInfoOlderPulseLogTest { // TODO } diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoRecentHighFlashLogDumpTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoRecentHighFlashLogDumpTest.java deleted file mode 100644 index 18f8dd3a2b..0000000000 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoRecentHighFlashLogDumpTest.java +++ /dev/null @@ -1,16 +0,0 @@ -package info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.podinfo; - -import org.junit.Test; - -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; - -import static org.junit.Assert.assertEquals; - -public class PodInfoRecentHighFlashLogDumpTest { - @Test - public void testDecoding() { - PodInfoRecentHighFlashLogDump podInfoRecentHighFlashLogDump = new PodInfoRecentHighFlashLogDump(ByteUtil.fromHexString("3d313b004030350045303a00483033004d313a005031310054313f00583038805d302d806030368001313b800c3033801130388014313480193138801c313280213039802431360029313d002c31390031303f0034313900393140003c31390041313e00443137004905723a80087335800d733a801073358015733a80187235801d7338802073338025733a00287235002d723b003072360035703b00383134"), 160); - - assertEquals(39, podInfoRecentHighFlashLogDump.getDwords().size()); - } -} diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoRecentPulseLogTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoRecentPulseLogTest.java new file mode 100644 index 0000000000..8e5d79c8d2 --- /dev/null +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoRecentPulseLogTest.java @@ -0,0 +1,16 @@ +package info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.podinfo; + +import org.junit.Test; + +import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; + +import static org.junit.Assert.assertEquals; + +public class PodInfoRecentPulseLogTest { + @Test + public void testDecoding() { + PodInfoRecentPulseLog podInfoRecentPulseLog = new PodInfoRecentPulseLog(ByteUtil.fromHexString("3d313b004030350045303a00483033004d313a005031310054313f00583038805d302d806030368001313b800c3033801130388014313480193138801c313280213039802431360029313d002c31390031303f0034313900393140003c31390041313e00443137004905723a80087335800d733a801073358015733a80187235801d7338802073338025733a00287235002d723b003072360035703b00383134"), 160); + + assertEquals(39, podInfoRecentPulseLog.getDwords().size()); + } +}