erewalk / qextserialport

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

Allow port listing based upon user defined filter. ex: getPorts("ttymxc*) #169

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Which version of QextSerialPort are you using?
1.2rc

What steps will reproduce the problem?
1. Platform embedded linux - Freescale iMX6
2. The following code block lists out all serial ports enumerated
// Get a listing of the Serial Ports for the System
if(listSerialPorts.size() > 0 && m_nPortNumber < listSerialPorts.size())
{
    for(int i = 0; i < listSerialPorts.size(); i++)
    {
        DEBUG_OUTPUT(i, listSerialPorts.at(i).portName);
    }
}

3.

What is the expected output? What do you see instead?
I expect to see output of all tty* on my system

instead, i see only ttyS*
// output
BOOLEAN CGenSerial::Init() : 0 "ttyS0" 
BOOLEAN CGenSerial::Init() : 1 "ttyS1" 
BOOLEAN CGenSerial::Init() : 2 "ttyS10" 
BOOLEAN CGenSerial::Init() : 3 "ttyS11" 
BOOLEAN CGenSerial::Init() : 4 "ttyS12" 
...
BOOLEAN CGenSerial::Init() : 29 "ttyS7" 
BOOLEAN CGenSerial::Init() : 30 "ttyS8" 
BOOLEAN CGenSerial::Init() : 31 "ttyS9

4. Feature request
Add support for filter parameter that we can pass to list ports

ex: QextSerialEnumerator::getPorts(const char *filter)

where filter may equal: 
"ttymxc*" 
"ttyS*"
etc...
"" //no filter is default behavior as is.

Original issue reported on code.google.com by nabav...@gmail.com on 18 Jul 2013 at 7:51

GoogleCodeExporter commented 9 years ago
Sorry you may want to move to feature request.

Original comment by nabav...@gmail.com on 18 Jul 2013 at 8:04