diff --git a/examples/Makefile.am b/examples/Makefile.am index e830769..6b70f99 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -17,6 +17,7 @@ dctool_SOURCES = \ dctool_parse.c \ dctool_read.c \ dctool_write.c \ + dctool_timesync.c \ dctool_fwupdate.c \ output.h \ output-private.h \ diff --git a/examples/dctool.c b/examples/dctool.c index df7fe01..f62b13c 100644 --- a/examples/dctool.c +++ b/examples/dctool.c @@ -63,6 +63,7 @@ static const dctool_command_t *g_commands[] = { &dctool_parse, &dctool_read, &dctool_write, + &dctool_timesync, &dctool_fwupdate, NULL }; diff --git a/examples/dctool.h b/examples/dctool.h index cc6a393..06e58a8 100644 --- a/examples/dctool.h +++ b/examples/dctool.h @@ -50,6 +50,7 @@ extern const dctool_command_t dctool_dump; extern const dctool_command_t dctool_parse; extern const dctool_command_t dctool_read; extern const dctool_command_t dctool_write; +extern const dctool_command_t dctool_timesync; extern const dctool_command_t dctool_fwupdate; const dctool_command_t * diff --git a/examples/dctool_timesync.c b/examples/dctool_timesync.c new file mode 100644 index 0000000..3a59af5 --- /dev/null +++ b/examples/dctool_timesync.c @@ -0,0 +1,162 @@ +/* + * libdivecomputer + * + * Copyright (C) 2017 Jef Driesen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#ifdef HAVE_GETOPT_H +#include +#endif + +#include +#include +#include + +#include "dctool.h" +#include "common.h" +#include "utils.h" + +static dc_status_t +do_timesync (dc_context_t *context, dc_descriptor_t *descriptor, const char *devname, const dc_datetime_t *datetime) +{ + dc_status_t rc = DC_STATUS_SUCCESS; + dc_device_t *device = NULL; + + // Open the device. + message ("Opening the device (%s %s, %s).\n", + dc_descriptor_get_vendor (descriptor), + dc_descriptor_get_product (descriptor), + devname ? devname : "null"); + rc = dc_device_open (&device, context, descriptor, devname); + if (rc != DC_STATUS_SUCCESS) { + ERROR ("Error opening the device."); + goto cleanup; + } + + // Register the event handler. + message ("Registering the event handler.\n"); + int events = DC_EVENT_WAITING | DC_EVENT_PROGRESS | DC_EVENT_DEVINFO | DC_EVENT_CLOCK | DC_EVENT_VENDOR; + rc = dc_device_set_events (device, events, dctool_event_cb, NULL); + if (rc != DC_STATUS_SUCCESS) { + ERROR ("Error registering the event handler."); + goto cleanup; + } + + // Register the cancellation handler. + message ("Registering the cancellation handler.\n"); + rc = dc_device_set_cancel (device, dctool_cancel_cb, NULL); + if (rc != DC_STATUS_SUCCESS) { + ERROR ("Error registering the cancellation handler."); + goto cleanup; + } + + // Syncronize the device clock. + message ("Syncronize the device clock.\n"); + rc = dc_device_timesync (device, datetime); + if (rc != DC_STATUS_SUCCESS) { + ERROR ("Error syncronizing the device clock."); + goto cleanup; + } + +cleanup: + dc_device_close (device); + return rc; +} + +static int +dctool_timesync_run (int argc, char *argv[], dc_context_t *context, dc_descriptor_t *descriptor) +{ + int exitcode = EXIT_SUCCESS; + dc_status_t status = DC_STATUS_SUCCESS; + + // Default option values. + unsigned int help = 0; + + // Parse the command-line options. + int opt = 0; + const char *optstring = "h"; +#ifdef HAVE_GETOPT_LONG + struct option options[] = { + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0 } + }; + while ((opt = getopt_long (argc, argv, optstring, options, NULL)) != -1) { +#else + while ((opt = getopt (argc, argv, optstring)) != -1) { +#endif + switch (opt) { + case 'h': + help = 1; + break; + default: + return EXIT_FAILURE; + } + } + + argc -= optind; + argv += optind; + + // Show help message. + if (help) { + dctool_command_showhelp (&dctool_timesync); + return EXIT_SUCCESS; + } + + // Get the system time. + dc_datetime_t datetime = {0}; + dc_ticks_t now = dc_datetime_now (); + if (!dc_datetime_localtime(&datetime, now)) { + message ("ERROR: Failed to get the system time.\n"); + exitcode = EXIT_FAILURE; + goto cleanup; + } + + // Synchronize the device clock. + status = do_timesync (context, descriptor, argv[0], &datetime); + if (status != DC_STATUS_SUCCESS) { + message ("ERROR: %s\n", dctool_errmsg (status)); + exitcode = EXIT_FAILURE; + goto cleanup; + } + +cleanup: + return exitcode; +} + +const dctool_command_t dctool_timesync = { + dctool_timesync_run, + DCTOOL_CONFIG_DESCRIPTOR, + "timesync", + "Synchronize the device clock", + "Usage:\n" + " dctool timesync [options]\n" + "\n" + "Options:\n" +#ifdef HAVE_GETOPT_LONG + " -h, --help Show help message\n" +#else + " -h Show help message\n" +#endif +}; diff --git a/include/libdivecomputer/device.h b/include/libdivecomputer/device.h index 1990926..f6d415c 100644 --- a/include/libdivecomputer/device.h +++ b/include/libdivecomputer/device.h @@ -96,6 +96,9 @@ dc_device_dump (dc_device_t *device, dc_buffer_t *buffer); dc_status_t dc_device_foreach (dc_device_t *device, dc_dive_callback_t callback, void *userdata); +dc_status_t +dc_device_timesync (dc_device_t *device, const dc_datetime_t *datetime); + dc_status_t dc_device_close (dc_device_t *device); diff --git a/include/libdivecomputer/hw_frog.h b/include/libdivecomputer/hw_frog.h index 67f624f..0af10ca 100644 --- a/include/libdivecomputer/hw_frog.h +++ b/include/libdivecomputer/hw_frog.h @@ -36,9 +36,6 @@ extern "C" { dc_status_t hw_frog_device_version (dc_device_t *device, unsigned char data[], unsigned int size); -dc_status_t -hw_frog_device_clock (dc_device_t *device, const dc_datetime_t *datetime); - dc_status_t hw_frog_device_display (dc_device_t *device, const char *text); diff --git a/include/libdivecomputer/hw_ostc.h b/include/libdivecomputer/hw_ostc.h index b68e083..b7daca7 100644 --- a/include/libdivecomputer/hw_ostc.h +++ b/include/libdivecomputer/hw_ostc.h @@ -43,9 +43,6 @@ typedef enum hw_ostc_format_t { dc_status_t hw_ostc_device_md2hash (dc_device_t *device, unsigned char data[], unsigned int size); -dc_status_t -hw_ostc_device_clock (dc_device_t *device, const dc_datetime_t *datetime); - dc_status_t hw_ostc_device_eeprom_read (dc_device_t *device, unsigned int bank, unsigned char data[], unsigned int size); diff --git a/include/libdivecomputer/hw_ostc3.h b/include/libdivecomputer/hw_ostc3.h index bd0d2ed..c69dd93 100644 --- a/include/libdivecomputer/hw_ostc3.h +++ b/include/libdivecomputer/hw_ostc3.h @@ -39,9 +39,6 @@ hw_ostc3_device_version (dc_device_t *device, unsigned char data[], unsigned int dc_status_t hw_ostc3_device_hardware (dc_device_t *device, unsigned char data[], unsigned int size); -dc_status_t -hw_ostc3_device_clock (dc_device_t *device, const dc_datetime_t *datetime); - dc_status_t hw_ostc3_device_display (dc_device_t *device, const char *text); diff --git a/src/atomics_cobalt.c b/src/atomics_cobalt.c index 91a6da6..7c7dccb 100644 --- a/src/atomics_cobalt.c +++ b/src/atomics_cobalt.c @@ -75,6 +75,7 @@ static const dc_device_vtable_t atomics_cobalt_device_vtable = { NULL, /* write */ NULL, /* dump */ atomics_cobalt_device_foreach, /* foreach */ + NULL, /* timesync */ atomics_cobalt_device_close /* close */ }; diff --git a/src/citizen_aqualand.c b/src/citizen_aqualand.c index 5e111da..47ba87f 100644 --- a/src/citizen_aqualand.c +++ b/src/citizen_aqualand.c @@ -51,6 +51,7 @@ static const dc_device_vtable_t citizen_aqualand_device_vtable = { NULL, /* write */ citizen_aqualand_device_dump, /* dump */ citizen_aqualand_device_foreach, /* foreach */ + NULL, /* timesync */ citizen_aqualand_device_close /* close */ }; diff --git a/src/cochran_commander.c b/src/cochran_commander.c index 16707bf..b515909 100644 --- a/src/cochran_commander.c +++ b/src/cochran_commander.c @@ -114,6 +114,7 @@ static const dc_device_vtable_t cochran_commander_device_vtable = { NULL, /* write */ cochran_commander_device_dump, /* dump */ cochran_commander_device_foreach, /* foreach */ + NULL, /* timesync */ cochran_commander_device_close /* close */ }; diff --git a/src/cressi_edy.c b/src/cressi_edy.c index 226f32f..68e13fc 100644 --- a/src/cressi_edy.c +++ b/src/cressi_edy.c @@ -75,6 +75,7 @@ static const dc_device_vtable_t cressi_edy_device_vtable = { NULL, /* write */ cressi_edy_device_dump, /* dump */ cressi_edy_device_foreach, /* foreach */ + NULL, /* timesync */ cressi_edy_device_close /* close */ }; diff --git a/src/cressi_leonardo.c b/src/cressi_leonardo.c index c354b22..f21a223 100644 --- a/src/cressi_leonardo.c +++ b/src/cressi_leonardo.c @@ -67,6 +67,7 @@ static const dc_device_vtable_t cressi_leonardo_device_vtable = { NULL, /* write */ cressi_leonardo_device_dump, /* dump */ cressi_leonardo_device_foreach, /* foreach */ + NULL, /* timesync */ cressi_leonardo_device_close /* close */ }; diff --git a/src/device-private.h b/src/device-private.h index dcf0b96..7ca6610 100644 --- a/src/device-private.h +++ b/src/device-private.h @@ -71,6 +71,8 @@ struct dc_device_vtable_t { dc_status_t (*foreach) (dc_device_t *device, dc_dive_callback_t callback, void *userdata); + dc_status_t (*timesync) (dc_device_t *device, const dc_datetime_t *datetime); + dc_status_t (*close) (dc_device_t *device); }; diff --git a/src/device.c b/src/device.c index 9dcc528..6277c90 100644 --- a/src/device.c +++ b/src/device.c @@ -370,6 +370,19 @@ dc_device_foreach (dc_device_t *device, dc_dive_callback_t callback, void *userd } +dc_status_t +dc_device_timesync (dc_device_t *device, const dc_datetime_t *datetime) +{ + if (device == NULL) + return DC_STATUS_UNSUPPORTED; + + if (device->vtable->timesync == NULL) + return DC_STATUS_UNSUPPORTED; + + return device->vtable->timesync (device, datetime); +} + + dc_status_t dc_device_close (dc_device_t *device) { diff --git a/src/diverite_nitekq.c b/src/diverite_nitekq.c index 205115a..8c8c442 100644 --- a/src/diverite_nitekq.c +++ b/src/diverite_nitekq.c @@ -69,6 +69,7 @@ static const dc_device_vtable_t diverite_nitekq_device_vtable = { NULL, /* write */ diverite_nitekq_device_dump, /* dump */ diverite_nitekq_device_foreach, /* foreach */ + NULL, /* timesync */ diverite_nitekq_device_close /* close */ }; diff --git a/src/divesystem_idive.c b/src/divesystem_idive.c index d26e2b4..8a8f1ae 100644 --- a/src/divesystem_idive.c +++ b/src/divesystem_idive.c @@ -86,6 +86,7 @@ static const dc_device_vtable_t divesystem_idive_device_vtable = { NULL, /* write */ NULL, /* dump */ divesystem_idive_device_foreach, /* foreach */ + NULL, /* timesync */ divesystem_idive_device_close /* close */ }; diff --git a/src/hw_frog.c b/src/hw_frog.c index d8b89ca..83ee998 100644 --- a/src/hw_frog.c +++ b/src/hw_frog.c @@ -61,6 +61,7 @@ typedef struct hw_frog_device_t { static dc_status_t hw_frog_device_set_fingerprint (dc_device_t *abstract, const unsigned char data[], unsigned int size); static dc_status_t hw_frog_device_foreach (dc_device_t *abstract, dc_dive_callback_t callback, void *userdata); +static dc_status_t hw_frog_device_timesync (dc_device_t *abstract, const dc_datetime_t *datetime); static dc_status_t hw_frog_device_close (dc_device_t *abstract); static const dc_device_vtable_t hw_frog_device_vtable = { @@ -71,6 +72,7 @@ static const dc_device_vtable_t hw_frog_device_vtable = { NULL, /* write */ NULL, /* dump */ hw_frog_device_foreach, /* foreach */ + hw_frog_device_timesync, /* timesync */ hw_frog_device_close /* close */ }; @@ -482,14 +484,11 @@ hw_frog_device_foreach (dc_device_t *abstract, dc_dive_callback_t callback, void } -dc_status_t -hw_frog_device_clock (dc_device_t *abstract, const dc_datetime_t *datetime) +static dc_status_t +hw_frog_device_timesync (dc_device_t *abstract, const dc_datetime_t *datetime) { hw_frog_device_t *device = (hw_frog_device_t *) abstract; - if (!ISINSTANCE (abstract)) - return DC_STATUS_INVALIDARGS; - if (datetime == NULL) { ERROR (abstract->context, "Invalid parameter specified."); return DC_STATUS_INVALIDARGS; diff --git a/src/hw_ostc.c b/src/hw_ostc.c index 3f46603..87c2b1d 100644 --- a/src/hw_ostc.c +++ b/src/hw_ostc.c @@ -70,6 +70,7 @@ typedef struct hw_ostc_firmware_t { static dc_status_t hw_ostc_device_set_fingerprint (dc_device_t *abstract, const unsigned char data[], unsigned int size); static dc_status_t hw_ostc_device_dump (dc_device_t *abstract, dc_buffer_t *buffer); static dc_status_t hw_ostc_device_foreach (dc_device_t *abstract, dc_dive_callback_t callback, void *userdata); +static dc_status_t hw_ostc_device_timesync (dc_device_t *abstract, const dc_datetime_t *datetime); static dc_status_t hw_ostc_device_close (dc_device_t *abstract); static const dc_device_vtable_t hw_ostc_device_vtable = { @@ -80,6 +81,7 @@ static const dc_device_vtable_t hw_ostc_device_vtable = { NULL, /* write */ hw_ostc_device_dump, /* dump */ hw_ostc_device_foreach, /* foreach */ + hw_ostc_device_timesync, /* timesync */ hw_ostc_device_close /* close */ }; @@ -377,15 +379,12 @@ hw_ostc_device_md2hash (dc_device_t *abstract, unsigned char data[], unsigned in } -dc_status_t -hw_ostc_device_clock (dc_device_t *abstract, const dc_datetime_t *datetime) +static dc_status_t +hw_ostc_device_timesync (dc_device_t *abstract, const dc_datetime_t *datetime) { dc_status_t status = DC_STATUS_SUCCESS; hw_ostc_device_t *device = (hw_ostc_device_t *) abstract; - if (!ISINSTANCE (abstract)) - return DC_STATUS_INVALIDARGS; - if (datetime == NULL) { ERROR (abstract->context, "Invalid parameter specified."); return DC_STATUS_INVALIDARGS; diff --git a/src/hw_ostc3.c b/src/hw_ostc3.c index e7b7d9e..a1a5efd 100644 --- a/src/hw_ostc3.c +++ b/src/hw_ostc3.c @@ -129,6 +129,7 @@ static dc_status_t hw_ostc3_device_read (dc_device_t *abstract, unsigned int add static dc_status_t hw_ostc3_device_write (dc_device_t *abstract, unsigned int address, const unsigned char data[], unsigned int size); static dc_status_t hw_ostc3_device_dump (dc_device_t *abstract, dc_buffer_t *buffer); static dc_status_t hw_ostc3_device_foreach (dc_device_t *abstract, dc_dive_callback_t callback, void *userdata); +static dc_status_t hw_ostc3_device_timesync (dc_device_t *abstract, const dc_datetime_t *datetime); static dc_status_t hw_ostc3_device_close (dc_device_t *abstract); static const dc_device_vtable_t hw_ostc3_device_vtable = { @@ -139,6 +140,7 @@ static const dc_device_vtable_t hw_ostc3_device_vtable = { hw_ostc3_device_write, /* write */ hw_ostc3_device_dump, /* dump */ hw_ostc3_device_foreach, /* foreach */ + hw_ostc3_device_timesync, /* timesync */ hw_ostc3_device_close /* close */ }; @@ -801,14 +803,11 @@ hw_ostc3_device_foreach (dc_device_t *abstract, dc_dive_callback_t callback, voi } -dc_status_t -hw_ostc3_device_clock (dc_device_t *abstract, const dc_datetime_t *datetime) +static dc_status_t +hw_ostc3_device_timesync (dc_device_t *abstract, const dc_datetime_t *datetime) { hw_ostc3_device_t *device = (hw_ostc3_device_t *) abstract; - if (!ISINSTANCE (abstract)) - return DC_STATUS_INVALIDARGS; - if (datetime == NULL) { ERROR (abstract->context, "Invalid parameter specified."); return DC_STATUS_INVALIDARGS; diff --git a/src/libdivecomputer.symbols b/src/libdivecomputer.symbols index c3d372b..3b16700 100644 --- a/src/libdivecomputer.symbols +++ b/src/libdivecomputer.symbols @@ -56,6 +56,7 @@ dc_device_read dc_device_set_cancel dc_device_set_events dc_device_set_fingerprint +dc_device_timesync dc_device_write oceanic_atom2_device_version @@ -79,19 +80,16 @@ suunto_eon_device_write_name suunto_vyper2_device_version suunto_vyper2_device_reset_maxdepth hw_ostc_device_md2hash -hw_ostc_device_clock hw_ostc_device_eeprom_read hw_ostc_device_eeprom_write hw_ostc_device_reset hw_ostc_device_screenshot hw_ostc_device_fwupdate hw_frog_device_version -hw_frog_device_clock hw_frog_device_display hw_frog_device_customtext hw_ostc3_device_version hw_ostc3_device_hardware -hw_ostc3_device_clock hw_ostc3_device_display hw_ostc3_device_customtext hw_ostc3_device_config_read diff --git a/src/mares_darwin.c b/src/mares_darwin.c index 9ac56ba..4b1bc24 100644 --- a/src/mares_darwin.c +++ b/src/mares_darwin.c @@ -70,6 +70,7 @@ static const dc_device_vtable_t mares_darwin_device_vtable = { NULL, /* write */ mares_darwin_device_dump, /* dump */ mares_darwin_device_foreach, /* foreach */ + NULL, /* timesync */ mares_darwin_device_close /* close */ }; diff --git a/src/mares_iconhd.c b/src/mares_iconhd.c index 3a73968..e945e9f 100644 --- a/src/mares_iconhd.c +++ b/src/mares_iconhd.c @@ -87,6 +87,7 @@ static const dc_device_vtable_t mares_iconhd_device_vtable = { NULL, /* write */ mares_iconhd_device_dump, /* dump */ mares_iconhd_device_foreach, /* foreach */ + NULL, /* timesync */ mares_iconhd_device_close /* close */ }; diff --git a/src/mares_nemo.c b/src/mares_nemo.c index 2ec3588..c73c24b 100644 --- a/src/mares_nemo.c +++ b/src/mares_nemo.c @@ -62,6 +62,7 @@ static const dc_device_vtable_t mares_nemo_device_vtable = { NULL, /* write */ mares_nemo_device_dump, /* dump */ mares_nemo_device_foreach, /* foreach */ + NULL, /* timesync */ mares_nemo_device_close /* close */ }; diff --git a/src/mares_puck.c b/src/mares_puck.c index fc8e00d..b220f54 100644 --- a/src/mares_puck.c +++ b/src/mares_puck.c @@ -57,6 +57,7 @@ static const dc_device_vtable_t mares_puck_device_vtable = { NULL, /* write */ mares_puck_device_dump, /* dump */ mares_puck_device_foreach, /* foreach */ + NULL, /* timesync */ mares_puck_device_close /* close */ }; diff --git a/src/oceanic_atom2.c b/src/oceanic_atom2.c index d9e8d5a..bae6537 100644 --- a/src/oceanic_atom2.c +++ b/src/oceanic_atom2.c @@ -74,6 +74,7 @@ static const oceanic_common_device_vtable_t oceanic_atom2_device_vtable = { oceanic_atom2_device_write, /* write */ oceanic_common_device_dump, /* dump */ oceanic_common_device_foreach, /* foreach */ + NULL, /* timesync */ oceanic_atom2_device_close /* close */ }, oceanic_common_device_logbook, diff --git a/src/oceanic_veo250.c b/src/oceanic_veo250.c index d47c532..b6021dd 100644 --- a/src/oceanic_veo250.c +++ b/src/oceanic_veo250.c @@ -56,6 +56,7 @@ static const oceanic_common_device_vtable_t oceanic_veo250_device_vtable = { NULL, /* write */ oceanic_common_device_dump, /* dump */ oceanic_common_device_foreach, /* foreach */ + NULL, /* timesync */ oceanic_veo250_device_close /* close */ }, oceanic_common_device_logbook, diff --git a/src/oceanic_vtpro.c b/src/oceanic_vtpro.c index 2e86f5f..cc09892 100644 --- a/src/oceanic_vtpro.c +++ b/src/oceanic_vtpro.c @@ -68,6 +68,7 @@ static const oceanic_common_device_vtable_t oceanic_vtpro_device_vtable = { NULL, /* write */ oceanic_common_device_dump, /* dump */ oceanic_common_device_foreach, /* foreach */ + NULL, /* timesync */ oceanic_vtpro_device_close /* close */ }, oceanic_vtpro_device_logbook, diff --git a/src/reefnet_sensus.c b/src/reefnet_sensus.c index 94d7a7e..37c343a 100644 --- a/src/reefnet_sensus.c +++ b/src/reefnet_sensus.c @@ -57,6 +57,7 @@ static const dc_device_vtable_t reefnet_sensus_device_vtable = { NULL, /* write */ reefnet_sensus_device_dump, /* dump */ reefnet_sensus_device_foreach, /* foreach */ + NULL, /* timesync */ reefnet_sensus_device_close /* close */ }; diff --git a/src/reefnet_sensuspro.c b/src/reefnet_sensuspro.c index bf88801..4df3c07 100644 --- a/src/reefnet_sensuspro.c +++ b/src/reefnet_sensuspro.c @@ -56,6 +56,7 @@ static const dc_device_vtable_t reefnet_sensuspro_device_vtable = { NULL, /* write */ reefnet_sensuspro_device_dump, /* dump */ reefnet_sensuspro_device_foreach, /* foreach */ + NULL, /* timesync */ reefnet_sensuspro_device_close /* close */ }; diff --git a/src/reefnet_sensusultra.c b/src/reefnet_sensusultra.c index f28dbb2..fba7511 100644 --- a/src/reefnet_sensusultra.c +++ b/src/reefnet_sensusultra.c @@ -65,6 +65,7 @@ static const dc_device_vtable_t reefnet_sensusultra_device_vtable = { NULL, /* write */ reefnet_sensusultra_device_dump, /* dump */ reefnet_sensusultra_device_foreach, /* foreach */ + NULL, /* timesync */ reefnet_sensusultra_device_close /* close */ }; diff --git a/src/shearwater_petrel.c b/src/shearwater_petrel.c index 4966d14..71f507e 100644 --- a/src/shearwater_petrel.c +++ b/src/shearwater_petrel.c @@ -56,6 +56,7 @@ static const dc_device_vtable_t shearwater_petrel_device_vtable = { NULL, /* write */ NULL, /* dump */ shearwater_petrel_device_foreach, /* foreach */ + NULL, /* timesync */ shearwater_petrel_device_close /* close */ }; diff --git a/src/shearwater_predator.c b/src/shearwater_predator.c index 0e7a0d3..42a579b 100644 --- a/src/shearwater_predator.c +++ b/src/shearwater_predator.c @@ -57,6 +57,7 @@ static const dc_device_vtable_t shearwater_predator_device_vtable = { NULL, /* write */ shearwater_predator_device_dump, /* dump */ shearwater_predator_device_foreach, /* foreach */ + NULL, /* timesync */ shearwater_predator_device_close /* close */ }; diff --git a/src/suunto_d9.c b/src/suunto_d9.c index 2908792..56f8c40 100644 --- a/src/suunto_d9.c +++ b/src/suunto_d9.c @@ -58,6 +58,7 @@ static const suunto_common2_device_vtable_t suunto_d9_device_vtable = { suunto_common2_device_write, /* write */ suunto_common2_device_dump, /* dump */ suunto_common2_device_foreach, /* foreach */ + NULL, /* timesync */ suunto_d9_device_close /* close */ }, suunto_d9_device_packet diff --git a/src/suunto_eon.c b/src/suunto_eon.c index ce9ce83..2875654 100644 --- a/src/suunto_eon.c +++ b/src/suunto_eon.c @@ -51,6 +51,7 @@ static const dc_device_vtable_t suunto_eon_device_vtable = { NULL, /* write */ suunto_eon_device_dump, /* dump */ suunto_eon_device_foreach, /* foreach */ + NULL, /* timesync */ suunto_eon_device_close /* close */ }; diff --git a/src/suunto_eonsteel.c b/src/suunto_eonsteel.c index 615f5c7..2e6d4c4 100644 --- a/src/suunto_eonsteel.c +++ b/src/suunto_eonsteel.c @@ -81,6 +81,7 @@ static const dc_device_vtable_t suunto_eonsteel_device_vtable = { NULL, /* write */ NULL, /* dump */ suunto_eonsteel_device_foreach, /* foreach */ + NULL, /* timesync */ suunto_eonsteel_device_close /* close */ }; diff --git a/src/suunto_solution.c b/src/suunto_solution.c index c708114..cb2481d 100644 --- a/src/suunto_solution.c +++ b/src/suunto_solution.c @@ -54,6 +54,7 @@ static const dc_device_vtable_t suunto_solution_device_vtable = { NULL, /* write */ suunto_solution_device_dump, /* dump */ suunto_solution_device_foreach, /* foreach */ + NULL, /* timesync */ suunto_solution_device_close /* close */ }; diff --git a/src/suunto_vyper.c b/src/suunto_vyper.c index ce44e05..33657dc 100644 --- a/src/suunto_vyper.c +++ b/src/suunto_vyper.c @@ -63,6 +63,7 @@ static const dc_device_vtable_t suunto_vyper_device_vtable = { suunto_vyper_device_write, /* write */ suunto_vyper_device_dump, /* dump */ suunto_vyper_device_foreach, /* foreach */ + NULL, /* timesync */ suunto_vyper_device_close /* close */ }; diff --git a/src/suunto_vyper2.c b/src/suunto_vyper2.c index 8ab521e..618ee4a 100644 --- a/src/suunto_vyper2.c +++ b/src/suunto_vyper2.c @@ -50,6 +50,7 @@ static const suunto_common2_device_vtable_t suunto_vyper2_device_vtable = { suunto_common2_device_write, /* write */ suunto_common2_device_dump, /* dump */ suunto_common2_device_foreach, /* foreach */ + NULL, /* timesync */ suunto_vyper2_device_close /* close */ }, suunto_vyper2_device_packet diff --git a/src/uwatec_aladin.c b/src/uwatec_aladin.c index d70369a..25c9208 100644 --- a/src/uwatec_aladin.c +++ b/src/uwatec_aladin.c @@ -62,6 +62,7 @@ static const dc_device_vtable_t uwatec_aladin_device_vtable = { NULL, /* write */ uwatec_aladin_device_dump, /* dump */ uwatec_aladin_device_foreach, /* foreach */ + NULL, /* timesync */ uwatec_aladin_device_close /* close */ }; diff --git a/src/uwatec_g2.c b/src/uwatec_g2.c index fc32aff..6e35104 100644 --- a/src/uwatec_g2.c +++ b/src/uwatec_g2.c @@ -54,6 +54,7 @@ static const dc_device_vtable_t uwatec_g2_device_vtable = { NULL, /* write */ uwatec_g2_device_dump, /* dump */ uwatec_g2_device_foreach, /* foreach */ + NULL, /* timesync */ uwatec_g2_device_close /* close */ }; diff --git a/src/uwatec_memomouse.c b/src/uwatec_memomouse.c index b23c6b2..2f93067 100644 --- a/src/uwatec_memomouse.c +++ b/src/uwatec_memomouse.c @@ -58,6 +58,7 @@ static const dc_device_vtable_t uwatec_memomouse_device_vtable = { NULL, /* write */ uwatec_memomouse_device_dump, /* dump */ uwatec_memomouse_device_foreach, /* foreach */ + NULL, /* timesync */ uwatec_memomouse_device_close /* close */ }; diff --git a/src/uwatec_meridian.c b/src/uwatec_meridian.c index d59b855..c32f3bc 100644 --- a/src/uwatec_meridian.c +++ b/src/uwatec_meridian.c @@ -56,6 +56,7 @@ static const dc_device_vtable_t uwatec_meridian_device_vtable = { NULL, /* write */ uwatec_meridian_device_dump, /* dump */ uwatec_meridian_device_foreach, /* foreach */ + NULL, /* timesync */ uwatec_meridian_device_close /* close */ }; diff --git a/src/uwatec_smart.c b/src/uwatec_smart.c index 425e76e..4fd2e2d 100644 --- a/src/uwatec_smart.c +++ b/src/uwatec_smart.c @@ -52,6 +52,7 @@ static const dc_device_vtable_t uwatec_smart_device_vtable = { NULL, /* write */ uwatec_smart_device_dump, /* dump */ uwatec_smart_device_foreach, /* foreach */ + NULL, /* timesync */ uwatec_smart_device_close /* close */ }; diff --git a/src/zeagle_n2ition3.c b/src/zeagle_n2ition3.c index fed6ae2..3d2bb24 100644 --- a/src/zeagle_n2ition3.c +++ b/src/zeagle_n2ition3.c @@ -64,6 +64,7 @@ static const dc_device_vtable_t zeagle_n2ition3_device_vtable = { NULL, /* write */ zeagle_n2ition3_device_dump, /* dump */ zeagle_n2ition3_device_foreach, /* foreach */ + NULL, /* timesync */ zeagle_n2ition3_device_close /* close */ };