summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothserviceinfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bluetooth/qbluetoothserviceinfo.cpp')
-rw-r--r--src/bluetooth/qbluetoothserviceinfo.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/bluetooth/qbluetoothserviceinfo.cpp b/src/bluetooth/qbluetoothserviceinfo.cpp
index 74b17ac4..7c3780ec 100644
--- a/src/bluetooth/qbluetoothserviceinfo.cpp
+++ b/src/bluetooth/qbluetoothserviceinfo.cpp
@@ -413,6 +413,9 @@ void QBluetoothServiceInfo::setDevice(const QBluetoothDeviceInfo &device)
If the service information is already registered with the platform's SDP database,
the database entry will not be updated until \l registerService() was called again.
+ \note If an attribute expectes a byte-encoded value (e.g. Bluetooth HID services),
+ it should be set as QByteArray.
+
\sa isRegistered(), registerService()
*/
void QBluetoothServiceInfo::setAttribute(quint16 attributeId, const QVariant &value)
@@ -578,6 +581,10 @@ static void dumpAttributeVariant(QDebug dbg, const QVariant &var, const QString&
dbg << QString::asprintf("%sstring %s\n", indent.toUtf8().constData(),
var.toString().toUtf8().constData());
break;
+ case QMetaType::QByteArray:
+ dbg << QString::asprintf("%sbytearray %s\n", indent.toUtf8().constData(),
+ var.toByteArray().toHex().constData());
+ break;
case QMetaType::Bool:
dbg << QString::asprintf("%sbool %d\n", indent.toUtf8().constData(), var.toBool());
break;
@@ -631,7 +638,7 @@ QDebug operator<<(QDebug dbg, const QBluetoothServiceInfo &info)
{
QDebugStateSaver saver(dbg);
dbg.noquote() << "\n";
- QList<quint16> attributes = info.attributes();
+ const QList<quint16> attributes = info.attributes();
for (quint16 id : attributes) {
dumpAttributeVariant(dbg, info.attribute(id), QStringLiteral("(%1)\t").arg(id));
}