From 8bfbb94087462a16dd13429945e0f405cb9d34e6 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Thu, 20 Jul 2023 23:35:23 +0200 Subject: [PATCH] Include the command byte in the hexdump The hexdump only includes the command parameters, but not the main command byte. Since there are many commands without parameters, that's not very useful. --- src/uwatec_smart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/uwatec_smart.c b/src/uwatec_smart.c index e7be4fc..e124c7b 100644 --- a/src/uwatec_smart.c +++ b/src/uwatec_smart.c @@ -286,8 +286,6 @@ uwatec_smart_usbhid_send (uwatec_smart_device_t *device, unsigned char cmd, cons return DC_STATUS_INVALIDARGS; } - HEXDUMP (abstract->context, DC_LOGLEVEL_DEBUG, "cmd", data, size); - buf[0] = 0; buf[1] = size + 1; buf[2] = cmd; @@ -296,6 +294,8 @@ uwatec_smart_usbhid_send (uwatec_smart_device_t *device, unsigned char cmd, cons } memset(buf + 3 + size, 0, sizeof(buf) - (size + 3)); + HEXDUMP (abstract->context, DC_LOGLEVEL_DEBUG, "cmd", buf + 2, size + 1); + if (dc_iostream_get_transport(device->iostream) == DC_TRANSPORT_BLE) { rc = dc_iostream_write(device->iostream, buf + 1, size + 2, NULL); } else {