This adds symbols that is exported from libdivecomputer for programs who would like to read and write settings.
Signed-off-by: Anton Lundin glance@acc.umu.se --- include/libdivecomputer/suunto_vyper.h | 6 ++++++ src/libdivecomputer.symbols | 2 ++ src/suunto_vyper.c | 12 ++++++++++++ 3 files changed, 20 insertions(+)
diff --git a/include/libdivecomputer/suunto_vyper.h b/include/libdivecomputer/suunto_vyper.h index a730b95..17f6814 100644 --- a/include/libdivecomputer/suunto_vyper.h +++ b/include/libdivecomputer/suunto_vyper.h @@ -42,6 +42,12 @@ suunto_vyper_extract_dives (dc_device_t *device, const unsigned char data[], uns dc_status_t suunto_vyper_parser_create (dc_parser_t **parser, dc_context_t *context);
+dc_status_t +suunto_vyper_device_config_read(dc_device_t *abstract, unsigned int config, unsigned char data[], unsigned int size); + +dc_status_t +suunto_vyper_device_config_write(dc_device_t *abstract, unsigned int config, const unsigned char data[], unsigned int size); + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/src/libdivecomputer.symbols b/src/libdivecomputer.symbols index 14a96a8..cf902cc 100644 --- a/src/libdivecomputer.symbols +++ b/src/libdivecomputer.symbols @@ -50,6 +50,8 @@ reefnet_sensusultra_parser_set_calibration uwatec_memomouse_parser_create uwatec_smart_parser_create suunto_vyper_parser_create +suunto_vyper_device_config_read +suunto_vyper_device_config_write suunto_solution_parser_create suunto_eon_parser_create suunto_d9_parser_create diff --git a/src/suunto_vyper.c b/src/suunto_vyper.c index b259259..09c7a14 100644 --- a/src/suunto_vyper.c +++ b/src/suunto_vyper.c @@ -570,3 +570,15 @@ suunto_vyper_extract_dives (dc_device_t *abstract, const unsigned char data[], u
return suunto_common_extract_dives (device, layout, data, callback, userdata); } + +dc_status_t +suunto_vyper_device_config_read(dc_device_t *abstract, unsigned int config, unsigned char data[], unsigned int size) +{ + return suunto_vyper_device_read(abstract, config, data, size); +} + +dc_status_t +suunto_vyper_device_config_write(dc_device_t *abstract, unsigned int config, const unsigned char data[], unsigned int size) +{ + return suunto_vyper_device_write(abstract, config, data, size); +}
On 2014-10-10 07:45, Anton Lundin wrote:
This adds symbols that is exported from libdivecomputer for programs who would like to read and write settings.
[...]
+dc_status_t +suunto_vyper_device_config_read(dc_device_t *abstract, unsigned int config, unsigned char data[], unsigned int size) +{
- return suunto_vyper_device_read(abstract, config, data, size);
+}
+dc_status_t +suunto_vyper_device_config_write(dc_device_t *abstract, unsigned int config, const unsigned char data[], unsigned int size) +{
- return suunto_vyper_device_write(abstract, config, data, size);
+}
These two functions are already exported as dc_device_read and dc_device_write. And they are available for all backends (unless the protocol doesn't support reading/writing), so I don't really see the point of your patch.
Jef
On 10 October, 2014 - Jef Driesen wrote:
On 2014-10-10 07:45, Anton Lundin wrote:
This adds symbols that is exported from libdivecomputer for programs who would like to read and write settings.
[...]
+dc_status_t +suunto_vyper_device_config_read(dc_device_t *abstract, unsigned int config, unsigned char data[], unsigned int size) +{
- return suunto_vyper_device_read(abstract, config, data, size);
+}
+dc_status_t +suunto_vyper_device_config_write(dc_device_t *abstract, unsigned int config, const unsigned char data[], unsigned int size) +{
- return suunto_vyper_device_write(abstract, config, data, size);
+}
These two functions are already exported as dc_device_read and dc_device_write. And they are available for all backends (unless the protocol doesn't support reading/writing), so I don't really see the point of your patch.
Ah, even better! =)
I must have missed that they are exported via the vtable, due to the fact that those functions are static.
Thanks!
//Anton