From 7fde60d9bedb815b66d374328d6535d10c701775 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Mon, 10 Feb 2014 13:52:48 +0100 Subject: Fix interaction with Android devices The custom uuid of a Serial port profile must be part of the service class property. This enables Android to find the custom uuid. Change-Id: Ibe0bfcfe6ba7fa6b72a979153afccf17d6b4eb83 Reviewed-by: Fabian Bumberger --- src/bluetooth/qbluetoothserver.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/bluetooth/qbluetoothserver.cpp b/src/bluetooth/qbluetoothserver.cpp index e70ec1db..fbb688ec 100644 --- a/src/bluetooth/qbluetoothserver.cpp +++ b/src/bluetooth/qbluetoothserver.cpp @@ -207,10 +207,12 @@ QBluetoothServiceInfo QBluetoothServer::listen(const QBluetoothUuid &uuid, const QBluetoothServiceInfo::Sequence classId; classId << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::SerialPort)); - serviceInfo.setAttribute(QBluetoothServiceInfo::ServiceClassIds, classId); serviceInfo.setAttribute(QBluetoothServiceInfo::BluetoothProfileDescriptorList, classId); + //Android requires custom uuid to be set as service class + classId.prepend(QVariant::fromValue(uuid)); + serviceInfo.setAttribute(QBluetoothServiceInfo::ServiceClassIds, classId); serviceInfo.setServiceUuid(uuid); QBluetoothServiceInfo::Sequence protocolDescriptorList; -- cgit v1.2.3