Skip to content

Commit eae0fa2

Browse files
jefdriesenmikeller
authored andcommitted
Add extra debug information to the log
1 parent b7aa89b commit eae0fa2

27 files changed

+90
-0
lines changed

src/atomics_cobalt.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ atomics_cobalt_device_open (dc_device_t **out, dc_context_t *context, dc_iostrea
105105
goto error_free;
106106
}
107107

108+
HEXDUMP (context, DC_LOGLEVEL_DEBUG, "Version", device->version, sizeof (device->version));
109+
108110
*out = (dc_device_t*) device;
109111

110112
return DC_STATUS_SUCCESS;

src/cressi_edy.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ cressi_edy_init2 (cressi_edy_device_t *device)
204204
if (rc != DC_STATUS_SUCCESS)
205205
return rc;
206206

207+
HEXDUMP (device->base.context, DC_LOGLEVEL_DEBUG, "Model", answer, sizeof (answer));
208+
207209
device->model = answer[0];
208210

209211
return DC_STATUS_SUCCESS;

src/cressi_goa.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,8 @@ cressi_goa_device_foreach (dc_device_t *abstract, dc_dive_callback_t callback, v
522522
const unsigned char *id_data = dc_buffer_get_data(id);
523523
size_t id_size = dc_buffer_get_size(id);
524524

525+
HEXDUMP (abstract->context, DC_LOGLEVEL_DEBUG, "Version", id_data, id_size);
526+
525527
if (id_size < 9) {
526528
ERROR (abstract->context, "Unexpected version length (" DC_PRINTF_SIZE ").", id_size);
527529
status = DC_STATUS_DATAFORMAT;

src/deepblu_cosmiq.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,8 @@ deepblu_cosmiq_device_foreach (dc_device_t *abstract, dc_dive_callback_t callbac
391391
goto error_exit;
392392
}
393393

394+
HEXDUMP (abstract->context, DC_LOGLEVEL_DEBUG, "Firmware", fw, sizeof(fw));
395+
394396
// Read the MAC address.
395397
unsigned char mac[6] = {0};
396398
status = deepblu_cosmiq_transfer (device, CMD_SYSTEM_MAC, &zero, 1, mac, sizeof(mac));
@@ -399,6 +401,8 @@ deepblu_cosmiq_device_foreach (dc_device_t *abstract, dc_dive_callback_t callbac
399401
goto error_exit;
400402
}
401403

404+
HEXDUMP (abstract->context, DC_LOGLEVEL_DEBUG, "Serial", mac, sizeof(mac));
405+
402406
// Emit a device info event.
403407
dc_event_devinfo_t devinfo;
404408
devinfo.model = 0;

src/deepsix_excursion.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,8 @@ deepsix_excursion_device_foreach (dc_device_t *abstract, dc_dive_callback_t call
283283
return status;
284284
}
285285

286+
HEXDUMP (abstract->context, DC_LOGLEVEL_DEBUG, "Hardware", rsp_hardware, sizeof(rsp_hardware));
287+
286288
// Read the software version.
287289
unsigned char rsp_software[6] = {0};
288290
status = deepsix_excursion_transfer (device, GRP_INFO, CMD_INFO_SOFTWARE, DIR_READ, NULL, 0, rsp_software, sizeof(rsp_software), NULL);
@@ -291,6 +293,8 @@ deepsix_excursion_device_foreach (dc_device_t *abstract, dc_dive_callback_t call
291293
return status;
292294
}
293295

296+
HEXDUMP (abstract->context, DC_LOGLEVEL_DEBUG, "Software", rsp_software, sizeof(rsp_software));
297+
294298
// Read the serial number
295299
unsigned char rsp_serial[12] = {0};
296300
status = deepsix_excursion_transfer (device, GRP_INFO, CMD_INFO_SERIAL, DIR_READ, NULL, 0, rsp_serial, sizeof(rsp_serial), NULL);
@@ -299,6 +303,8 @@ deepsix_excursion_device_foreach (dc_device_t *abstract, dc_dive_callback_t call
299303
return status;
300304
}
301305

306+
HEXDUMP (abstract->context, DC_LOGLEVEL_DEBUG, "Serial", rsp_serial, sizeof(rsp_serial));
307+
302308
// Emit a device info event.
303309
dc_event_devinfo_t devinfo;
304310
devinfo.model = 0;

src/diverite_nitekq.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ diverite_nitekq_device_open (dc_device_t **out, dc_context_t *context, dc_iostre
191191
goto error_free;
192192
}
193193

194+
HEXDUMP (context, DC_LOGLEVEL_DEBUG, "Version", device->version, sizeof (device->version));
195+
194196
*out = (dc_device_t*) device;
195197

196198
return DC_STATUS_SUCCESS;

src/divesoft_freedom.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,8 @@ divesoft_freedom_device_open (dc_device_t **out, dc_context_t *context, dc_iostr
344344
goto error_free_hdlc;
345345
}
346346

347+
HEXDUMP (context, DC_LOGLEVEL_DEBUG, "Connection", rsp_connect, sizeof(rsp_connect));
348+
347349
DEBUG (context, "Connection: compression=%u, protocol=%u.%u, serial=%.16s",
348350
array_uint16_le (rsp_connect),
349351
rsp_connect[2], rsp_connect[3],
@@ -402,6 +404,8 @@ divesoft_freedom_device_foreach (dc_device_t *abstract, dc_dive_callback_t callb
402404
goto error_exit;
403405
}
404406

407+
HEXDUMP (abstract->context, DC_LOGLEVEL_DEBUG, "Version", rsp_version, sizeof(rsp_version));
408+
405409
DEBUG (abstract->context, "Device: model=%u, hw=%u.%u, sw=%u.%u.%u.%u serial=%.16s",
406410
rsp_version[0],
407411
rsp_version[1], rsp_version[2],

src/divesystem_idive.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,8 @@ divesystem_idive_device_foreach (dc_device_t *abstract, dc_dive_callback_t callb
453453
if (rc != DC_STATUS_SUCCESS)
454454
return rc;
455455

456+
HEXDUMP (abstract->context, DC_LOGLEVEL_DEBUG, "Version", packet, commands->id.size);
457+
456458
// Emit a device info event.
457459
dc_event_devinfo_t devinfo;
458460
devinfo.model = array_uint16_le (packet);

src/halcyon_symbios.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,8 @@ halcyon_symbios_device_foreach (dc_device_t *abstract, dc_dive_callback_t callba
445445
goto error_exit;
446446
}
447447

448+
HEXDUMP (abstract->context, DC_LOGLEVEL_DEBUG, "Version", info, sizeof(info));
449+
448450
// Emit a vendor event.
449451
dc_event_vendor_t vendor;
450452
vendor.data = info;
@@ -494,6 +496,8 @@ halcyon_symbios_device_foreach (dc_device_t *abstract, dc_dive_callback_t callba
494496
const unsigned char *data = dc_buffer_get_data (logbook);
495497
size_t size = dc_buffer_get_size (logbook);
496498

499+
HEXDUMP (abstract->context, DC_LOGLEVEL_DEBUG, "Logbook", data, size);
500+
497501
// Get the number of dives.
498502
unsigned int ndives = 0;
499503
unsigned int offset = size;

src/hw_frog.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,8 @@ hw_frog_device_foreach (dc_device_t *abstract, dc_dive_callback_t callback, void
326326
return rc;
327327
}
328328

329+
HEXDUMP (abstract->context, DC_LOGLEVEL_DEBUG, "Version", id, sizeof (id));
330+
329331
// Emit a device info event.
330332
dc_event_devinfo_t devinfo;
331333
devinfo.model = 0;

0 commit comments

Comments
 (0)