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_bluez.cpp File Reference

(a4ff2497ecee8aa6046ed0aa558f736dc9f614c5)

#include "lecmaccalculator_p.h"
#include "qlowenergycontroller_bluez_p.h"
#include "qbluetoothsocketbase_p.h"
#include "qbluetoothsocket_bluez_p.h"
#include "qleadvertiser_bluez_p.h"
#include "bluez/bluez_data_p.h"
#include "bluez/hcimanager_p.h"
#include "bluez/objectmanager_p.h"
#include "bluez/remotedevicemanager_p.h"
#include "bluez/bluez5_helper_p.h"
#include "bluez/bluetoothmanagement_p.h"
#include <QtCore/QFileInfo>
#include <QtCore/QLoggingCategory>
#include <QtCore/QSettings>
#include <QtCore/QTimer>
#include <QtBluetooth/QBluetoothLocalDevice>
#include <QtBluetooth/QBluetoothSocket>
#include <QtBluetooth/QLowEnergyCharacteristicData>
#include <QtBluetooth/QLowEnergyDescriptorData>
#include <QtBluetooth/QLowEnergyService>
#include <QtBluetooth/QLowEnergyServiceData>
#include <algorithm>
#include <climits>
#include <cstring>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
#include "moc_qlowenergycontroller_bluez_p.cpp"
Include dependency graph for qlowenergycontroller_bluez.cpp:

Go to the source code of this file.

Classes

class  ServerSocket

Macros

#define GATT_PRIMARY_SERVICE   quint16(0x2800)
#define GATT_SECONDARY_SERVICE   quint16(0x2801)
#define GATT_INCLUDED_SERVICE   quint16(0x2802)
#define GATT_CHARACTERISTIC   quint16(0x2803)
#define ERROR_RESPONSE_HEADER_SIZE   5
#define FIND_INFO_REQUEST_HEADER_SIZE   5
#define GRP_TYPE_REQ_HEADER_SIZE   7
#define READ_BY_TYPE_REQ_HEADER_SIZE   7
#define READ_REQUEST_HEADER_SIZE   3
#define READ_BLOB_REQUEST_HEADER_SIZE   5
#define WRITE_REQUEST_HEADER_SIZE   3
#define PREPARE_WRITE_HEADER_SIZE   5
#define EXECUTE_WRITE_HEADER_SIZE   2
#define MTU_EXCHANGE_HEADER_SIZE   3
#define APPEND_VALUE   true
#define NEW_VALUE   false

Functions

static bool dumpErrorInformation (const QByteArray &response)
static int getUuidSize (const QBluetoothUuid &uuid)
template<typename T>
static void putDataAndIncrement (const T &src, char *&dst)
template<>
void putDataAndIncrement (const QBluetoothUuid &uuid, char *&dst)
template<>
void putDataAndIncrement (const QByteArray &value, char *&dst)
QLowEnergyHandle parseReadByTypeCharDiscovery (QLowEnergyServicePrivate::CharData *charData, const char *data, quint16 elementLength)
QLowEnergyHandle parseReadByTypeIncludeDiscovery (QList< QBluetoothUuid > *foundServices, const char *data, quint16 elementLength)
static Q_DECL_COLD_FUNCTION void reportMalformedData (QBluezConst::AttCommand cmd, const QByteArray &response)
static bool isNotificationEnabled (quint16 clientConfigValue)
static bool isIndicationEnabled (quint16 clientConfigValue)
static QString nameOfRemoteCentral (const QBluetoothAddress &peerAddress)
static QByteArray uuidToByteArray (const QBluetoothUuid &uuid)
template<>
void putDataAndIncrement (const QBluetoothUuid &uuid, char *&dst)
template<>
void putDataAndIncrement (const QByteArray &value, char *&dst)

Variables

constexpr quint16 ATT_DEFAULT_LE_MTU = 23
constexpr quint16 ATT_MAX_LE_MTU = 0x200
const int maxPrepareQueueSize = 1024

Macro Definition Documentation

◆ APPEND_VALUE

#define APPEND_VALUE   true

Definition at line 57 of file qlowenergycontroller_bluez.cpp.

◆ ERROR_RESPONSE_HEADER_SIZE

#define ERROR_RESPONSE_HEADER_SIZE   5

Definition at line 46 of file qlowenergycontroller_bluez.cpp.

◆ EXECUTE_WRITE_HEADER_SIZE

#define EXECUTE_WRITE_HEADER_SIZE   2

Definition at line 54 of file qlowenergycontroller_bluez.cpp.

◆ FIND_INFO_REQUEST_HEADER_SIZE

#define FIND_INFO_REQUEST_HEADER_SIZE   5

Definition at line 47 of file qlowenergycontroller_bluez.cpp.

◆ GATT_CHARACTERISTIC

#define GATT_CHARACTERISTIC   quint16(0x2803)

Definition at line 43 of file qlowenergycontroller_bluez.cpp.

◆ GATT_INCLUDED_SERVICE

#define GATT_INCLUDED_SERVICE   quint16(0x2802)

Definition at line 42 of file qlowenergycontroller_bluez.cpp.

◆ GATT_PRIMARY_SERVICE

#define GATT_PRIMARY_SERVICE   quint16(0x2800)

Definition at line 40 of file qlowenergycontroller_bluez.cpp.

◆ GATT_SECONDARY_SERVICE

#define GATT_SECONDARY_SERVICE   quint16(0x2801)

Definition at line 41 of file qlowenergycontroller_bluez.cpp.

◆ GRP_TYPE_REQ_HEADER_SIZE

#define GRP_TYPE_REQ_HEADER_SIZE   7

Definition at line 48 of file qlowenergycontroller_bluez.cpp.

◆ MTU_EXCHANGE_HEADER_SIZE

#define MTU_EXCHANGE_HEADER_SIZE   3

Definition at line 55 of file qlowenergycontroller_bluez.cpp.

◆ NEW_VALUE

#define NEW_VALUE   false

Definition at line 58 of file qlowenergycontroller_bluez.cpp.

◆ PREPARE_WRITE_HEADER_SIZE

#define PREPARE_WRITE_HEADER_SIZE   5

Definition at line 53 of file qlowenergycontroller_bluez.cpp.

◆ READ_BLOB_REQUEST_HEADER_SIZE

#define READ_BLOB_REQUEST_HEADER_SIZE   5

Definition at line 51 of file qlowenergycontroller_bluez.cpp.

◆ READ_BY_TYPE_REQ_HEADER_SIZE

#define READ_BY_TYPE_REQ_HEADER_SIZE   7

Definition at line 49 of file qlowenergycontroller_bluez.cpp.

◆ READ_REQUEST_HEADER_SIZE

#define READ_REQUEST_HEADER_SIZE   3

Definition at line 50 of file qlowenergycontroller_bluez.cpp.

◆ WRITE_REQUEST_HEADER_SIZE

#define WRITE_REQUEST_HEADER_SIZE   3

Definition at line 52 of file qlowenergycontroller_bluez.cpp.

Function Documentation

◆ dumpErrorInformation()

◆ getUuidSize()

int getUuidSize ( const QBluetoothUuid & uuid)
static

Definition at line 136 of file qlowenergycontroller_bluez.cpp.

◆ isIndicationEnabled()

bool isIndicationEnabled ( quint16 clientConfigValue)
static

Definition at line 2586 of file qlowenergycontroller_bluez.cpp.

◆ isNotificationEnabled()

bool isNotificationEnabled ( quint16 clientConfigValue)
static

Definition at line 2585 of file qlowenergycontroller_bluez.cpp.

◆ nameOfRemoteCentral()

QString nameOfRemoteCentral ( const QBluetoothAddress & peerAddress)
static

Definition at line 3024 of file qlowenergycontroller_bluez.cpp.

◆ parseReadByTypeCharDiscovery()

QLowEnergyHandle parseReadByTypeCharDiscovery ( QLowEnergyServicePrivate::CharData * charData,
const char * data,
quint16 elementLength )

Definition at line 905 of file qlowenergycontroller_bluez.cpp.

◆ parseReadByTypeIncludeDiscovery()

QLowEnergyHandle parseReadByTypeIncludeDiscovery ( QList< QBluetoothUuid > * foundServices,
const char * data,
quint16 elementLength )

Definition at line 932 of file qlowenergycontroller_bluez.cpp.

◆ putDataAndIncrement() [1/5]

template<>
void putDataAndIncrement ( const QBluetoothUuid & uuid,
char *& dst )

Definition at line 146 of file qlowenergycontroller_bluez.cpp.

◆ putDataAndIncrement() [2/5]

template<>
void putDataAndIncrement ( const QBluetoothUuid & uuid,
char *& dst )

Definition at line 146 of file qlowenergycontroller_bluez.cpp.

◆ putDataAndIncrement() [3/5]

template<>
void putDataAndIncrement ( const QByteArray & value,
char *& dst )

Definition at line 159 of file qlowenergycontroller_bluez.cpp.

◆ putDataAndIncrement() [4/5]

template<>
void putDataAndIncrement ( const QByteArray & value,
char *& dst )

Definition at line 159 of file qlowenergycontroller_bluez.cpp.

◆ putDataAndIncrement() [5/5]

template<typename T>
void putDataAndIncrement ( const T & src,
char *& dst )
static

Definition at line 141 of file qlowenergycontroller_bluez.cpp.

◆ reportMalformedData()

Q_DECL_COLD_FUNCTION void reportMalformedData ( QBluezConst::AttCommand cmd,
const QByteArray & response )
static

Definition at line 965 of file qlowenergycontroller_bluez.cpp.

◆ uuidToByteArray()

QByteArray uuidToByteArray ( const QBluetoothUuid & uuid)
static

Definition at line 3267 of file qlowenergycontroller_bluez.cpp.

Variable Documentation

◆ ATT_DEFAULT_LE_MTU

quint16 ATT_DEFAULT_LE_MTU = 23
constexpr

Definition at line 37 of file qlowenergycontroller_bluez.cpp.

◆ ATT_MAX_LE_MTU

quint16 ATT_MAX_LE_MTU = 0x200
constexpr

Definition at line 38 of file qlowenergycontroller_bluez.cpp.

◆ maxPrepareQueueSize

const int maxPrepareQueueSize = 1024

Definition at line 67 of file qlowenergycontroller_bluez.cpp.