diff options
author | Laszlo Papp <lpapp@kde.org> | 2013-07-27 16:57:08 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-02 21:05:07 +0100 |
commit | 959775c41683033adbd99faab7e3d70e0009c143 (patch) | |
tree | 4d6586946d44617271dbbc56840d45196e855dec /src/serialport/qserialportinfo.cpp | |
parent | 5a2314414fc89c6ef44521f6d13899045b6da7af (diff) |
Add API for querying the serial number
Thanks go to Massimo Callegari for the initial patch and the request to remind
us again. Thanks also go to Denis and Sergey for working on the windows serial
number parser.
Task-number: QTBUG-31981
Change-Id: I60d882280f481eb99d275e0a9c81da50292b1c61
Reviewed-by: Massimo Callegari <massimocallegari@yahoo.it>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Diffstat (limited to 'src/serialport/qserialportinfo.cpp')
-rw-r--r-- | src/serialport/qserialportinfo.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/serialport/qserialportinfo.cpp b/src/serialport/qserialportinfo.cpp index 401973fb..90b22cec 100644 --- a/src/serialport/qserialportinfo.cpp +++ b/src/serialport/qserialportinfo.cpp @@ -170,7 +170,7 @@ QString QSerialPortInfo::systemLocation() const Returns the description string of the serial port, if available; otherwise returns an empty string. - \sa manufacturer() + \sa manufacturer(), serialNumber() */ QString QSerialPortInfo::description() const { @@ -182,7 +182,7 @@ QString QSerialPortInfo::description() const Returns the manufacturer string of the serial port, if available; otherwise returns an empty string. - \sa description() + \sa description(), serialNumber() */ QString QSerialPortInfo::manufacturer() const { @@ -191,6 +191,22 @@ QString QSerialPortInfo::manufacturer() const } /*! + \since 5.3 + + Returns the serial number string of the serial port, + if available; otherwise returns an empty string. + + \note The serial number may include letters. + + \sa description(), manufacturer() +*/ +QString QSerialPortInfo::serialNumber() const +{ + Q_D(const QSerialPortInfo); + return !d ? QString() : d->serialNumber; +} + +/*! Returns the 16-bit vendor number for the serial port, if available; otherwise returns zero. |