mirror of
git://sigrok.org/libserialport
synced 2023-08-10 21:13:24 +03:00
If present, add usb_serial to description for better identification
This commit is contained in:
parent
5497520891
commit
ea17bfca3d
9
linux.c
9
linux.c
@ -135,6 +135,15 @@ SP_PRIV enum sp_return get_port_details(struct sp_port *port)
|
|||||||
fclose(file);
|
fclose(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If present, add serial to description for better identification. */
|
||||||
|
if (port->usb_serial && strlen(port->usb_serial)) {
|
||||||
|
snprintf(description, sizeof(description) - 1,
|
||||||
|
"%s - %s", port->description, port->usb_serial);
|
||||||
|
if (port->description)
|
||||||
|
free(port->description);
|
||||||
|
port->description = strdup(description);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user