Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qlowenergycontroller_winrt.cpp File Reference
#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 <functional>
#include <robuffer.h>
#include <windows.devices.enumeration.h>
#include <windows.devices.bluetooth.h>
#include <windows.devices.bluetooth.genericattributeprofile.h>
#include <windows.foundation.collections.h>
#include <windows.foundation.metadata.h>
#include <windows.storage.streams.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
 

Macros

#define EMIT_WORKER_ERROR_AND_QUIT_IF_FAILED(hr)
 
#define EMIT_WORKER_ERROR_AND_QUIT_IF_FAILED_2(hr, message)
 
#define WARN_AND_CONTINUE_IF_FAILED(hr, msg)
 
#define DEC_CHAR_COUNT_AND_CONTINUE_IF_FAILED(hr, msg)
 
#define CHECK_FOR_DEVICE_CONNECTION_ERROR_IMPL(this, hr, msg, ret)
 
#define CHECK_FOR_DEVICE_CONNECTION_ERROR(hr, msg, ret)    CHECK_FOR_DEVICE_CONNECTION_ERROR_IMPL(this, hr, msg, ret)
 
#define CHECK_HR_AND_SET_SERVICE_ERROR(hr, msg, service, error, ret)
 

Typedefs

typedef ITypedEventHandler< GattSession *, IInspectable * > MtuHandler
 
typedef ITypedEventHandler< GattCharacteristic *, GattValueChangedEventArgs * > ValueChangedHandler
 
typedef GattReadClientCharacteristicConfigurationDescriptorResult ClientCharConfigDescriptorResult
 
typedef IGattReadClientCharacteristicConfigurationDescriptorResult IClientCharConfigDescriptorResult
 

Functions

static QByteArray byteArrayFromGattResult (const ComPtr< IGattReadResult > &gattResult, bool isWCharString=false)
 
template<typename T >
static void closeDeviceService (ComPtr< T > service)
 

Variables

QT_BEGIN_NAMESPACE typedef ITypedEventHandler< BluetoothLEDevice *, IInspectable * > StatusHandler
 
static constexpr qint64 kMaxConnectTimeout = 20000
 

Macro Definition Documentation

◆ CHECK_FOR_DEVICE_CONNECTION_ERROR

#define CHECK_FOR_DEVICE_CONNECTION_ERROR (   hr,
  msg,
  ret 
)     CHECK_FOR_DEVICE_CONNECTION_ERROR_IMPL(this, hr, msg, ret)

Definition at line 77 of file qlowenergycontroller_winrt.cpp.

◆ CHECK_FOR_DEVICE_CONNECTION_ERROR_IMPL

#define CHECK_FOR_DEVICE_CONNECTION_ERROR_IMPL (   this,
  hr,
  msg,
  ret 
)
Value:
if (FAILED(hr)) { \
this->handleConnectionError(msg); \
ret; \
}
return ret

Definition at line 71 of file qlowenergycontroller_winrt.cpp.

◆ CHECK_HR_AND_SET_SERVICE_ERROR

#define CHECK_HR_AND_SET_SERVICE_ERROR (   hr,
  msg,
  service,
  error,
  ret 
)
Value:
if (FAILED(hr)) { \
qCDebug(QT_BT_WINDOWS) << msg; \
service->setError(error); \
ret; \
}
DBusConnection const char DBusError * error

Definition at line 80 of file qlowenergycontroller_winrt.cpp.

◆ DEC_CHAR_COUNT_AND_CONTINUE_IF_FAILED

#define DEC_CHAR_COUNT_AND_CONTINUE_IF_FAILED (   hr,
  msg 
)
Value:
if (FAILED(hr)) { \
qCWarning(QT_BT_WINDOWS) << msg; \
--mCharacteristicsCountToBeDiscovered; \
continue; \
}

Definition at line 64 of file qlowenergycontroller_winrt.cpp.

◆ EMIT_WORKER_ERROR_AND_QUIT_IF_FAILED

#define EMIT_WORKER_ERROR_AND_QUIT_IF_FAILED (   hr)
Value:
if (FAILED(hr)) { \
emitErrorAndQuitThread(hr); \
return; \
}

Definition at line 46 of file qlowenergycontroller_winrt.cpp.

◆ EMIT_WORKER_ERROR_AND_QUIT_IF_FAILED_2

#define EMIT_WORKER_ERROR_AND_QUIT_IF_FAILED_2 (   hr,
  message 
)
Value:
if (FAILED(hr)) { \
emitErrorAndQuitThread(message); \
return; \
}
GLuint GLsizei const GLchar * message

Definition at line 52 of file qlowenergycontroller_winrt.cpp.

◆ WARN_AND_CONTINUE_IF_FAILED

#define WARN_AND_CONTINUE_IF_FAILED (   hr,
  msg 
)
Value:
if (FAILED(hr)) { \
qCWarning(QT_BT_WINDOWS) << msg; \
continue; \
}

Definition at line 58 of file qlowenergycontroller_winrt.cpp.

Typedef Documentation

◆ ClientCharConfigDescriptorResult

typedef GattReadClientCharacteristicConfigurationDescriptorResult ClientCharConfigDescriptorResult

Definition at line 43 of file qlowenergycontroller_winrt.cpp.

◆ IClientCharConfigDescriptorResult

typedef IGattReadClientCharacteristicConfigurationDescriptorResult IClientCharConfigDescriptorResult

Definition at line 44 of file qlowenergycontroller_winrt.cpp.

◆ MtuHandler

typedef ITypedEventHandler<GattSession *, IInspectable *> MtuHandler

Definition at line 41 of file qlowenergycontroller_winrt.cpp.

◆ ValueChangedHandler

typedef ITypedEventHandler<GattCharacteristic *, GattValueChangedEventArgs *> ValueChangedHandler

Definition at line 42 of file qlowenergycontroller_winrt.cpp.

Function Documentation

◆ byteArrayFromGattResult()

static QByteArray byteArrayFromGattResult ( const ComPtr< IGattReadResult > &  gattResult,
bool  isWCharString = false 
)
static

Definition at line 92 of file qlowenergycontroller_winrt.cpp.

References byteArrayFromBuffer(), and qCWarning.

Referenced by QWinRTLowEnergyServiceHandler::obtainCharList().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ closeDeviceService()

template<typename T >
static void closeDeviceService ( ComPtr< T >  service)
static

Definition at line 106 of file qlowenergycontroller_winrt.cpp.

Referenced by QWinRTLowEnergyServiceHandler::~QWinRTLowEnergyServiceHandler().

+ Here is the caller graph for this function:

Variable Documentation

◆ kMaxConnectTimeout

constexpr qint64 kMaxConnectTimeout = 20000
staticconstexpr

Definition at line 90 of file qlowenergycontroller_winrt.cpp.

◆ StatusHandler

QT_BEGIN_NAMESPACE typedef ITypedEventHandler<BluetoothLEDevice *, IInspectable *> StatusHandler

Definition at line 40 of file qlowenergycontroller_winrt.cpp.