summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qlowenergycontroller_winrt.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Don't report S_OK as error when calling GetAddressOf()v5.12.0-beta1Alex Blasche2018-09-281-1/+1
| | | | | | Fixes: QTBUG-70799 Change-Id: Iebbfbc2e00d83a6c08bb8a376c01734188e69388 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-09-081-1/+5
|\ | | | | | | Change-Id: I576079e30f4075117ca764f45198bc1e5269d887
| * winrt: Do proper error handling if connecting to a LE device failsOliver Wolff2018-08-311-1/+5
| | | | | | | | | | | | Task-number: QTBUG-70162 Change-Id: I4556cbf1965121b042a55e3e36e24383f8fa8dc9 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Replace foreach with for loop and set QT_NO_FOREACHOliver Wolff2018-08-151-3/+3
| | | | | | | | | | | | | | | | To avoid unnecessary copies, const is used wherever possible. Change-Id: Ic743716512751cfd24fad5bd37c244b115dd26fe Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | winrt: Only emit characteristicWritten if WriteWithResponse was setOliver Wolff2018-07-181-2/+3
|/ | | | | | | | | | | Winrt API does not distinguish, whether the gatt write was done with or without response but always runs into the callback while doing "the right thing" on a lower level. If WriteWithResponse was not specified, we should not emit characteristicWritten though. Change-Id: I4479296d2931635f6f9d0eb52eed78b394a43d66 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-01-201-3/+20
|\ | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I6e93fc7435a49b601a5c10519ed86d2a15125074
| * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-01-181-3/+20
| |\ | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I6d2140aa8692bc7ce56f4366275fd02d008900f0
| | * winrt: Do not crash when trying to an unreachable paired LE deviceOliver Wolff2017-12-121-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As device discovery returns every paired device on winrt, it is possible that we try to connect to a device, that is paired but not available. When doing so the application should not crash but state that there was an error connecting to the device. Task-number: QTBUG-64480 Change-Id: I8d79f6da1de2b0bda7a51a7cfd068bb4a6057257 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Miguel Costa <miguel.costa@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
| | * winrt: Early return instead of assert is case of errorMaurice Kalinowski2017-11-161-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Some devices report access denied for various reasons (group policy, disabled, etc.). Hence, do return and stop the discovery instead of asserting. Change-Id: I22fe9cc375fd3b3580deaf72c614bf62600cbf32 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-211-0/+25
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/bluetooth/bluetooth.pro Change-Id: Ibccccc974b545696ae053f1fbffcc973d8be43cc
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-11-151-0/+24
| |\| | | | | | | | | | Change-Id: I549972a6521a33a1c52fcbf0506a6aff502b364c
| | * winrt: Reflect unsupported state of peripheral role of lowenergycontrollerOliver Wolff2017-11-031-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There currently is no API for supporting the peripheral role on winrt, but there is no way to reflect that inside our API. If a user tries to set up a low energy peripheral device, the application should not crash though. The crash occurred, when the controller was set up in a perihperal role and the application tried to read or write a descriptor or characteristic. In this case the functions should just return early. Task-number: QTBUG-63709 Change-Id: I30b277788d822f869743e1f294ee1402abd36309 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-301-0/+1
| |\| | | | | | | | | | Change-Id: Iaa053dcb125490ee1e83d7e27cb75d4171297b9f
| | * winrt: Fix build using -no-pchOliver Wolff2017-10-251-0/+1
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-63210 Change-Id: I98637337d8a77c8847bd0f2c567fec5e6a4ace31 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | Merge all QLEConrollerPrivate::addServiceHelper() implementationAlex Blasche2017-11-031-50/+0
| | | | | | | | | | | | | | | Change-Id: Id346f2f98e63c5c7ea9e2cd3fb7e68e4573ac1e5 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | Unify meta type registration for QLEDescriptor and QLECharacteristicAlex Blasche2017-11-031-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The QLEControllerPrivate objects use the same function (apart from Apple platforms) and unit tests do not have to register those types at all anymore. Change-Id: I06a4a035f5a8fba9a146a3c05d1157b47c22e056 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | Provide UWP specific header for QLEControllerPrivateAlex Blasche2017-11-031-22/+22
| | | | | | | | | | | | | | | Change-Id: Ic2ee2a76e2da4c236415f1eb3b98ab642ee3d1fc Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | Provide own header for QLowEnergyControllerPrivate instance on BluezAlex Blasche2017-11-031-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This utilizes the new QLowEnergyController interface and separates the existing Bluez implementation more clearly from other platforms. The existing addServiceHelper() class is moved out into the individual backends to avoid compiling the class into the new dbus backend. Change-Id: I1eea99e493958c61cb1fae830c08a3eb26bda9c3 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | Rename various QLEControllerPrivate classesAlex Blasche2017-11-031-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The base class is renamed to QLEControllerPrivate and the existing QLEControllerPrivate becomes QLEControllerPrivateCommon. This is necessary to re-enable Q_DECLARE_PRIVATE. The macro uses by convention the "Private" class prefix which is currently broken because not every implementation uses QLEControllerPrivate as d-pointer type. This also avoids a SC/BC break in qlowenergycontroller.h as the d-pointer remains the same and the functions declared via Q_DECLARE_PRIVATE still return the same type. Change-Id: I84890b06280b2c473a4d370606d3bbc58a258eea Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | Introduce Base class for QLowEnergyControllerPrivateAlex Blasche2017-11-031-3/+1
|/ / | | | | | | | | | | | | | | This permits alternative implementations selectable at runtime. Currently this is only used by Bluez. Change-Id: I3ddeb7f888f3b09bdc62f10d5b9a36320500f329 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Add configure test to detect presence of winrt APIOliver Wolff2017-08-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Instead of checking for a certain Windows version, we should check whether the API is actually available [ChangeLog][QtBluetooth][Windows] Enabled UWP backend for desktop Windows versions that support the API Task-number: QTBUG-61566 Change-Id: I8384119c70cc2c4bdcdbe6b297cfcf5fb3e3f534 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | winrt: Ensure that QLowEnergyController::RemoteHostClosedError is emittedOliver Wolff2017-08-021-0/+5
|/ | | | | | | | | | | | As there is no Windows API to disconnect from a BTLE device, we just set the internal state in QLowEnergyController::disconnectFromDevice. By removing the callback registration in disconnectFromDevice we can be sure, that every state change from connected to disconnected is caused by the remote host closing the connection and thus implement RemoteHostClosedError. Change-Id: I7dcacaffce68784cb297b02df2e9f9356bf14d9d Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* winrt: qRegisterMetaType for QLowEnergyCharacteristic/QLowEnergyDescriptorOliver Wolff2016-12-071-0/+3
| | | | | | | | | | As the signals about read/written characteristics and descriptors are emitted from a different thread (XAML thread) the types have to be registered in order to make the queued connection work. Task-number: QTBUG-57385 Change-Id: I4542c8d1be03d2d3fe1b0a69b94ef0a2ff916026 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* winrt: Do not emit a LE status change if an error/timeout happenedOliver Wolff2016-11-011-2/+4
| | | | | | | | | It is possible that the connectionStateChanged callback is called after an error occurred (device is being connected too late). In this case the controller must not emit the connected signal. Change-Id: Id82decba72067b34a2078720802a762e15308a41 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* winrt: Avoid unnecessary asserts in LowEnergyControllerOliver Wolff2016-11-011-1/+3
| | | | | | | | | We do not want to assert when a user tries to write an invalid value. Setting the correct error and returning early is the proper way to handle this situation. Change-Id: Ia358023ed186bc4b7c5be0e6319182dbe563f576 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* winrt: BTLE: Handle characteristic changesOliver Wolff2016-11-011-3/+80
| | | | | | Task-number: QTBUG-37779 Change-Id: Ie368e85286a3d132c633ef759a2bdb0fb206172d Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* winrt: Added missing error handling to device discovery and low energyOliver Wolff2016-10-041-3/+10
| | | | | | | Task-number: QTBUG-56191 Task-number: QTBUG-56219 Change-Id: I8ad3dc392d09055418b0dca3794386e53f287307 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Proper state and warning on access denied errorOliver Wolff2016-07-281-0/+5
| | | | | Change-Id: I4cf980c020fa11a1e213a1f5cd0110033aeaec71 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Register connectionStatus callback in Xaml threadOliver Wolff2016-07-261-12/+16
| | | | | Change-Id: I06777c75c20f662d3dff897f65947321eb79d5a2 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* WinRT: getNativeService/getNativeCharacteristic helper functionsOliver Wolff2016-07-261-53/+66
| | | | | Change-Id: I5094eb7252049e55617a2883d0f917700c42b451 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* winrt: Proper handling of ClientCharacteristicConfigurationOliver Wolff2016-07-261-91/+229
| | | | | | Task-number: QTBUG-37779 Change-Id: Ie37067abc104a2e6e162ea9e00af8ff6d504fb0e Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* WinRT: use constrefs for ComPtr parameters where applicableOliver Wolff2016-07-191-4/+4
| | | | | Change-Id: Ic4ba77d86f11e984ba66929006df183d227fccce Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* WinRT: BTLE: Write descriptorsOliver Wolff2016-06-161-5/+89
| | | | | | | Task-number: QTBUG-37779 Change-Id: Ib3ef0723b069275f4dd96dfba8316cc2b4ecb4f3 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* WinRT: BTLE: Write characteristicsOliver Wolff2016-06-161-6/+83
| | | | | | | Task-number: QTBUG-37779 Change-Id: I10a9ebdb6d879646f9b063fa031b02f0c71797b4 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* WinRT: BTLE: Read descriptorsOliver Wolff2016-06-161-4/+70
| | | | | | | Task-number: QTBUG-37779 Change-Id: I25f598ad7b5aef3791070842cbbc1a405e264572 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* WinRT: BTLE: Read characteristicsOliver Wolff2016-06-161-3/+57
| | | | | | | Task-number: QTBUG-37779 Change-Id: I430009132f68ed71e6054bebece05101fde7409a Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* WinRT: Use ComPtr for native typesOliver Wolff2016-05-311-1/+1
| | | | | Change-Id: Id6b09a04925296ff8b21b9c784df722fae79e3cd Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* WinRT: BTLE: Discover service detailsOliver Wolff2016-05-311-2/+237
| | | | | | | Task-number: QTBUG-37779 Change-Id: I5a4fb51b9c2402954ce4d370f003e8787561f5a7 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* WinRT: BTLE: Discover list of available servicesOliver Wolff2016-05-311-1/+80
| | | | | | Task-number: QTBUG-37779 Change-Id: Ia92facf9f3f1c6aae8fac7a205d3f9ad4921787e Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* winrt: BTLE: Device (dis-)connectionOliver Wolff2016-05-261-0/+257
Task-number: QTBUG-37779 Change-Id: I0f83e706a10d6c42543bd41aa012fde746f1a334 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>