From 74449f1b0b2952dcbad9525c167b36fbf908696f Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Tue, 8 Apr 2014 17:48:23 +0200 Subject: Add Bluez5 support for QBluetoothLocalDevice The pairing signals are not yet implemented. For details see QTBUG-38401. Task-number: QTBUG-32085 Change-Id: I2b4e9a97b880801ebbffe367a8ab98320dd7ef2f Reviewed-by: Robin Burchell --- tests/bttestui/btlocaldevice.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'tests/bttestui/btlocaldevice.cpp') diff --git a/tests/bttestui/btlocaldevice.cpp b/tests/bttestui/btlocaldevice.cpp index 3a9b52b5..d67b13fb 100644 --- a/tests/bttestui/btlocaldevice.cpp +++ b/tests/bttestui/btlocaldevice.cpp @@ -144,10 +144,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) -- cgit v1.2.3