Using USB with QT



  • I have a device MICROCHIP CAN BUS Analyzer, with known to me VID and PID. My task is to read data from it. But for this, I need to find it (identify). I used different libraries, such as: LIBUSB, HIDAPI, some libraries modified for QT. And not one library could not help me. The maximum I have achieved is to find my keyboard. And nothing more. Help me please.
    And sorry for my bad english.

    It's a custom USB devices:
    alt text
    VID: 04D8
    PID: 0A30
    Here is a photo of the device: alt text



  • First guess: did you install the drivers of the device?



  • @VRonin said in Using USB with QT:

    First guess: did you install the drivers of the device?

    Of Course



  • Of Course

    Then you should to use its vendor-specific SDK && API documentation (if it is possible) to have access to an analyzer, as I assume (or just to use its viewers software "as is").



  • @kuzulis said in Using USB with QT:

    Of Course

    Then you should to use its vendor-specific SDK && API documentation (if it is possible) to have access to an analyzer, as I assume (or just to use its viewers software "as is").

    Is it possible to find it via VID and PID through Device Manager?
    Or at least make it so that a whole list of all connected USB devices is displayed?



  • Is it possible to find it via VID and PID through Device Manager?
    Or at least make it so that a whole list of all connected USB devices is displayed?

    What for? Do you have a protocol's API specification of your Analyzer?

    In this situation you have two ways:

    1. Use the Analyzer's device which is created by MICROCHIP CAN BUS driver directly (as it does from vendor-utility). For this purpose, you need in some SDK && API documentation, in which described how to enumerate your Analyzer's device in system, how to open it and how to control/read/write from.. usually it does via CreateFile/ReadFile/WriteFile/DeviceIoControl functions. But, the main problem is in documentation of a protocol (related to the transferred data structures, and ioctrl's on device to configure it).

    For this purpose, you can enumerate your Analyser's system path by class GUID of your Analyser, which can be found in *.inf file of Analyser's driver. Just use Windows Setup Api (SetupDiGetClassDevs and so on functions) to enumerate device system path to opening.

    1. Use the WinUSB functions directly, where are used generic winusb.sys driver for your Analyser, instead of MICROCHIP's vendor-driver. In this case you can read/write control/bulk/isochronous USB requests directly to/from Analyser. But, here also, you need an API documentation about of a formats of messages and so on.

    For this purpose, you can enumerate your Analyser's device, using WinUSB functions.

    PS: Please, do not ask how to do it, as all related information you can found in MSDN and in google.


Log in to reply