summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* 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>
* 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>
* | | Fix a bug whereby the last descriptor of a service was always skippedAlex Blasche2014-06-261-10/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was caused by the service end handle being used as starting handle for the next service. Very often the last service handle is a descriptor attribute. Most debug output shifted to categorised logging. Change-Id: I6cdd4a6bc43a6290c42674c805d4be2da9d48977 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* | | Introduce QLowEnergyDescriptorAlex Blasche2014-06-261-59/+211
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The class is based in QLowEnergyDescriptorInfo and exposes the found descriptor information. The only missing piece of information is the descriptor value. Extends the QLowEnergyController unit test in such a way that descriptor information is tested too (except for values). Change-Id: I6ba6a862fff48fbdd27cd8219d2eb8f6d0058aea Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | | Read characteristic values on BluezAlex Blasche2014-06-261-1/+473
| | | | | | | | | | | | | | | Change-Id: I6427c6dad133ca11852f5295cf37720addec7644 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* | | Send and process ReadByType request/responsesAlex Blasche2014-06-201-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The characteristic information is not yet incorporated into the internal QLEService data strcutures. This change introduces the concept of a pending request queue to be able to refer to the request's context information when processing the response. Change-Id: Id699856543b0fd3a8471721b48679f917096a99b Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* | | Don't require the user to create all service objects if not neededAlex Blasche2014-06-191-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | QLEControllerNew hands out QObject's per requested uuid and the caller owns the QObject. Change-Id: Ib81084df47821657cd3bc731c15500f215b0c507 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* | | Unify the shared data types between controller and service classAlex Blasche2014-06-191-5/+5
| | | | | | | | | | | | | | | | | | | | | This reduces the overhead and simplifies the data structures Change-Id: Iddf184a6d3de5ac253c889f2223a09f2fe08ce15 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | | Connect QLowEnergyService and QLowEnergyControllerNew classesAlex Blasche2014-06-191-22/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensures that the two classes have sufficient references to each other. When the controller disconnects the related QLES classes should become invalid. Introduces an error flag for QLowEnergyService. Change-Id: I28aee49e45f93c68c4ac69a5e489c0a3cc33dbf5 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | | Shift local Bt adapter validation out of constructorAlex Blasche2014-06-181-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | It can emit error signals which cannot be received while still running the ctor. Add documentation on how this affects the localAddress() function. Change-Id: I144ea7277470f7db498b49952a9525d29c43183a Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* | | Push improved API.Alex Blasche2014-06-171-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | QLowEnergyService represents each single service on the remote BTLE device. QLowEnergyControllerNew acts as factory for QLowEnergyService instances. Change-Id: I07c6bfae6d14b73a80e8314f6e8471285fccf069 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>