From: Linus Torvalds <[email protected]> Date: Sun, 20 Aug 2017 20:41:29 -0700 Subject: [PATCH 2/2] Make dive computer download automatically sync the time
This needs a button or a checkbox or something. This unconditional time sync is a hack. Not-yet-signed-off-by: Linus Torvalds <[email protected]> --- And this is the patch to use the new 'dc_device_timesync()' at download time that should *not* be applied, and needs some UI love to make it conditional. Not that applying it will be disastrous (and will only affect EON Steel and the OSTC family of dive computers right now anyway, since I think those are the only ones that have a working 'timesync' implementation), but it sounded like everybody wanted to make it conditional. core/libdivecomputer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/libdivecomputer.c b/core/libdivecomputer.c index 2c5f607d..c610fb67 100644 --- a/core/libdivecomputer.c +++ b/core/libdivecomputer.c @@ -1117,6 +1117,11 @@ const char *do_libdivecomputer_import(device_data_t *data) } if (rc == DC_STATUS_SUCCESS) { + /* HACK HACK HACK - need some kind of "set device time" checkbox */ + dc_datetime_t now; + dc_datetime_localtime(&now, dc_datetime_now()); + dc_device_timesync(data->device, &now); + err = do_device_import(data); /* TODO: Show the logfile to the user on error. */ dc_device_close(data->device); -- 2.14.0.rc1.2.g4c8247ec3 _______________________________________________ subsurface mailing list [email protected] http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
