| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
A similar change was done earlier for iOS already. This is due to
deprecated API.
Task-number: QTBUG-62658
Change-Id: If1d4a0eae382e46e3224a6bd4a6e75309ff87cac
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
The type of manage.state has changed on macOS (like on iOS before),
making an declataion invalid.
(cherry-picked from qtconnectivity/0c3cc5374d2703fde6a99d301fcff974122d057d)
Change-Id: I55caa32fa9f0a85090506cfbd788c1a80d41e8ce
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|\
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/bluetooth/osx/osxbtledeviceinquiry.mm
src/bluetooth/qbluetoothdevicediscoveryagent_osx.mm
Change-Id: I7dc75c187af73917f31c28b9edfaf8bcf9652a3e
|
| |\
| | |
| | |
| | | |
Change-Id: Ie9b0ebf1c5e925107e90b5d01b112916a8d1d83d
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
iOS 10 (and tvOS 10) deprecates CBCentralManagerState enum
(and associated values). Replaced by CBManagerState enum.
Change-Id: I1c1bb0691403deaa6330949516846961c76865f5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Since now the use of Q_FUNC_INFO is not recommended (and indeed can
mix ugly with QT_MESSAGE_PATTERN), remove it (it now stays only in
3-parameter Q_ASSERTs and NSLogs.
The next patch will do the same kind of cleanup in C++ part.
Change-Id: Ief8bd7c90ea2ff2a99f246885691102062aa5e54
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>
|
|\| |
| | |
| | |
| | | |
Change-Id: I858ee0b39b7a488f08fc045635d2a39053f32d99
|
| |\|
| | |
| | |
| | | |
Change-Id: I77d7b5877ce36057c3882a0b397ff27d5c35ad53
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
-serviceForUUID: fails to find included service and returns a nil
for a valid service previously discovered.
Task-number: QTBUG-52324
Change-Id: I9f4f8b1f3d3a78879344ace0170e23c03921d648
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
|\|
| |
| |
| | |
Change-Id: I97b51eb3fe2040711c00da67bbb1954fc2e65c1f
|
| |
| |
| |
| |
| | |
Change-Id: I0baa4bbbc5d398f388a1e0aff9ba88f82a23c1cc
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
|/
|
|
|
|
|
|
|
|
| |
Builds but not tested
Moved Q_DECLARE_METATYPE outside of namespace to fix namespaced builds
Change-Id: I19c1dba904da8fad155f0f612b863e8f5e0c422e
Reviewed-by: James Turner <james.turner@kdab.com>
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
Add read descriptor/characteristic support for iOS and OS X.
Change-Id: If7547f3756dc37930052c9cefd243d6063bcab1c
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
Compile time check of SDK version is not sufficient if Qt is build
for older device.
Change-Id: I0e4d0baf903c6291e67462890107b0e5cc30e7c4
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
While writing with response, Core Bluetooth does not
update characteristic/descriptor values in write notifications.
I have to 'cache' this values and report them back.
Also this patch fixes minor bugs in '-performNextWriteRequest':
while handling errors it's not enough just to call 'performNextWriteRequest:'
again, it must be in return statement or followed by 'return'.
Change-Id: I6e7ab7fe6f63ea84268bf6c7ea67e2939d524f91
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>
|
|
|
|
|
|
|
| |
Remove debug messages from OSXBTCentralManager.
Change-Id: I980ffac49453b670fa93d4ddfb0e621e29dff4f3
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|