summaryrefslogtreecommitdiffstats
path: root/master/model-150-fixes.patch
diff options
context:
space:
mode:
authorfishsoupisgood <github@madingley.org>2019-05-27 03:32:21 +0100
committerfishsoupisgood <github@madingley.org>2019-05-27 03:32:21 +0100
commit35c4b69542a6dcc3b48462e6682848d0c37ff5a2 (patch)
treee8ecf1274618a16cec69dd98c9b86fca28e3b264 /master/model-150-fixes.patch
parent9eb2f077abae0c7b2a6ff0722e9ac388b0ea9586 (diff)
downloaddatalink-pq-35c4b69542a6dcc3b48462e6682848d0c37ff5a2.tar.gz
datalink-pq-35c4b69542a6dcc3b48462e6682848d0c37ff5a2.tar.bz2
datalink-pq-35c4b69542a6dcc3b48462e6682848d0c37ff5a2.zip
add 150 support, tidy up 50 support
Diffstat (limited to 'master/model-150-fixes.patch')
-rw-r--r--master/model-150-fixes.patch80
1 files changed, 80 insertions, 0 deletions
diff --git a/master/model-150-fixes.patch b/master/model-150-fixes.patch
new file mode 100644
index 0000000..912d581
--- /dev/null
+++ b/master/model-150-fixes.patch
@@ -0,0 +1,80 @@
+diff --git a/dl_init_watch.c b/dl_init_watch.c
+index d6a7408..ec2c1bc 100644
+--- a/dl_init_watch.c
++++ b/dl_init_watch.c
+@@ -139,7 +139,7 @@ WatchInfoPtr dl_init_watch(int type)
+ result->max_wristapp_len = 742;
+ result->max_mel_len = 64;
+ result->pre_notification_time = 0;
+- result->time_adjust = 9;
++ result->time_adjust = 2;
+ break;
+ case DATALINK_IRONMAN:
+ result->dl_device = type;
+diff --git a/dl_send_data.c b/dl_send_data.c
+index 20f4203..3ea7bfa 100644
+--- a/dl_send_data.c
++++ b/dl_send_data.c
+@@ -825,6 +825,8 @@ int dl_send_data(WatchInfoPtr wi, int type)
+
+ if (*buf != 4)
+ {
++ *buf += 2;
++
+ dl_docrc(buf);
+
+ if (write(ofd, buf, *buf) != *buf)
+@@ -845,7 +847,21 @@ int dl_send_data(WatchInfoPtr wi, int type)
+
+ if (dl_download_data.num_melody)
+ {
++ unsigned melody_len;
++ unsigned char *melody_data;
++ unsigned char melody_header[]={0x25, 0x04, 0x19, 0x69};
+ melody = dl_download_data.melody;
++
++
++ melody_len = melody->len;
++ melody_data = melody->data;
++
++
++ if ((melody_len >= sizeof(melody_header)) && (!memcmp(melody_data, melody_header, sizeof(melody_header)))) {
++ melody_len -= sizeof(melody_header);
++ melody_data += sizeof(melody_header);
++ }
++
+ memcpy(buf, dstart, *dstart);
+ buf[2] = 3;
+ dl_docrc(buf);
+@@ -856,12 +872,12 @@ int dl_send_data(WatchInfoPtr wi, int type)
+
+ memcpy(buf, dinfo, *dinfo);
+ buf[2] = 3;
+- buf[3] = melody->len / (max_pckt - 6);
++ buf[3] = melody_len / (max_pckt - 6);
+
+- if (melody->len % (max_pckt - 6))
++ if (melody_len % (max_pckt - 6))
+ buf[3]++;
+
+- buf[4] = 0xff - melody->len;
++ buf[4] = 0xff - melody_len;
+ *buf = 7;
+
+ dl_docrc(buf);
+@@ -883,12 +899,14 @@ int dl_send_data(WatchInfoPtr wi, int type)
+ buf[3] = pnum++;
+
+ if (!_write_data
+- (ofd, buf, melody->data, melody->len, &pnum, 3, wi))
++ (ofd, buf, melody_data, melody_len, &pnum, 3, wi))
+ return ((*dl_error_proc)
+ ("Can't write to tmp file."));
+
+ if (*buf != 4)
+ {
++ *buf += 2;
++
+ dl_docrc(buf);
+
+ if (write(ofd, buf, *buf) != *buf)