Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
Macros | Variables
L2CAPComm.cpp File Reference
#include <cstring>
#include <string>
#include <memory>
#include <cstdint>
#include <vector>
#include <cstdio>
#include <algorithm>
#include <jau/debug.hpp>
#include "L2CAPComm.hpp"
#include "DBTConst.hpp"
#include "BTIoctl.hpp"
#include "L2CAPIoctl.hpp"
#include "BTDevice.hpp"
#include <unistd.h>
#include <sys/socket.h>
#include <poll.h>
#include <pthread.h>
#include <signal.h>
Include dependency graph for L2CAPComm.cpp:

Go to the source code of this file.

Macros

#define CASE2_TO_STRING(U, V)   case U::V: return #V;
 
#define RWEXITCODE_ENUM(X)
 

Variables

constexpr const bool SET_BT_SECURITY_POST_CONNECT = true
 Setting BT_SECURITY within open() after bind() and before connect() causes BlueZ/Kernel to immediately process SMP, leading to a potential deadlock. More...
 

Macro Definition Documentation

◆ RWEXITCODE_ENUM

#define RWEXITCODE_ENUM (   X)
Value:
X(RWExitCode, SUCCESS) \
X(RWExitCode, NOT_OPEN) \
X(RWExitCode, INTERRUPTED) \
X(RWExitCode, INVALID_SOCKET_DD) \
X(RWExitCode, POLL_ERROR) \
X(RWExitCode, POLL_TIMEOUT) \
X(RWExitCode, READ_ERROR) \
X(RWExitCode, READ_TIMEOUT) \
X(RWExitCode, WRITE_ERROR)

Definition at line 497 of file L2CAPComm.cpp.

◆ CASE2_TO_STRING

#define CASE2_TO_STRING (   U,
 
)    case U::V: return #V;

Definition at line 508 of file L2CAPComm.cpp.

Variable Documentation

◆ SET_BT_SECURITY_POST_CONNECT

constexpr const bool SET_BT_SECURITY_POST_CONNECT = true
inlineconstexpr

Setting BT_SECURITY within open() after bind() and before connect() causes BlueZ/Kernel to immediately process SMP, leading to a potential deadlock.

Here we experience, setting security level before connect() will block the thread within connect(), potentially a mutex used in the SMP procedure.

Hence we set BT_SECURITY after connect() within open().

Definition at line 82 of file L2CAPComm.cpp.