diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/Services/ExecutionService.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/Services/ExecutionService.java
index c79bb5b23e..e063ffcb8d 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/Services/ExecutionService.java
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/Services/ExecutionService.java
@@ -58,6 +58,7 @@ import info.nightscout.androidaps.plugins.DanaR.comm.MsgSetExtendedBolusStart;
import info.nightscout.androidaps.plugins.DanaR.comm.MsgSetExtendedBolusStop;
import info.nightscout.androidaps.plugins.DanaR.comm.MsgSetTempBasalStart;
import info.nightscout.androidaps.plugins.DanaR.comm.MsgSetTempBasalStop;
+import info.nightscout.androidaps.plugins.DanaR.comm.MsgSetTime;
import info.nightscout.androidaps.plugins.DanaR.comm.MsgSettingActiveProfile;
import info.nightscout.androidaps.plugins.DanaR.comm.MsgSettingBasal;
import info.nightscout.androidaps.plugins.DanaR.comm.MsgSettingGlucose;
@@ -320,6 +321,7 @@ public class ExecutionService extends Service {
mSerialIOThread.sendMessage(new MsgSettingActiveProfile());
mSerialIOThread.sendMessage(new MsgSettingProfileRatios());
mSerialIOThread.sendMessage(new MsgSettingProfileRatiosAll());
+ mSerialIOThread.sendMessage(new MsgSetTime(new Date()));
danaRPump.lastSettingsRead = now;
}
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/comm/MessageBase.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/comm/MessageBase.java
index 3fc4093119..1d97a02ba1 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/comm/MessageBase.java
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/comm/MessageBase.java
@@ -51,6 +51,15 @@ public class MessageBase {
AddParamByte((byte) (date.get(Calendar.MINUTE)));
}
+ public void AddParamDateTime(Date date) {
+ AddParamByte((byte) (date.getSeconds()));
+ AddParamByte((byte) (date.getMinutes()));
+ AddParamByte((byte) (date.getHours()));
+ AddParamByte((byte) (date.getDate()));
+ AddParamByte((byte) (date.getMonth() + 1));
+ AddParamByte((byte) (date.getYear() - 100));
+ }
+
public byte[] getRawMessageBytes() {
this.buffer[0] = (byte) 0x7E;
this.buffer[1] = (byte) 0x7E;
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/comm/MsgSetTime.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/comm/MsgSetTime.java
new file mode 100644
index 0000000000..827958608c
--- /dev/null
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/comm/MsgSetTime.java
@@ -0,0 +1,28 @@
+package info.nightscout.androidaps.plugins.DanaR.comm;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Date;
+
+import info.nightscout.androidaps.Config;
+
+/**
+ * Created by mike on 09.12.2016.
+ */
+
+public class MsgSetTime extends MessageBase {
+ private static Logger log = LoggerFactory.getLogger(MsgSetTime.class);
+
+ public MsgSetTime(Date time) {
+ SetCommand(0x330a);
+ AddParamDateTime(time);
+ }
+
+ public void handleMessage(byte[] bytes) {
+ int result = intFromBuff(bytes, 0, 1);
+
+ if (Config.logDanaMessageDetail)
+ log.debug("Result: " + result);
+ }
+}
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/Services/ExecutionService.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/Services/ExecutionService.java
index 13435a0855..6ec790c94c 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/Services/ExecutionService.java
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/Services/ExecutionService.java
@@ -31,8 +31,8 @@ import info.nightscout.androidaps.R;
import info.nightscout.androidaps.db.Treatment;
import info.nightscout.androidaps.events.EventAppExit;
import info.nightscout.androidaps.events.EventPreferenceChange;
-import info.nightscout.androidaps.plugins.DanaR.comm.MessageBase;
-import info.nightscout.androidaps.plugins.DanaR.comm.RecordTypes;
+import info.nightscout.androidaps.plugins.DanaR.comm.*;
+import info.nightscout.androidaps.plugins.DanaR.comm.MsgSetTime;
import info.nightscout.androidaps.plugins.DanaR.events.EventDanaRBolusStart;
import info.nightscout.androidaps.plugins.DanaR.events.EventDanaRConnectionStatus;
import info.nightscout.androidaps.plugins.DanaR.events.EventDanaRNewStatus;
@@ -40,6 +40,37 @@ import info.nightscout.androidaps.plugins.DanaRKorean.DanaRKoreanPlugin;
import info.nightscout.androidaps.plugins.DanaRKorean.DanaRKoreanPump;
import info.nightscout.androidaps.plugins.DanaRKorean.SerialIOThread;
import info.nightscout.androidaps.plugins.DanaRKorean.comm.*;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgBolusProgress;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgBolusStart;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgBolusStop;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgCheckValue;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgHistoryAlarm;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgHistoryBasalHour;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgHistoryBolus;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgHistoryCarbo;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgHistoryDailyInsulin;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgHistoryDone;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgHistoryError;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgHistoryGlucose;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgHistoryRefill;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgHistorySuspend;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgPCCommStart;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgPCCommStop;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgSetCarbsEntry;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgSetExtendedBolusStart;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgSetExtendedBolusStop;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgSetSingleBasalProfile;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgSetTempBasalStart;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgSetTempBasalStop;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgSettingBasal;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgSettingGlucose;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgSettingMaxValues;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgSettingProfileRatios;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgSettingPumpTime;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgSettingShippingInfo;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgStatusBasic;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgStatusBolusExtended;
+import info.nightscout.androidaps.plugins.DanaRKorean.comm.MsgStatusTempBasal;
import info.nightscout.client.data.NSProfile;
import info.nightscout.utils.SafeParse;
import info.nightscout.utils.ToastUtils;
@@ -281,6 +312,7 @@ public class ExecutionService extends Service {
mSerialIOThread.sendMessage(new MsgSettingGlucose());
mSerialIOThread.sendMessage(new MsgSettingPumpTime());
mSerialIOThread.sendMessage(new MsgSettingProfileRatios());
+ mSerialIOThread.sendMessage(new MsgSetTime(new Date()));
danaRKoreanPump.lastSettingsRead = now;
}
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/comm/MsgSetTime.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/comm/MsgSetTime.java
new file mode 100644
index 0000000000..a610ca4613
--- /dev/null
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/comm/MsgSetTime.java
@@ -0,0 +1,29 @@
+package info.nightscout.androidaps.plugins.DanaRKorean.comm;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Date;
+
+import info.nightscout.androidaps.Config;
+import info.nightscout.androidaps.plugins.DanaR.comm.MessageBase;
+
+/**
+ * Created by mike on 09.12.2016.
+ */
+
+public class MsgSetTime extends MessageBase {
+ private static Logger log = LoggerFactory.getLogger(MsgSetTime.class);
+
+ public MsgSetTime(Date time) {
+ SetCommand(0x330a);
+ AddParamDateTime(time);
+ }
+
+ public void handleMessage(byte[] bytes) {
+ int result = intFromBuff(bytes, 0, 1);
+
+ if (Config.logDanaMessageDetail)
+ log.debug("Result: " + result);
+ }
+}
diff --git a/wear/wear.iml b/wear/wear.iml
index ee49850ebe..a3cf0fc780 100644
--- a/wear/wear.iml
+++ b/wear/wear.iml
@@ -43,13 +43,6 @@
-
-
-
-
-
-
-
@@ -58,6 +51,13 @@
+
+
+
+
+
+
+
@@ -106,14 +106,6 @@
-
-
-
-
-
-
-
-
@@ -122,6 +114,14 @@
+
+
+
+
+
+
+
+