summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothserviceinfo.cpp
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@digia.com>2013-09-23 13:52:35 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-25 10:37:27 +0200
commit85de7d64e85aa058f1777bc9d1a778790b1d50a6 (patch)
treea498afb7454905736cf589d3624ab68542ae04d8 /src/bluetooth/qbluetoothserviceinfo.cpp
parent85eac47703aa40df76e5102eb04291d8f029bfa3 (diff)
Fix peer to peer communication using two local adapters.
The code assumed to use the default adapter in a variety of places which caused wrong SDP registrations, device searches and peer names. The btchat examples was extended to cope with two local adapters. If there are more than two local adapters they will be ignored. Change-Id: I27d8bce65d943773e4e6cbd86982446fa79664a4 Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/bluetooth/qbluetoothserviceinfo.cpp')
-rw-r--r--src/bluetooth/qbluetoothserviceinfo.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/bluetooth/qbluetoothserviceinfo.cpp b/src/bluetooth/qbluetoothserviceinfo.cpp
index 4e2c0499..0a1d9ee5 100644
--- a/src/bluetooth/qbluetoothserviceinfo.cpp
+++ b/src/bluetooth/qbluetoothserviceinfo.cpp
@@ -152,21 +152,27 @@ bool QBluetoothServiceInfo::isRegistered() const
}
/*!
- \fn bool QBluetoothServiceInfo::registerService() const
+ \fn bool QBluetoothServiceInfo::registerService()
Registers this service with the platform's Service Discovery Protocol (SDP) implementation,
making it findable by other devices when they perform service discovery. Returns true if the
service is successfully registered, otherwise returns false. Once registered changes to the record
cannot be made. The service must be unregistered and registered again with the changes.
+
+ The \l localAdapter parameter determines the local Bluetooth adapter under which
+ the service should be registered. If \a localAdapter is \c null the default Bluetooth adapter
+ will be used. If this service info object is already registered via a local adapter
+ and this is function is called using a different local adapter, the previous registration
+ is removed and the service reregistered using the new adapter.
*/
-bool QBluetoothServiceInfo::registerService() const
+bool QBluetoothServiceInfo::registerService(const QBluetoothAddress &localAdapter)
{
- return d_ptr->registerService();
+ return d_ptr->registerService(localAdapter);
}
/*!
- \fn bool QBluetoothServiceInfo::unregisterService() const
+ \fn bool QBluetoothServiceInfo::unregisterService()
Unregisters this service with the platform's Service Discovery Protocol (SDP) implementation.
After this, the service will no longer be findable by other devices through service discovery.
@@ -174,7 +180,7 @@ bool QBluetoothServiceInfo::registerService() const
Returns true if the service is successfully unregistered, otherwise returns false.
*/
-bool QBluetoothServiceInfo::unregisterService() const
+bool QBluetoothServiceInfo::unregisterService()
{
return d_ptr->unregisterService();
}