How can I listen usb data communication



  • I want to read data from external device and device is connected with computer via usb cable. Device sends data over usb every second. is it possible to read data with Qt ?



  • I don't think Qt has a class specific for USB. I haven't seen one at least.

    You can communicate with USB devices connected to a computer but you will likely need to use the OS API directly. If, using windows for example, you would use DeviceIoControl(), CreateFile(), and a few other related functions.

    You need to know a lot of the low level details involved. There are utilities and documentation out there that can show you the details at the different levels you will need to work your way through to get to what you are looking for. I had a utility at one time that was quite nice for walking through the different USB devices connected to my computer (USB Explorer - ?). It showed all the details almost the way the API presented them.



  • Do you know if your device is an FTDI based USB device? If so there are two things you can do:

    1. Install the virtual com port drivers from FTDI. (Windows). That will make your USB device look like a serial port then QSerialPort can open it.

    2. Use the D2XX driver/libs from FTDI and you can communicate with the device directly.

    Alternatively if your device is a HID device there are some HID interface tools you can find that would help you to open and talk to the device.

    Without knowing more about the kind of device it is hard to say how to talk to it.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.