blob: c1a3d56498ae372c6d50d04bd506624e9fc83a44 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#include <QtCore/QCoreApplication>
#include <QtCore/QStringList>
#include <QtCore/QDebug>
#include "serialportinfo.h"
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QList<SerialPortInfo> list = SerialPortInfo::availablePorts();
int item = 0;
foreach(SerialPortInfo info, list) {
qDebug() << "--> Item: " << item++;
qDebug() << "Port name : " << info.portName();
qDebug() << "Port location : " << info.systemLocation();
qDebug() << "Port description : " << info.description();
qDebug() << "Port manufacturer: " << info.manufacturer();
}
return a.exec();
}
|