Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qlowenergycontroller_winrt.cpp File Reference

(80b628514cf40009d81a7dfaf1580615135f83e4)

#include "qlowenergycontroller_winrt_p.h"
#include "qbluetoothutils_winrt_p.h"
#include <QtBluetooth/qbluetoothlocaldevice.h>
#include <QtBluetooth/QLowEnergyCharacteristicData>
#include <QtBluetooth/QLowEnergyDescriptorData>
#include <QtBluetooth/private/qbluetoothutils_winrt_p.h>
#include <QtBluetooth/QLowEnergyService>
#include <QtCore/QtEndian>
#include <QtCore/QLoggingCategory>
#include <QtCore/private/qfunctions_winrt_p.h>
#include <QtCore/QDeadlineTimer>
#include <QtCore/qpointer.h>
#include <QtCore/QAbstractEventDispatcher>
#include <functional>
#include <type_traits>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Foundation.Metadata.h>
#include <winrt/Windows.Devices.Enumeration.h>
#include <winrt/Windows.Devices.Bluetooth.h>
#include <winrt/Windows.Devices.Bluetooth.GenericAttributeProfile.h>
#include <winrt/Windows.Storage.Streams.h>
#include <windows.devices.bluetooth.h>
#include <windows.devices.bluetooth.genericattributeprofile.h>
#include "qlowenergycontroller_winrt.moc"
Include dependency graph for qlowenergycontroller_winrt.cpp:

Go to the source code of this file.

Classes

class  QWinRTLowEnergyServiceHandler
class  QWinRTLowEnergyConnectionHandler

Namespaces

namespace  abi

Macros

#define ENUM_BITWISE_OPS(E)
#define WARN_AND_CONTINUE(msg)
#define DEC_CHAR_COUNT_AND_CONTINUE(msg)
#define RETURN_SERVICE_ERROR(msg, service, error)
#define RETURN_FALSE(msg)
#define RETURN_MSG(msg)

Typedefs

using abi::BluetoothLEDevice = ABI::Windows::Devices::Bluetooth::IBluetoothLEDevice
using abi::GattSession = ABI::Windows::Devices::Bluetooth::GenericAttributeProfile::IGattSession
using GlobalCondition = std::function<bool()>

Functions

template<typename E, std::enable_if_t< std::is_enum_v< E >, int > = 0>
constexpr std::underlying_type_t< Ebitwise_and (E x, E y)
template<typename T, typename E, std::enable_if_t< std::conjunction_v< std::is_integral< T >, std::is_enum< E > >, int > = 0>
constexpr T bitwise_and (T x, E y)
template<typename E, std::enable_if_t< std::is_enum_v< E >, int > = 0>
constexpr std::underlying_type_t< Ebitwise_or (E x, E y)
template<typename T, typename E, std::enable_if_t< std::conjunction_v< std::is_integral< T >, std::is_enum< E > >, int > = 0>
constexpr T bitwise_or (T x, E y)
template<typename T, typename E, std::enable_if_t< std::conjunction_v< std::is_integral< T >, std::is_enum< E > >, int > = 0>
constexpr T & bitwise_or_equal (T &a, const E &b)
static constexpr bool never ()
template<typename T>
static T await (IAsyncOperation< T > asyncInfo, GlobalCondition canceled=never, int timeout=5000)
template<typename T>
static T await_forever (IAsyncOperation< T > asyncInfo, GlobalCondition canceled=never)
static QByteArray byteArrayFromBuffer (IBuffer buffer, bool isWCharString=false)
static QByteArray byteArrayFromGattResult (GattReadResult gattResult, bool isWCharString=false)

Variables

QT_BEGIN_NAMESPACE typedef GattReadClientCharacteristicConfigurationDescriptorResult ClientCharConfigDescriptorResult
constexpr int timeout_infinity = -1
static constexpr qint64 kMaxConnectTimeout = 20000

Macro Definition Documentation

◆ DEC_CHAR_COUNT_AND_CONTINUE

#define DEC_CHAR_COUNT_AND_CONTINUE ( msg)
Value:
{ \
qCWarning(QT_BT_WINDOWS) << msg; \
--mCharacteristicsCountToBeDiscovered; \
continue; \
}

Definition at line 149 of file qlowenergycontroller_winrt.cpp.

◆ ENUM_BITWISE_OPS

#define ENUM_BITWISE_OPS ( E)
Value:
inline constexpr std::underlying_type_t<E> operator&(E x, E y) { return bitwise_and<E>(x, y); } \
\
template<typename T> \
inline constexpr T operator&(T x, E y) { return bitwise_and<T, E>(x, y); } \
\
template<typename T> \
inline constexpr T operator&(E x, T y) { return bitwise_and<T, E>(y, x); } \
\
inline constexpr std::underlying_type_t<E> operator|(E x, E y) { return bitwise_or<E>(x, y); } \
\
template<typename T> \
inline constexpr T operator|(T x, E y) { return bitwise_or<T, E>(x, y); } \
\
template<typename T> \
inline constexpr T operator|(E x, T y) { return bitwise_or<T, E>(y, x); } \
\
template<typename T> \
inline constexpr T &operator |=(T &a, const E &b) { return bitwise_or_equal(a, b); }
QBitArray operator&(const QBitArray &a1, const QBitArray &a2)
constexpr T & bitwise_or_equal(T &a, const E &b)
constexpr std::underlying_type_t< E > bitwise_or(E x, E y)
constexpr std::underlying_type_t< E > bitwise_and(E x, E y)
GLboolean GLboolean GLboolean b
GLint GLint GLint GLint GLint x
GLboolean GLboolean GLboolean GLboolean a
GLint y
constexpr QUrl::FormattingOptions operator|(QUrl::UrlFormattingOption f1, QUrl::UrlFormattingOption f2)
Definition qurl.h:296
QUrl::FormattingOptions & operator|=(QUrl::FormattingOptions &i, QUrl::ComponentFormattingOptions f)
Definition qurl.h:304

Definition at line 86 of file qlowenergycontroller_winrt.cpp.

◆ RETURN_FALSE

#define RETURN_FALSE ( msg)
Value:
{ \
qErrnoWarning(msg); \
return false; \
}

Definition at line 163 of file qlowenergycontroller_winrt.cpp.

◆ RETURN_MSG

#define RETURN_MSG ( msg)
Value:
{ \
qErrnoWarning(msg); \
return; \
}

Definition at line 169 of file qlowenergycontroller_winrt.cpp.

◆ RETURN_SERVICE_ERROR

#define RETURN_SERVICE_ERROR ( msg,
service,
error )
Value:
{ \
qCDebug(QT_BT_WINDOWS) << msg; \
service->setError(error); \
return; \
}
DBusConnection const char DBusError * error

Definition at line 156 of file qlowenergycontroller_winrt.cpp.

◆ WARN_AND_CONTINUE

#define WARN_AND_CONTINUE ( msg)
Value:
{ \
qCWarning(QT_BT_WINDOWS) << msg; \
continue; \
}

Definition at line 143 of file qlowenergycontroller_winrt.cpp.

Typedef Documentation

◆ GlobalCondition

typedef std::function< bool()> GlobalCondition = std::function<bool()>

Definition at line 112 of file qlowenergycontroller_winrt.cpp.

Function Documentation

◆ await()

template<typename T>
T await ( IAsyncOperation< T > asyncInfo,
GlobalCondition canceled = never,
int timeout = 5000 )
static

Definition at line 116 of file qlowenergycontroller_winrt.cpp.

◆ await_forever()

template<typename T>
T await_forever ( IAsyncOperation< T > asyncInfo,
GlobalCondition canceled = never )
inlinestatic

Definition at line 138 of file qlowenergycontroller_winrt.cpp.

References timeout_infinity.

◆ bitwise_and() [1/2]

template<typename E, std::enable_if_t< std::is_enum_v< E >, int > = 0>
std::underlying_type_t< E > bitwise_and ( E x,
E y )
inlineconstexpr

Definition at line 52 of file qlowenergycontroller_winrt.cpp.

◆ bitwise_and() [2/2]

template<typename T, typename E, std::enable_if_t< std::conjunction_v< std::is_integral< T >, std::is_enum< E > >, int > = 0>
T bitwise_and ( T x,
E y )
inlineconstexpr

Definition at line 59 of file qlowenergycontroller_winrt.cpp.

◆ bitwise_or() [1/2]

template<typename E, std::enable_if_t< std::is_enum_v< E >, int > = 0>
std::underlying_type_t< E > bitwise_or ( E x,
E y )
inlineconstexpr

Definition at line 66 of file qlowenergycontroller_winrt.cpp.

◆ bitwise_or() [2/2]

template<typename T, typename E, std::enable_if_t< std::conjunction_v< std::is_integral< T >, std::is_enum< E > >, int > = 0>
T bitwise_or ( T x,
E y )
inlineconstexpr

Definition at line 73 of file qlowenergycontroller_winrt.cpp.

◆ bitwise_or_equal()

template<typename T, typename E, std::enable_if_t< std::conjunction_v< std::is_integral< T >, std::is_enum< E > >, int > = 0>
T & bitwise_or_equal ( T & a,
const E & b )
inlineconstexpr

Definition at line 80 of file qlowenergycontroller_winrt.cpp.

◆ byteArrayFromBuffer()

QByteArray byteArrayFromBuffer ( IBuffer buffer,
bool isWCharString = false )
static

Definition at line 180 of file qlowenergycontroller_winrt.cpp.

◆ byteArrayFromGattResult()

QByteArray byteArrayFromGattResult ( GattReadResult gattResult,
bool isWCharString = false )
static

Definition at line 197 of file qlowenergycontroller_winrt.cpp.

◆ never()

constexpr bool never ( )
staticconstexpr

Definition at line 113 of file qlowenergycontroller_winrt.cpp.

Variable Documentation

◆ ClientCharConfigDescriptorResult

QT_BEGIN_NAMESPACE typedef GattReadClientCharacteristicConfigurationDescriptorResult ClientCharConfigDescriptorResult

Definition at line 110 of file qlowenergycontroller_winrt.cpp.

◆ kMaxConnectTimeout

constexpr qint64 kMaxConnectTimeout = 20000
staticconstexpr

Definition at line 178 of file qlowenergycontroller_winrt.cpp.

◆ timeout_infinity

int timeout_infinity = -1
constexpr

Definition at line 135 of file qlowenergycontroller_winrt.cpp.

Referenced by await_forever().