summaryrefslogtreecommitdiffstats
path: root/tests/bttestui/btlocaldevice.cpp
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@digia.com>2014-05-26 14:56:49 +0200
committerAlex Blasche <alexander.blasche@digia.com>2014-05-26 14:56:49 +0200
commitf334ea4b196950c4074e7513626aabeef3d99d7f (patch)
treeccb07d59afbb60a92b80a061645c8013aab9b96c /tests/bttestui/btlocaldevice.cpp
parent3910d9ffcc11db7b3beb7f2b6f0c1754103cfacb (diff)
parent552f1a164d627720942414915fb56ae7d3b7ef22 (diff)
Merge branch 'dev' into btle
Conflicts: examples/bluetooth/bluetooth.pro src/bluetooth/bluez/bluez.pri src/bluetooth/doc/src/bluetooth-index.qdoc src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp src/bluetooth/qbluetoothdeviceinfo.cpp src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp src/bluetooth/qbluetoothservicediscoveryagent_p.h src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp Change-Id: I88b22c51a4ee95b067ef8d2b2fddb5cbff4566f8
Diffstat (limited to 'tests/bttestui/btlocaldevice.cpp')
-rw-r--r--tests/bttestui/btlocaldevice.cpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/tests/bttestui/btlocaldevice.cpp b/tests/bttestui/btlocaldevice.cpp
index 148ba1aa..e70003ac 100644
--- a/tests/bttestui/btlocaldevice.cpp
+++ b/tests/bttestui/btlocaldevice.cpp
@@ -146,10 +146,20 @@ void BtLocalDevice::requestPairingUpdate(bool isPairing)
if (baddr.isNull())
return;
- if (isPairing)
- localDevice->requestPairing(baddr, QBluetoothLocalDevice::Paired);
- else
+
+
+ if (isPairing) {
+ //toggle between authorized and non-authorized pairing to achieve better
+ //level of testing
+ static short pairing = 0;
+ if ((pairing%2) == 1)
+ localDevice->requestPairing(baddr, QBluetoothLocalDevice::Paired);
+ else
+ localDevice->requestPairing(baddr, QBluetoothLocalDevice::AuthorizedPaired);
+ pairing++;
+ } else {
localDevice->requestPairing(baddr, QBluetoothLocalDevice::Unpaired);
+ }
for (int i = 0; i < foundTestServers.count(); i++) {
if (isPairing)
@@ -331,7 +341,7 @@ void BtLocalDevice::dumpServiceDiscovery()
qDebug() << "Discovered Devices:" << list.count();
foreach (const QBluetoothDeviceInfo &info, list)
- qDebug() << info.name() << info.address().toString();
+ qDebug() << info.name() << info.address().toString() << info.rssi();
}
if (serviceAgent) {
qDebug() << "Service Discovery active:" << serviceAgent->isActive();
@@ -467,7 +477,10 @@ void BtLocalDevice::readData()
if (socket) {
while (socket->canReadLine()) {
QByteArray line = socket->readLine().trimmed();
- qDebug() << ">>>>" << QString::fromUtf8(line.constData(), line.length());
+ qDebug() << ">> peer(" << socket->peerName() << socket->peerAddress()
+ << socket->peerPort() << ") local("
+ << socket->localName() << socket->localAddress() << socket->localPort()
+ << ")>>" << QString::fromUtf8(line.constData(), line.length());
}
}
}
@@ -605,7 +618,7 @@ void BtLocalDevice::clientSocketReadyRead()
while (socket->canReadLine()) {
const QByteArray line = socket->readLine().trimmed();
QString lineString = QString::fromUtf8(line.constData(), line.length());
- qDebug() << ">>(" << socket->peerName() << ")>>"
+ qDebug() << ">>(" << server->serverAddress() << server->serverPort() <<")>>"
<< lineString;
//when using the tst_QBluetoothSocket we echo received text back