mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-05-06 21:57:57 -04:00
Detect serial devices behind USB hubs
This commit is contained in:
@@ -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() */
|
||||
|
||||
Reference in New Issue
Block a user