summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Correct the use of QString::argThiago Macieira2017-04-031-4/+4
| | | | | | | | | | It returns an updated QString, without modifying the variable it was called on. Found by Clang when building: qbluetoothsocket_bluez.cpp:255:17: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result] Change-Id: I27b55fdf514247549455fffd14b1795de236d488 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Remove unused function convertAddressThiago Macieira2017-04-031-10/+0
| | | | | | | | Found by Clang: qbluetoothservicediscoveryagent_bluez.cpp:61:20: warning: unused function 'convertAddress' [-Wunused-function] Change-Id: I27b55fdf514247549455fffd14b1793f89f60f92 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix detecting simple NFC tagsOleg Evseev2017-03-311-6/+9
| | | | | | | | | Before this patch Qt NFC detects only NDEF tags and signals targetDetected/targetLost are never fired for simple tags Task-number: QTBUG-59455 Change-Id: Ic868b6d66f35f790f6aba0ec30afc96fa32a5b6a Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Oleg Evseev <ev.mipt@gmail.com>
* NFC on Android: Fix crash on restart of an app in debug buildv5.9.0-beta1Lars Schmertmann2017-03-162-1/+4
| | | | | | Task-number: QTBUG-59343 Change-Id: Ib474db8e9a8d38b3d5668499f838cb8d38e10625 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Ensure the passkey and pincode for pairing are randomAlex Blasche2017-03-141-2/+2
| | | | | | | | | | | | The previous AND operation with 1mio was not random (especially when the hex value was used). Task-number: QTBUG-59392 Change-Id: Id9ba5432c21fa41a9e5af9800a8633ce4f02fba4 Reviewed-by: Tuomas Vaarala <tuomas.vaarala@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix unused parameter warningAlex Blasche2017-03-131-0/+1
| | | | | | | | qnearfieldtarget_neard_p.cpp:52:54: warning: unused parameter `isPersistent` [-Wunused-parameter] bool QNearFieldTargetPrivate::setKeepConnection(bool isPersistent) Change-Id: Ib16e986f88452bb043afb973113747f56379ffaf Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-102-23/+39
|\ | | | | | | Change-Id: I26c44498f63bcb2628c186e4f1a7f563460b0327
| * Match connected device changes based on local device instanceAlex Blasche2017-02-172-23/+39
| | | | | | | | | | | | | | | | | | | | | | | | A new device connection is only ever for one particular device. Prior to this patch all local device instances (for different adapters) assumed the new connection request would be theirs. Task-number: QTBUG-57417 Change-Id: I0e7ced15cb83df4321284a297ac42b8786f9314b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | NFC on Android: Fix crash on restart of an appLars Schmertmann2017-03-081-0/+4
| | | | | | | | | | | | Task-number: QTBUG-59343 Change-Id: Id40844b428eb7ef781f8abc4dc3ce0c7469d178a Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Update QML export versions in QtConnectivity APIsAlex Blasche2017-02-284-9/+9
| | | | | | | | | | Change-Id: I141ad0e347883d035fb8ece4a9e7f540e2fe9aa2 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* | WinRT: Remove dummy warningv5.9.0-alpha1Oliver Wolff2017-02-083-6/+3
| | | | | | | | | | | | | | | | With classic bluetooth in place the dummy warning is no longer needed even though peripheral support is not implemented yet. Change-Id: Ia6e471cf74583d9ea704217687de272dc6d46433 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Rename WinRT logging categoryOliver Wolff2017-02-082-2/+2
| | | | | | | | | | | | | | | | While the bluetooth port was only available for Windows phone at the beginning it covers all winrt platforms now. Change-Id: I9b7ec7a914a481c692c7717e645ebf121d75ab73 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Remove WinPhone leftoversOliver Wolff2017-02-082-15/+2
| | | | | | | | | | Change-Id: I0bc4da9d8ac17930d509a55c8c5c6494dad4558f Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | winrt: Accept malformed profile descriptor list from applicationsOliver Wolff2017-02-081-0/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Other backends accept a malformed profile descriptor list which only contains a short uuid. WinRt seems to be more restrictive here and expects a nested sequence containing a short uuid and a version per entry. In order not to break existing applications the WinRT backend repairs the profile descriptor list's structure so that it is accepted as part of IRfcommServiceProvider's list of sdp attributes. Task-number: QTBUG-58529 Change-Id: Ic1754135bc139a732ac014728ef9341205a59e86 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | Provide support for QLEService::writeDescriptor() on Android PeripheralAlex Blasche2017-02-062-5/+60
| | | | | | | | | | | | | | | | This permits the server itself to change descriptors at runtime. Change-Id: I5d60cfb1838ba83737cd748671520c7072201bc4 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Add a small section describing how to enable Bluetooth loggingAlex Blasche2017-02-061-0/+8
| | | | | | | | | | | | Change-Id: Iffef04c75c35ebd0174c6e3ba6701ba5f8385296 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Add missing logging categories to QtBluetooth docsAlex Blasche2017-02-061-3/+9
| | | | | | | | | | | | | | | | and improve the general logging table content. Change-Id: I84c40a3a6e909bb62d1a59e74a91716bd13bcf0d Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Update platform feature table for QtBluetoothAlex Blasche2017-02-061-2/+2
| | | | | | | | | | | | | | Added Android Peripheral and WinRT Classic Bluetooth. Change-Id: I2c1d55553d3940eeb050d38ebf817a61620dafe7 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | QLowEnergyController: Fix spelling errorFriedemann Kleint2017-02-061-1/+1
| | | | | | | | | | Change-Id: I5f3e3e415730e36647ec0011c9fe0ed350d4cd62 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | winrt: Set proper socket state in setSocketDescriptorOliver Wolff2017-02-031-0/+1
| | | | | | | | | | Change-Id: I5469f696d0f20d563a67cdcc94af16faf6cac8ea Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | winrt: Use custom setSocketDescriptor functionOliver Wolff2017-02-033-8/+19
| | | | | | | | | | | | | | | | We have to use a similar approach to the one that is used on android as the ComPtr cannot reliably passed as an int. Change-Id: Ia52c78d4725fb3240eafa62fcb55531a282c0cd3 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | winrt: Register callbacks in Xaml threadOliver Wolff2017-02-032-14/+26
| | | | | | | | | | Change-Id: Ib32af0803e95229a1671055da4d5608f3fd3e0f6 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | winrt: maxPendingConnections must be lower than currently pending connectionsOliver Wolff2017-02-031-0/+6
| | | | | | | | | | Change-Id: Ie14506c0ad648413019c511d4d39dc8bd43d7405 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Document that BT servers on Android and WinRT only support RFCOMMOliver Wolff2017-01-311-0/+1
| | | | | | | | | | Change-Id: Ic93d086cc6b6549e8de90f01a0bba5913207d7e5 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | winrt: Add bluetooth server supportOliver Wolff2017-01-317-8/+682
| | | | | | | | | | | | Task-numer: QTBUG-37779 Change-Id: Ieb3ed5dfea7d60b3875cbe97bb26f8060bebcc17 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | winrt: Fix wrong function name in invokeMethod in bluetooth socketOliver Wolff2017-01-301-1/+1
| | | | | | | | | | Change-Id: I9fd9131c031328afa936a52e42371409e3fbac48 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | winrt: Fixed reading of string attributes in sequencesOliver Wolff2017-01-301-1/+4
| | | | | | | | | | Change-Id: I063668f9b95b95aa15a736b80e11d81c15cd1730 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | Allow using nfc when running as a serviceLars Schmertmann2017-01-271-11/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | With this change it will be possible to use a tag injected from outside when running as a service. Intent newIntent = new Intent(); newIntent.putExtra(NfcAdapter.EXTRA_TAG, tag); QtNative.onNewIntent(newIntent); Task-number: QTBUG-57646 Change-Id: I628d4357f023a0926e7d61914b39278342ac7161 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Implement QLEService::writeCharacteristic() for Android peripheralAlex Blasche2017-01-272-25/+230
| | | | | | | | | | | | | | | | | | | | | | This includes the correct handling of client characteristic notifications (CCNs). As per Bluetooth spec this descriptor is unique for each device. If a characteristic was changed all chars with enabled CCNs are notified. CCN settings are even retained while the remote device is not connected. Change-Id: Iec612e6a5e70206a6be0263e10e615c26def7559 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Avoid app crash on android when using nfc within a serviceLars Schmertmann2017-01-261-0/+2
| | | | | | | | | | Change-Id: I28a165c7b7503b1c8159dd0c46f3f7450e599c74 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Fix a lot of minor issues in the new Android peripheral backendAlex Blasche2017-01-244-13/+13
| | | | | | | | | | | | Change-Id: I3aa89926c5237ee8da18b73f66f0c7a321a83c91 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Android: Implement QLEService::descriptorWritten() signals for peripheralAlex Blasche2017-01-246-0/+99
| | | | | | | | | | Change-Id: I60e5bdce4256804754909c2538aebe581897e1e9 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Android: Implement QLEService::characteristicChanged() for peripheral modeAlex Blasche2017-01-246-3/+87
| | | | | | | | | | | | | | | | | | Emits the above signal when the remote client successfully updates a characteristic. Change-Id: I236b1f92b682028bc10be798192f46bffc981101 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-241-2/+35
|\| | | | | | | Change-Id: I9684e4cc76336250b235a261fdc8924a2ca70086
| * [REG] LE/Android: report ServiceDiscovered for an empty services as wellKonstantin Ritt2017-01-161-0/+6
| | | | | | | | | | | | | | | | a regression has been introduced by the service discoverer refactoring, causing an empty service to stuck in DiscoveringServices state for ever Change-Id: I1d339279e77f5409231d5fbd3677f9e2eb98a0a8 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * Improve likelyhood that BluetoothGatt.connectGatt succeedsAlex Blasche2017-01-131-2/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dreaded GATT_ERROR 133 (0x85) is a long standing issue in Android. There have been continued efforts to reduce it up until Android N: https://code.google.com/p/android/issues/detail?id=192561 Tests have shown that the new BluetoothGatt.connectGatt() overload is much more reliable. Android v23+ gets some relief and Android v21+ gets unofficial/hidden relief. Reports indicate that error 133 is timeing related. While the new connectGatt() call seems to resolve this problem it is throwing the timeing related error 22 more proactively. Very quick connect()/disconnect()/connect() calls can cause the error. The patch adds a more specific error code handling for error 22 to provide some hints on what the user can do to prevent it. Task-number: QTBUG-56078 Change-Id: Ib14d503701cee7ea766247b712106302cba896f3 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Android: Implement descriptor and char read/write for peripheralAlex Blasche2017-01-231-5/+85
| | | | | | | | | | | | Change-Id: I0fed368384fbfd4e9e8be74b7a586cbf2ed10218 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Android: Keep track of peripheral advertisement errorsAlex Blasche2017-01-236-0/+93
| | | | | | | | | | | | | | | | | | | | If advertisement fails then we drop back into the unconnected state and provide a more detailed error message for individual advertisement errors. Change-Id: Ic9de02b456409cd1a2dec11e53c884fe368ae267 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Android: Implement QLEC::stateChanged() notificationAlex Blasche2017-01-234-4/+92
| | | | | | | | | | | | Change-Id: Id2cabd9df7b5387fe5e6f1c898fe02e40f7c0a3d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Setup descriptor permissions for Android peripheralAlex Blasche2017-01-231-6/+85
| | | | | | | | | | | | Change-Id: Id40033b0745a720466a8466ad3c82ad804cadd9c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Setup characteristic permissions for Android peripheralAlex Blasche2017-01-231-4/+66
| | | | | | | | | | | | Change-Id: I32a3c4c711ac62ee89570534ae8c658a681bbdb8 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Android: Add access to BTLE connection parametersAlex Blasche2017-01-234-9/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately, Android only provides access to a very generic connection priority. The patch uses the minimalInterval() to determine the desired priority. Everything below 30ms is high priority and everything above 100ms is low priority. Every other value is balanced priority. QLowEnergyController::requestConnectionUpdate() was modified to permit access when the controller is connected, discovered or in the process of being discovered. The limiting factor is an existing physical connection. The documentation was updated to reflect Android's API limitations. [ChangeLog][QtBluetooth][Android] Added access to BTLE connection parameter settings. Task-number: QTBUG-53476 Change-Id: I3e22c65bd9598296a9219463dd05f0d9fc73599d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Add ability to export basic service data and advertiseAlex Blasche2017-01-236-11/+233
| | | | | | | | | | | | | | | | | | | | | | | | Advertisement data and Advertisement parameter in Qt are now connected to the Android/Java side. In addition the basic service structure is supported. Descriptors and char detail export are still missing. Change-Id: I941cba5e832d76ff7beca811d08a2148367c6bf5 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Connect QtBluetoothLEServer class to Qt's QLowEnergyController APIAlex Blasche2017-01-232-18/+37
| | | | | | | | | | | | Change-Id: I4403a9d5c79fae2c6bbe9c478660ead01dc16fe4 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Protect Android Gatt code behind version checksAlex Blasche2017-01-231-13/+37
| | | | | | | | | | | | | | | | | | | | | | | | Android Bluetooth LE Client support requires API v18 and Server support requires API v21. In fact earlier releases of Qt did not actually catch the v18 border at all. It excisted since Qt 5.5 already. Change-Id: I9baabf5138b2b0d48f8d09670c4feeef688681fd Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Android: Beginnings of Android Bluetooth Peripheral supportAlex Blasche2017-01-235-9/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | Focus is on the Java side of things. The Gatt server & LE advertiser can be started and stopped. This patch builds the foundation for future changes. The C++ side is only very rudimentary and a lot of debugging helper are left inside the new code sections. Change-Id: Ic56da3ec6471ccb438fc2088fbf5eeb3053d5cf1 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | winrt: Add bluetooth socket supportOliver Wolff2017-01-204-4/+711
| | | | | | | | | | | | | | Task-number: QTBUG-37779 Change-Id: I7fb49a6870768da956793b0d0681c371da939df9 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | winrt: Add service discoveryOliver Wolff2017-01-204-1/+635
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Windows 10 SDK versions < 14393 full service discovery is not supported. While GetRfcommServicesWithCacheModeAsync enables us to specify the lookup mode get_RfcommServices only returns cached services. To be able to offer some functionality for older version we use its results but give a warning about the limited abilites of this API in case of full service discovery. Task-number: QTBUG-37779 Change-Id: I21a15f8bb1d058780c8322ece2c3d9a285ecab25 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | winrt: Minor adjustments to QBluetoothLocalDeviceOliver Wolff2017-01-192-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The WinRT API does not provide functionality to obtain the state of the devices host mode. In order to make the examples (for example btscanner) work in winrt, the hostMode defaults to HostConnectable and the local device is always valid on this platform. Additionally the API only enables us to discover paired devices, so every device that is found, has to be in "Paired" state. Change-Id: I32359d0defdb9f8e1cc1a629d32da1214a669aff Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | winrt: Fixed null ptr access in LE device discoveryOliver Wolff2017-01-191-0/+4
| | | | | | | | | | | | | | | | | | | | For some devices DeviceInformation is null. These cases should not lead to a crash so we just ignore these devices. Change-Id: I9f55b6931c9790b4bdfe217fd506229d2125b78b Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>