summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothuuid.cpp
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@digia.com>2014-06-04 15:01:30 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-06-11 12:03:22 +0200
commit1a9a359b9bdee646cd964fd5af13b239da79f9c9 (patch)
treec69d6c1fe6389a44856284ceaeacd05bab9b41ed /src/bluetooth/qbluetoothuuid.cpp
parent516bc395a69f5dbe965c1e1da8580b5a6c38779f (diff)
Provide means of translating descriptor types to user strings
Also, this patch fixes the uninitialised m_type member in the QLowEnergyDescriptorInfo private implementation Change-Id: I6736d5f38738490bc4f0f53908f925361f1843bd Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/bluetooth/qbluetoothuuid.cpp')
-rw-r--r--src/bluetooth/qbluetoothuuid.cpp38
1 files changed, 37 insertions, 1 deletions
diff --git a/src/bluetooth/qbluetoothuuid.cpp b/src/bluetooth/qbluetoothuuid.cpp
index 3c112775..b68e6e1f 100644
--- a/src/bluetooth/qbluetoothuuid.cpp
+++ b/src/bluetooth/qbluetoothuuid.cpp
@@ -754,7 +754,7 @@ QString QBluetoothUuid::protocolToString(QBluetoothUuid::ProtocolUuid uuid)
}
/*!
- Returns a human-readable and translated name for the given characteristic
+ Returns a human-readable and translated name for the given characteristic type
represented by \a uuid.
\sa QBluetoothUuid::CharacteristicType
@@ -873,6 +873,42 @@ QString QBluetoothUuid::characteristicToString(CharacteristicType uuid)
}
/*!
+ Returns a human-readable and translated name for the given descriptor type
+ represented by \a uuid.
+
+ \sa QBluetoothUuid::CharacteristicType
+
+ \since 5.4
+*/
+QString QBluetoothUuid::descriptorToString(QBluetoothUuid::DescriptorType uuid)
+{
+ switch (uuid) {
+ case QBluetoothUuid::CharacteristicExtendedProperties:
+ return QBluetoothServiceDiscoveryAgent::tr("Characteristic Extended Properties");
+ case QBluetoothUuid::CharacteristicUserDescription:
+ return QBluetoothServiceDiscoveryAgent::tr("Characteristic User Description");
+ case QBluetoothUuid::ClientCharacteristicConfiguration:
+ return QBluetoothServiceDiscoveryAgent::tr("Client Characteristic Configuration");
+ case QBluetoothUuid::ServerCharacteristicConfiguration:
+ return QBluetoothServiceDiscoveryAgent::tr("Server Characteristic Configuratio");
+ case QBluetoothUuid::CharacteristicPresentationFormat:
+ return QBluetoothServiceDiscoveryAgent::tr("Characteristic Presentation Format");
+ case QBluetoothUuid::CharacteristicAggregateFormat:
+ return QBluetoothServiceDiscoveryAgent::tr("Characteristic Aggregate Format");
+ case QBluetoothUuid::ValidRange:
+ return QBluetoothServiceDiscoveryAgent::tr("Valid Range");
+ case QBluetoothUuid::ExternalReportReference:
+ return QBluetoothServiceDiscoveryAgent::tr("External Report Reference");
+ case QBluetoothUuid::ReportReference:
+ return QBluetoothServiceDiscoveryAgent::tr("Report Reference");
+ default:
+ break;
+ }
+
+ return QString();
+}
+
+/*!
Returns true if \a other is equal to this Bluetooth UUID, otherwise false.
*/
bool QBluetoothUuid::operator==(const QBluetoothUuid &other) const