From 35c4b69542a6dcc3b48462e6682848d0c37ff5a2 Mon Sep 17 00:00:00 2001 From: fishsoupisgood Date: Mon, 27 May 2019 03:32:21 +0100 Subject: add 150 support, tidy up 50 support --- master/tools.patch | 104 +++++++++++++---------------------------------------- 1 file changed, 24 insertions(+), 80 deletions(-) (limited to 'master/tools.patch') diff --git a/master/tools.patch b/master/tools.patch index 96a117d..b618df5 100644 --- a/master/tools.patch +++ b/master/tools.patch @@ -1,93 +1,37 @@ -diff --git a/dl_init_watch.c b/dl_init_watch.c -index 9e88500..d6a7408 100644 ---- a/dl_init_watch.c -+++ b/dl_init_watch.c -@@ -86,7 +86,7 @@ WatchInfoPtr dl_init_watch(int type) - result->max_wristapp_len = 0; - result->max_mel_len = 0; - result->pre_notification_time = 0; -- result->time_adjust = 9; -+ result->time_adjust = 2; - break; - case DATALINK_70: - result->dl_device = type; -diff --git a/dl_send_data.c b/dl_send_data.c -index e68904f..af2a24f 100644 ---- a/dl_send_data.c -+++ b/dl_send_data.c -@@ -531,13 +531,13 @@ int dl_send_data(WatchInfoPtr wi, int type) - ("Can't write to tmp file.")); - - --#if 0 -- memcpy(buf, dend, *dend); -- buf[2] = 1; --#else -- buf[0]=0x4; -- buf[1]=0x62; --#endif -+ if (wi->dl_device == DATALINK_50) { -+ buf[0]=0x4; -+ buf[1]=0x62; -+ } else { -+ memcpy(buf, dend, *dend); -+ buf[2] = 1; -+ } - - - dl_docrc(buf); -@@ -675,11 +675,7 @@ int dl_send_data(WatchInfoPtr wi, int type) - } - - /* timezone label packet for IRONMAN watch */ --#if 0 -- if (wi->dl_device == DATALINK_IRONMAN) --#else -- if (1) --#endif -+ if ((wi->dl_device == DATALINK_IRONMAN) || (wi->dl_device == DATALINK_50)) - for (i = 0; i < dl_download_data.num_times; i++) - { - p = 0; -@@ -748,7 +744,7 @@ int dl_send_data(WatchInfoPtr wi, int type) - buf[0] = 0x07; - buf[1] = 0x70; - buf[2] = 0x00; -- buf[3] = 0x61 + dl_download_data.alarms[i].alarm_num; -+ buf[3] = 0x60 + dl_download_data.alarms[i].alarm_num; - buf[4] = 0x00; - - dl_docrc(buf); diff --git a/tools/to_h.c b/tools/to_h.c new file mode 100644 -index 0000000..d2b100d +index 0000000..915437c --- /dev/null +++ b/tools/to_h.c -@@ -0,0 +1,27 @@ +@@ -0,0 +1,31 @@ +#include + + -+int main(int argc, char *argv) ++int ++main (int argc, char *argv) +{ -+unsigned i,n; -+unsigned char c; -+int fd; ++ unsigned i, n; ++ unsigned char c; ++ int fd; + -+fd=open("DEBUGOUTPUT",0); ++ fd = open ("DEBUGOUTPUT", 0); + + -+while (read(fd,&c,1)==1) { -+n=c; -+printf (" 0x%02x, ",c); ++ while (read (fd, &c, 1) == 1) ++ { ++ n = c; ++ printf (" 0x%02x, ", c); + -+for (i=1;i