From dfee9aa22f2dbaae3476770d0ab65f26494fe451 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Thu, 11 Oct 2018 17:31:54 +0200 Subject: Fix the BluetoothProfileDescriptorStructure As per spec this is meant to be a list/sequence within a sequence and the version was missing too. For simplicity version 1.0 is used. Fixes: QTBUG-58529 Change-Id: I57090148aadf60ea1fbbb207ff0a4ae61e06caf2 Reviewed-by: Qt CI Bot Reviewed-by: Timur Pocheptsov Reviewed-by: Oliver Wolff --- examples/bluetooth/btchat/chatserver.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'examples/bluetooth') diff --git a/examples/bluetooth/btchat/chatserver.cpp b/examples/bluetooth/btchat/chatserver.cpp index 683dfb94..d078a32c 100644 --- a/examples/bluetooth/btchat/chatserver.cpp +++ b/examples/bluetooth/btchat/chatserver.cpp @@ -85,13 +85,17 @@ void ChatServer::startServer(const QBluetoothAddress& localAdapter) //serviceInfo.setAttribute(QBluetoothServiceInfo::ServiceRecordHandle, (uint)0x00010010); + QBluetoothServiceInfo::Sequence profileSequence; QBluetoothServiceInfo::Sequence classId; - classId << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::SerialPort)); + classId << QVariant::fromValue(quint16(0x100)); + profileSequence.append(QVariant::fromValue(classId)); serviceInfo.setAttribute(QBluetoothServiceInfo::BluetoothProfileDescriptorList, - classId); + profileSequence); - classId.prepend(QVariant::fromValue(QBluetoothUuid(serviceUuid))); + classId.clear(); + classId << QVariant::fromValue(QBluetoothUuid(serviceUuid)); + classId << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::SerialPort)); serviceInfo.setAttribute(QBluetoothServiceInfo::ServiceClassIds, classId); -- cgit v1.2.3