Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
bluez_data_p.h File Reference

(f6f75200436f5ed0506fe94a31e8a15e39b45c81)

#include <QtCore/private/qglobal_p.h>
#include <QtCore/qendian.h>
#include <sys/socket.h>
#include <QtBluetooth/QBluetoothUuid>
#include <QtCore/qtmetamacros.h>
+ Include dependency graph for bluez_data_p.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  bt_security
 
struct  __attribute__
 
struct  sockaddr_l2
 
struct  sockaddr_rc
 
struct  sockaddr_hci
 
struct  hci_dev_req
 
struct  hci_dev_list_req
 
struct  hci_dev_stats
 
struct  hci_dev_info
 
struct  hci_conn_info
 
struct  hci_conn_list_req
 
struct  hci_filter
 
struct  evt_cmd_complete
 
struct  AclData
 
struct  L2CapHeader
 
struct  hci_command_hdr
 

Namespaces

namespace  QBluezConst
 

Macros

#define ATTRIBUTE_CHANNEL_ID   4
 
#define SIGNALING_CHANNEL_ID   5
 
#define SECURITY_CHANNEL_ID   6
 
#define BTPROTO_L2CAP   0
 
#define BTPROTO_HCI   1
 
#define BTPROTO_RFCOMM   3
 
#define SOL_HCI   0
 
#define SOL_L2CAP   6
 
#define SOL_RFCOMM   18
 
#define SOL_BLUETOOTH   274
 
#define RFCOMM_LM   0x03
 
#define RFCOMM_LM_AUTH   0x0002
 
#define RFCOMM_LM_ENCRYPT   0x0004
 
#define RFCOMM_LM_TRUSTED   0x0008
 
#define RFCOMM_LM_SECURE   0x0020
 
#define L2CAP_LM   0x03
 
#define L2CAP_LM_AUTH   0x0002
 
#define L2CAP_LM_ENCRYPT   0x0004
 
#define L2CAP_LM_TRUSTED   0x0008
 
#define L2CAP_LM_SECURE   0x0020
 
#define BT_SECURITY   4
 
#define BT_SECURITY_SDP   0
 
#define BT_SECURITY_LOW   1
 
#define BT_SECURITY_MEDIUM   2
 
#define BT_SECURITY_HIGH   3
 
#define BDADDR_LE_PUBLIC   0x01
 
#define BDADDR_LE_RANDOM   0x02
 
#define SCO_LINK   0x00
 
#define ACL_LINK   0x01
 
#define ESCO_LINK   0x02
 
#define LE_LINK   0x80
 
#define htobs(d)   (d)
 
#define htobl(d)   (d)
 
#define htobll(d)   (d)
 
#define btohs(d)   (d)
 
#define btohl(d)   (d)
 
#define btohll(d)   (d)
 
#define HCIGETCONNLIST   _IOR('H', 212, int)
 
#define HCIGETDEVINFO   _IOR('H', 211, int)
 
#define HCIGETDEVLIST   _IOR('H', 210, int)
 
#define HCI_MAX_DEV   16
 
#define HCI_DEV_NONE   0xffff
 
#define HCI_CHANNEL_CONTROL   0x3
 
#define HCI_MAX_EVENT_SIZE   260
 
#define HCI_FILTER   2
 
#define HCI_COMMAND_PKT   0x01
 
#define HCI_ACL_PKT   0x02
 
#define HCI_EVENT_PKT   0x04
 
#define HCI_VENDOR_PKT   0xff
 
#define HCI_FLT_TYPE_BITS   31
 
#define HCI_FLT_EVENT_BITS   63
 
#define HCI_EVENT_HDR_SIZE   2
 
#define EVT_ENCRYPT_CHANGE_SIZE   4
 
#define opCodePack(ogf, ocf)   (quint16(((ocf) & 0x03ff)|((ogf) << 10)))
 
#define ogfFromOpCode(op)   ((op) >> 10)
 
#define ocfFromOpCode(op)   ((op) & 0x03ff)
 

Typedefs

typedef QUuid::Id128Bytes BluezUint128
 

Enumerations

enum  QBluezConst::OpCodeGroupField { QBluezConst::OgfLinkControl = 0x8 }
 
enum  QBluezConst::OpCodeCommandField {
  QBluezConst::OcfLeSetAdvParams = 0x6 , QBluezConst::OcfLeReadTxPowerLevel = 0x7 , QBluezConst::OcfLeSetAdvData = 0x8 , QBluezConst::OcfLeSetScanResponseData = 0x9 ,
  QBluezConst::OcfLeSetAdvEnable = 0xa , QBluezConst::OcfLeClearWhiteList = 0x10 , QBluezConst::OcfLeAddToWhiteList = 0x11 , QBluezConst::OcfLeConnectionUpdate = 0x13
}
 
enum class  QBluezConst::AttCommand : quint8 {
  QBluezConst::ATT_OP_ERROR_RESPONSE = 0x01 , QBluezConst::ATT_OP_EXCHANGE_MTU_REQUEST = 0x02 , QBluezConst::ATT_OP_EXCHANGE_MTU_RESPONSE = 0x03 , QBluezConst::ATT_OP_FIND_INFORMATION_REQUEST = 0x04 ,
  QBluezConst::ATT_OP_FIND_INFORMATION_RESPONSE = 0x05 , QBluezConst::ATT_OP_FIND_BY_TYPE_VALUE_REQUEST = 0x06 , QBluezConst::ATT_OP_FIND_BY_TYPE_VALUE_RESPONSE = 0x07 , QBluezConst::ATT_OP_READ_BY_TYPE_REQUEST = 0x08 ,
  QBluezConst::ATT_OP_READ_BY_TYPE_RESPONSE = 0x09 , QBluezConst::ATT_OP_READ_REQUEST = 0x0A , QBluezConst::ATT_OP_READ_RESPONSE = 0x0B , QBluezConst::ATT_OP_READ_BLOB_REQUEST = 0x0C ,
  QBluezConst::ATT_OP_READ_BLOB_RESPONSE = 0x0D , QBluezConst::ATT_OP_READ_MULTIPLE_REQUEST = 0x0E , QBluezConst::ATT_OP_READ_MULTIPLE_RESPONSE = 0x0F , QBluezConst::ATT_OP_READ_BY_GROUP_REQUEST = 0x10 ,
  QBluezConst::ATT_OP_READ_BY_GROUP_RESPONSE = 0x11 , QBluezConst::ATT_OP_WRITE_REQUEST = 0x12 , QBluezConst::ATT_OP_WRITE_RESPONSE = 0x13 , QBluezConst::ATT_OP_PREPARE_WRITE_REQUEST = 0x16 ,
  QBluezConst::ATT_OP_PREPARE_WRITE_RESPONSE = 0x17 , QBluezConst::ATT_OP_EXECUTE_WRITE_REQUEST = 0x18 , QBluezConst::ATT_OP_EXECUTE_WRITE_RESPONSE = 0x19 , QBluezConst::ATT_OP_HANDLE_VAL_NOTIFICATION = 0x1b ,
  QBluezConst::ATT_OP_HANDLE_VAL_INDICATION = 0x1d , QBluezConst::ATT_OP_HANDLE_VAL_CONFIRMATION = 0x1e , QBluezConst::ATT_OP_WRITE_COMMAND = 0x52 , QBluezConst::ATT_OP_SIGNED_WRITE_COMMAND = 0xD2
}
 
enum class  QBluezConst::AttError : quint8 {
  QBluezConst::ATT_ERROR_NO_ERROR = 0x00 , QBluezConst::ATT_ERROR_INVALID_HANDLE = 0x01 , QBluezConst::ATT_ERROR_READ_NOT_PERM = 0x02 , QBluezConst::ATT_ERROR_WRITE_NOT_PERM = 0x03 ,
  QBluezConst::ATT_ERROR_INVALID_PDU = 0x04 , QBluezConst::ATT_ERROR_INSUF_AUTHENTICATION = 0x05 , QBluezConst::ATT_ERROR_REQUEST_NOT_SUPPORTED = 0x06 , QBluezConst::ATT_ERROR_INVALID_OFFSET = 0x07 ,
  QBluezConst::ATT_ERROR_INSUF_AUTHORIZATION = 0x08 , QBluezConst::ATT_ERROR_PREPARE_QUEUE_FULL = 0x09 , QBluezConst::ATT_ERROR_ATTRIBUTE_NOT_FOUND = 0x0A , QBluezConst::ATT_ERROR_ATTRIBUTE_NOT_LONG = 0x0B ,
  QBluezConst::ATT_ERROR_INSUF_ENCR_KEY_SIZE = 0x0C , QBluezConst::ATT_ERROR_INVAL_ATTR_VALUE_LEN = 0x0D , QBluezConst::ATT_ERROR_UNLIKELY = 0x0E , QBluezConst::ATT_ERROR_INSUF_ENCRYPTION = 0x0F ,
  QBluezConst::ATT_ERROR_UNSUPPRTED_GROUP_TYPE = 0x10 , QBluezConst::ATT_ERROR_INSUF_RESOURCES = 0x11 , QBluezConst::ATT_ERROR_APPLICATION_START = 0x80 , QBluezConst::ATT_ERROR_REQUEST_STALLED = 0x81 ,
  QBluezConst::ATT_ERROR_APPLICATION_END = 0x9f
}
 

Functions

template<typename T >
getBtData (const void *ptr)
 
static quint16 bt_get_le16 (const void *ptr)
 
template<typename T >
void putBtData (T src, void *dst)
 
static void hci_set_bit (int nr, void *addr)
 
static void hci_clear_bit (int nr, void *addr)
 
static void hci_filter_clear (struct hci_filter *f)
 
static void hci_filter_set_ptype (int t, struct hci_filter *f)
 
static void hci_filter_clear_ptype (int t, struct hci_filter *f)
 
static void hci_filter_set_event (int e, struct hci_filter *f)
 
static void hci_filter_clear_event (int e, struct hci_filter *f)
 
static void hci_filter_all_ptypes (struct hci_filter *f)
 
static void hci_filter_all_events (struct hci_filter *f)
 
struct evt_cmd_complete __attribute__ ((packed))
 

Variables

quint8 ncmd
 
quint16 opcode
 
struct AclData __attribute__
 
quint8 plen
 
Q_NAMESPACE enum QBluezConst::OpCodeGroupField QBluezConst::__attribute__
 

Macro Definition Documentation

◆ ACL_LINK

#define ACL_LINK   0x01

Definition at line 68 of file bluez_data_p.h.

Referenced by HciManager::activeLowEnergyConnections().

◆ ATTRIBUTE_CHANNEL_ID

#define ATTRIBUTE_CHANNEL_ID   4

Definition at line 26 of file bluez_data_p.h.

Referenced by ServerSocket::listen().

◆ BDADDR_LE_PUBLIC

#define BDADDR_LE_PUBLIC   0x01

Definition at line 64 of file bluez_data_p.h.

Referenced by ServerSocket::listen().

◆ BDADDR_LE_RANDOM

#define BDADDR_LE_RANDOM   0x02

Definition at line 65 of file bluez_data_p.h.

◆ BT_SECURITY

#define BT_SECURITY   4

Definition at line 54 of file bluez_data_p.h.

Referenced by QBluetoothSocketPrivateBluez::connectToServiceHelper().

◆ BT_SECURITY_HIGH

#define BT_SECURITY_HIGH   3

Definition at line 62 of file bluez_data_p.h.

Referenced by QBluetoothSocketPrivateBluez::connectToServiceHelper().

◆ BT_SECURITY_LOW

#define BT_SECURITY_LOW   1

Definition at line 60 of file bluez_data_p.h.

Referenced by QBluetoothSocketPrivateBluez::connectToServiceHelper().

◆ BT_SECURITY_MEDIUM

#define BT_SECURITY_MEDIUM   2

Definition at line 61 of file bluez_data_p.h.

Referenced by QBluetoothSocketPrivateBluez::connectToServiceHelper().

◆ BT_SECURITY_SDP

#define BT_SECURITY_SDP   0

Definition at line 59 of file bluez_data_p.h.

◆ btohl

#define btohl ( d)    (d)

Definition at line 78 of file bluez_data_p.h.

◆ btohll

#define btohll ( d)    (d)

Definition at line 79 of file bluez_data_p.h.

◆ btohs

#define btohs ( d)    (d)

Definition at line 77 of file bluez_data_p.h.

◆ BTPROTO_HCI

#define BTPROTO_HCI   1

◆ BTPROTO_L2CAP

#define BTPROTO_L2CAP   0

◆ BTPROTO_RFCOMM

#define BTPROTO_RFCOMM   3

Definition at line 32 of file bluez_data_p.h.

Referenced by QBluetoothSocketPrivateBluez::ensureNativeSocket().

◆ ESCO_LINK

#define ESCO_LINK   0x02

Definition at line 69 of file bluez_data_p.h.

Referenced by HciManager::activeLowEnergyConnections().

◆ EVT_ENCRYPT_CHANGE_SIZE

#define EVT_ENCRYPT_CHANGE_SIZE   4

Definition at line 281 of file bluez_data_p.h.

◆ HCI_ACL_PKT

#define HCI_ACL_PKT   0x02

◆ HCI_CHANNEL_CONTROL

#define HCI_CHANNEL_CONTROL   0x3

Definition at line 143 of file bluez_data_p.h.

Referenced by BluetoothManagement::BluetoothManagement().

◆ HCI_COMMAND_PKT

#define HCI_COMMAND_PKT   0x01

Definition at line 151 of file bluez_data_p.h.

Referenced by HciManager::sendCommand().

◆ HCI_DEV_NONE

#define HCI_DEV_NONE   0xffff

Definition at line 141 of file bluez_data_p.h.

Referenced by BluetoothManagement::BluetoothManagement().

◆ HCI_EVENT_HDR_SIZE

#define HCI_EVENT_HDR_SIZE   2

Definition at line 274 of file bluez_data_p.h.

◆ HCI_EVENT_PKT

#define HCI_EVENT_PKT   0x04

Definition at line 153 of file bluez_data_p.h.

Referenced by HciManager::monitorEvent().

◆ HCI_FILTER

#define HCI_FILTER   2

◆ HCI_FLT_EVENT_BITS

#define HCI_FLT_EVENT_BITS   63

Definition at line 157 of file bluez_data_p.h.

Referenced by hci_filter_clear_event(), and hci_filter_set_event().

◆ HCI_FLT_TYPE_BITS

#define HCI_FLT_TYPE_BITS   31

Definition at line 156 of file bluez_data_p.h.

Referenced by hci_filter_clear_ptype(), and hci_filter_set_ptype().

◆ HCI_MAX_DEV

#define HCI_MAX_DEV   16

Definition at line 140 of file bluez_data_p.h.

Referenced by mandatoryHciIoctlsAvailable().

◆ HCI_MAX_EVENT_SIZE

#define HCI_MAX_EVENT_SIZE   260

Definition at line 145 of file bluez_data_p.h.

◆ HCI_VENDOR_PKT

#define HCI_VENDOR_PKT   0xff

Definition at line 154 of file bluez_data_p.h.

Referenced by hci_filter_clear_ptype(), and hci_filter_set_ptype().

◆ HCIGETCONNLIST

#define HCIGETCONNLIST   _IOR('H', 212, int)

◆ HCIGETDEVINFO

#define HCIGETDEVINFO   _IOR('H', 211, int)

Definition at line 92 of file bluez_data_p.h.

Referenced by mandatoryHciIoctlsAvailable().

◆ HCIGETDEVLIST

#define HCIGETDEVLIST   _IOR('H', 210, int)

Definition at line 93 of file bluez_data_p.h.

Referenced by mandatoryHciIoctlsAvailable().

◆ htobl

#define htobl ( d)    (d)

Definition at line 75 of file bluez_data_p.h.

◆ htobll

#define htobll ( d)    (d)

Definition at line 76 of file bluez_data_p.h.

◆ htobs

#define htobs ( d)    (d)

◆ L2CAP_LM

#define L2CAP_LM   0x03

Definition at line 48 of file bluez_data_p.h.

◆ L2CAP_LM_AUTH

#define L2CAP_LM_AUTH   0x0002

Definition at line 49 of file bluez_data_p.h.

◆ L2CAP_LM_ENCRYPT

#define L2CAP_LM_ENCRYPT   0x0004

Definition at line 50 of file bluez_data_p.h.

◆ L2CAP_LM_SECURE

#define L2CAP_LM_SECURE   0x0020

Definition at line 52 of file bluez_data_p.h.

◆ L2CAP_LM_TRUSTED

#define L2CAP_LM_TRUSTED   0x0008

Definition at line 51 of file bluez_data_p.h.

◆ LE_LINK

#define LE_LINK   0x80

Definition at line 70 of file bluez_data_p.h.

Referenced by HciManager::activeLowEnergyConnections().

◆ ocfFromOpCode

#define ocfFromOpCode ( op)    ((op) & 0x03ff)

Definition at line 390 of file bluez_data_p.h.

◆ ogfFromOpCode

#define ogfFromOpCode ( op)    ((op) >> 10)

Definition at line 389 of file bluez_data_p.h.

◆ opCodePack

#define opCodePack ( ogf,
ocf )   (quint16(((ocf) & 0x03ff)|((ogf) << 10)))

Definition at line 388 of file bluez_data_p.h.

Referenced by HciManager::sendCommand().

◆ RFCOMM_LM

#define RFCOMM_LM   0x03

Definition at line 41 of file bluez_data_p.h.

◆ RFCOMM_LM_AUTH

#define RFCOMM_LM_AUTH   0x0002

Definition at line 43 of file bluez_data_p.h.

◆ RFCOMM_LM_ENCRYPT

#define RFCOMM_LM_ENCRYPT   0x0004

Definition at line 44 of file bluez_data_p.h.

◆ RFCOMM_LM_SECURE

#define RFCOMM_LM_SECURE   0x0020

Definition at line 46 of file bluez_data_p.h.

◆ RFCOMM_LM_TRUSTED

#define RFCOMM_LM_TRUSTED   0x0008

Definition at line 45 of file bluez_data_p.h.

◆ SCO_LINK

#define SCO_LINK   0x00

Definition at line 67 of file bluez_data_p.h.

Referenced by HciManager::activeLowEnergyConnections().

◆ SECURITY_CHANNEL_ID

#define SECURITY_CHANNEL_ID   6

Definition at line 28 of file bluez_data_p.h.

◆ SIGNALING_CHANNEL_ID

#define SIGNALING_CHANNEL_ID   5

Definition at line 27 of file bluez_data_p.h.

Referenced by HciManager::sendConnectionParameterUpdateRequest().

◆ SOL_BLUETOOTH

#define SOL_BLUETOOTH   274

Definition at line 38 of file bluez_data_p.h.

Referenced by QBluetoothSocketPrivateBluez::connectToServiceHelper().

◆ SOL_HCI

#define SOL_HCI   0

◆ SOL_L2CAP

#define SOL_L2CAP   6

Definition at line 35 of file bluez_data_p.h.

◆ SOL_RFCOMM

#define SOL_RFCOMM   18

Definition at line 36 of file bluez_data_p.h.

Typedef Documentation

◆ BluezUint128

Definition at line 96 of file bluez_data_p.h.

Function Documentation

◆ __attribute__()

struct evt_cmd_complete __attribute__ ( (packed) )

◆ bt_get_le16()

static quint16 bt_get_le16 ( const void * ptr)
inlinestatic

Definition at line 128 of file bluez_data_p.h.

References ptr().

Referenced by dumpErrorInformation(), parseReadByTypeCharDiscovery(), and parseReadByTypeIncludeDiscovery().

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

◆ getBtData()

template<typename T >
T getBtData ( const void * ptr)
inline

Definition at line 123 of file bluez_data_p.h.

References ptr().

+ Here is the call graph for this function:

◆ hci_clear_bit()

static void hci_clear_bit ( int nr,
void * addr )
inlinestatic

Definition at line 237 of file bluez_data_p.h.

Referenced by hci_filter_clear_event(), and hci_filter_clear_ptype().

+ Here is the caller graph for this function:

◆ hci_filter_all_events()

static void hci_filter_all_events ( struct hci_filter * f)
inlinestatic

Definition at line 265 of file bluez_data_p.h.

Referenced by HciManager::monitorAclPackets().

+ Here is the caller graph for this function:

◆ hci_filter_all_ptypes()

static void hci_filter_all_ptypes ( struct hci_filter * f)
inlinestatic

Definition at line 261 of file bluez_data_p.h.

◆ hci_filter_clear()

static void hci_filter_clear ( struct hci_filter * f)
inlinestatic

Definition at line 241 of file bluez_data_p.h.

Referenced by HciManager::stopEvents().

+ Here is the caller graph for this function:

◆ hci_filter_clear_event()

static void hci_filter_clear_event ( int e,
struct hci_filter * f )
inlinestatic

Definition at line 257 of file bluez_data_p.h.

References hci_clear_bit(), and HCI_FLT_EVENT_BITS.

+ Here is the call graph for this function:

◆ hci_filter_clear_ptype()

static void hci_filter_clear_ptype ( int t,
struct hci_filter * f )
inlinestatic

Definition at line 249 of file bluez_data_p.h.

References hci_clear_bit(), HCI_FLT_TYPE_BITS, and HCI_VENDOR_PKT.

+ Here is the call graph for this function:

◆ hci_filter_set_event()

static void hci_filter_set_event ( int e,
struct hci_filter * f )
inlinestatic

Definition at line 253 of file bluez_data_p.h.

References HCI_FLT_EVENT_BITS, and hci_set_bit().

Referenced by HciManager::monitorEvent().

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

◆ hci_filter_set_ptype()

static void hci_filter_set_ptype ( int t,
struct hci_filter * f )
inlinestatic

Definition at line 245 of file bluez_data_p.h.

References HCI_FLT_TYPE_BITS, hci_set_bit(), and HCI_VENDOR_PKT.

Referenced by HciManager::monitorAclPackets(), and HciManager::monitorEvent().

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

◆ hci_set_bit()

static void hci_set_bit ( int nr,
void * addr )
inlinestatic

Definition at line 233 of file bluez_data_p.h.

Referenced by hci_filter_set_event(), and hci_filter_set_ptype().

+ Here is the caller graph for this function:

◆ putBtData()

template<typename T >
void putBtData ( T src,
void * dst )
inline

Definition at line 133 of file bluez_data_p.h.

References qToLittleEndian().

Referenced by LeCmacCalculator::createFullMessage(), putDataAndIncrement(), putDataAndIncrement(), QLowEnergyControllerPrivateBluez::readCharacteristic(), and QLowEnergyControllerPrivateBluez::readDescriptor().

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

Variable Documentation

◆ __attribute__

struct AclData __attribute__

◆ ncmd

quint8 ncmd

Definition at line 0 of file bluez_data_p.h.

◆ opcode

◆ plen

quint8 plen

Definition at line 1 of file bluez_data_p.h.