diff options
author | Oliver Wolff <oliver.wolff@qt.io> | 2017-01-17 13:27:42 +0100 |
---|---|---|
committer | Oliver Wolff <oliver.wolff@qt.io> | 2017-01-19 12:19:11 +0000 |
commit | 9ee0c3c36b039367bcac3e2bc116a97efcbc3d3f (patch) | |
tree | 3c4e8359f9841631e1826692ca7ae47cc05a1590 /src/bluetooth/qbluetoothlocaldevice_p.cpp | |
parent | 09b287e98fab38f9c6e9e76e185d5662d9a14a6c (diff) |
winrt: Minor adjustments to QBluetoothLocalDevice
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>
Diffstat (limited to 'src/bluetooth/qbluetoothlocaldevice_p.cpp')
-rw-r--r-- | src/bluetooth/qbluetoothlocaldevice_p.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/bluetooth/qbluetoothlocaldevice_p.cpp b/src/bluetooth/qbluetoothlocaldevice_p.cpp index e9177f39..28e787c7 100644 --- a/src/bluetooth/qbluetoothlocaldevice_p.cpp +++ b/src/bluetooth/qbluetoothlocaldevice_p.cpp @@ -85,7 +85,11 @@ void QBluetoothLocalDevice::setHostMode(QBluetoothLocalDevice::HostMode mode) QBluetoothLocalDevice::HostMode QBluetoothLocalDevice::hostMode() const { +#ifdef QT_WINRT_BLUETOOTH + return HostConnectable; +#else return HostPoweredOff; +#endif } QList<QBluetoothAddress> QBluetoothLocalDevice::connectedDevices() const @@ -112,7 +116,11 @@ QBluetoothLocalDevice::Pairing QBluetoothLocalDevice::pairingStatus( const QBluetoothAddress &address) const { Q_UNUSED(address); +#ifdef QT_WINRT_BLUETOOTH + return Paired; +#else return Unpaired; +#endif } void QBluetoothLocalDevice::pairingConfirmation(bool confirmation) |