summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-10-03 12:57:42 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-10-05 12:42:40 -0700
commit1065a526358809019f7ec93eb3b8169f98baebf1 (patch)
tree55f28fdc1dab7b48fe14d89b085401444f636fa4 /core
parent468eb7ef33443dcc303aaf87e4d33302053238fa (diff)
downloadsubsurface-1065a526358809019f7ec93eb3b8169f98baebf1.tar.gz
libdc/debug: provide better info regarding libdc interaction
Instead of just sending this to the user through the progress bar text, also send things to stderr in verbose mode. That should make it easier to debug situations where we fail to download from a dive computer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core')
-rw-r--r--core/libdivecomputer.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/libdivecomputer.c b/core/libdivecomputer.c
index b56daeb81..bca99d377 100644
--- a/core/libdivecomputer.c
+++ b/core/libdivecomputer.c
@@ -431,6 +431,9 @@ static void dev_info(device_data_t *devdata, const char *fmt, ...)
vsnprintf(buffer, sizeof(buffer), fmt, ap);
va_end(ap);
progress_bar_text = buffer;
+ if (verbose)
+ INFO(0, "dev_info: %s\n", buffer);
+
if (progress_callback)
(*progress_callback)(buffer);
}
@@ -1292,9 +1295,10 @@ static dc_status_t usbhid_device_open(dc_iostream_t **iostream, dc_context_t *co
break;
dc_iterator_free (iterator);
- if (!device)
+ if (!device) {
+ ERROR(context, "didn't find HID device\n");
return DC_STATUS_NODEVICE;
-
+ }
dev_info(data, "Opening USB HID device for %04x:%04x",
dc_usbhid_device_get_vid(device),
dc_usbhid_device_get_pid(device));