1
0
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:
Uffe Jakobsen 2015-02-16 23:07:00 +01:00 committed by Uwe Hermann
parent 5497520891
commit ea17bfca3d

View File

@ -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 {