List serial ports in Qt application on windows and Mac
I am creating one Qt based application for windows and Mac OS X. I used Qextserial port to connect and communicate through serial port it works well.
But now I need to list existing serial ports in a system like "COM1" "COM2" etc.
How I can do this in Qt, is there any native C++ code available to list existing serial ports in a system that i can include in Qt application
Re: List serial ports in Qt application on windows and Mac
Did you read the QextSerialPort documentation? There are only two classes and the bit about QextSerialEnumerator will be illuminating.
Re: List serial ports in Qt application on windows and Mac
I didn't understand. Is there any function to get existing serial ports in a system
There is no function available to list existing serial ports in QExtserilport. They are simply hard coded the portnames
They are used like this
port = new QextSerialPort("COM1");
but i need to get this "COM1" from system
Re: List serial ports in Qt application on windows and Mac
From the link posted by Chris:
Quote:
QextSerialEnumerator enumerates ports currently available in the system.
QextSerialEnumerator::getPorts
Quote:
Get list of ports.
return list of ports currently available in the system.
Re: List serial ports in Qt application on windows and Mac
As they say in English: "You can lead a horse to water, but you can't make him drink."
Re: List serial ports in Qt application on windows and Mac
Thank you all, I didn't noticed that earlier
Thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!