Detect serial devices behind USB hubs
This commit is contained in:
parent
0c7009b973
commit
c7b9fe90a6
1 changed files with 6 additions and 2 deletions
|
|
@ -58,7 +58,11 @@ std::string find_usb_serial_port(unsigned short vid, unsigned short pid)
|
|||
{
|
||||
char * usb_dev = strstr(usb_string, "/");
|
||||
usb_dev++;
|
||||
usb_dev = strtok(usb_dev, "/");
|
||||
char * usb_end = strstr(usb_dev, "/tty");
|
||||
*usb_end = '\0';
|
||||
|
||||
usb_end = strrchr(usb_dev, '/');
|
||||
*usb_end = '\0';
|
||||
|
||||
char usb_path[1024];
|
||||
|
||||
|
|
@ -115,4 +119,4 @@ std::string find_usb_serial_port(unsigned short vid, unsigned short pid)
|
|||
|
||||
return ret_string;
|
||||
|
||||
} /* find_usb_serial_port() */
|
||||
} /* find_usb_serial_port() */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue