| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
The only thing we can do on macOS/iOS - call stopAdvertising (we
have nothing to disconnect from with CoreBluetooth).
Also, remove a really weird warning.
Change-Id: I589bdb819468fc659a9ed3e68170dc498ffc8cd9
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
A device UUID is valid/works on iOS/macOS only: platforms where
CoreBluetooth hides addresses and generates 128-bit uuids instead.
We connect to a LE device using such a UUID. This patch adds a getter
to access a UUID of a remote device our controller works with
(similar to 'remoteAddress' method on other platforms).
Task-number: QTBUG-52690
Change-Id: I000e17bbea90c508922ac47ce5291e28d938de7c
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
From CoreBluetooth's point of view - this is just a callback, not a
descriptor write request (they even consider all descriptors immutable
in peripheral), but for Qt it should be a descriptor write operation,
and we must emit a signal.
Oh, and set endHandle correctly on a LE service object!
Change-Id: I71922507a6ece987ad8b5c317ef618301ae240c2
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Instead of hardcoded 10 second timeout use the latest Qt API enabling
arbitrary or infinite length for LE device discovery.
- Since now scan can take long or unlimited time, the previous approach
with detached CBCentralManager and DDA is not working anymore -
we can not report devices only at the end of scan.
Re-use LENotifier and signals/slots instead.
- Remove DDA timer, timeout logic is completely inside
osxbtledeviceinquiry object now.
Change-Id: I07735581ac175d1d5e5d788aaf697dcb41429e31
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
| |
No Q_FUNC_INFO in qCDebug/Warning/Critical needed anymore.
Change-Id: I0e47ccc7ffa971b8277b8d742e00319f4acef2f7
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
|
|
| |
Since we now have OS X 10.9 and iOS 7.0 as the minimal required
(SDK and deployment target) - get rid of outdated code-branches
in _SDK_EQUAL_OR_ABOVE etc.
Change-Id: I5f546e8bb746f6b94f26a40460b3caa0af6a531c
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
|
| |
CoreBluetooth for tvOS does not support peripheral role.
Change-Id: I82e7a61abfd907ea53faf33264951727f3cbe5a2
Reviewed-by: Mike Krus <mike.krus@kdab.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
|
|
| |
CoreBluetooth has CBPeripheralManager/CBMutableService both on iOS (since 6.0) and OS X
(>= 10.9). This lets me implement the Qt's BTLE 'advertisement'
API and peripheral role for both iOS and OS X.
Change-Id: I3e69a5870535a45bc16bbd9862ca84300b01daca
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
|
|
|
|
|
|
| |
Task-number: QTBUG-41175
Change-Id: I62d74236faf9161681306d952e409e23e0cea24d
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|\
| |
| |
| | |
Change-Id: If9cf6718cbd619dd7ce38db2da274fe9d0a41fb7
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/
Updated license headers to use new LGPL header instead of LGPL21 one
(in those files which will be under LGPL v3)
Change-Id: I856c13e2a6d4d12c46e1286b0ca1c092ee4608f8
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
|
| |
| |
| |
| |
| |
| |
| | |
Implemented for BlueZ only.
Change-Id: I358a98bbc7499d5ce5437fb0d4672fde46c3b831
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|\|
| |
| |
| |
| |
| |
| | |
Conflicts:
src/bluetooth/qlowenergycontroller.cpp
Change-Id: I28b116deb3fa87169432eb2d94b70894359a9057
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Most likely it was used before some changes rendered it unused.
At this point the variable was initialized to false and never ever
set to true.
Change-Id: I5b60cf83bc362ff53f8ce276c16392aada9efc69
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
So far, only a local disconnect triggered the invalidation process.
Task-number: QTBUG-50125
Change-Id: I324e01c86eb0c7cc820e91a6f6d6d01fb23170ab
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
|
|\|
| |
| |
| | |
Change-Id: I48826b6a83d8876b97095387cd329165a534eec2
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
ATM CBCentralManager's delegate does its work on the main queue. With
CoreFoundation event dispatcher it's now possible to use QtBluetooth from
non-gui thread (more generally - from a thread other than main).
This makes main queue useless - and we have to move to a dedicated dispatch
queue. Also, we have to make sure we do not have race conditioins/dead-locks.
This patch:
1. decouples OSXBTLECentralManager and QLowEnergyController so that these
two objects working (potentially) on different threads do not share any data
and do not have to use locks, removes the explicit 'delegate' interface/inheritance
and replaces them with LECentralNotifier class - to be able to use Qt's signal/slot mechanics
for inter-thread communication.
2. all OSXBTLECentralManager's are now executed on qt_LE_queue queue
to avoid any race-conditions (since they potentially update manager's
internal state).
3. Results/errors are now reported using LECentralNotifier's object
(QLowEnergyController has corresponding slots connected to the notifier)
Task-number: QTBUG-49476
Change-Id: Ie07cdc13ad559c96a7d2ff010843fb7bcce07c99
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|\|
| |
| |
| | |
Change-Id: I1fc766d26aadb7cc01d33c4c8a2260411d7bb138
|
| |\
| | |
| | |
| | | |
Change-Id: I4404df69bfdac335e9c1eb63e4ada3ba89b48b6c
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The QMetaType register my not be up and running by the time
we attempt these meta type registration.
Change-Id: I1a857a936a24b4b00a49574fac311c08c09b3d5a
Task-number: QTBUG-49455
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is the next step in implementing LE peripheral support.
Change-Id: I5e8cb186d556e7bfb9ae8a5e60e051ff7398b77d
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|/ /
| |
| |
| |
| |
| |
| | |
And provide an implementation for BlueZ.
Change-Id: I302aee7c43b77016d9e1e7a0d5bcbf00096abf76
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|/
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Task-number: QTBUG-45435
Change-Id: I3ded6bf88d3980481e386073ce160d5d54520034
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
|
|
|
|
|
|
|
| |
Add read descriptor/characteristic support for iOS and OS X.
Change-Id: If7547f3756dc37930052c9cefd243d6063bcab1c
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.
Change-Id: I3822a6484e8f7a420330de1cb1aeb0c3d1cf41b7
Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
|
|
|
|
|
|
|
| |
Add runtime version checks, compile time can be not enough.
Change-Id: If59131b3a9039a7fe15ccba0346fa71d58f36736
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
|
|
| |
Get rid of all 'hand-written' function/method signatures in qCWarnings
and Q_ASSERTS, use Q_FUNC_INFO instead. Fix error function for
characteristic/descriptor write errors - remove unused parameter.
Change-Id: I4f3f7c6c6a06802135f47a4b5cbb7c4313af4f34
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Several problems found by qlowenergycontroller auto test:
- Core Bluetooth in its didWriteCharacteristicValue callback
does not have this new updated value, but the old one,
to avoid additional characteristic read I have to cache this
value in writeCharacteristic and report it later from the callback
as it's already done for client characteristic configuration.
- writeDescriptor with state != ServiceDiscovered (can happen after disconnectFromDevice)
should set an error.
- setNotifyValue did not check that value has the wrong length ( > 2 bytes) -
this also should be an error.
- Fix a key mismatch - in setNotifyValue remember descrptor's handle, not
the characteristic's handle.
- Remove annoying qCWarnings from didUpdateNotifyValue - it happens
very often that we set this value in 'automatic' mode, without 'writeDescriptor'
request.
Change-Id: If3955f0e1364587b96403d23f2f8da28e6723e87
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
|
| |
On OS X QLowEnergyController can return the valid local address,
even if it was constructed without this parameter.
Change-Id: I40252a9f1f64506ae23d6dfe1e61fc786e895860
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
|
| |
If client characteristic configuration descriptor has an indication/notification bit set
- enable ("automatically" == no explicit user's request) notifications.
Change-Id: I839aabd6f5513141f66c8e4467618b3edd523350
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
|
| |
Cache a characteristic's value in update/write notification only
if characteristic has a 'Read' property.
Change-Id: Idc705e0c4f2ee704a80bf37b4e59e1dd09ca9e4f
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
|
|
| |
Core Bluetooth has a special method to enable/disable char update notifications and
even more - Core Bluetooth does not allow to use writeValue:forDescriptor:
with ClientCharacteristicConfiguration - that's why need this 'workaround'.
Change-Id: I4a01690a76aabf62397321ca6ba22c4abb1c420c
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
|
| |
Fix a bug - call setState on a service instead of stateChanged (which is
just a signal not actually chanding the service's state).
Change-Id: I243f1f6c6775a5592357a443a2f180e4afcf8219
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
| |
Qt's API assumes that several write operations must be
serialized (this is not guaranteed with Core Bluetooth AFAIK).
I can enqueu only write with response operations, otherwise
I never know when to do the next write.
Change-Id: Iaa83514748358437e2c39335ab142d084ff197e3
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
| |
Core Bluetooth - based implementation.
Change-Id: Ie642a13ae9a4d75401dd10648fac6eeee4123a3b
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In Qt we work with handles (real for Bluez, emulated for Android/iOS/OS X).
Core Bluetooth has its own (quite primitive and inconvenient) data structures
(arrays of objects, containing nested arrays).
To make things not so ugly I'm adding several
maps to be able to find a characteristic/descriptor/service using a
handle from Qt's layer.
Also modify writeCharacteristic to use this new 'addressing scheme'.
Change-Id: Ic822c9aa82a4df1e9c4cf4c673451cac8006b9ba
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
| |
writeCharacteristic - implemented with Core Bluetooth for OS X and iOS.
Change-Id: Ia228ff451e1e6d7b6fb7de6cad29198aa9257602
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
| |
Implement details discovery: characteristics, their values (if any),
descriptors. We have to emulate handles (QLowEnergyHandle) - while
Core Bluetooth internally has the notion of handles, it never exposes
them as a public API.
Change-Id: I09158433ce6835dd34fe8ad47d047212dab59e8e
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
|
| |
It looks like isPrimary property is always 'NO' on CBService objects
discovered making this property ... hmm, TOTALLY USELESS?
Change-Id: Ia38323c204e6cf1c3def3bbb3deb08bb8cdf90e4
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
| |
The initial version of service discovery failed to discover included services
correctly, actually this discovery requires some kind of 'graph traversal'
on the services tree. This patch re-implements the service discovery, discovering
included services also and avoiding ... loops in services referencing each other
(if it ever happens :) )
Change-Id: I60c6122fa5ddb922c21c99dd12024879cffad334
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix for disconnectFromDevice.
It can happen that connect requesting is pending forever and not reporting
any error: there is no timeout in Core Bluetooth (quite reasonable),
a device (after it was found by LE scan) can be turned off or move out
of range before connected. If a user calls disconnectFromDevice on a controller
during this time:
- we still have to call cancelPeripheralConnection to make sure the pending
connection never succeeds
- we have to set the controller's state to unconnected, since, unfortunately,
delegate's callback is not guaranteed to work (descipe of Apple's docs
promising this behavior).
Fix for connectToDevice - small typo was breaking connectToDevice's logic.
Change-Id: I4040c79a37ff31ecb5fb2296fa0d39b81d26393d
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Implement discoverServices and delegate's methods to work with a service
discovery on a peripheral.
- CBUUID (it's internal data) can be only 2 bytes long (16-bit shortened UUID)
despite of the docs saying 'CBUUID is a 16-bit UUID'.
- property 'isPrimary' did not exist prior to 10.9 SDK (OS X).
Change-Id: If692d147c0479ed69a331514617e3ef2a986cdf4
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement connect to device/disconnect from device methods,
add CentralManager class dealing with CBCentralManager (with
additional external logic).
- Improve error handling while in 'connecting' state.
- Use the proper error (ConnectionError) instead of UnknownError +
make the error handling more uniform while isConnecting == true.
- Use isNull on QBluetoothUuid, no need in ugly 'hasUuid'.
Change-Id: I84a704a746b4677ccb870b9c132db5f7359030c6
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
QLowEnergyController/Private for OS X and iOS.
This patch contains dummy empty classes required.
While LE controller is not fully implemented, I have to
disable (marking as insignificant) auto test on this class,
otherwise changing the (empty) class to pass the test adds more problem.
Change-Id: I54f764f7f6468b1acf58e80555ae454922de9f3b
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|