summaryrefslogtreecommitdiffstats
path: root/examples/serialport/cenumerator
diff options
context:
space:
mode:
Diffstat (limited to 'examples/serialport/cenumerator')
-rw-r--r--examples/serialport/cenumerator/main.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/serialport/cenumerator/main.cpp b/examples/serialport/cenumerator/main.cpp
index 2d770e81..5007389d 100644
--- a/examples/serialport/cenumerator/main.cpp
+++ b/examples/serialport/cenumerator/main.cpp
@@ -56,15 +56,18 @@ int main(int argc, char *argv[])
const QString blankString = QObject::tr("N/A");
QString description;
QString manufacturer;
+ QString serialNumber;
foreach (const QSerialPortInfo &serialPortInfo, serialPortInfoList) {
description = serialPortInfo.description();
manufacturer = serialPortInfo.manufacturer();
+ serialNumber = serialPortInfo.serialNumber();
out << endl
<< QObject::tr("Port: ") << serialPortInfo.portName() << endl
<< QObject::tr("Location: ") << serialPortInfo.systemLocation() << endl
<< QObject::tr("Description: ") << (!description.isEmpty() ? description : blankString) << endl
<< QObject::tr("Manufacturer: ") << (!manufacturer.isEmpty() ? manufacturer : blankString) << endl
+ << QObject::tr("Serial number: ") << (!serialNumber.isEmpty() ? serialNumber : blankString) << endl
<< QObject::tr("Vendor Identifier: ") << (serialPortInfo.hasVendorIdentifier() ? QByteArray::number(serialPortInfo.vendorIdentifier(), 16) : blankString) << endl
<< QObject::tr("Product Identifier: ") << (serialPortInfo.hasProductIdentifier() ? QByteArray::number(serialPortInfo.productIdentifier(), 16) : blankString) << endl
<< QObject::tr("Busy: ") << (serialPortInfo.isBusy() ? QObject::tr("Yes") : QObject::tr("No")) << endl;