yun93us / qextserialport

Automatically exported from code.google.com/p/qextserialport
Other
0 stars 0 forks source link

QextSerialEnumerator finds Parallelports (LPT) on Win XP, too. #42

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.List all the Supplied Ports on system.
QList<QextPortInfo> ports = QextSerialEnumerator::getPorts();

    QStringList strPortList;
    printf("List of ports:\n");
    for (int i = 0; i < ports.size(); i++) {

        strPortList << ports.at(i).portName.toLocal8Bit().constData();

        printf("port name: %s\n",
ports.at(i).portName.toLocal8Bit().constData());
        printf("friendly name: %s\n",
ports.at(i).friendName.toLocal8Bit().constData());
        printf("physical name: %s\n",
ports.at(i).physName.toLocal8Bit().constData());
        printf("enumerator name: %s\n",
ports.at(i).enumName.toLocal8Bit().constData());
        printf("===================================\n\n");
}

2. On first place i find the LPT1 Port.
(My PC has one LPT1 port)

What is the expected output? What do you see instead?
Expected: i will see only ComX ports. I see instea: My LPT1 port and all
ComX ports on my system.

What version of the product are you using? On what operating system?
Yestarday cheked out. Windows XP SP3.

Please provide any additional information below.
I have use 1.2 alpha before. allt works very well.
I found some changes, waht could produce the new behawiour.
In File qextserialenumerator_winn.cpp Line 34:
 DEFINE_GUID(GUID_DEVCLASS_PORTS, 0x4D36E978, 0xE325, 0x11CE, 0xBF, 0xC1,
0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18 );
Should it be like in older revision, File Qextserialenumerator.cpp Line 16:
        DEFINE_GUID(GUID_CLASS_COMPORT, 0x86e0d1e0L, 0x8089, 0x11d0, 0x9c, 0xe4,
0x08, 0x00, 0x3e, 0x30, 0x1f, 0x73);
?

Here 
http://msdn.microsoft.com/en-us/library/ms791134.aspx
you can read:
"This class includes serial and parallel port devices. See also the
MultiportSerial class."
But we need only serialport, right?
Haw can we fix it?

Original issue reported on code.google.com by henningjuergen@gmail.com on 15 Feb 2010 at 10:40

GoogleCodeExporter commented 9 years ago
I don't see any reason to fix it.  It works with the same API - if you want to 
use one then you can, if not then 
don't :)

Original comment by lst...@gmail.com on 16 Feb 2010 at 7:23

GoogleCodeExporter commented 9 years ago
?
Same Api, but in the last version you use GUID_DEVCLASS_PORTS and not
GUID_CLASS_COMPORT. Could yiu tell why?
It is not a bug, that the function "QextSerialEnumerator::getPorts()" returns 
LTP
ports too?
> if you want to use one then you can...
What you meen with "one" Api? library? GUID_Class?

Original comment by henningjuergen@gmail.com on 16 Feb 2010 at 11:17

GoogleCodeExporter commented 9 years ago
Because on Windows, using the previous GUID does not detect all USB serial 
devices, whereas this GUID does.  

Windows (for whatever reason) categorizes LPT and serial ports together, so 
they use the same library to 
communicate.

Original comment by lst...@gmail.com on 16 Feb 2010 at 4:01

GoogleCodeExporter commented 9 years ago
Pleas answer the following quetions too:
It is not a bug, that the function "QextSerialEnumerator::getPorts()" returns 
LPT
ports too? Is that behavior wished or not?

In the past i wrote an application with Qextserialport. The application has and
combobox to choose one of available comports on pc. Now, i wanted to use the 
latest
version of your Lib to use my app in linux too. Now, the are Enumerators in 
Linux. I
am happy, but windows version of my app hase the LPT port in an "available 
comports"
combobox now.
I would be very well, if I could use only one version of Qextserialport-library.
What is you suggestion: should i change my app and filter all the LPTs in 
output of
getPorts() out, or change the Lib (change getPorts()) to get the comports only?
Thanks.

Original comment by henningjuergen@gmail.com on 16 Feb 2010 at 4:31