summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
| * Fix QBluetoothSocket unit test failures on AndroidAlex Blasche2014-10-131-8/+22
| | | | | | | | | | | | Change-Id: Ib8800fa30c74678c74df9ed943b143ea4cf49bb2 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
| * Fix QBluetoothSocket::isReadable()/isOpen()/isWritable()Alex Blasche2014-10-131-12/+35
| | | | | | | | | | | | | | Change-Id: Ifd6b5ed8176aa7959ed8da0edc762266aa2bd6fa Task-number: QTBUG-32704 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
| * Remove nfctestserver test applicationAlex Blasche2014-10-018-609/+0
| | | | | | | | | | | | | | | | | | It is realted to nfc socket streaming which we don't support at this stage. Change-Id: Idae80decad7aa2cdf7eb67b82ddc3e20384df8b8 Reviewed-by: Martin Leutelt <martin.leutelt@basyskom.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
| * Fix QBluetoothServiceInfo uni test on platforms using fake server portsAlex Blasche2014-09-302-6/+56
| | | | | | | | | | | | | | | | | | | | Those platforms require a running QBluetoothServer to satisfy the prerequisites of calling QBluetoothServiceInfo::registerService(). This requirement is imposed by the public API contract anyway. Change-Id: I2498030fa2787df9745580cd744886693945fe4f Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | QtBluetooth - device discovery test on OS X.Timur Pocheptsov2014-10-162-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Enable this auto test on OS X, requires a modification: 'stop' is synchronous and so cancelSpy.isEmpty() == false (the last QVERIFY fails. - Fix several problems with SDK versions (workarounds for non-existing methods in SDK < 10.9). - Change error handling: we set an error in a ctor _only_ if QBluetoothAddress parameter was not null (!isNull()) and we failed to find a local device with such an address. This is the only case documented/expected, all others _do_ _not_ set an error, even if a local adapter is off or does not exits. This fixes a failing (to integrate) auto-test. Change-Id: I9902211078330f296775f1c3249da166c19001a4 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | QBluetoothServer - enable auto test on OS X.Timur Pocheptsov2014-10-022-5/+7
| | | | | | | | | | | | | | | | Enable test and skip the part, that tries to set host mode and check the success (setHostMode is a noop on OS X). Change-Id: Ib2583b9d0990c38445aaa44d62e778f5ac820141 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | QBluetoothLocalDevice - enable auto test on OS X.Timur Pocheptsov2014-10-022-3/+13
| | | | | | | | | | | | | | | | The patch enables this test, but has to skip several test like powerOn/Off and setHostMode - which is noop on OS X. Change-Id: I6ef5e76294e61808668e46ad53ceaadfd855c9c3 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | QtBluetooth - enable auto tests on OS X.Timur Pocheptsov2014-10-013-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | The first patch to enable tests - does not require any modifications in tests, just enabling the test. Add fix for publishedRecordWithDictioinary - this function is new in 10.9, deprecating withSDPRe..., but it crashed the test on 10.7 (and the same must happen on 10.8). Change-Id: I38e92cbc6f72fcaf8034824ef734148111139e0a Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | QtBluetooth - service discovery test.Timur Pocheptsov2014-09-301-1/+1
| | | | | | | | | | | | | | | | | | Run service discovery in 'FullDiscovery' mode (to make sure something is found at all on platforms where MinimalDiscovery works with cached results only). Change-Id: I33441dcba942ec3778b3d071ff90f64d483e497c Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | Merge branch '5.4' into btleAlex Blasche2014-09-264-9/+77
|\| | | | | | | Change-Id: Ic5f6b510e43afbebc9bb76aa7bcd68a27d4a4a9b
| * Add missing error() signal to QBluetoothTransferReplyAlex Blasche2014-09-181-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | The signal makes error handling much more conveniant. One error situation on QNX did not emit the required finished()/errorType() signals when required. A few minor typo fixes. Task-number: QTBUG-38983 Change-Id: I89c3fbee43921c8894a0ab200ee5550e7dc44543 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Upgrade ATT reads requests to encrypted links when indicatedAlex Blasche2014-09-161-1/+65
| | | | | | | | | | | | | | | | | | | | | | | | This is triggered if the GATT server complains about missing authorization/encryption when reading an attribute. The same mechanism has to be applied to all remaining read and write types Change-Id: Ia8330951ffdc61afb98424557bbeffe444e9a812 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Misc TODO and test fixesAlex Blasche2014-09-082-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 1.) Use updateValueOf*() where possible to channel all value changes through the same gate. 2.) BTLE connects have a much larger timeout when the remote device is not present. The device discovery could still turn up this device due to existing pairing information. 3.) Remove obsolete write long characteristic TODO Change-Id: I5b5815b0c3b99f8c4f87e0f1747ac6f1e274e592 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
| * Support writing of long characteristic valuesAlex Blasche2014-09-081-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In this context long means the characteristic value is longer than the maximal ATT message size. In such cases the Bluetooth spec demands a combination of PrepareWrite commands finished by an ExecuteWrite. This is very similar to reliable writes which use the same combination of prepare/execute but permit the atomic writing of multiple characteristics at the same time. Reliable writes are not (yet) supported by the public API. Also, this works for characteristics only. Long descriptor writes will follow. Change-Id: Id139ad1848c92ca5ebf1bd1dfe8e3da297312d4f Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* | Port QBluetoothLocalDevice and QBluetoothDeviceDiscoveryAgent to OS X.Timur Pocheptsov2014-09-167-0/+18
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QBluetoothLocalDevice and QBluetoothDeviceDiscoveryAgent for OS X - Bluetooth Classic (the implementation based on IOBluetooth). + a very simple non-gui test (requires QApplication to work though). Update 0: style issues reported by Qt-Bot + fix a test. Update 1: QBluetoothLocalDevice - display confirmation Update 2: Device discovery agent - follow the expected logic and apply suggested fixes. Update 3: started/finished delegate methods seems to be synchronous and immediately follow start/stop calls on an inquiry. Update 4: remove unused function and redundant error message. Update 5: the first attempt to fix pairingStatus/requestPairing on a local device. Update 6: on OS X it's impossible (with a given public API) to request 'Unpaired'. I was only able to find some quite terrible hacks with private APIs or even worse - playing with SystemConfiguration frameworks and changing System Preferencies programmatically (requires authorization and looks like a total hack, since it has nothing to do with Bluetooth framework). Update 7: A very limited support for deviceConnected and connectedDevices. Update 8: Fix an invalid invokeMethod's argument. Update 9: Subject changed. Update 10: fixes in a documentation. Update 11: asserts in a coding convetion/style. Update 12: "fix" asserts + emit errors if a start/stop failed. Update 13: deviceDisconnected implemented. Update 14: use not only paired && connected devices (QBluetoothLocalDevice::connectedDevices), but also devices discovered by the connection monitor. Update 15: remove a test, not required (there are 'auto' tests). Update 16: fix private headers - they MUST have _p suffix :( Update 17: tests are known to fail (at the moment) - IOBluetooth requires adjustment (QApplication instead of QCoreApplication, lack of ability to power on/off a device (not possible on Mac) + other things). Change-Id: Iea1c8a98f1fd719f4560ec8920d00cc07eaa8146 Reviewed-by: Alex Blasche <alexander.blasche@digia.com> Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Remove QLowEnergyServiceInfoAlex Blasche2014-09-036-292/+0
| | | | | | | | There is no need for this class anymore as QBluetoothServiceInfo covers the same information. Change-Id: I411a8abb68b34a3a4893a67ee9fac096f44bbd62 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add QLES::characteristicWritten() signalAlex Blasche2014-09-021-123/+83
| | | | | | | | | | | | The previous characteristicChanged() signal was emitted when the characteristic was updated due to a notification and when the value was changed using writeCharacteristic(). This meant that it was not possible to distinguish the two use cases. The new signal is only emitted in response to writeCharacteristic() whereas the old signal is only emitted when the peripheral indicates a change. Change-Id: Ie8797090f9463ae0e7fb053a42a79afa6829ca75 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Rename descriptorChanged() to descriptorWritten()Alex Blasche2014-09-021-2/+2
| | | | | | | | | | | | | | | | | This is the part of a change to be able to distinguish characteristic write confirmations from characteristic change notifications. Since descriptors cannot receive notifications they won't have a changed() signal and all existing descriptorChanged() signals become descriptorWritten() signals. The changed() signal is emitted when a value notification is received from the device. The written() signal is emitted when a write request from the API user was successful. Change-Id: Ief2491ead4723eaa1bca65a09a09c34458f33630 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add support for BTLE write command (BlueZ/Linux)Alex Blasche2014-09-021-15/+282
| | | | | | | | So far, we only supported write requests which reply with write responses. Change-Id: Ibdad36dcf18dec23260f003911b9361cc4ab1e3d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add a way to detect that the QLEController is performing a discoveryAlex Blasche2014-09-023-0/+54
| | | | | Change-Id: Ie3146c136461ad4ecde4169f3b30dda0c814ca7b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-08-281-7/+15
|\ | | | | | | | | | | | | Conflicts: src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp Change-Id: Ie8bf1903f9c7c1ccd5b05a3f97049ae0882b88b8
| * Fix L2CP socket connectionsv5.3.2Alex Blasche2014-08-271-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | L2CP's psm (the RFCOMM port equivalent) was never published via SDP. Therefore the service client could not get the required information to connect to the server. After this patch Qt properly publishes the psm. Also, QBluetoothSocket::connect() initiated a service discovery to obtain the missing psm. Since the published SDP entry didn't contain one, protocolServiceMultiplexer() always returned 0 and another service discovery was initiated. This caused a crash inside QBluetoothSocket because the 1st QBluetoothServiceDiscoveryAgent instance was deleted in favor of the 2nd. The patch changes the client behavior such that it doesn't crash if the service discovery didn't turn up a valid psm/port. It improves the robustness in case of an error and avoids a second service discovery (which wouldn't turn up more information anyway). The bug only affected Bluez as it is the only platform supporting pure L2CP sockets. Last but not least a capability to test L2CP sockets was added to bttestui. Change-Id: I46c88a67c2baa4782ea908e645dcd4db9422dbba Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* | Improve quint128 to QBluetoothUuid conversion performanceAlex Blasche2014-08-271-0/+13
| | | | | | | | | | | | | | The change improves the performance between 8-10%. Change-Id: I342e669d3f18cd2179b65f1af172db52303ff44c Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
* | Update license headers and add new licensesJani Heikkinen2014-08-2433-613/+349
| | | | | | | | | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I7a8b8b787fcae9a178794364efdefe1021d10b1b Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | Merge remote-tracking branch 'gerrit/5.4' into btleAlex Blasche2014-08-133-0/+32
|\ \ | | | | | | | | | Change-Id: I1e79c96602d0da2c2d36d6217bdfe7ff183e6df9
| * | Merge branch '5.3' into devAlex Blasche2014-07-173-0/+32
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/bluetooth/bluez/bluez.pri src/bluetooth/qbluetoothsocket_bluez.cpp Change-Id: Ieca8f2a327bf54b42403ddab88f8b9c3ff6b4a95
| | * Add code to test service discovery on specific remote deviceAlex Blasche2014-07-153-0/+26
| | | | | | | | | | | | | | | Change-Id: I548d17928fb371ba7dbf2010efb6995bc6f5ff2d Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
| | * Add ability to abort server sockets via bttestuiAlex Blasche2014-07-021-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | This equalizes the behavior of the Close and Abort button. Abort will disconnect the local client socket as well as all sockets which were established via the listening server socket. Change-Id: I68d3d7190641aab44612fa3fc00b38fdc31799a3 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* | | Characteristic and descriptor value() are no longer hex encodedAlex Blasche2014-07-231-108/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no point converting the data to its hex representation. The use case at hand will decide it in the current application context. The returned QByteArray is the raw byte array as it comes from the device. This behavior was legacy (introduced by the previous API) and subsequently it was simply adopted. Change-Id: If662c02a5e3c3d37cccb374add02e75522352894 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* | | Remove QBluetoothServiceDiscoveryAgent dependency from QLE unit testsAlex Blasche2014-07-233-98/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Services cannot always discovered via SDP. Therefore we can only run a device discovery and let QLEController do the service discovery. In addition we add the missing Connection Control service to the QLEController unit test. This service was introduced by a firmware update on the TI SensorTag. Change-Id: I52f172c0c4968c393779cd42275c548998dde8ce Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* | | Rename QLowEnergyControllerNew -> QLowEnergyControllerAlex Blasche2014-07-233-53/+53
| | | | | | | | | | | | | | | | | | | | | | | | Moves the new API into its place and completes the removal of the old API. Change-Id: I10a285e24e288aeb747cb1606574e27a4bf57308 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* | | Further cleanup QLowEnergyServiceInfoAlex Blasche2014-07-232-23/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removes obsolte code from the previos GATT API and other API elements which do not make any sense under the new API anymore. The entire purpose of QLowEnergyServiceInfo is also in question as it doesn't really contain BTLE specifics when compared to QBluetoothServiceInfo. This requires further API evaluation. Change-Id: Idfce724bb58150839f756745b87864054909dedb Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* | | Remove old GATT APIAlex Blasche2014-07-233-74/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | The subsequent patches will rename QLowEnergyControllerNew to QLowEnergyController and fix up the documentation fragments which still point to the old API. Change-Id: I084e6b1a85a17f424702018f3ad7047bda35d46a Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* | | Convert QLowEnergyHandle from quint32 to quint16Alex Blasche2014-07-162-75/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is in accordence with the maximal possible handle size of 0xffff as per Bluetooth spec. As a side effect processReply() had to be modified since endHandle (0xffff) + 1 caused a type overrun. Change-Id: Ibdd0ec49f6f5fba7cf875f92a52659c6961076e9 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* | | Add simpler API to retrieve descriptor/characteristic for certain uuidAlex Blasche2014-07-162-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | This new API is mostly syntactic sugar and reduces the amount of code to be written by API users. Change-Id: I51ff1ea706ac97199646d211e39e79c8140ee74b Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* | | Add ability to process notifications and indicationsAlex Blasche2014-07-161-14/+47
| | | | | | | | | | | | | | | Change-Id: I7e9436b99b84176d490b01605d721bf5eb014fa7 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* | | Add unit test for writing descriptorsAlex Blasche2014-07-151-5/+138
| | | | | | | | | | | | | | | Change-Id: Ic2bc8cbd12fd11122994afb8661e0aa5f2d0d92b Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* | | Add QLowEnergyService::contains(QLowEnergyDescriptor)Alex Blasche2014-07-151-2/+95
| | | | | | | | | | | | | | | | | | | | | | | | The patch adds extensive test code for the two contains() functions in QLowEnergyService. Change-Id: I640767b55ccad63e390478ccf14f2b47eb24de7f Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* | | Remove old API test from tst_qlowenergycontrollerAlex Blasche2014-07-151-558/+0
| | | | | | | | | | | | | | | | | | | | | | | | After the SensorTag firmware change the service verification data was obsolete anyway. Change-Id: I6027c0df280af5520aa73fd9f2c9c8570f8b9cb8 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* | | Update QLEConttroller unit test after SensorTag firmware updateAlex Blasche2014-07-151-94/+264
| | | | | | | | | | | | | | | | | | | | | | | | | | | Old firmware versions will fail now. If the test fails the firmware should first be updated. Currently the test uses firmware version 1.5. Change-Id: Id6dfd1bf0f969e714b0bdec8541994d953ebb8ee Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* | | Merge branch 'dev' into btleAlex Blasche2014-07-031-0/+2
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp Change-Id: Ib960b9e8d8800af84d2094bdf26c2652d4c81dba
| * | Merge branch '5.3' into devAlex Blasche2014-06-271-0/+2
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/bluetooth/qbluetoothlocaldevice_bluez.cpp src/bluetooth/qbluetoothlocaldevice_p.h src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp Change-Id: Ifb0c01eb8bffbffcd2416ea8d7bf1d36eb1c70f2
| | * Fix crash in bttestui when using default backendAlex Blasche2014-06-251-0/+2
| | | | | | | | | | | | | | | | | | | | | The cause are uninitialized pointers. Change-Id: I4ba5f79dbda3e20361fc1127fa08e93a2b7ce80e Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
| * | Compare the NDef records without using qHashAlex Blasche2014-05-281-6/+29
| | | | | | | | | | | | | | | | | | | | | | | | It seems Windows produces a different hash value compared to other platforms. Change-Id: I73669894d63ffca08dbc6ed010e923050a0c8e8f Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* | | Support writing of characteristicAlex Blasche2014-07-021-4/+146
| | | | | | | | | | | | | | | | | | | | | | | | Right now we assume that the target characteristic is writable with confirmation response. WriteNoResponse support is still missing. Change-Id: Ie584db43f80a0bf90ec67499772488f509fc3d29 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* | | Add comparison operators for QLECharacteristic & QLEDescriptorAlex Blasche2014-07-022-0/+89
| | | | | | | | | | | | | | | Change-Id: I5e23af887aa423c6c80335399d0342bec964f6d2 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* | | Rewrite QLowEnergyCharacteristic unit testAlex Blasche2014-07-025-231/+321
| | | | | | | | | | | | | | | | | | | | | | | | This change incorporates the change from QLECharacteristicInfo to QLECharacteristic. Change-Id: I0fc6d31b60975e3b0cccc7666df9c0555350f40f Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* | | Rewrite Descriptor class unit testAlex Blasche2014-07-026-217/+269
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Rename test due to class renaming - Test all class properties - Fix QLowEnergyDescriptor::uuid() when using invalid descriptor - Fixup dead code in QLowEnergyController unit test Change-Id: I5ffed5b67db786e6c2d9752ca51d2ede51e3f176 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* | | Add more unit testing to verify robustness of L2CP communicationAlex Blasche2014-07-021-3/+185
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Verifies that multiple services can be discovered at the same time and confirms the correct behavior of the controller when reconnecting (old service objects become invalid but retain data and new service objects have same data and are valid). Change-Id: I7e5a809a050c6effaac9a9dc90024be8a5e8d418 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* | | Add ability to read value of all discovered descriptorsAlex Blasche2014-07-021-16/+58
| | | | | | | | | | | | | | | Change-Id: I92fcfcae7727b0d6b4b6d642f33218a6a321c1de Reviewed-by: Fabian Bumberger <fbumberger@rim.com>