diff options
Diffstat (limited to 'src/bluetooth/qbluetoothuuid.cpp')
-rw-r--r-- | src/bluetooth/qbluetoothuuid.cpp | 38 |
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 |