summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabian Bumberger <fbumberger@rim.com>2013-10-01 14:20:26 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-01 15:53:59 +0200
commiteefe516bd08771d037afafc833764ebaa6ff213e (patch)
treea7de9029265fdebc4036e87188d50c945ab38086
parent80884c9842899094574635e872fc717aaaa8814c (diff)
Change the service properties in btchat example
And adding some links to the documentation. Change-Id: I7f9baf6a648547ef028f9521b0d88b88267fa301 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
-rw-r--r--examples/bluetooth/btchat/chatserver.cpp9
-rw-r--r--src/bluetooth/qbluetoothserviceinfo.cpp6
-rw-r--r--src/bluetooth/qbluetoothuuid.cpp4
3 files changed, 15 insertions, 4 deletions
diff --git a/examples/bluetooth/btchat/chatserver.cpp b/examples/bluetooth/btchat/chatserver.cpp
index 8b1bf6f0..0b29b87b 100644
--- a/examples/bluetooth/btchat/chatserver.cpp
+++ b/examples/bluetooth/btchat/chatserver.cpp
@@ -73,11 +73,16 @@ void ChatServer::startServer(const QBluetoothAddress& localAdapter)
}
//! [Create the server]
- serviceInfo.setAttribute(QBluetoothServiceInfo::ServiceRecordHandle, (uint)0x00010010);
+ //serviceInfo.setAttribute(QBluetoothServiceInfo::ServiceRecordHandle, (uint)0x00010010);
//! [Class Uuuid must contain at least 1 entry]
QBluetoothServiceInfo::Sequence classId;
- classId << QVariant::fromValue(QBluetoothUuid(serviceUuid));
+
+ classId << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::SerialPort));
+ serviceInfo.setAttribute(QBluetoothServiceInfo::BluetoothProfileDescriptorList,
+ classId);
+
+ classId.prepend(QVariant::fromValue(QBluetoothUuid(serviceUuid)));
serviceInfo.setAttribute(QBluetoothServiceInfo::ServiceClassIds, classId);
//! [Class Uuuid must contain at least 1 entry]
diff --git a/src/bluetooth/qbluetoothserviceinfo.cpp b/src/bluetooth/qbluetoothserviceinfo.cpp
index 5ff48b4e..c38d5bbc 100644
--- a/src/bluetooth/qbluetoothserviceinfo.cpp
+++ b/src/bluetooth/qbluetoothserviceinfo.cpp
@@ -110,10 +110,12 @@ QT_BEGIN_NAMESPACE
Bluetooth service attributes. Please check the Bluetooth Core Specification for a more detailed description of these attributes.
\value ServiceRecordHandle Specifies a service record from which attributes can be retrieved.
- \value ServiceClassIds UUIDs of service classes that the service conforms to.
+ \value ServiceClassIds UUIDs of service classes that the service conforms to. The
+ most common service classes are defined in (\l QBluetoothUuid::ServiceClassUuid)
\value ServiceRecordState Attibute changes when any other service attribute is added, deleted or modified.
\value ServiceId UUID that uniquely identifies the service.
- \value ProtocolDescriptorList List of protocols used by the service.
+ \value ProtocolDescriptorList List of protocols used by the service. The most common protocol Uuids are defined
+ in \l QBluetoothUuid::ProtocolUuid
\value BrowseGroupList List of browse groups the service is in.
\value LanguageBaseAttributeIdList List of language base attribute IDs to support human-readable attributes.
\value ServiceInfoTimeToLive Number of seconds for which the service record is expected to remain valid and unchanged.
diff --git a/src/bluetooth/qbluetoothuuid.cpp b/src/bluetooth/qbluetoothuuid.cpp
index 5426e943..fcf5a5f7 100644
--- a/src/bluetooth/qbluetoothuuid.cpp
+++ b/src/bluetooth/qbluetoothuuid.cpp
@@ -96,6 +96,8 @@ Q_GLOBAL_STATIC_WITH_ARGS(QUuid, baseUuid, ("{00000000-0000-1000-8000-00805F9B34
\value McapControlChannel Multi-Channel Adaptation Protocol UUID
\value McapDataChannel Multi-Channel Adaptation Protocol UUID
\value L2cap L2CAP protocol UUID
+
+ \sa QBluetoothServiceInfo::ProtocolDescriptorList
*/
/*!
@@ -161,6 +163,8 @@ Q_GLOBAL_STATIC_WITH_ARGS(QUuid, baseUuid, ("{00000000-0000-1000-8000-00805F9B34
\value HDP Health Device Profile
\value HDPSource Health Device Profile
\value HDPSink Health Device Profile
+
+ \sa QBluetoothServiceInfo::ServiceClassIds
*/
/*!