41#include "HCIIoctl.hpp"
62 HCIException(std::string type, std::string
const& m,
const char* file,
int line) noexcept
66 HCIException(std::string
const& m,
const char* file,
int line) noexcept
86 return static_cast<int>(rhs);
104 const uint16_t multiplier=10) noexcept
106 return std::max<uint16_t>(min_result_ms,
107 ( 1 + conn_latency ) * conn_interval_max_ms * std::max<uint16_t>(2, multiplier)
117 constexpr int32_t
getHCIMaxConnLatency(
const int16_t supervision_timeout_ms,
const int16_t conn_interval_max_ms) {
118 return ((supervision_timeout_ms / (conn_interval_max_ms*2)) - 1);
129 return static_cast<uint16_t
>(rhs);
235 return static_cast<uint8_t
>(rhs);
241 const char*
name() const noexcept
override {
return "HCI"; }
242 std::string
message(
int condition)
const override {
286 return static_cast<uint8_t
>(rhs);
301 return static_cast<uint8_t
>(rhs);
343 return static_cast<uint8_t
>(rhs);
388 return static_cast<uint8_t
>(rhs);
458 return static_cast<uint16_t
>(rhs);
516 return static_cast<uint8_t
>(rhs);
553 virtual std::string
nameString() const noexcept {
return "HCIPacket"; }
555 virtual std::string
baseString() const noexcept {
return ""; }
563 if( 0 == total_packet_size ) {
573 if( 0 == total_packet_size ) {
588 static T*
clone(const T& source) noexcept {
return new T(source); }
620 if( has < min || has >
max ) {
634 std::string
nameString() const noexcept
override {
return "HCICommand"; }
661 if( exp_param_size > paramSize ) {
672 if( 255 < param_size ) {
684 if( param_size > 0 ) {
696 if( 255 < param_size ) {
723 std::string
nameString() const noexcept
override {
return "HCIDisconnectCmd"; }
777 std::string
nameString() const noexcept
override {
return "HCILEEnableEncryptionCmd"; }
852 std::string
nameString() const noexcept
override {
return "HCILELTKReplyAckCmd"; }
900 std::string
nameString() const noexcept
override {
return "HCILELTKReplyRejCmd"; }
927 template<
typename hcistruct>
931 std::string
nameString() const noexcept
override {
return "HCIStructCmd"; }
939 bzero((
void*)cp,
sizeof(hcistruct));
944 :
HCICommand(opc, (const uint8_t *)(&cp), sizeof(hcistruct))
986 START_NON_AUTOFLUSH_HOST = 0b00,
988 CONTINUING_FRAGMENT = 0b01,
990 START_AUTOFLUSH = 0b10,
992 COMPLETE_L2CAP_AUTOFLUSH = 0b11,
994 static constexpr uint8_t
number(
const PBFlag v)
noexcept {
return static_cast<uint8_t
>(v); }
1021 std::string
toString(
const uint8_t* l2cap_data)
const noexcept {
1040 constexpr static uint16_t
get_handle(
const uint16_t handle_and_flags)
noexcept {
return static_cast<uint16_t
>(handle_and_flags & 0x0fff); }
1045 constexpr static uint8_t
get_pbflag(
const uint16_t handle_and_flags)
noexcept {
return static_cast<uint8_t
>( ( handle_and_flags >> 12 ) & 0b11 ); }
1050 constexpr static uint8_t
get_bcflag(
const uint16_t handle_and_flags)
noexcept {
return static_cast<uint8_t
>( ( handle_and_flags >> 14 ) & 0b11 ); }
1064 l2cap_frame
getL2CAPFrame(
const uint8_t* & l2cap_data)
const noexcept;
1067 const uint8_t* l2cap_data;
1094 if( has < min || has >
max ) {
1108 std::string
nameString() const noexcept
override {
return "HCIEvent"; }
1138 if( exp_param_size > baseParamSize ) {
1157 if( param_size > 0 ) {
1185 template<
typename hcistruct>
1220 std::string
nameString() const noexcept
override {
return "HCIDisconnectionCompleteEvent"; }
1257 std::string
nameString() const noexcept
override {
return "HCICmdCompleteEvent"; }
1305 std::string
nameString() const noexcept
override {
return "HCICmdStatusEvent"; }
1355 std::string
nameString() const noexcept
override {
return "HCIMetaEvent"; }
1372 :
HCIEvent(buffer, buffer_len, 1+exp_meta_param_size)
1388 if( meta_param_size > 0 ) {
1429 std::string
nameString() const noexcept
override {
return "HCILELTKReqEvent"; }
1469 template<
typename hcistruct>
BT Core Spec v5.2: Vol 4, Part E HCI: 5.4.2 HCI ACL Data packets.
static constexpr uint8_t get_pbflag(const uint16_t handle_and_flags) noexcept
Returns the Packet_Boundary_Flag.
static constexpr uint8_t get_bcflag(const uint16_t handle_and_flags) noexcept
Returns the Broadcast_Flag.
uint16_t getHandleAndFlags() const noexcept
l2cap_frame getL2CAPFrame(const uint8_t *&l2cap_data) const noexcept
jau::nsize_t getParamSize() const noexcept
HCIACLData(const uint8_t *buffer, const jau::nsize_t buffer_len)
Persistent memory, w/ ownership .
std::string toString(const l2cap_frame &l2cap, const uint8_t *l2cap_data) const noexcept
static constexpr uint16_t get_handle(const uint16_t handle_and_flags) noexcept
Returns the handle.
const uint8_t * getParam() const noexcept
std::string toString() const noexcept
static std::unique_ptr< HCIACLData > getSpecialized(const uint8_t *buffer, jau::nsize_t const buffer_size) noexcept
Return a newly created specialized instance pointer to base class.
BT Core Spec v5.2: Vol 4, Part E HCI: 7.7.14 Command Complete event.
jau::nsize_t getReturnParamSize() const noexcept
std::string baseString() const noexcept override
const uint8_t * getReturnParam() const
HCIOpcode getOpcode() const noexcept
The associated command.
uint8_t getNumCommandPackets() const noexcept
The Number of HCI Command packets which are allowed to be sent to the Controller from the Host.
std::string nameString() const noexcept override
HCICommandCompleteEvent(const uint8_t *buffer, const jau::nsize_t buffer_len)
bool validate(const HCICommand &cmd) const noexcept override
BT Core Spec v5.2: Vol 4, Part E HCI: 7.7.15 Command Status event.
bool validate(const HCICommand &cmd) const noexcept override
uint8_t getNumCommandPackets() const noexcept
The Number of HCI Command packets which are allowed to be sent to the Controller from the Host.
HCICommandStatusEvent(const uint8_t *buffer, const jau::nsize_t buffer_len)
std::string baseString() const noexcept override
HCIOpcode getOpcode() const noexcept
The associated command.
std::string nameString() const noexcept override
HCIStatusCode getStatus() const noexcept
BT Core Spec v5.2: Vol 4, Part E HCI: 5.4.1 HCI Command packet.
static void checkOpcode(const HCIOpcode has, const HCIOpcode exp)
const uint8_t * getParam() const noexcept
static std::unique_ptr< HCICommand > getSpecialized(const uint8_t *buffer, jau::nsize_t const buffer_size) noexcept
Return a newly created specialized instance pointer to base class.
HCICommand(const HCIOpcode opc, const jau::nsize_t param_size)
Enabling manual construction of command without given value.
jau::nsize_t getParamSize() const noexcept
std::string nameString() const noexcept override
HCIOpcode getOpcode() const noexcept
~HCICommand() noexcept override=default
std::string valueString() const noexcept override
std::string baseString() const noexcept override
HCICommand(const HCIOpcode opc, const uint8_t *param, const jau::nsize_t param_size)
Enabling manual construction of command with given value.
static void checkOpcode(const HCIOpcode has, const HCIOpcode min, const HCIOpcode max)
HCICommand(const uint8_t *buffer, const jau::nsize_t buffer_len, const jau::nsize_t exp_param_size)
Persistent memory, w/ ownership .
void trimParamSize(const jau::nsize_t param_size)
BT Core Spec v5.2: Vol 4, Part E HCI: 7.1.6 Disconnect command.
constexpr uint16_t getHandle() const noexcept
HCIDisconnectCmd(const uint8_t *buffer, const jau::nsize_t buffer_len)
HCIStatusCode getReason() const noexcept
std::string valueString() const noexcept override
std::string nameString() const noexcept override
HCIDisconnectCmd(const uint16_t handle, HCIStatusCode reason)
BT Core Spec v5.2: Vol 4, Part E HCI: 7.7.5 Disconnection Complete event.
std::string baseString() const noexcept override
HCIStatusCode getReason() const noexcept
HCIDisconnectionCompleteEvent(const uint8_t *buffer, const jau::nsize_t buffer_len)
uint16_t getHandle() const noexcept
HCIStatusCode getStatus() const noexcept
std::string nameString() const noexcept override
bool validate(const HCICommand &cmd) const noexcept override
BT Core Spec v5.2: Vol 4, Part E HCI: 5.4.4 HCI Event packet.
~HCIEvent() noexcept override=default
std::string valueString() const noexcept override
constexpr bool isEvent(HCIEventType t) const noexcept
virtual HCIMetaEventType getMetaEventType() const noexcept
The meta subevent type.
static void checkEventType(const HCIEventType has, const HCIEventType min, const HCIEventType max)
bool isMetaEvent(HCIMetaEventType t) const noexcept
static void checkEventType(const HCIEventType has, const HCIEventType exp)
constexpr HCIEventType getEventType() const noexcept
jau::nsize_t getBaseParamSize() const noexcept
uint64_t getTimestamp() const noexcept
std::string nameString() const noexcept override
std::string baseString() const noexcept override
virtual bool validate(const HCICommand &cmd) const noexcept
virtual const uint8_t * getParam() const noexcept
HCIEvent(const HCIEventType evt, const jau::nsize_t param_size=0)
Enabling manual construction of event without given value.
virtual jau::nsize_t getParamSize() const noexcept
HCIEvent(const uint8_t *buffer, const jau::nsize_t buffer_len, const jau::nsize_t exp_param_size)
Persistent memory, w/ ownership .
static std::unique_ptr< HCIEvent > getSpecialized(const uint8_t *buffer, jau::nsize_t const buffer_size) noexcept
Return a newly created specialized instance pointer to base class.
HCIEvent(const HCIEventType evt, const uint8_t *param, const jau::nsize_t param_size)
Enabling manual construction of event with given value.
HCIException(std::string type, std::string const &m, const char *file, int line) noexcept
HCIException(std::string const &m, const char *file, int line) noexcept
BT Core Spec v5.2: Vol 4, Part E HCI: 7.8.24 LE Enable Encryption command.
constexpr jau::uint128dp_t getLTK() const noexcept
Returns the 128-bit Long Term Key (16 octets)
std::string valueString() const noexcept override
HCILEEnableEncryptionCmd(const uint16_t handle, const uint64_t rand, const uint16_t ediv, const jau::uint128dp_t ltk)
HCILEEnableEncryptionCmd(const uint8_t *buffer, const jau::nsize_t buffer_len)
constexpr uint16_t getEDIV() const noexcept
Returns the 16-bit EDIV value (2 octets) being distributed.
constexpr uint64_t getRand() const noexcept
Returns the 64-bit Rand value (8 octets) being distributed.
constexpr uint16_t getHandle() const noexcept
std::string nameString() const noexcept override
BT Core Spec v5.2: Vol 4, Part E HCI: 7.8.25 LE Long Term Key Request Reply command.
std::string valueString() const noexcept override
HCILELTKReplyAckCmd(const uint8_t *buffer, const jau::nsize_t buffer_len)
std::string nameString() const noexcept override
HCILELTKReplyAckCmd(const uint16_t handle, const jau::uint128dp_t ltk)
constexpr uint16_t getHandle() const noexcept
constexpr jau::uint128dp_t getLTK() const noexcept
Returns the 128-bit Long Term Key (16 octets)
BT Core Spec v5.2: Vol 4, Part E HCI: 7.8.26 LE Long Term Key Request Negative Reply command.
HCILELTKReplyRejCmd(const uint16_t handle)
constexpr uint16_t getHandle() const noexcept
HCILELTKReplyRejCmd(const uint8_t *buffer, const jau::nsize_t buffer_len)
std::string valueString() const noexcept override
std::string nameString() const noexcept override
BT Core Spec v5.2: Vol 4, Part E HCI: 7.7.65.5 LE Long Term Key Request event.
constexpr uint64_t getRand() const noexcept
Returns the 64-bit Rand value (8 octets) being distributed.
std::string valueString() const noexcept override
HCILELTKReqEvent(const uint8_t *buffer, const jau::nsize_t buffer_len)
Passing through preset buffer of this type.
constexpr uint16_t getHandle() const noexcept
std::string nameString() const noexcept override
constexpr uint16_t getEDIV() const noexcept
Returns the 16-bit EDIV value (2 octets) being distributed.
HCIOpcodeException(std::string const &m, const char *file, int line) noexcept
HCIPacketException(std::string const &m, const char *file, int line) noexcept
BT Core Spec v5.2: Vol 4, Part E HCI: 5.4 Exchange of HCI-specific information.
constexpr jau::nsize_t getTotalSize() const noexcept
virtual std::string nameString() const noexcept
HCIPacket(const HCIPacketType type, const jau::nsize_t total_packet_size)
static T * clone(const T &source) noexcept
Clone template for convenience, based on derived class's copy-constructor.
HCIPacket(const uint8_t *packet_data, const jau::nsize_t total_packet_size)
Persistent memory, w/ ownership .
virtual ~HCIPacket() noexcept=default
HCIPacketType getPacketType() noexcept
virtual std::string valueString() const noexcept
static void checkPacketType(const HCIPacketType type)
std::string toString() const noexcept
virtual std::string baseString() const noexcept
jau::TROOctets & getPDU() noexcept
Return the underlying octets read only.
const char * name() const noexcept override
std::string message(int condition) const override
static HCIStatusCodeCategory & get()
Generic HCIEvent wrapper for any HCI IOCTL 'command complete' alike event struct having a HCIStatusCo...
const hcistruct * getStruct() const noexcept
std::string toString() const noexcept
HCIStructCmdCompleteEvtWrap(HCIEvent &orig_)
hcistruct * getWStruct() noexcept
bool isTypeAndSizeValid(const HCIEventType ec) const noexcept
HCIStatusCode getStatus() const noexcept
Generic HCICommand wrapper for any HCI IOCTL structure.
HCIStructCommand(const HCIOpcode opc, const hcistruct &cp)
Enabling manual construction of command with given value.
std::string nameString() const noexcept override
const hcistruct * getStruct() const noexcept
HCIStructCommand(const HCIOpcode opc)
Enabling manual construction of command with zero value.
hcistruct * getWStruct() noexcept
Persistent endian aware octet data, i.e.
POctets & resize(const nsize_t newCapacity, const nsize_t newSize)
Resizes this instance, including its capacity.
RuntimeException(std::string type, std::string const &m, const char *file, int line) noexcept
constexpr void put_uint64_nc(const nsize_t i, const uint64_t &v) noexcept
constexpr void put_uint128_nc(const nsize_t i, const uint128dp_t &v) noexcept
constexpr void put_uint16_nc(const nsize_t i, const uint16_t v) noexcept
constexpr void put_uint8_nc(const nsize_t i, const uint8_t v) noexcept
uint8_t * get_wptr_nc(const nsize_t i) noexcept
Transient read only and endian aware octet data, i.e.
constexpr uint16_t get_uint16_nc(const nsize_t i) const noexcept
constexpr uint128dp_t get_uint128_nc(const nsize_t i) const noexcept
constexpr nsize_t size() const noexcept
Returns the used memory size for read and write operations, may be zero.
constexpr bool is_range_valid(const nsize_t i, const nsize_t count) const noexcept
void check_range(const nsize_t i, const nsize_t count, const char *file, int line) const
constexpr uint64_t get_uint64_nc(const nsize_t i) const noexcept
constexpr uint8_t get_uint8_nc(const nsize_t i) const noexcept
constexpr uint8_t const * get_ptr() const noexcept
constexpr uint8_t const * get_ptr_nc(const nsize_t i) const noexcept
lb_endian_t
Simplified reduced endian type only covering little- and big-endian.
HCIOpcode
BT Core Spec v5.2: Vol 4, Part E HCI: 7.1 Link Controller commands.
std::string to_string(const HCIPacket &p) noexcept
HCIEventType
BT Core Spec v5.2: Vol 4, Part E HCI: 7.7 Events.
HCIMetaEventType
BT Core Spec v5.2: Vol 4, Part E HCI: 7.7.65 LE Meta event.
@ LE_SET_EXT_SCAN_RSP_DATA
@ LE_CREATE_CONN
LE_CREATE_CONN.
@ LE_READ_PEER_RESOLV_ADDR
FIXME: May not be supported by Linux/BlueZ.
@ LE_SET_EVENT_MASK
LE_SET_EVENT_MASK.
@ IO_CAPABILITY_REQ_REPLY
@ LE_READ_WHITE_LIST_SIZE
@ IO_CAPABILITY_REQ_NEG_REPLY
@ SET_EVENT_MASK
SET_EVENT_MASK.
@ LE_READ_LOCAL_RESOLV_ADDR
FIXME: May not be supported by Linux/BlueZ.
@ LE_SET_ADDR_RESOLV_ENABLE
@ LE_DEL_FROM_RESOLV_LIST
@ LE_READ_REMOTE_FEATURES
@ LE_READ_RESOLV_LIST_SIZE
@ DISCONN_PHY_LINK_COMPLETE
@ DISCONN_LOGICAL_LINK_COMPLETE
@ ENCRYPT_KEY_REFRESH_COMPLETE
@ CHANGE_LINK_KEY_COMPLETE
@ LE_PERIODIC_ADV_SYNC_TRANSFER_RECV
LE_PERIODIC_ADV_SYNC_TRANSFER_RECV.
@ LE_CHANNEL_SEL_ALGO
LE_CHANNEL_SEL_ALGO.
@ LE_PERIODIC_ADV_SYNC_LOST
LE_PERIODIC_ADV_SYNC_LOST.
@ LE_TRANSMIT_POWER_REPORTING
LE_TRANSMIT_POWER_REPORTING.
@ LE_EXT_CONN_COMPLETE
LE_ENHANCED_CONN_COMPLETE.
@ LE_CONN_COMPLETE
LE_CONN_COMPLETE.
@ LE_PERIODIC_ADV_REPORT
LE_PERIODIC_ADV_REPORT.
@ LE_LTK_REQUEST
LE_LTK_REQUEST.
@ LE_CONN_UPDATE_COMPLETE
LE_CONN_UPDATE_COMPLETE.
@ LE_BIGINFO_ADV_REPORT
LE_BIGINFO_ADV_REPORT.
@ LE_ADVERTISING_REPORT
LE_ADVERTISING_REPORT.
@ LE_DIRECT_ADV_REPORT
LE_DIRECT_ADV_REPORT.
@ LE_CTE_REQ_FAILED
LE_CTE_REQ_FAILED.
@ LE_REQUEST_PEER_SCA_COMPLETE
LE_REQUEST_PEER_SCA_COMPLETE.
@ LE_SCAN_TIMEOUT
LE_SCAN_TIMEOUT.
@ LE_CIS_REQUEST
LE_CIS_REQUEST.
@ LE_EXT_ADV_REPORT
LE_EXT_ADV_REPORT.
@ LE_BIG_SYNC_LOST
LE_BIG_SYNC_LOST.
@ LE_REMOTE_FEAT_COMPLETE
LE_REMOTE_FEAT_COMPLETE.
@ LE_CONN_IQ_REPORT
LE_CONN_IQ_REPORT.
@ LE_PERIODIC_ADV_SYNC_ESTABLISHED
LE_PERIODIC_ADV_SYNC_ESTABLISHED.
@ LE_CONNLESS_IQ_REPORT
LE_CONNLESS_IQ_REPORT.
@ LE_BIG_SYNC_ESTABLISHED
LE_BIG_SYNC_ESTABLISHED.
@ LE_REMOTE_CONN_PARAM_REQ
LE_REMOTE_CONN_PARAM_REQ.
@ LE_READ_LOCAL_P256_PUBKEY_COMPLETE
LE_READ_LOCAL_P256_PUBKEY_COMPLETE.
@ LE_CREATE_BIG_COMPLETE
LE_CREATE_BIG_COMPLETE.
@ LE_CIS_ESTABLISHED
LE_CIS_ESTABLISHED.
@ LE_TERMINATE_BIG_COMPLETE
LE_TERMINATE_BIG_COMPLETE.
@ LE_DATA_LENGTH_CHANGE
LE_DATA_LENGTH_CHANGE.
@ LE_SCAN_REQ_RECEIVED
LE_SCAN_REQ_RECEIVED.
@ LE_PATH_LOSS_THRESHOLD
LE_PATH_LOSS_THRESHOLD.
@ LE_ADV_SET_TERMINATED
LE_ADV_SET_TERMINATED.
@ LE_PHY_UPDATE_COMPLETE
LE_PHY_UPDATE_COMPLETE.
@ LE_GENERATE_DHKEY_COMPLETE
LE_GENERATE_DHKEY_COMPLETE.
@ EVENT_HDR_SIZE
HCIPacketType::EVENT header size including HCIPacketType.
@ ACL_HDR_SIZE
HCIPacketType::ACLDATA header size including HCIPacketType.
@ PACKET_MAX_SIZE
Total packet size, guaranteed to be handled by adapter.
@ SCO_HDR_SIZE
HCIPacketType::SCODATA header size including HCIPacketType.
@ COMMAND_HDR_SIZE
HCIPacketType::COMMAND header size including HCIPacketType.
@ LE_CTL
LE controller commands.
@ LINK_POLICY
link policy commands
@ BREDR_CTL
controller baseband commands
@ LINK_CTL
link control commands
std::string to_string(const DiscoveryPolicy v) noexcept
constexpr int32_t getHCIMaxConnLatency(const int16_t supervision_timeout_ms, const int16_t conn_interval_max_ms)
Supervisor timeout shall be in the range [0 - ((supervision_timeout_ms / (conn_interval_max_ms*2)) - ...
L2CAP_PSM
Protocol Service Multiplexers (PSM) Assigned numbers https://www.bluetooth.com/specifications/assigne...
std::error_code make_error_code(HCIStatusCode e) noexcept
constexpr uint16_t getHCIConnSupervisorTimeout(const uint16_t conn_latency, const uint16_t conn_interval_max_ms, const uint16_t min_result_ms=number(HCIConstInt::LE_CONN_MIN_TIMEOUT_MS), const uint16_t multiplier=10) noexcept
Defining the supervising timeout for LE connections to be a multiple of the maximum connection interv...
HCIStatusCode
BT Core Spec v5.2: Vol 1, Part F Controller Error Codes: 1.3 List of Error Codes.
constexpr uint8_t number(const DiscoveryPolicy rhs) noexcept
@ LE_CONN_MIN_TIMEOUT_MS
le connection supervisor timeout minimum of 500ms, see getHCIConnSupervisorTimeout() and v5....
@ PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED
@ COARSE_CLOCK_ADJ_REJECTED
@ UNKNOWN_CONNECTION_IDENTIFIER
@ CONNECTION_TERMINATED_BY_LOCAL_HOST
@ CHANNEL_ASSESSMENT_NOT_SUPPORTED
@ RESERVED_SLOT_VIOLATION
@ MEMORY_CAPACITY_EXCEEDED
@ REMOTE_DEVICE_TERMINATED_CONNECTION_LOW_RESOURCES
@ OPERATION_CANCELLED_BY_HOST
@ CONNECTION_TERMINATED_MIC_FAILURE
@ INVALID_HCI_COMMAND_PARAMETERS
@ REMOTE_USER_TERMINATED_CONNECTION
@ DIFFERENT_TRANSACTION_COLLISION
@ UNSUPPORTED_FEATURE_OR_PARAM_VALUE
@ CONNECTION_REJECTED_UNACCEPTABLE_BD_ADDR
@ INVALID_LMP_OR_LL_PARAMETERS
@ LMP_OR_LL_RESPONSE_TIMEOUT
@ UNACCEPTABLE_CONNECTION_PARAM
@ REQUESTED_QOS_NOT_SUPPORTED
@ SYNC_DEVICE_CONNECTION_LIMIT_EXCEEDED
@ ROLE_CHANGE_NOT_ALLOWED
@ CONNECTION_REJECTED_LIMITED_RESOURCES
@ CONNECTION_LIMIT_EXCEEDED
@ REMOTE_DEVICE_TERMINATED_CONNECTION_POWER_OFF
@ SIMPLE_PAIRING_NOT_SUPPORTED_BY_HOST
@ UNSUPPORTED_REMOTE_OR_LMP_FEATURE
@ LINK_KEY_CANNOT_BE_CHANGED
@ CONNECTION_ACCEPT_TIMEOUT_EXCEEDED
@ CONNECTION_ALREADY_EXISTS
@ UNKNOWN_ADVERTISING_IDENTIFIER
@ UNSUPPORTED_LMP_OR_LL_PARAMETER_VALUE
@ TYPE0_SUBMAP_NOT_DEFINED
@ CONNECTION_REJECTED_SECURITY
@ CONNECTION_EST_FAILED_OR_SYNC_TIMEOUT
@ ENCRYPTION_MODE_NOT_ACCEPTED
@ CONNECTION_REJECTED_NO_SUITABLE_CHANNEL
@ QOS_UNACCEPTABLE_PARAMETER
constexpr T min(const T x, const T y) noexcept
Returns the minimum of two integrals (w/ branching) in O(1)
uint_fast32_t nsize_t
Natural 'size_t' alternative using uint_fast32_t as its natural sized type.
constexpr T max(const T x, const T y) noexcept
Returns the maximum of two integrals (w/ branching) in O(1)
std::string bytesHexString(const void *data, const nsize_t offset, const nsize_t length, const bool lsbFirst, const bool lowerCase=true) noexcept
Produce a hexadecimal string representation of the given byte values.
std::string to_hexstring(value_type const &v) noexcept
Produce a lower-case hexadecimal string representation of the given pointer.
__pack(...): Produces MSVC, clang and gcc compatible lead-in and -out macros.
uint64_t getCurrentMilliseconds() noexcept
Returns current monotonic time in milliseconds.
Representing ACL Datas' L2CAP Frame.
static std::string toString(const PBFlag v) noexcept
constexpr bool isGATT() const noexcept
PBFlag
The Packet_Boundary_Flag.
const uint8_t bc_flag
The Broadcast_Flag.
const uint16_t handle
The connection handle.
constexpr bool isSMP() const noexcept
std::string toString() const noexcept
l2cap_frame(const uint16_t handle_, const PBFlag pb_flag_, const uint8_t bc_flag_, const L2CAP_CID cid_, const L2CAP_PSM psm_, const uint16_t len_)
Oly for manual injection, usually using casted pointer.
static constexpr uint8_t number(const PBFlag v) noexcept
std::string toString(const uint8_t *l2cap_data) const noexcept
std::string toString() noexcept
A 128-bit packed uint8_t data array.