summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@digia.com>2014-06-02 14:29:26 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-06-04 13:41:37 +0200
commite9ae2bc3605345fe1f5ca0acee643b7b449735cd (patch)
tree9a0b6dcca07275ee66452a3b0ea638d3a61cb5d6 /src
parentf7ce1949efa1c916141972cc037841c881c945e2 (diff)
Improve handling of QBluetoothUuid::CharacteristicType enum
- Sort enum values based on their hex values - Add QBluetoothUuid::characteristicToString(CharacteristicType) - Rename QBluetoothUuid::CharacteristicDescriptor -> DescriptorType - Add a couple of missing \since tags Change-Id: I9724eb2f43c6978f07420bf6ec4c8557ad9efbaf Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/bluetooth/qbluetoothuuid.cpp127
-rw-r--r--src/bluetooth/qbluetoothuuid.h139
-rw-r--r--src/bluetooth/qlowenergycharacteristicinfo.cpp87
-rw-r--r--src/bluetooth/qlowenergycontroller.cpp1
-rw-r--r--src/bluetooth/qlowenergydescriptorinfo.cpp5
-rw-r--r--src/bluetooth/qlowenergydescriptorinfo.h4
-rw-r--r--src/bluetooth/qlowenergydescriptorinfo_p.h2
-rw-r--r--src/bluetooth/qlowenergyserviceinfo.cpp1
8 files changed, 205 insertions, 161 deletions
diff --git a/src/bluetooth/qbluetoothuuid.cpp b/src/bluetooth/qbluetoothuuid.cpp
index 89f14440..3c112775 100644
--- a/src/bluetooth/qbluetoothuuid.cpp
+++ b/src/bluetooth/qbluetoothuuid.cpp
@@ -220,7 +220,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QUuid, baseUuid, ("{00000000-0000-1000-8000-00805F9B34
*/
/*!
- \enum QBluetoothUuid::CharacteristicId
+ \enum QBluetoothUuid::CharacteristicType
This enum is a convienience type for Bluetooth low energy service characteristics class UUIDs. Values of this type
will be implicitly converted into a QBluetoothUuid when necessary.
@@ -375,7 +375,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QUuid, baseUuid, ("{00000000-0000-1000-8000-00805F9B34
*/
/*!
- \enum QBluetoothUuid::CharacteristicDescriptor
+ \enum QBluetoothUuid::DescriptorType
Descriptors are attributes that describe Bluetooth Low Energy characteristic values.
@@ -440,7 +440,7 @@ QBluetoothUuid::QBluetoothUuid(CharacteristicType uuid)
/*!
Constructs a new Bluetooth UUID from the descriptor type \a uuid.
*/
-QBluetoothUuid::QBluetoothUuid(QBluetoothUuid::CharacteristicDescriptor uuid)
+QBluetoothUuid::QBluetoothUuid(DescriptorType uuid)
: QUuid(uuid, baseUuid()->data2, baseUuid()->data3, baseUuid()->data4[0], baseUuid()->data4[1],
baseUuid()->data4[2], baseUuid()->data4[3], baseUuid()->data4[4], baseUuid()->data4[5],
baseUuid()->data4[6], baseUuid()->data4[7])
@@ -716,7 +716,7 @@ QString QBluetoothUuid::serviceClassToString(QBluetoothUuid::ServiceClassUuid uu
\sa QBluetoothUuid::ProtocolUuid
- \since Qt 5.4
+ \since 5.4
*/
QString QBluetoothUuid::protocolToString(QBluetoothUuid::ProtocolUuid uuid)
{
@@ -754,6 +754,125 @@ QString QBluetoothUuid::protocolToString(QBluetoothUuid::ProtocolUuid uuid)
}
/*!
+ Returns a human-readable and translated name for the given characteristic
+ represented by \a uuid.
+
+ \sa QBluetoothUuid::CharacteristicType
+
+ \since 5.4
+*/
+QString QBluetoothUuid::characteristicToString(CharacteristicType uuid)
+{
+ switch (uuid) {
+ case QBluetoothUuid::DeviceName: return QBluetoothServiceDiscoveryAgent::tr("GAP Device Name");
+ case QBluetoothUuid::Appearance: return QBluetoothServiceDiscoveryAgent::tr("GAP Appearance");
+ case QBluetoothUuid::PeripheralPrivacyFlag:
+ return QBluetoothServiceDiscoveryAgent::tr("GAP Peripheral Privacy Flag");
+ case QBluetoothUuid::ReconnectionAddress:
+ return QBluetoothServiceDiscoveryAgent::tr("GAP Reconnection Address");
+ case QBluetoothUuid::PeripheralPreferredConnectionParameters:
+ return QBluetoothServiceDiscoveryAgent::tr("GAP Peripheral Preferred Connection Parameters");
+ case QBluetoothUuid::ServiceChanged: return QBluetoothServiceDiscoveryAgent::tr("GATT Service Changed");
+ case QBluetoothUuid::AlertLevel: return QBluetoothServiceDiscoveryAgent::tr("Alert Level");
+ case QBluetoothUuid::TxPowerLevel: return QBluetoothServiceDiscoveryAgent::tr("TX Power");
+ case QBluetoothUuid::DateTime: return QBluetoothServiceDiscoveryAgent::tr("Date Time");
+ case QBluetoothUuid::DayOfWeek: return QBluetoothServiceDiscoveryAgent::tr("Day Of Week");
+ case QBluetoothUuid::DayDateTime: return QBluetoothServiceDiscoveryAgent::tr("Day Date Time");
+ case QBluetoothUuid::ExactTime256: return QBluetoothServiceDiscoveryAgent::tr("Exact Time 256");
+ case QBluetoothUuid::DSTOffset: return QBluetoothServiceDiscoveryAgent::tr("DST Offset");
+ case QBluetoothUuid::TimeZone: return QBluetoothServiceDiscoveryAgent::tr("Time Zone");
+ case QBluetoothUuid::LocalTimeInformation:
+ return QBluetoothServiceDiscoveryAgent::tr("Local Time Information");
+ case QBluetoothUuid::TimeWithDST: return QBluetoothServiceDiscoveryAgent::tr("Time With DST");
+ case QBluetoothUuid::TimeAccuracy: return QBluetoothServiceDiscoveryAgent::tr("Time Accuracy");
+ case QBluetoothUuid::TimeSource: return QBluetoothServiceDiscoveryAgent::tr("Time Source");
+ case QBluetoothUuid::ReferenceTimeInformation:
+ return QBluetoothServiceDiscoveryAgent::tr("Reference Time Information");
+ case QBluetoothUuid::TimeUpdateControlPoint:
+ return QBluetoothServiceDiscoveryAgent::tr("Time Update Control Point");
+ case QBluetoothUuid::TimeUpdateState: return QBluetoothServiceDiscoveryAgent::tr("Time Update State");
+ case QBluetoothUuid::GlucoseMeasurement: return QBluetoothServiceDiscoveryAgent::tr("Glucose Measurement");
+ case QBluetoothUuid::BatteryLevel: return QBluetoothServiceDiscoveryAgent::tr("Battery Level");
+ case QBluetoothUuid::TemperatureMeasurement:
+ return QBluetoothServiceDiscoveryAgent::tr("Temperature Measurement");
+ case QBluetoothUuid::TemperatureType: return QBluetoothServiceDiscoveryAgent::tr("Temperature Type");
+ case QBluetoothUuid::IntermediateTemperature:
+ return QBluetoothServiceDiscoveryAgent::tr("Intermediate Temperature");
+ case QBluetoothUuid::MeasurementInterval: return QBluetoothServiceDiscoveryAgent::tr("Measurement Interval");
+ case QBluetoothUuid::BootKeyboardInputReport: return QBluetoothServiceDiscoveryAgent::tr("Boot Keyboard Input Report");
+ case QBluetoothUuid::SystemID: return QBluetoothServiceDiscoveryAgent::tr("System ID");
+ case QBluetoothUuid::ModelNumberString: return QBluetoothServiceDiscoveryAgent::tr("Model Number String");
+ case QBluetoothUuid::SerialNumberString: return QBluetoothServiceDiscoveryAgent::tr("Serial Number String");
+ case QBluetoothUuid::FirmwareRevisionString: return QBluetoothServiceDiscoveryAgent::tr("Firmware Revision String");
+ case QBluetoothUuid::HardwareRevisionString: return QBluetoothServiceDiscoveryAgent::tr("Hardware Revision String");
+ case QBluetoothUuid::SoftwareRevisionString: return QBluetoothServiceDiscoveryAgent::tr("Software Revision String");
+ case QBluetoothUuid::ManufacturerNameString: return QBluetoothServiceDiscoveryAgent::tr("Manufacturer Name String");
+ case QBluetoothUuid::IEEE1107320601RegulatoryCertificationDataList:
+ return QBluetoothServiceDiscoveryAgent::tr("IEEE 11073 20601 Regulatory Certification Data List");
+ case QBluetoothUuid::CurrentTime: return QBluetoothServiceDiscoveryAgent::tr("Current Time");
+ case QBluetoothUuid::ScanRefresh: return QBluetoothServiceDiscoveryAgent::tr("Scan Refresh");
+ case QBluetoothUuid::BootKeyboardOutputReport:
+ return QBluetoothServiceDiscoveryAgent::tr("Boot Keyboard Output Report");
+ case QBluetoothUuid::BootMouseInputReport: return QBluetoothServiceDiscoveryAgent::tr("Boot Mouse Input Report");
+ case QBluetoothUuid::GlucoseMeasurementContext:
+ return QBluetoothServiceDiscoveryAgent::tr("Glucose Measurement Context");
+ case QBluetoothUuid::BloodPressureMeasurement:
+ return QBluetoothServiceDiscoveryAgent::tr("Blood Pressure Measurement");
+ case QBluetoothUuid::IntermediateCuffPressure:
+ return QBluetoothServiceDiscoveryAgent::tr("Intermediate Cuff Pressure");
+ case QBluetoothUuid::HeartRateMeasurement: return QBluetoothServiceDiscoveryAgent::tr("Heart Rate Measurement");
+ case QBluetoothUuid::BodySensorLocation: return QBluetoothServiceDiscoveryAgent::tr("Body Sensor Location");
+ case QBluetoothUuid::HeartRateControlPoint: return QBluetoothServiceDiscoveryAgent::tr("Heart Rate Control Point");
+ case QBluetoothUuid::AlertStatus: return QBluetoothServiceDiscoveryAgent::tr("Alert Status");
+ case QBluetoothUuid::RingerControlPoint: return QBluetoothServiceDiscoveryAgent::tr("Ringer Control Point");
+ case QBluetoothUuid::RingerSetting: return QBluetoothServiceDiscoveryAgent::tr("Ringer Setting");
+ case QBluetoothUuid::AlertCategoryIDBitMask:
+ return QBluetoothServiceDiscoveryAgent::tr("Alert Category ID Bit Mask");
+ case QBluetoothUuid::AlertCategoryID: return QBluetoothServiceDiscoveryAgent::tr("Alert Category ID");
+ case QBluetoothUuid::AlertNotificationControlPoint:
+ return QBluetoothServiceDiscoveryAgent::tr("Alert Notification Control Point");
+ case QBluetoothUuid::UnreadAlertStatus: return QBluetoothServiceDiscoveryAgent::tr("Unread Alert Status");
+ case QBluetoothUuid::NewAlert: return QBluetoothServiceDiscoveryAgent::tr("New Alert");
+ case QBluetoothUuid::SupportedNewAlertCategory:
+ return QBluetoothServiceDiscoveryAgent::tr("Supported New Alert Category");
+ case QBluetoothUuid::SupportedUnreadAlertCategory:
+ return QBluetoothServiceDiscoveryAgent::tr("Supported Unread Alert Category");
+ case QBluetoothUuid::BloodPressureFeature: return QBluetoothServiceDiscoveryAgent::tr("Blood Pressure Feature");
+ case QBluetoothUuid::HIDInformation: return QBluetoothServiceDiscoveryAgent::tr("HID Information");
+ case QBluetoothUuid::ReportMap: return QBluetoothServiceDiscoveryAgent::tr("Report Map");
+ case QBluetoothUuid::HIDControlPoint: return QBluetoothServiceDiscoveryAgent::tr("HID Control Point");
+ case QBluetoothUuid::Report: return QBluetoothServiceDiscoveryAgent::tr("Report");
+ case QBluetoothUuid::ProtocolMode: return QBluetoothServiceDiscoveryAgent::tr("Protocol Mode");
+ case QBluetoothUuid::ScanIntervalWindow: return QBluetoothServiceDiscoveryAgent::tr("Scan Interval Window");
+ case QBluetoothUuid::PnPID: return QBluetoothServiceDiscoveryAgent::tr("PnP ID");
+ case QBluetoothUuid::GlucoseFeature: return QBluetoothServiceDiscoveryAgent::tr("Glucose Feature");
+ case QBluetoothUuid::RecordAccessControlPoint:
+ return QBluetoothServiceDiscoveryAgent::tr("Record Access Control Point");
+ case QBluetoothUuid::RSCMeasurement: return QBluetoothServiceDiscoveryAgent::tr("RSC Measurement");
+ case QBluetoothUuid::RSCFeature: return QBluetoothServiceDiscoveryAgent::tr("RSC Feature");
+ case QBluetoothUuid::SCControlPoint: return QBluetoothServiceDiscoveryAgent::tr("SC Control Point");
+ case QBluetoothUuid::CSCMeasurement: return QBluetoothServiceDiscoveryAgent::tr("CSC Measurement");
+ case QBluetoothUuid::CSCFeature: return QBluetoothServiceDiscoveryAgent::tr("CSC Feature");
+ case QBluetoothUuid::SensorLocation: return QBluetoothServiceDiscoveryAgent::tr("Sensor Location");
+ case QBluetoothUuid::CyclingPowerMeasurement:
+ return QBluetoothServiceDiscoveryAgent::tr("Cycling Power Measurement");
+ case QBluetoothUuid::CyclingPowerVector: return QBluetoothServiceDiscoveryAgent::tr("Cycling Power Vector");
+ case QBluetoothUuid::CyclingPowerFeature: return QBluetoothServiceDiscoveryAgent::tr("Cycling Power Feature");
+ case QBluetoothUuid::CyclingPowerControlPoint:
+ return QBluetoothServiceDiscoveryAgent::tr("Cycling Power COntrol Point");
+ case QBluetoothUuid::LocationAndSpeed: return QBluetoothServiceDiscoveryAgent::tr("Location And Speed");
+ case QBluetoothUuid::Navigation: return QBluetoothServiceDiscoveryAgent::tr("Navigation");
+ case QBluetoothUuid::PositionQuality: return QBluetoothServiceDiscoveryAgent::tr("Position Quality");
+ case QBluetoothUuid::LNFeature: return QBluetoothServiceDiscoveryAgent::tr("LN Feature");
+ case QBluetoothUuid::LNControlPoint: return QBluetoothServiceDiscoveryAgent::tr("LN Control Point");
+ default:
+ break;
+ }
+
+ return QString();
+}
+
+/*!
Returns true if \a other is equal to this Bluetooth UUID, otherwise false.
*/
bool QBluetoothUuid::operator==(const QBluetoothUuid &other) const
diff --git a/src/bluetooth/qbluetoothuuid.h b/src/bluetooth/qbluetoothuuid.h
index e98bb5a5..c5f9224c 100644
--- a/src/bluetooth/qbluetoothuuid.h
+++ b/src/bluetooth/qbluetoothuuid.h
@@ -177,90 +177,90 @@ public:
};
enum CharacteristicType {
- AlertCategoryID = 0x2a43,
- AlertCategoryIDBitMask = 0x2a42,
- AlertLevel = 0x2a06,
- AlertNotificationControlPoint = 0x2a44,
- AlertStatus = 0x2a3f,
+ DeviceName = 0x2a00,
Appearance = 0x2a01,
- BatteryLevel = 0x2a19,
- BloodPressureFeature = 0x2a49,
- BloodPressureMeasurement = 0x2a35,
- BodySensorLocation = 0x2a38,
- BootKeyboardInputReport = 0x2a22,
- BootKeyboardOutputReport = 0x2a32,
- BootMouseInputReport = 0x2a33,
- CSCFeature = 0x2a5c,
- CSCMeasurement = 0x2a5b,
- CurrentTime = 0x2a2b,
- CyclingPowerControlPoint = 0x2a66,
- CyclingPowerFeature = 0x2a65,
- CyclingPowerMeasurement = 0x2a63,
- CyclingPowerVector = 0x2a64,
+ PeripheralPrivacyFlag = 0x2a02,
+ ReconnectionAddress = 0x2a03,
+ PeripheralPreferredConnectionParameters = 0x2a04,
+ ServiceChanged = 0x2a05,
+ AlertLevel = 0x2a06,
+ TxPowerLevel = 0x2a07,
DateTime = 0x2a08,
- DayDateTime = 0x2a0a,
DayOfWeek = 0x2a09,
- DeviceName = 0x2a00,
- DSTOffset = 0x2a0d,
+ DayDateTime = 0x2a0a,
ExactTime256 = 0x2a0c,
- FirmwareRevisionString = 0x2a26,
- GlucoseFeature = 0x2a51,
+ DSTOffset = 0x2a0d,
+ TimeZone = 0x2a0e,
+ LocalTimeInformation = 0x2a0f,
+ TimeWithDST = 0x2a11,
+ TimeAccuracy = 0x2a12,
+ TimeSource = 0x2a13,
+ ReferenceTimeInformation = 0x2a14,
+ TimeUpdateControlPoint = 0x2a16,
+ TimeUpdateState = 0x2a17,
GlucoseMeasurement = 0x2a18,
- GlucoseMeasurementContext = 0x2a34,
- HardwareRevisionString = 0x2a27,
- HeartRateControlPoint = 0x2a39,
- HeartRateMeasurement = 0x2a37,
- HIDControlPoint = 0x2a4c,
- HIDInformation = 0x2a4a,
- IEEE1107320601RegulatoryCertificationDataList = 0x2a2a,
- IntermediateCuffPressure = 0x2a36,
+ BatteryLevel = 0x2a19,
+ TemperatureMeasurement = 0x2a1c,
+ TemperatureType = 0x2a1d,
IntermediateTemperature = 0x2a1e,
- LNControlPoint = 0x2a6b,
- LNFeature = 0x2a6a,
- LocalTimeInformation = 0x2a0f,
- LocationAndSpeed = 0x2a67,
- ManufacturerNameString = 0x2a29,
MeasurementInterval = 0x2a21,
+ BootKeyboardInputReport = 0x2a22,
+ SystemID = 0x2a23,
ModelNumberString = 0x2a24,
- Navigation = 0x2a68,
+ SerialNumberString = 0x2a25,
+ FirmwareRevisionString = 0x2a26,
+ HardwareRevisionString = 0x2a27,
+ SoftwareRevisionString = 0x2a28,
+ ManufacturerNameString = 0x2a29,
+ IEEE1107320601RegulatoryCertificationDataList = 0x2a2a,
+ CurrentTime = 0x2a2b,
+ ScanRefresh = 0x2a31,
+ BootKeyboardOutputReport = 0x2a32,
+ BootMouseInputReport = 0x2a33,
+ GlucoseMeasurementContext = 0x2a34,
+ BloodPressureMeasurement = 0x2a35,
+ IntermediateCuffPressure = 0x2a36,
+ HeartRateMeasurement = 0x2a37,
+ BodySensorLocation = 0x2a38,
+ HeartRateControlPoint = 0x2a39,
+ AlertStatus = 0x2a3f,
+ RingerControlPoint = 0x2a40,
+ RingerSetting = 0x2a41,
+ AlertCategoryIDBitMask = 0x2a42,
+ AlertCategoryID = 0x2a43,
+ AlertNotificationControlPoint = 0x2a44,
+ UnreadAlertStatus = 0x2a45,
NewAlert = 0x2a46,
- PeripheralPreferredConnectionParameters = 0x2a04,
- PeripheralPrivacyFlag = 0x2a02,
- PnPID = 0x2a50,
- PositionQuality = 0x2a69,
+ SupportedNewAlertCategory = 0x2a47,
+ SupportedUnreadAlertCategory = 0x2a48,
+ BloodPressureFeature = 0x2a49,
+ HIDInformation = 0x2a4a,
+ ReportMap = 0x2a4b,
+ HIDControlPoint = 0x2a4c,
+ Report = 0x2a4d,
ProtocolMode = 0x2a4e,
- ReconnectionAddress = 0x2a03,
+ ScanIntervalWindow = 0x2a4f,
+ PnPID = 0x2a50,
+ GlucoseFeature = 0x2a51,
RecordAccessControlPoint = 0x2a52,
- ReferenceTimeInformation = 0x2a14,
- Report = 0x2a4d,
- ReportMap = 0x2a4b,
- RingerControlPoint = 0x2a40,
- RingerSetting = 0x2a41,
- RSCFeature = 0x2a54,
RSCMeasurement = 0x2a53,
+ RSCFeature = 0x2a54,
SCControlPoint = 0x2a55,
- ScanIntervalWindow = 0x2a4f,
- ScanRefresh = 0x2a31,
+ CSCMeasurement = 0x2a5b,
+ CSCFeature = 0x2a5c,
SensorLocation = 0x2a5d,
- SerialNumberString = 0x2a25,
- ServiceChanged = 0x2a05,
- SoftwareRevisionString = 0x2a28,
- SupportedNewAlertCategory = 0x2a47,
- SupportedUnreadAlertCategory = 0x2a48,
- SystemID = 0x2a23,
- TemperatureMeasurement = 0x2a1c,
- TemperatureType = 0x2a1d,
- TimeAccuracy = 0x2a12,
- TimeSource = 0x2a13,
- TimeUpdateControlPoint = 0x2a16,
- TimeUpdateState = 0x2a17,
- TimeWithDST = 0x2a11,
- TimeZone = 0x2a0e,
- TxPowerLevel = 0x2a07,
- UnreadAlertStatus = 0x2a45
+ CyclingPowerMeasurement = 0x2a63,
+ CyclingPowerVector = 0x2a64,
+ CyclingPowerFeature = 0x2a65,
+ CyclingPowerControlPoint = 0x2a66,
+ LocationAndSpeed = 0x2a67,
+ Navigation = 0x2a68,
+ PositionQuality = 0x2a69,
+ LNFeature = 0x2a6a,
+ LNControlPoint = 0x2a6b,
};
- enum CharacteristicDescriptor {
+ enum DescriptorType {
CharacteristicExtendedProperties = 0x2900,
CharacteristicUserDescription = 0x2901,
ClientCharacteristicConfiguration = 0x2902,
@@ -276,7 +276,7 @@ public:
QBluetoothUuid(ProtocolUuid uuid);
QBluetoothUuid(ServiceClassUuid uuid);
QBluetoothUuid(CharacteristicType uuid);
- QBluetoothUuid(CharacteristicDescriptor uuid);
+ QBluetoothUuid(DescriptorType uuid);
explicit QBluetoothUuid(quint16 uuid);
explicit QBluetoothUuid(quint32 uuid);
explicit QBluetoothUuid(quint128 uuid);
@@ -295,6 +295,7 @@ public:
static QString serviceClassToString(ServiceClassUuid uuid);
static QString protocolToString(ProtocolUuid uuid);
+ static QString characteristicToString(CharacteristicType uuid);
};
#ifndef QT_NO_DEBUG_STREAM
diff --git a/src/bluetooth/qlowenergycharacteristicinfo.cpp b/src/bluetooth/qlowenergycharacteristicinfo.cpp
index 506f6d1c..efd2ec38 100644
--- a/src/bluetooth/qlowenergycharacteristicinfo.cpp
+++ b/src/bluetooth/qlowenergycharacteristicinfo.cpp
@@ -51,6 +51,8 @@ QT_BEGIN_NAMESPACE
\brief The QLowEnergyCharacteristicInfo class stores information about a Bluetooth
Low Energy service characteristic.
+ \since 5.4
+
QLowEnergyCharacteristicInfo provides information about a Bluetooth Low Energy
service characteristic's name, UUID, value, permissions, handle and descriptors.
To get the full characteristic specification and information it is necessary to
@@ -75,87 +77,6 @@ QT_BEGIN_NAMESPACE
*/
/*!
- Method for parsing the characteristic name with given \a uuid.
- * \brief parseUuid
- * \param uuid
- * \return
- */
-QString parseUuid(QBluetoothUuid uuid) {
- static QHash<int, QString> uuidnames;
- if ( uuidnames.isEmpty() ) {
- uuidnames[0x2a43] = QStringLiteral("Alert Category ID");
- uuidnames[0x2A42] = QStringLiteral("Alert Category ID Bit Mask");
- uuidnames[0x2A06] = QStringLiteral("Alert Level");
- uuidnames[0x2A44] = QStringLiteral("Alert Notification Control Point");
- uuidnames[0x2A3F] = QStringLiteral("Alert Status");
- uuidnames[0x2A01] = QStringLiteral("GAP Appearance");
- uuidnames[0x2A19] = QStringLiteral("Battery Level");
- uuidnames[0x2A49] = QStringLiteral("Blood Pressure Feature");
- uuidnames[0x2A35] = QStringLiteral("Blood Pressure Measurement");
- uuidnames[0x2A38] = QStringLiteral("Body Sensor Location");
- uuidnames[0x2A22] = QStringLiteral("Boot Keyboard Input Report");
- uuidnames[0x2A32] = QStringLiteral("Boot Keyboard Output Report");
- uuidnames[0x2A33] = QStringLiteral("Boot Mouse Input Report");
- uuidnames[0x2A2B] = QStringLiteral("Current Time");
- uuidnames[0x2A08] = QStringLiteral("Date Time");
- uuidnames[0x2A0A] = QStringLiteral("Day Date Time");
- uuidnames[0x2A09] = QStringLiteral("Day of Week");
- uuidnames[0x2A00] = QStringLiteral("GAP Device Name");
- uuidnames[0x2A0D] = QStringLiteral("DST Offset");
- uuidnames[0x2A0C] = QStringLiteral("Exact Time 256");
- uuidnames[0x2A26] = QStringLiteral("Firmware Revision String");
- uuidnames[0x2A51] = QStringLiteral("Glucose Feature");
- uuidnames[0x2A18] = QStringLiteral("Glucose Measurement");
- uuidnames[0x2A34] = QStringLiteral("Glucose Measurement Context");
- uuidnames[0x2A27] = QStringLiteral("Hardware Revision String");
- uuidnames[0x2A39] = QStringLiteral("Heart Rate Control Point");
- uuidnames[0x2A37] = QStringLiteral("Heart Rate Measurement");
- uuidnames[0x2A4C] = QStringLiteral("HID Control Point");
- uuidnames[0x2A4A] = QStringLiteral("HID Information");
- uuidnames[0x2A2A] = QStringLiteral("IEEE 11073 20601 Regulatory Certification Data List");
- uuidnames[0x2A36] = QStringLiteral("Intermediate Blood Pressure");
- uuidnames[0x2A1E] = QStringLiteral("Iintermediate Temperature");
- uuidnames[0x2A0F] = QStringLiteral("Local Time Information");
- uuidnames[0x2A29] = QStringLiteral("Manufacturer Name String");
- uuidnames[0x2A21] = QStringLiteral("Measurement Interval");
- uuidnames[0x2A24] = QStringLiteral("Model Number String");
- uuidnames[0x2A46] = QStringLiteral("New Alert");
- uuidnames[0x2A04] = QStringLiteral("GAP Peripheral Preferred Connection Parameters");
- uuidnames[0x2A02] = QStringLiteral("GAP Peripheral Privacy Flag");
- uuidnames[0x2A50] = QStringLiteral("PNP ID");
- uuidnames[0x2A4E] = QStringLiteral("Protocol Mode");
- uuidnames[0x2A03] = QStringLiteral("GAP Reconnection Address");
- uuidnames[0x2A52] = QStringLiteral("Record Access Control Point");
- uuidnames[0x2A14] = QStringLiteral("Reference Time Information");
- uuidnames[0x2A4D] = QStringLiteral("Report");
- uuidnames[0x2A4B] = QStringLiteral("Report Map");
- uuidnames[0x2A40] = QStringLiteral("Ringer Control Point");
- uuidnames[0x2A41] = QStringLiteral("Ringer Setting");
- uuidnames[0x2A4F] = QStringLiteral("Scan Interval Window");
- uuidnames[0x2A31] = QStringLiteral("Scan Refresh");
- uuidnames[0x2A25] = QStringLiteral("Serial Number String");
- uuidnames[0x2A05] = QStringLiteral("GATT Service Changed");
- uuidnames[0x2A28] = QStringLiteral("Software Revision String");
- uuidnames[0x2A47] = QStringLiteral("Supported New Alert Category");
- uuidnames[0x2A48] = QStringLiteral("Supported Unread Alert Category");
- uuidnames[0x2A23] = QStringLiteral("System ID");
- uuidnames[0x2A1C] = QStringLiteral("Temperature Measurement");
- uuidnames[0x2A1D] = QStringLiteral("Temperature Type");
- uuidnames[0x2A12] = QStringLiteral("Time Accuracy");
- uuidnames[0x2A13] = QStringLiteral("Time Source");
- uuidnames[0x2A16] = QStringLiteral("Time Update Control Point");
- uuidnames[0x2A17] = QStringLiteral("Time Update State");
- uuidnames[0x2A11] = QStringLiteral("Time With DST");
- uuidnames[0x2A0E] = QStringLiteral("Time Zone");
- uuidnames[0x2A07] = QStringLiteral("TX Power");
- uuidnames[0x2A45] = QStringLiteral("Unread Alert Status");
- }
- QString name = uuidnames.value(uuid.toUInt16(), QStringLiteral("Unknown Characteristic"));
- return name;
-
-}
-
-/*!
Construct a new QLowEnergyCharacteristicInfo.
*/
QLowEnergyCharacteristicInfo::QLowEnergyCharacteristicInfo():
@@ -198,8 +119,8 @@ QLowEnergyCharacteristicInfo::~QLowEnergyCharacteristicInfo()
*/
QString QLowEnergyCharacteristicInfo::name() const
{
- d_ptr->name = parseUuid(d_ptr->uuid);
- return d_ptr->name;
+ return QBluetoothUuid::characteristicToString(
+ static_cast<QBluetoothUuid::CharacteristicType>(d_ptr->uuid.toUInt16()));
}
/*!
diff --git a/src/bluetooth/qlowenergycontroller.cpp b/src/bluetooth/qlowenergycontroller.cpp
index d993e205..afb9831a 100644
--- a/src/bluetooth/qlowenergycontroller.cpp
+++ b/src/bluetooth/qlowenergycontroller.cpp
@@ -50,6 +50,7 @@ QT_BEGIN_NAMESPACE
\inmodule QtBluetooth
\brief The QLowEnergyController class is used for connecting and reading data from LE device
services.
+ \since 5.4
To read data contained in LE service characteristics, the LE device must be paired and turned on.
First, connect necessary signals from the class and then connect to service by passing the wanted service
diff --git a/src/bluetooth/qlowenergydescriptorinfo.cpp b/src/bluetooth/qlowenergydescriptorinfo.cpp
index 70be3e22..b71d7b4b 100644
--- a/src/bluetooth/qlowenergydescriptorinfo.cpp
+++ b/src/bluetooth/qlowenergydescriptorinfo.cpp
@@ -50,6 +50,7 @@ QT_BEGIN_NAMESPACE
\inmodule QtBluetooth
\brief The QLowEnergyDescriptorInfo class stores information about the Bluetooth
Low Energy descriptor.
+ \since 5.4
QLowEnergyDescriptorInfo provides information about a Bluetooth Low Energy
descriptor's name, UUID, value and handle. Descriptors are contained in the
@@ -103,7 +104,7 @@ QLowEnergyDescriptorInfo::QLowEnergyDescriptorInfo(const QBluetoothUuid &uuid):
characteristic \a uuid, descriptor \a type and \a handle.
*/
QLowEnergyDescriptorInfo::QLowEnergyDescriptorInfo(const QBluetoothUuid &uuid,
- QBluetoothUuid::CharacteristicDescriptor type,
+ QBluetoothUuid::DescriptorType type,
const QString &handle):
d_ptr(new QLowEnergyDescriptorInfoPrivate(uuid, handle))
{
@@ -166,7 +167,7 @@ QString QLowEnergyDescriptorInfo::name() const
/*!
Returns the type of descriptor.
*/
-QBluetoothUuid::CharacteristicDescriptor QLowEnergyDescriptorInfo::type() const
+QBluetoothUuid::DescriptorType QLowEnergyDescriptorInfo::type() const
{
return d_ptr->m_type;
}
diff --git a/src/bluetooth/qlowenergydescriptorinfo.h b/src/bluetooth/qlowenergydescriptorinfo.h
index 4b768d01..2840e1aa 100644
--- a/src/bluetooth/qlowenergydescriptorinfo.h
+++ b/src/bluetooth/qlowenergydescriptorinfo.h
@@ -68,12 +68,12 @@ public:
QString handle() const;
QString name() const;
- QBluetoothUuid::CharacteristicDescriptor type() const;
+ QBluetoothUuid::DescriptorType type() const;
private:
QSharedPointer<QLowEnergyDescriptorInfoPrivate> d_ptr;
QLowEnergyDescriptorInfo(const QBluetoothUuid &uuid,
- QBluetoothUuid::CharacteristicDescriptor desc,
+ QBluetoothUuid::DescriptorType desc,
const QString &handle);
};
diff --git a/src/bluetooth/qlowenergydescriptorinfo_p.h b/src/bluetooth/qlowenergydescriptorinfo_p.h
index 29c000ff..fb177dfe 100644
--- a/src/bluetooth/qlowenergydescriptorinfo_p.h
+++ b/src/bluetooth/qlowenergydescriptorinfo_p.h
@@ -56,7 +56,7 @@ public:
QBluetoothUuid m_uuid;
QString m_handle;
QString m_name;
- QBluetoothUuid::CharacteristicDescriptor m_type;
+ QBluetoothUuid::DescriptorType m_type;
#ifdef QT_QNX_BLUETOOTH
int instance;
#endif
diff --git a/src/bluetooth/qlowenergyserviceinfo.cpp b/src/bluetooth/qlowenergyserviceinfo.cpp
index ee6a9484..c820e51c 100644
--- a/src/bluetooth/qlowenergyserviceinfo.cpp
+++ b/src/bluetooth/qlowenergyserviceinfo.cpp
@@ -50,6 +50,7 @@ QT_BEGIN_NAMESPACE
\inmodule QtBluetooth
\brief The QLowEnergyServiceInfo class stores information about the Bluetooth
Low Energy service.
+ \since 5.4
QLowEnergyServiceInfo provides information about a Bluetooth Low Energy
service's name, device, UUID, connection status, service type, handle