From 1adf8718ae59cda647f5e1d900e923eb9528bae0 Mon Sep 17 00:00:00 2001 From: Roumen Georgiev Date: Tue, 12 Jun 2018 13:30:07 +0300 Subject: [PATCH] more debugging output --- .../plugins/PumpDanaR/comm/MsgGetUserOptions.java | 3 +++ .../PumpDanaR/comm/MsgSettingUserOptions.java | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/comm/MsgGetUserOptions.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/comm/MsgGetUserOptions.java index a8aeb5e84e..aeffbd66df 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/comm/MsgGetUserOptions.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/comm/MsgGetUserOptions.java @@ -37,6 +37,9 @@ public class MsgGetUserOptions extends MessageBase { public void handleMessage(byte[] packet) { DanaRPump pump = DanaRPump.getInstance(); byte[] bytes = getDataBytes(packet, 0, packet.length - 10); + for(int pos=0; pos < bytes.length; pos++) { + log.debug("[" + pos + "]" + bytes[pos]); + } pump.timeDisplayType = bytes[0] == (byte) 1 ? 0 : 1; // 1 -> 24h 0 -> 12h pump.buttonScrollOnOff = bytes[1] == (byte) 1 ? 1 : 0; // 1 -> ON, 0-> OFF pump.beepAndAlarm = bytes[2]; // 1 -> Sound on alarm 2-> Vibrate on alarm 3-> Both on alarm 5-> Sound + beep 6-> vibrate + beep 7-> both + beep Beep adds 4 diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/comm/MsgSettingUserOptions.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/comm/MsgSettingUserOptions.java index 56a71d00f0..48a4493f28 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/comm/MsgSettingUserOptions.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/comm/MsgSettingUserOptions.java @@ -28,6 +28,15 @@ public class MsgSettingUserOptions extends MessageBase { public MsgSettingUserOptions(int timeDisplayType, int buttonScrollOnOff, int beepAndAlarm, int lcdOnTimeSec, int backlightOnTimeSec, int selectedLanguage, int glucoseUnit, int shutdownHour, int lowReservoirRate, int cannulaVolume, int refillRate) { this(); log.debug(" initializing MsgSetUserOptions"); + log.debug("timeDisplayType: " + (byte) timeDisplayType); + log.debug("Button scroll: " + (byte) buttonScrollOnOff); + log.debug("BeepAndAlarm: " + (byte) beepAndAlarm); + log.debug("screen timeout: " + (byte) lcdOnTimeSec); + log.debug("Backlight: " + (byte) backlightOnTimeSec); + log.debug("Selected language: " + (byte) selectedLanguage); + log.debug("Units: " + (byte) glucoseUnit); + log.debug("Shutdown: " + (byte) shutdownHour); + log.debug("Low reservoir: " + (byte) lowReservoirRate); this.timeDisplayType = timeDisplayType; this.buttonScrollOnOff = buttonScrollOnOff; this.beepAndAlarm = beepAndAlarm; @@ -39,7 +48,8 @@ public class MsgSettingUserOptions extends MessageBase { this.lowReservoirRate = lowReservoirRate; this.cannulaVolume = cannulaVolume; this.refillRate = refillRate; - + // need to organize here + // glucoseunit is at pos 8 and lowReservoirRate is at pos 27 AddParamByte((byte) timeDisplayType); AddParamByte((byte) buttonScrollOnOff); AddParamByte((byte) beepAndAlarm);