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 <name>:conn=<spec>" 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
This commit is contained in:
parent
87307940f1
commit
a1771c26ba
|
@ -206,7 +206,7 @@ static GSList *ser_hid_hidapi_list(GSList *list, sr_ser_list_append_t append)
|
||||||
if (serno)
|
if (serno)
|
||||||
g_string_append_printf(desc, " %ls", serno);
|
g_string_append_printf(desc, " %ls", serno);
|
||||||
if (vid && pid)
|
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);
|
list = append(list, name, desc->str);
|
||||||
g_string_free(desc, TRUE);
|
g_string_free(desc, TRUE);
|
||||||
g_free(name);
|
g_free(name);
|
||||||
|
|
Loading…
Reference in New Issue