summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Revert "qndefnfcsmartposterrecord.h: Fix build with headersclean check."v5.5.0-beta1Friedemann Kleint2015-04-211-4/+0
| | | | | | | | | | | Follow-up commit will fix the headers clean test properly by adding the missing assignment operator to QNdefNfcSmartPosterRecord. This reverts commit 2d4f7fd1f8d29175c8dab88a6d6cc72162511e1a. Change-Id: I9bbe381a429f695e70770ba7de33ecd704d63a86 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add assignment operator to QNdefNfcSmartPosterRecord.Friedemann Kleint2015-04-212-0/+13
| | | | | | | Required to pass the headersclean test. Change-Id: I0b274ee90c4172dde99dc2f8f60525466fb8d35f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Bluetooth LE - add readCharacteristic/readDescriptor (OS X/iOS)Timur Pocheptsov2015-04-205-66/+311
| | | | | | | Add read descriptor/characteristic support for iOS and OS X. Change-Id: If7547f3756dc37930052c9cefd243d6063bcab1c Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* qndefnfcsmartposterrecord.h: Fix build with headersclean check.Friedemann Kleint2015-04-201-0/+4
| | | | | | | | Skip check, required for qtbase/ 6668f5becfb8fcb6d10e42495c6ea5cdba2d15c5. Change-Id: Ie14c1f6201e60f71ce694323bf209422c7dba779 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Fix trailing commas in enumsAlex Blasche2015-04-204-6/+5
| | | | | | | This was caused by the new headersclean enforcing warnings as errors Change-Id: Idd595fc4cf78411a80ff3dbb46477d5130a04c3e Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
* Android: Avoid code duplication and don't break readWriteQueueAlex Blasche2015-04-151-82/+35
| | | | | | | | | | | | | | handleFor(Characteristic|Descriptor)() find a handle for a given char and desc. We should reuse it inside the read notifier for chars and descs. In addition, under certain circumstances the read/write queue operation was finished although the queue was not empty yet. This happened when the last read operation failed with a certain type of error. Now we always finish with a call to performNextIO(). Change-Id: Ifdb66c0b03d25ae19db7c49bcbe70eeec2665b6e Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Misc fixes based on code review commentsAlex Blasche2015-04-151-3/+3
| | | | | | | - doc fixes Change-Id: I4a5f413672d30c53be0cfcb022953e8ba3da6a83 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Make the QLEService unit test more error tolerantAlex Blasche2015-04-151-10/+11
| | | | | | | | | The service discovery sometimes takes longer than 10s on Adroid and there is really no point in testing the value of the System ID characteristic. This value is different for every device. Change-Id: Ib418e852e8a41db7483c5b47d2d0dc61f28b05b2 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Android: Fix read/write error reports when failure during initial callAlex Blasche2015-04-152-0/+38
| | | | | | | | | | | | | The BluetoothGatt.[read|write][Characteristic|Descriptor]() functions may immediately return under certain circumstances such as writing a read-only characteristic. So far, this "synchronous" form of error reporting was not handled. Any read error during the initial service dioscovery and its related cache population continues to surpress any read errors. Change-Id: I4987f67f4a0d2afe58cd144a577a19e0f0d43b33 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Android: Implement error reporting for char & desc readingAlex Blasche2015-04-156-17/+80
| | | | | | Change-Id: I5652075b4fde4d4927e86f5394baf176f263104f Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Fix enum value breakAlex Blasche2015-04-151-3/+3
| | | | | | | | | | | | | | | The new values CharacteristicReadError & DescriptorReadError were introduced in Qt 5.5 whereas all other values of the QLEService::ServiceError enum were introduced by Qt 5.4. The new values should not have been put in between the existing enum values as it breaks binary compatibility. Although the QLEService API is tech preview in Qt 5.4, there is no reason to break the compatibility here. In fact this broke the Android implementation as the enum values are hardcoded on the Java side. Change-Id: Ic263550f281e03c90f04ae8ae55d1054c1fd7ea6 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Android: Implement QLEService:readCharacateristic & readDescriptorAlex Blasche2015-04-152-74/+251
| | | | | | | | | | | | | In general we extend the concept of the write queue. Not only do we queue up write requests but also read requests. The handling of read errors is still missing. Right now the QLEService::error() signal is not emitted when a readCharacteristic() and readDescriptor() call fails. Change-Id: I4b4f086c351c4a29d6e48e8ee9079e9f33f36539 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Further improve QLEService class docs with regards to recent changes.Alex Blasche2015-04-151-16/+43
| | | | | Change-Id: Iba3ec93eb4ad1e6bca30f5ddffde2c80fcd25063 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Add tests for QLEService::readDescriptor()Alex Blasche2015-04-151-4/+31
| | | | | Change-Id: I84f6d76e89036d29f14f8ca326f3fa26e626ff63 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Add QLEService tests dealing with read and write error casesAlex Blasche2015-04-151-0/+230
| | | | | Change-Id: If3ea946371583b0011e6fb9533d4d5789db3739b Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Always read/write the GATT hardware even if meta data reports otherwiseAlex Blasche2015-04-153-15/+23
| | | | | | | | | | | | | | | | It is possible that a ATT attribute is not readable or writable. Usually this is reported via descriptors or other types of meta data. However it is possible that the meta data is reporting the wrong information. Therefore we always ensure that every read and write request is forwarded to the hardware. It is up to the hardware to respond to such requests. This change keeps the device usable in cases of buggy device meta data. This only affected writeCharacteristic() calls. Change-Id: Ieb2b95f47aa51c86a8ae7c4bebed4043d7478874 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com> Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Emit OperationError if char or desc is not part of current serviceAlex Blasche2015-04-152-40/+24
| | | | | | | | So far, the OperationError was not set. This improves the error feedback to the user. Change-Id: I37eccb2419d6ede3b9bd4e94b9e0538182d1db7e Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Add writeCharacteristic() test to encrypted characteristicAlex Blasche2015-04-151-4/+26
| | | | | | | The test is not automatic and the right hardware setup is required. Change-Id: I6ad9115e21cbd826cfe647a66f5b58f56a380a6f Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Add tests for QLES::readCharacteristic()Alex Blasche2015-04-151-10/+138
| | | | | | | | | | | | | | | | | The following types of tests are performed: 1. reading of char value that fits into single ATT packet 2. reading of char value that is not readable 3. reading of char value that is requires two ATT packets (blob reads) 4. reading of char value that is exactly as long as one ATT packet (this is different than case 1 as it triggers blob reads where the the first blob read packaet is empty) Cases 1 & 2 are done using the TI Sensor Tag. Cases 3 & 4 require programmable CSR dev kit. Those tests are not enabled by default and require manual setup. Change-Id: I402a7369abbbde6b8309bed8bef6b9a9441cabc9 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Bluez: Implement QLES::readCharacteristic()/readDescriptor()Alex Blasche2015-04-156-11/+178
| | | | | Change-Id: I418db6ea375b8e29def136b28b4fc25154d4ffe8 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Make new read(Descriptor/Characteristic)() API compile on OSX and iOSAlex Blasche2015-04-101-0/+30
| | | | | Change-Id: I19a1fd15a5cdc13b28f77fff02949a7895ddb0cb Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Minor doc fixesAlex Blasche2015-04-101-2/+2
| | | | | Change-Id: I8bf5a48b96fe27d66cd33adb0926591b2302bf8c Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Prevent characteristic write if service is not discoveredAlex Blasche2015-04-101-3/+2
| | | | | | | | Previously it was possible to issue the characteristic write request while the service was not discovered. Change-Id: Id370a2ae0f15860e28d1aee0624bdf13517e1e32 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Add ability to read characteristics and descriptorsAlex Blasche2015-04-104-5/+110
| | | | | | | This patch introduces the new API elements without any implementation. Change-Id: Ia2a4d4c588f2f2f219288967ed9cc69b13b682c6 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Merge branch '5.4' into 5.5Alex Blasche2015-04-017-117/+296
|\ | | | | | | Change-Id: I177affc6c60fd3cc55e914a7ea2a9aeba260906f
| * Android: Fix crash due to dangling pointer inputthreadAlex Blasche2015-03-311-0/+4
| | | | | | | | | | | | | | | | This happened when the remote device closes the socket and the local Android device tries to reconnect using connectToDevice(). Change-Id: I1d8e3bfaea5f956cd71e390f4ab6e9d39256a66d Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
| * Do not assert if encryption change was requested by somebody elseAlex Blasche2015-03-311-1/+3
| | | | | | | | | | | | | | | | | | This can happen if the QLowEnergyController was created, connected, disconnected and last but not least a second app reconnects. Direct BTLE device interaction with bluetoothctl can cause this. Change-Id: I4a2c68a018b7eb9b866a54cc127e03f6c4bf6672 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
| * Android: abort() QBluetoothSocket in its dtorAlex Blasche2015-03-301-0/+2
| | | | | | | | | | | | | | | | [ChangeLog][QBluetooth][Android] Forced QBluetoothSocket to close when its dtor is called Change-Id: Ie31a6b64e4939c800983b5c497532c6fcf90c7c0 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
| * Android: Fix crash when destructing socket during active connectAlex Blasche2015-03-302-73/+244
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling BluetoothSocket.connect in Java blocks for a certain amount of time. Previously, QtConcurrent::run() was used to separate the Java connect() call out into a different thread. Since the function executed by QtConcurrent and the user facing class shared data fields, a crash occurred if the user deleted QBluetoothSocket while QtConcurrent hadn't executed its service connect call yet. The problem is solved by using QThread and Standard signal/slots which separates the shared data members. The only remaining shared data member is Java's BluetoothSocket instance which is shared via QAndroidJniObject references. This is no problem as deleting one reference retains the other reference. Calling close() on an Android BluetoothSocket while a connect() is ongoing seems to be buggy. Sometimes the close() returns, the pending connect() throws an exception but the physical connection still gets established. To avoid this the patch queues the close() call up until after the connect() statement has returned. It is accepted behavior that the connection might still get enabled for a very brief moment despite a close() being issues before the connect() actually finished. The SocketConnectThread cleans itself up once the thread finished(). Task-number: QTBUG-44930 Change-Id: I8324497a7395de390529ecd0b97b1a326cd78f63 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
| * Fix crash in QBluetoothServiceDiscoveryAgent on Bluez 5.xAlex Blasche2015-03-232-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The list of internally discovered devices was already cleared. It should not be referenced anymore. Furthermore the QBluetoothSocket is killed while its internal QBluetoothServiceDiscoveryAgent is still running. This change stops the agent as well and thereby prevents more QBluetoothSocket slots froms being invoked and a more controlled termination of QBluetoothServiceDiscoveryAgent. [ChangeLog][QtBluetooth][Android] Fixed crash in QBluetoothServiceDiscoveryAgent on Bluez 5 when using single device discovery. Single device discovery is used during QBluetoothSocket::connectToService(). Task-number: QTBUG-44930 Change-Id: Ib3129c492151a3fe12b0c451cf5ffdddc62d001c Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * Minor code optimizationAlex Blasche2015-03-191-12/+2
| | | | | | | | | | | | | | | | | | QBluetoothSocketPrivate::close() was always called when the internal socket state has been set to ClosingState. The removed checks were meaningless. Change-Id: Ia36808a21de7dd1076cdd47bca8fd6855ec957c3 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
| * Android: Fix crash in QBluetoothLocalDevice ctor due to Java exceptionAlex Blasche2015-03-181-28/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In general BluetoothAdapter.getDefaultAdapter should not throw an exception. If the device does not support Bluetooth the function should return a null reference only. However some devices throw a RuntimeException as well. We need to catch it to prevent unwinding of the stack. At the same time the patch simplifies the code by using QAndroidJniObject where possible. [ChangeLog][QtBluetooth][Android] Fixed crash in QBluetoothLocalDevice ctor on some devices due to a platform exception in QBluetoothAdapter.getDefaultAdapter(). Task-number: QTBUG-45066 Change-Id: I933783cda891127e5e37722f96f477c13b433ca7 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
| * QLowEnergyController_bluez now responds to server requests.Christian Waßmuth2015-03-171-2/+14
| | | | | | | | | | | | | | | | | | | | | | The bluez implementation of QLowEnergyController now responds to requests with a "Request not supported" message, instead of ignoring it. If such requests are ignored, the remote will close the connection after 30 seconds, according to the bluetooth ATT specification. Task-number: QTBUG-44915 Change-Id: Id81b4a31d92a48269eda7d6c2d5995639dffe00a Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Don't remain on Service list page if the BTLE controller disconnectedAlex Blasche2015-03-311-0/+4
| | | | | | | | | | | | | | | | When a disconnect happened, this change ensures a more consistent UI flow. Change-Id: I0faafd79ac82b701a35d43d43c04bf211d8cd803 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* | Don't mix pixel and point sizeAlex Blasche2015-03-312-2/+2
| | | | | | | | | | | | | | | | | | | | | | The view is rather obscured because of this. Every other font size in this example uses point size except for these two elements. This mix of point and pizel size is not permitted. There seems to be a warning and probably related change in Qt 5.5 as well. Change-Id: I36a7e9f1648d23f5bc737393ae735bbc7d04b494 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* | Make the right Nfc import in qml examplesPeter Rustler2015-03-242-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The examples in nfc that uses qml need to import 5.5 instead of 5.2. This patch is cherry-picked from the qtconnectivity/neard branch. Change-Id: Ieb4dcfc3ec667d7a13c78a6d52d6c1a3c54f78eb Reviewed-by: Stephan Binner <stephan.binner@basyskom.com> Reviewed-by: Peter Rustler <peter.rustler@basyskom.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Bluetooth device discovery agent - minor cleanup (OS X)Timur Pocheptsov2015-03-242-6/+4
| | | | | | | | | | | | | | Use d_ptr; test inquiryLE in 'isValid' also (just to be consistent). Change-Id: If5a8977cfc7adfb06150a2bf8a2e14d0613e26c7 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Bluetooth (classic) service discovery - skip LE devices (OS X)Timur Pocheptsov2015-03-241-0/+7
| | | | | | | | | | | | | | | | | | LE scan on OS X can find LE devices, but CoreBluetooth does not expose hardware addresses and as a result we can not run (and should not) SDP scan on such devices - just skip them. Change-Id: Iaa5c47e1d317c39918d13830c9c6eeab398bc7a5 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Bluetooth - LE device discovery agent, timer bug (OS X)Timur Pocheptsov2015-03-246-14/+170
| | | | | | | | | | | | | | | | | | | | | | | | CBCentralManager does not have a timeout while scanning and we had to use a delayed selector (via performSelector) to interrupt the scan. This is a bug in the case we're in NSModalPanelRunLoopMode mode (for example) - selector never gets performed (it waits for the default mode) or performed too late. Found in our btchat example. Now we use external QTimer instead to check if it's time to stop a scan. Change-Id: I159bf5821398f3aa76f03a52a8334dea97cbf688 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Fix loading of image and show image beneath textsStephan Binner2015-03-241-10/+10
| | | | | | | | | | Change-Id: I3c623dc0db720083bc2c0c4ef53e70ccf208bfd8 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Bluetooth socket - fix invalid invokeMethod call on OS XTimur Pocheptsov2015-03-231-1/+1
| | | | | | | | | | | | | | | | | | | | While removing hand-written signatures from warnings/errors, the correct name in invokeMethod was accidentally replaced with Q_FUNC_INFO - must be '_q_writeNotify' instead, now fixed. Change-Id: I65225de7cd6e2fdce0cdd8b7c9f09609feb49ae3 Task-number: QTBUG-45177 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Fix storing of image MIME recordStephan Binner2015-03-231-0/+1
| | | | | | | | | | Change-Id: I0866be315d70a6e21b587130c246e8e06a954a36 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | OSX: Minor signal and readability fix for QBluetoothSocketAlex Blasche2015-03-191-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | 1.) QBluetoothSocketPrivate::close() is always called after the socket state has changed to ClosingState. The removed check was meaningless. 2.) Ensure socket is set to NotOpen and ClosingState before we start the socket's abort() process. Change-Id: Idf693be2068f77020113f38612b03565a2a89ca4 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* | OSX: Ensure service discovery is stopped when socket disconnectsAlex Blasche2015-03-191-0/+13
| | | | | | | | | | | | Task-number: QTBUG-44930 Change-Id: Iffdbe5d85a0c8b0168d6a196ffbe848e07535950 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* | Android: Replace call to deprecated getStaticObjectField() function.Christian Strømme2015-03-171-1/+1
| | | | | | | | | | | | | | | | The template version of QAndroidJniObject::getStaticObjectField() is deprecated. Use the non-template version instead. Change-Id: If60abfc33e55dbdfdfedb7c603f191285cd13eeb Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-03-171-1/+2
|\| | | | | | | Change-Id: I5e86b84a6a4a7eb3dd5d64855a9f6a435bd2dcb6
| * Fix case where BluetoothDevice.getServiceChannel() error is not handledAlex Blasche2015-03-051-1/+2
| | | | | | | | | | | | | | | | | | | | This applies to Android versions 4.1.x and below. The function returns BluetoothDevice.ERROR or -1 in case of an error. So far only the ERROR case was caught. Task-number: QTBUG-44792 Change-Id: I512f846d74f2a03b2e6f5bf4df4127d584993f6c Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* | Shift all OSX & iOS translations into C++ filev5.5.0-alpha1Alex Blasche2015-03-0610-52/+235
| | | | | | | | | | | | | | | | | | | | | | lupdate cannot parse .mm files. Therefore tr markup must be inside of C++ files. Some error strings where slightly modified to make use of already existing translations for other backends such as Bluez and QNX. Change-Id: I97fe6cfe2227e32fdbc61edd253080a1cd68edc9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | Further fixes to translated messages.Friedemann Kleint2015-03-053-4/+5
| | | | | | | | | | | | Change-Id: I7d5f9f8b9ad26ed607684c44e231eb0fcbcdc9ab Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Further fixes to Bluetooth UUID messages.Friedemann Kleint2015-03-021-11/+32
| | | | | | | | | | | | | | | | | | | | - Use Linguist comments instead of disambiguating strings for developer comments - Add Linguist comments for some abbreviations - Fix spelling. Change-Id: I5887be7c7c5ef9197b5bde8b0b46ba68690af0ef Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>