diff options
author | Alex Blasche <alexander.blasche@digia.com> | 2014-01-24 14:12:46 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-28 07:12:40 +0100 |
commit | 7644b7184ab5c304594bb3298c41405374203592 (patch) | |
tree | e7168500c8e9dd2ded9819a0ff3e5344378f1589 /src/bluetooth | |
parent | 77b974742faa61e21e6e5c87ebff84e19211bea6 (diff) |
Fix broken SDP discovery on QBluetoothSocket
ThHis is only used on Bluez at this stage. THe SDP agent was initialized
with the local adapter being the remote address of the remote service.
This could never work. The remote address is now properly set (being the
handed over bt address to QBluetoothSocket::connectToService()).
[ChangeLog][QtBluetooth][QtBluetoothSocket] Fixed incorrect
invocation of QBluetoothDiscoveryAgent where the remote service address
was incorrectly assumed to be the local Bt adapter address. This prevented
the detection of the remote service. This bug only affects the Bluez
backend.
Change-Id: Ice2b9c351bfd42f1f4398b14ac68f76315f01fa8
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Diffstat (limited to 'src/bluetooth')
-rw-r--r-- | src/bluetooth/qbluetoothsocket.cpp | 4 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothsocket_bluez.cpp | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/bluetooth/qbluetoothsocket.cpp b/src/bluetooth/qbluetoothsocket.cpp index 4b3cdd21..9eaf6758 100644 --- a/src/bluetooth/qbluetoothsocket.cpp +++ b/src/bluetooth/qbluetoothsocket.cpp @@ -488,10 +488,12 @@ void QBluetoothSocket::doDeviceDiscovery(const QBluetoothServiceInfo &service, O qCDebug(QT_BT) << "Starting discovery"; if(d->discoveryAgent) { + d->discoveryAgent->stop(); delete d->discoveryAgent; } - d->discoveryAgent = new QBluetoothServiceDiscoveryAgent(service.device().address(),this); + d->discoveryAgent = new QBluetoothServiceDiscoveryAgent(this); + d->discoveryAgent->setRemoteAddress(service.device().address()); //qDebug() << "Got agent"; diff --git a/src/bluetooth/qbluetoothsocket_bluez.cpp b/src/bluetooth/qbluetoothsocket_bluez.cpp index a3048546..13ae2b93 100644 --- a/src/bluetooth/qbluetoothsocket_bluez.cpp +++ b/src/bluetooth/qbluetoothsocket_bluez.cpp @@ -361,7 +361,7 @@ QString QBluetoothSocketPrivate::peerName() const convertAddress(addr.l2_bdaddr.b, bdaddr); } else { - qCWarning(QT_BT_BLUEZ) << "peerName() called on socket of known type"; + qCWarning(QT_BT_BLUEZ) << "peerName() called on socket of unknown type"; return QString(); } |