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

(216230d7f5628c55ee90572911597d5b75b5f486)

#include <QtCore/qloggingcategory.h>
#include <QtCore/qsocketnotifier.h>
#include <QtCore/qtimer.h>
#include "bluetoothmanagement_p.h"
#include "bluez_data_p.h"
#include "../qbluetoothsocketbase_p.h"
#include <unistd.h>
#include <sys/prctl.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <linux/capability.h>
#include <cerrno>
#include "moc_bluetoothmanagement_p.cpp"
Include dependency graph for bluetoothmanagement.cpp:

Go to the source code of this file.

Classes

struct  MgmtHdr
struct  MgmtEventDeviceFound
struct  capHdr
struct  capData

Macros

#define _LINUX_CAPABILITY_VERSION_3   0x20080522
#define _LINUX_CAPABILITY_U32S_3   2
#define CAP_NET_ADMIN   12
#define CAP_TO_INDEX(x)
#define CAP_TO_MASK(x)

Functions

QT_BEGIN_NAMESPACE struct MgmtHdr __attribute__ ((packed))
static int sysCallCapGet (capHdr *header, capData *data)
static bool hasBtMgmtPermission ()

Variables

quint16 cmdCode
quint16 controllerIndex
quint16 length
bdaddr_t bdaddr
quint8 type
quint8 rssi
quint32 flags
quint16 eirLength
quint8 eirData [0]
struct capHdr __attribute__
const int msecInADay = 1000*60*60*24

Macro Definition Documentation

◆ _LINUX_CAPABILITY_U32S_3

#define _LINUX_CAPABILITY_U32S_3   2

Definition at line 73 of file bluetoothmanagement.cpp.

◆ _LINUX_CAPABILITY_VERSION_3

#define _LINUX_CAPABILITY_VERSION_3   0x20080522

Definition at line 69 of file bluetoothmanagement.cpp.

◆ CAP_NET_ADMIN

#define CAP_NET_ADMIN   12

Definition at line 77 of file bluetoothmanagement.cpp.

◆ CAP_TO_INDEX

#define CAP_TO_INDEX ( x)
Value:
((x) >> 5) /* 1 << 5 == bits in __u32 */
GLint GLint GLint GLint GLint x

Definition at line 81 of file bluetoothmanagement.cpp.

◆ CAP_TO_MASK

#define CAP_TO_MASK ( x)
Value:
(1 << ((x) & 31)) /* mask for indexed __u32 */

Definition at line 85 of file bluetoothmanagement.cpp.

Function Documentation

◆ __attribute__()

QT_BEGIN_NAMESPACE struct MgmtHdr __attribute__ ( (packed) )

◆ hasBtMgmtPermission()

bool hasBtMgmtPermission ( )
static

Definition at line 98 of file bluetoothmanagement.cpp.

References capHdr::pid, and sysCallCapGet().

Referenced by BluetoothManagement::BluetoothManagement().

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

◆ sysCallCapGet()

int sysCallCapGet ( capHdr * header,
capData * data )
static

Definition at line 90 of file bluetoothmanagement.cpp.

Referenced by hasBtMgmtPermission().

Here is the caller graph for this function:

Variable Documentation

◆ __attribute__

struct AdvData __attribute__

Definition at line 276 of file qioseventdispatcher.mm.

◆ bdaddr

bdaddr_t bdaddr

Definition at line 0 of file bluetoothmanagement.cpp.

◆ cmdCode

quint16 cmdCode

Definition at line 0 of file bluetoothmanagement.cpp.

◆ controllerIndex

quint16 controllerIndex

Definition at line 1 of file bluetoothmanagement.cpp.

◆ eirData

quint8 eirData

Definition at line 5 of file bluetoothmanagement.cpp.

◆ eirLength

quint16 eirLength

Definition at line 4 of file bluetoothmanagement.cpp.

◆ flags

Definition at line 3 of file bluetoothmanagement.cpp.

◆ length

Definition at line 2 of file bluetoothmanagement.cpp.

◆ msecInADay

const int msecInADay = 1000*60*60*24

Definition at line 88 of file bluetoothmanagement.cpp.

Referenced by BluetoothManagement::BluetoothManagement().

◆ rssi

quint8 rssi

Definition at line 2 of file bluetoothmanagement.cpp.

◆ type

Definition at line 1 of file bluetoothmanagement.cpp.