summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Bluetooth: Add API to set up GATT services.Christian Kandeler2015-11-2015-8/+1055
| | | | | | | This is the next step in implementing LE peripheral support. Change-Id: I5e8cb186d556e7bfb9ae8a5e60e051ff7398b77d Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* QLowEnergyController: Listen for and accept GATT connection requests.Christian Kandeler2015-11-194-5/+132
| | | | | | | BlueZ only. No requests are handled yet. Change-Id: I25058989beb5b3ae02a4f43eeaec09c8225198dc Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* QBluetoothSocket: Do not report an error when the connection closes.Christian Kandeler2015-11-171-2/+2
| | | | | | | | Higher-level code should decide whether a remote device disconnecting constitutes an error or not. Change-Id: I50d7524d2684dbbbfc8df5667e227748fb31cee4 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Bluetooth: Introduce API for LE advertising.Christian Kandeler2015-11-1718-21/+1713
| | | | | | | And provide an implementation for BlueZ. Change-Id: I302aee7c43b77016d9e1e7a0d5bcbf00096abf76 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Bluetooth: Introduce convenience "put data" function for quint* types.Christian Kandeler2015-11-121-0/+14
| | | | | | | | | | Users can just call the function regardless of the concrete type, and it will do the right thing with regards to casting and edianness. This will come in handy when implementing GATT server functionality, where lots of generic packet creation needs to happen. Change-Id: Id6315bc1fd628bdfb84c1b91c7c8b50925f24d32 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Merge remote-tracking branch 'gerrit/5.6' into devAlex Blasche2015-11-1113-79/+125
|\ | | | | | | Change-Id: I9303c9e168afa9bea87a63abe8774c8f2fee5f3e
| * QLowEnergyController: Add missing error string for ConnectionError.Christian Kandeler2015-11-101-1/+5
| | | | | | | | | | | | | | | | Also remove the default case from the switch so the next such oversight causes a compiler warning. Change-Id: If332a9a00698debb834462f442dddb0dac40b83d Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * Add comment that QBluetoothSocket only supports asynch read/writeAlex Blasche2015-11-021-0/+3
| | | | | | | | | | | | Task-number: QTBUG-38916 Change-Id: Ibd425ca24a1a98433f7b9d8b1fa11a7c287de871 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
| * Doc: minor link issuesNico Vertriest2015-10-302-2/+2
| | | | | | | | | | | | Change-Id: Ibd0da6662aca93d9ddd9d0a71b6ec81d983e2900 Task-number: QTBUG-43810 Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
| * CoreBluetooth - simplify osxbledeviceinquiry's code.Timur Pocheptsov2015-10-292-42/+43
| | | | | | | | | | | | | | | | Replace pendingStart and isActive + all places they have to be modified with scanPhase and enum {startingScan, activeScan, noActivity}. Change-Id: I29edff3b99fc877d0d52a5974aa64c9ff2faa584 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * Core Bluetooth - give a user the second chance to enable BluetoothTimur Pocheptsov2015-10-291-11/+52
| | | | | | | | | | | | | | | | | | | | | | On iOS when we receive centralManagerDidUpdateState with the state == PoweredOff, iOS also shows an alert on screen, asking to enable Bluetooth via the "Settings" app. If we do not report an error and a user indeed enables BT, we can continue to work. Change-Id: Ic1f63f205b56fc356bc7fa645359b583c00195a6 Task-number: QTBUG-48713 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * Bluetooth: Put some data types into the Qt namespace.Christian Kandeler2015-10-231-0/+4
| | | | | | | | | | | | | | There's no reason they should be outside. Change-Id: I597c7c07857c9af820fcdb93e1587f62a2064ab3 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * Doc: Update examplesinstallpath to include the repository nameTopi Reinio2015-10-212-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The examplesinstallpath variable in .qdocconf files defines the path under QT_INSTALL_EXAMPLES where examples are found. To match the way examples are packaged in Qt 5.6, prefix the install path with the repository name. Task-number: QTBUG-48736 Change-Id: I3452cf1ec1b1f16301497eb5468bd746d99e5cbc Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
| * Bluetooth: Fix value of an ATT error type.Christian Kandeler2015-10-161-4/+10
| | | | | | | | | | Change-Id: I2239624dd411daf400e987ec092be48805b8fa57 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * Bluetooth socket: Simplify address conversion.Christian Kandeler2015-10-153-30/+17
| | | | | | | | | | | | | | | | In most cases, callers of convertAddress() feed the result into a QBluetoothAddress, so they have no need for the output parameter. Change-Id: I23b2e8d5d49ac300c35d141b75ffa8e398e22f19 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-10-1437-11/+391
|\| | | | | | | Change-Id: Ieb4c4a3ce134e53b1387ccedae029d5a9ade92f8
| * Merge remote-tracking branch 'gerrit/5.5' into 5.6Alex Blasche2015-10-131-0/+2
| |\ | | | | | | | | | Change-Id: I9d78ba7ad02848e3166a29c9f2d4876dd1bc1e96
| | * CoreBluetooth - update for iOS 9.0Timur Pocheptsov2015-10-122-10/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New SDK removed deprecated properties/methods and we have a compilation error as a result. Use performSelector instead of direct calls to make sure: 1. it compiles 2. it calls an existing method. This is a backport of 371818e71839280abafae858e9bb53c4ee6b9e5e. Task-number:QTBUG-48518 Change-Id: I10a2d062f9e71229a1e218d9d167a4132b97b6ab Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| | * Bluetooth device discovery agent (bluez): Prevent null pointer access.Christian Kandeler2015-10-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | We would potentially access a null adapter if stop() was called from a user slot connected to the deviceDiscovered() signal. Task-number: QTBUG-48481 Change-Id: I784120dcd7a9f71d9532fac9538ae98e1a329db2 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * | Add missing "We mean it" comments to private headers.Friedemann Kleint2015-10-0932-0/+352
| | | | | | | | | | | | | | | Change-Id: I4e78a2b263fb779253556201fd20fe47a2afc58e Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * | CoreBluetooth - update for iOS 9.0Timur Pocheptsov2015-10-082-10/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New SDK removed deprecated properties/methods and we have a compilation error as a result. Use performSelector instead of direct calls to make sure: 1. it compiles 2. it calls an existing method. Task-number:QTBUG-48518 Change-Id: I10a2d062f9e71229a1e218d9d167a4132b97b6ab Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * | Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-10-022-1/+6
| |\| | | | | | | | | | Change-Id: I0f261e312e052855a47a3985b62c40c2f0338119
| | * Tweak documentation terminologyAlex Blasche2015-09-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | "frozen" might be interpreted as "no further changes in the future" Change-Id: If99cabb0c352460bb9904cc277da5a8de8984bbc Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
| | * Improve QBluetoothDeviceInfo::deviceUuid() documentationAlex Blasche2015-09-031-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The device uuuid is only used on OS X and iOS. QBluetoothDeviceInfo::setDeviceUuid() already stated this limitation. The getter function was not. This patch fixes the oversight. Change-Id: I900b885c922b4248abe6f60fe38deea952605bf8 Task-number: QTBUG-48022 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* | | Merge remote-tracking branch 'gerrit/5.6' into devAlex Blasche2015-09-2223-154/+288
|\| | | | | | | | | | | Change-Id: I429976979c83e7b14c3c7d4f8acabdfc1850deac
| * | Use the new way of disabling strict C++ supportThiago Macieira2015-09-211-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | 4684c1afe5fdb3774d56d85a52b2feaab1b8de2c in qtbase added the feature to default_post.prf Change-Id: I42e7ef1a481840699a8dffff14051bf3b83c69c2 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * | [Bluetooth] Optimize loopsKonstantin Ritt2015-09-1615-100/+196
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Decrease complexity from O(N+N*logN) to just O(N) for cases like foreach (Key key, map.keys()) Value value = map.value(key); , by rewriting with use of iterators. Change-Id: I81f1334797f16b624293fcebdee885b2be3c89f1 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * | A nano optimization to QLowEnergyServiceKonstantin Ritt2015-09-162-17/+8
| | | | | | | | | | | | | | | | | | | | | Rearrange condition to fail earlier for an invalid service object. Change-Id: I3ee0c611bab5610352ea4a058edd4af810212aaf Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * | bluez: SDP: find a device before creating it.Robin Burchell2015-09-153-13/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To enable service discovery for known devices even if org.bluez.Adapter.CreateDevice has security restrictions, call org.bluez.Adapter.FindDevice first and CreateDevice only if the device isn't already known. The change is needed due to runtime security checks on Jolla devices, but reordering the calls does no harm when used with upstream bluetoothd. Change-Id: I8ad09808cec648f5b5949044c60173ff1ad46332 Task-number: MER#1225 Done-by: Hannu Mallat <hannu.mallat@jollamobile.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * | QBluetoothSocket's securityFlag exists since Qt 5.6 and not 5.5Alex Blasche2015-09-151-2/+2
| | | | | | | | | | | | | | | Change-Id: I13c7ec6b588280f01ce13699199177c45040645e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
| * | Introduce QML Nfc 5.6 versionv5.6.0-alpha1Alex Blasche2015-08-252-3/+9
| | | | | | | | | | | | | | | Change-Id: I99b6dc6c23dd94ff3bca413ba644018880d75eba Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
| * | Introduce QML Bluetooth 5.6 version.Alex Blasche2015-08-252-5/+5
| | | | | | | | | | | | | | | Change-Id: I6acf0153ae92371183c181c9218f614670f0419c Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
| * | Stop device discovery session before retrieving service records.Robin Burchell2015-08-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each org.bluez.Adapter.StartDiscovery should be paired with a corresponding StopDiscovery; it is not enough to merely observe that an adapter's Discovering property momentarily changes from true to false. Change-Id: Iee4ea4119cb4b6cd78982385bf18970d5b48d2de Task-number: MER#1230 Done-by: Hannu Mallat <hannu.mallat@jollamobile.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * | bluez: Fix some memory leaks on device discovery.Robin Burchell2015-08-201-2/+7
| | | | | | | | | | | | | | | | | | | | | QDBusPendingCallWatcher will leak if it isn't deleted. Change-Id: I5571dfbc087f54308193dc89127e974e6d2e9275 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * | bluez: peername: find a device before creating it.Robin Burchell2015-08-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To enable reading peername for known devices even if org.bluez.Adapter.CreateDevice has security restrictions, call org.bluez.Adapter.FindDevice first and CreateDevice only if the device isn't already known. The change is needed due to runtime security checks on Jolla devices, but reordering the calls does no harm when used with upstream bluetoothd. Change-Id: I4a86840487a8b4c90759044b7c995815c77a7609 Task-number: MER#1225 Done-by: Hannu Mallat <hannu.mallat@jollamobile.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * | To check for errors when starting discovery, wait for the call.Hannu Mallat2015-08-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Errors can't be known until the call runs. Change-Id: I68687ba8c813da922ca2c0906f9d33414333d87d Task-number: MER#1231 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * | Merge remote-tracking branch 'gerrit/5.5' into 5.6Alex Blasche2015-08-193-7/+34
| |\| | | | | | | | | | Change-Id: I54b8430309c4eaea9113cd28d0b2034071801456
* | | Tests: Remove QT_DISABLE_DEPRECATED_BEFORE=0.Friedemann Kleint2015-08-251-2/+2
| | | | | | | | | | | | | | | | | | | | | Fix usage of API that is marked deprecated. Change-Id: I82fe0911f6783a709356211b001e1d377f694642 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | | Merge remote-tracking branch 'origin/5.5' into devFrederik Gladhorn2015-08-093-7/+34
|\ \ \ | |/ / |/| / | |/ Change-Id: If4411ac45ddf612ddfa450a7f62cbce66172ccfd
| * Parse all char descriptions in one goAlex Blasche2015-07-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | ATT_OP_READ_BY_TYPE_REQUEST may return more than one char description per response packet. Due to a missing offset adjustment we only ever read the first description. Subsequent description were read by issuing a new READ_BY_TYPE request. This is very inefficient as at worst 3 times as many requests had to be send to the device. Change-Id: I83ca75a42425fe230926411f068112865c249061 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * Add debug option to sdpscanner permitting plain text output of scan resultsAlex Blasche2015-07-131-4/+30
| | | | | | | | | | Change-Id: I8b2c8931b3755306491deff51b57d1476fe87e3a Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
| * Do not cut 32bit value down to 16bitAlex Blasche2015-07-132-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | handledata contains a 16bit char handle in the lower bits and may contains a 16bit descriptor handle in its upper 16 bits. When doing blob read requests for descriptors the upper 16 bit may be cut off and the descriptor read turns into a characteristic read. In turn this switches the internal state of the service discovery state machine causing an endless loop between descriptor and characteristic reads. Change-Id: Ia66f230e8fb018da51c3ce32db936d02a0b195b8 Task-number: QTBUG-47028 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
| * Cut high bits from QLECharacteristic::PropertyTypesAlex Blasche2015-07-131-1/+1
| | | | | | | | | | | | | | | | The enum value is 32 bit. the field we are reading is 8bit. Ensure that the higher bits are always set to 0. Change-Id: I317a877e23645c2785fd75e38494103f2272d2cd Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* | Add missing metatype registration related functions for Q_ENUMsOliver Wolff2015-07-105-0/+17
| | | | | | | | | | Change-Id: Iedd83bb8f9d31268fb5a17879feaaf97a82f86cc Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Android: Apply QBluetoothSocket::preferredSecurityFlags during connectAlex Blasche2015-07-071-2/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch permits Android clients to choose the security level before connecting to the server. This may also used by some older devices (Android 4.1 or lower) to connect if they don't support the so far predetermined secure way of connecting via rfcomm. Task-number: QTBUG-46377 Change-Id: I3f72f183e7ead16bec57a0ce83e9a96324675312 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* | Bluez: Apply QBluetoothSocket::preferredSecurityFlags during connectAlex Blasche2015-07-071-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | This permits Bluez clients to determine the security level before connecting to the server. Note that the server may change the sec level at runtime without the user noticing. If the user wants to detect such cases socketDescriptor() in compination with getsockopt() should be used. Task-number: QTBUG-46377 Change-Id: I3bc4fcd62dc44d9e2e14e5a6e7416e3bb8e0d50b Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* | Bluez: Improve security flag handling in QBluetoothServerAlex Blasche2015-07-072-82/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1.) Remove the usage SOL_RFCOMM & SOL_L2CAP. They were replaced by SOL_BLUEOOTH. The same applies to RFCOMM_LM & L2CAP_LM which were replaced by BT_SECURITY. 2.) Fix securityFlags() when socket was closed already. It always triggered undesirable error messages as the code assumed a valid socket fd. 3.) Fix setSecurityFlags() when calling after the server socket was closed. The docs state that this function shall be called before listen is called. However after the socket was closed for the first time the security level could not be set anymore because the server socket is invalid until the next call to listen(). To solve this problem the initial security level is stored and applied during listen(). These changes imply a slightly different runtime behavior of securityFlags(). While the socket is closed it returns the stored value and during runtime the actual runtime level is returned. Change-Id: I720e6ac94a569397c4fec0058a1d388a1f35ecae Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* | Add preferredSecurityFlags to QBluetoothSocketAlex Blasche2015-07-037-6/+80
| | | | | | | | | | | | | | | | | | This permits the API user to determine the security parameters for the connect attempt to the remote SPP service. Task-number: QTBUG-46377 Change-Id: I1ed5ea0f5a32aa08dcedc46a34b0377654e420b2 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-06-2922-38/+307
|\| | | | | | | | | | | | | | | Conflicts: .qmake.conf src/nfc/doc/src/nfc-index.qdoc Change-Id: Ie12d3023ff934f6579ae93617c95fc654e85a7f0
| * Merge remote-tracking branch 'origin/5.5.0' into 5.5Liang Qi2015-06-261-0/+1
| |\ | | | | | | | | | Change-Id: I16d831a6ab1e22c03ce82f076f6759eb6531a8cd