Results 1 to 7 of 7

Thread: Reading data from usb port

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: Reading data from usb port

    The QextSerialPort is not what you want.
    Search in the forum - someone posted few weeks back a Qt wrapper for USB lib.
    But this is really not a Qt issue, you can use any USB lib that will work for you in your Qt project.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  2. #2
    Join Date
    Oct 2009
    Posts
    364
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    10
    Thanked 37 Times in 36 Posts

    Default Re: Reading data from usb port

    In case you are using a usb to serial converter like FTDI which features a driver with a virtual comm port (judging by the high com port number), then you could use qextserialport, however, be aware that the new location for that project is on google code:
    http://code.google.com/p/qextserialport/

    the version you downloaded is old.

    Once you get the proper source, look at qextserialport examples and please refer to the forums/mailing list over at qextserialport on how to use this library.

  3. #3
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: Reading data from usb port

    In case you are using a usb to serial converter
    If schnitzel is correct, then you want to read from a SERIAL port, not a USB port.
    The fact the serial port is originally a USB port, plays no role for you.
    Your code will only deal with a serial port - in which case the code you posted makes sense.
    So what is it that you need?
    Do you want to read a USB port or a serial port?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  4. #4
    Join Date
    Oct 2009
    Posts
    364
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    10
    Thanked 37 Times in 36 Posts

    Default Re: Reading data from usb port

    I should clarify...

    I'm using one of those FTDI chips on a custom board. The chip is supported by a library (win/mac/linux) available for free from ftdi website. The chip isn't actually a usb to serial converter *but* it features the so called VCP (Virtual COM Port) driver. From ftdi web site:
    For most of these operating systems two types of driver are available: Virtual COM Port (VCP) drivers and direct (D2XX) drivers. The VCP driver emulates a standard PC serial port such that the USB device may be communicated with as a standard RS232 device. The D2XX driver allows direct access to a USB device via a DLL interface.
    I have never used the device with VCP, because the transfer rate is a bit lower compared to using the device with the direct drivers.

    Like you said high_flyer, OP needs to clarify what he needs/uses.

Similar Threads

  1. Replies: 3
    Last Post: 27th April 2011, 09:27
  2. Serial Port Reading problem
    By sfabel in forum Qt Programming
    Replies: 12
    Last Post: 18th February 2010, 14:59
  3. Problem in reading port using QextSerialPort
    By cutie.monkey in forum Qt Programming
    Replies: 6
    Last Post: 2nd July 2009, 02:07
  4. Replies: 1
    Last Post: 1st July 2009, 00:37
  5. Replies: 1
    Last Post: 1st July 2009, 00:36

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
  •  
Qt is a trademark of The Qt Company.