From: Uffe Jakobsen Date: Mon, 16 Feb 2015 22:07:00 +0000 (+0100) Subject: If present, add usb_serial to description for better identification X-Git-Tag: libserialport-0.1.1~84 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=ea17bfca3d955fdf976ec13a0d6c3bb6a9f3b9e9;p=libserialport.git If present, add usb_serial to description for better identification --- diff --git a/linux.c b/linux.c index 61446a4..9ffdc91 100644 --- a/linux.c +++ b/linux.c @@ -135,6 +135,15 @@ SP_PRIV enum sp_return get_port_details(struct sp_port *port) 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; } } else {