From a1771c26baadd27e1e71ccd6dc63f79fb15f5c08 Mon Sep 17 00:00:00 2001 From: Gerhard Sittig Date: Thu, 20 Jun 2019 11:06:22 +0200 Subject: [PATCH] serial_hid: make --list-serial output compatible with conn=, print "VID.PID" When the list of all connections gets created which are supported by the HID serial transport, items contain a "hid/ch9325/raw=/dev/hidraw3" path and a "1a86:e008" pair of vendor and product IDs. Separate the VID/PID pair by a period not a colon, so that --list-serial output immediately becomes usable with "--driver :conn=" invocations. Eliminate the necessity to adjust clipboard context by the user. This improves usability in cases where not a single connection gets addressed, but a group of connections gets specified by ambiguous conn= specs. $ sigrok-cli -d uni-t-ut32x:conn=1a86.e008 --scan --- src/serial_hid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/serial_hid.c b/src/serial_hid.c index 0c5b9ccc..0ad0e513 100644 --- a/src/serial_hid.c +++ b/src/serial_hid.c @@ -206,7 +206,7 @@ static GSList *ser_hid_hidapi_list(GSList *list, sr_ser_list_append_t append) if (serno) g_string_append_printf(desc, " %ls", serno); if (vid && pid) - g_string_append_printf(desc, " %04hx:%04hx", vid, pid); + g_string_append_printf(desc, " %04hx.%04hx", vid, pid); list = append(list, name, desc->str); g_string_free(desc, TRUE); g_free(name);