0

I have a microcontroller board which has a USB hub to which several CP2108 USB to serial modules are connected and one PIC Microcontroller is connected.

The USB hub is connected to Laptop USB Port..

The CP2108 devices are assigned /dev/ttyUSB0, /dev/ttyUSB1 ID's, whereas the PIC Microcontroller is assigned a /dev/usb/abc.

If I connect another USB device to Laptop USB Port, it will get /dev/ttyUSB2

I want to verify whether /dev/ttyUSB and /dev/usb/abc are on the same hub and not on different one..

Is there any way to find out through code.. I tried to look into sysfs , but I am unable to find out the difference

md.jamal
  • 4,067
  • 8
  • 45
  • 108
  • Sorry about the obvious... but why ??? – Stargateur Aug 10 '18 at 03:49
  • We will be connecting two of such boards ( Microcontroller over USB + CP2108 usb both connected to USB hub ) to Laptop.. The microcontroller is linked to CP2108 modules.. We don't want board A microcontroller to communicate with CP2108 modules of board B and vice versa.. I can provide you more information if you don't understand above – md.jamal Aug 10 '18 at 04:02
  • Try to find sysfs path for the USB hub, all the sub devices will be mounted within the sysfs path of USB hub – kiran Biradar Aug 10 '18 at 04:30
  • Can we do using the same operation from libusb comparing the parents.. – md.jamal Aug 14 '18 at 05:48

0 Answers0