Results 1 to 8 of 8

Thread: Communicating with a USB device in Qt?

  1. #1
    Join Date
    Aug 2009
    Location
    United States
    Posts
    45
    Thanks
    20
    Qt products
    Qt4
    Platforms
    Windows

    Default Communicating with a USB device in Qt?

    Is there any kind of USB library for Qt that simplifies communication with an HID or CDC USB device?

    I have a microcontroller that I am trying to communicate with (a PIC18F4550) over USB, and I think that using either the HID or CDC would be the easiest, but I'm not really sure how to do this.

    Appreciate any advice you might have

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Communicating with a USB device in Qt?

    Which OS?

    Cross platform? No.

    Linux? Well there is libusb.
    Embedded Linux? There's QtExtended.

  3. #3
    Join Date
    Aug 2009
    Location
    United States
    Posts
    45
    Thanks
    20
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Communicating with a USB device in Qt?

    Sorry, I meant to say that I'm using Windows. And no, it doesn't need to be cross platform.

  4. #4
    Join Date
    Sep 2009
    Location
    Tashkent, Uzbekistan
    Posts
    107
    Thanks
    1
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Communicating with a USB device in Qt?

    Check WinAPI reference. Suer you can find different sources as well.

    Regards,
    -- tanuki

  5. #5
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Communicating with a USB device in Qt?

    Quote Originally Posted by N3wb View Post
    I have a microcontroller that I am trying to communicate with (a PIC18F4550) over USB, and I think that using either the HID or CDC would be the easiest, but I'm not really sure how to do this.
    The typical way on Windows would be to write a device driver for that device, and then communicate with that. Most people doing this seem to use a virtual serial port driver for the task as you can then just open the driver and use normal file I/O.

  6. #6
    Join Date
    Aug 2009
    Location
    United States
    Posts
    45
    Thanks
    20
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Communicating with a USB device in Qt?

    Up until now I've been using an RS-232 to USB converter, but now I'm thinking about going the HID route. Someone recommended that I use CDC, but I kind of feel like that's a half step forward from RS-232 and that I might as well make the move to the USB standard.

    An HID device would not require me writing a driver, correct?

  7. #7
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Communicating with a USB device in Qt?

    In that case, maybe this page will be useful for you: http://www.alanmacek.com/usb/

  8. The following user says thank you to squidge for this useful post:

    caodungviet (3rd May 2011)

  9. #8
    Join Date
    Mar 2011
    Posts
    10
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Communicating with a USB device in Qt?

    thank you so much!

Similar Threads

  1. QtExtended Porting on ARM Device - Color Problem
    By ramsarvan in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 19th February 2009, 07:32
  2. Replies: 0
    Last Post: 19th October 2008, 00:01
  3. How to install a Qt-WinCE app on the device?
    By nish in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 3rd June 2008, 12:53
  4. No network when Modem Emulator connect to a real device
    By tommy_tang in forum Qt for Embedded and Mobile
    Replies: 3
    Last Post: 10th December 2007, 09:24
  5. how to export images of Qt/Embedded on Device
    By mahe2310 in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 23rd March 2006, 13:05

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.