Results 1 to 7 of 7

Thread: Virtual USB COM port with Qt 4.8

  1. #1
    Join Date
    May 2013
    Posts
    4
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Virtual USB COM port with Qt 4.8

    Hello,

    I have an Symbol LS1203 barcode reader with USB cable. I need to implement in my program:

    - enumerate all ports and find out which is the port where the barcode reader is connected
    - listen to data comming
    - parse data for a valid barcode string

    after this i do some basic operations like finding the ID in my database etc..


    I don't have access to Qt5, we are still on 4.8 commercial license. I have integrated QExtSerialPort and the enumeratation only lists COM1 port. So that's obviously the physical port. So, i need to download a driver or software from the Symbol product page to emulate virtual RS232.

    I'm on windows 7 and the driver for emulation does not work on win 7. End of story ((

    So basically, i have no option else then popping out a QDialog with a QLineEdit and using the barcode reading in a keyboard wedge mode: setFocus to QLineEdit and waiting for the string. Something similair is seen in supermarkets/stores, i often see a little window poppping and waiting for the scanned product ID.

    I was hoping, to avoid this application modal dialog, and use a library such as QExtSerialPort,..but the fact that i don't know how to make this USB port show as an Virtual Serial Port forces me to use dialogs.


    Is there maybe another solution possible to avoid dialogs? I have googled and searched alot these days and haven't find out anything. Maybe, there is a little hack such as, installing the driver on XP and modfify-ing some settings and configs, ...but that's out of my knowledge.

    I hope there is. Thanks

  2. The following user says thank you to WinterIsComing for this useful post:


  3. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Virtual USB COM port with Qt 4.8

    Which version of QExtSerialPort ? We are working with QExtSerialPort and have no problems with enumaration. Is the virtual COM port visible in hardware manager ?

  4. The following user says thank you to Lesiok for this useful post:


  5. #3
    Join Date
    Jan 2009
    Location
    Russia
    Posts
    309
    Thanks
    2
    Thanked 43 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Virtual USB COM port with Qt 4.8

    instead of QextSerialPort it is better and simple to use QtSerialPort.

  6. The following user says thank you to kuzulis for this useful post:


  7. #4
    Join Date
    May 2013
    Posts
    4
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Virtual USB COM port with Qt 4.8

    qextserialport-1.2rc

    no not visible, but it should be listed in "Human Interface Devices" ?

    i'm currently thinking of buying a different cable and tell the client to use the real serial port. Something like this: http://salestores.com/motorolasymb328.html (i'm sorry if it's not allowed to post links, i haven't had the time to read the rules yet..)

    Obvously it's a problem of the barcode pistol, it has no appropriate driver to emulate usb com port on windows 7

    I guess a proper solution would be to buy the cable, add a settings page in GUI, and allow the user to choose between USB or SERIAL PORT, if it's serial port, then have combos for configuring settings (baudrate, etc..) If it's usb-cable, show a dialog and wait for string at cursor.

    Quote Originally Posted by kuzulis View Post
    instead of QextSerialPort it is better and simple to use QtSerialPort.
    Would be nice indeed, currently we are still on Qt 4.8 commercial license, i must wait for the whole crew before migrating to Qt5, as many applications needs to be updated manually

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


  9. #5
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Virtual USB COM port with Qt 4.8

    If You don't see COM port in Hardware Manager You can't enumarate this as COM port. QExtSerialPort library is working with COM devices not with "Human interface Devices". First you need to have the appropriate driver.

    Quote Originally Posted by kuzulis View Post
    instead of QextSerialPort it is better and simple to use QtSerialPort.
    Sorry kuzulis but you're talking nonsense. What QtSerialPort is better to use a non-existent device ?

  10. The following user says thank you to Lesiok for this useful post:


  11. #6
    Join Date
    Jan 2009
    Location
    Russia
    Posts
    309
    Thanks
    2
    Thanked 43 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Virtual USB COM port with Qt 4.8

    Lesiok,

    Testers are simply necessary to me for QtSerialPort therefore I carry out such propaganda .

    Besides, QtSerialPort supports an enumeration for bigger number of devices than QextSerialPort (more GUIDS). Therefore I also suggested it to try, maybe suddenly it would earn.

    But now, since we see that the device is defined as HID, neither QextSerialPort and neither QtSerialPort won't help.

  12. The following user says thank you to kuzulis for this useful post:


  13. #7
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Virtual USB COM port with Qt 4.8

    If the barcode reader injects scanned codes into the keyboard stream immediately after you plug it in (i.e. without installing drivers) then it is designed as a HID class device. Unless the manufacturer tells you otherwise and provides a driver that reconfigures the device it will never appear as a serial device (communications class).

    The keyboard input should go to whatever widget has focus. I see no reason that needs to be in dialog. If your focus is on a QLineEdit with a suitable validator for the bar codes then you should have a reasonable way to ensure you get the code either by scanning or manual keying (for those occasions when you are in a hurry and a barcode simply will not scan).

  14. The following user says thank you to ChrisW67 for this useful post:


Similar Threads

  1. Replies: 1
    Last Post: 13th March 2013, 09:44
  2. Qextserual can't detect virtual com-port
    By blm in forum Qt Programming
    Replies: 9
    Last Post: 13th December 2012, 08:45
  3. C++ virtual functions
    By sonulohani in forum Newbie
    Replies: 3
    Last Post: 23rd May 2012, 10:17
  4. Virtual destructors
    By jml in forum Qt Programming
    Replies: 6
    Last Post: 15th January 2008, 01:10
  5. Virtual Memory in Qt 4.2.2
    By Shuchi Agrawal in forum Newbie
    Replies: 3
    Last Post: 6th March 2007, 00:38

Tags for this Thread

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.