26#ifndef ATT_PDU_TYPES_HPP_
27#define ATT_PDU_TYPES_HPP_
207 AttException(std::string type, std::string
const& m,
const char* file,
int line) noexcept
211 AttException(std::string
const& m,
const char* file,
int line) noexcept
352 PDU_UNDEFINED = 0x00,
356 AUTH_SIGNATURE_FLAG = 0x80,
359 EXCHANGE_MTU_REQ = 0x02,
360 EXCHANGE_MTU_RSP = 0x03,
361 FIND_INFORMATION_REQ = 0x04,
362 FIND_INFORMATION_RSP = 0x05,
363 FIND_BY_TYPE_VALUE_REQ = 0x06,
364 FIND_BY_TYPE_VALUE_RSP = 0x07,
365 READ_BY_TYPE_REQ = 0x08,
366 READ_BY_TYPE_RSP = 0x09,
369 READ_BLOB_REQ = 0x0C,
370 READ_BLOB_RSP = 0x0D,
371 READ_MULTIPLE_REQ = 0x0E,
372 READ_MULTIPLE_RSP = 0x0F,
373 READ_BY_GROUP_TYPE_REQ = 0x10,
374 READ_BY_GROUP_TYPE_RSP = 0x11,
377 WRITE_CMD = WRITE_REQ + COMMAND_FLAG,
378 PREPARE_WRITE_REQ = 0x16,
379 PREPARE_WRITE_RSP = 0x17,
380 EXECUTE_WRITE_REQ = 0x18,
381 EXECUTE_WRITE_RSP = 0x19,
383 READ_MULTIPLE_VARIABLE_REQ = 0x20,
384 READ_MULTIPLE_VARIABLE_RSP = 0x21,
386 MULTIPLE_HANDLE_VALUE_NTF = 0x23,
388 HANDLE_VALUE_NTF = 0x1B,
389 HANDLE_VALUE_IND = 0x1D,
390 HANDLE_VALUE_CFM = 0x1E,
392 SIGNED_WRITE_CMD = WRITE_REQ + COMMAND_FLAG + AUTH_SIGNATURE_FLAG
395 return static_cast<uint8_t
>(rhs);
404 return static_cast<bool>(rhs);
490 return static_cast<Opcode> (
static_cast<uint8_t
>(lhs) &
static_cast<uint8_t
>(rhs) );
492 static constexpr bool bit_test(
const Opcode lhs,
const Opcode rhs)
noexcept {
493 return 0 != (
static_cast<uint8_t
>(lhs) &
static_cast<uint8_t
>(rhs) );
504 if( expected != has ) {
512 if( exp1 != has && exp2 != has ) {
667 virtual std::string
getName() const noexcept {
692 std::string
getName() const noexcept
override {
693 return "AttPDUUndefined";
708 INVALID_HANDLE = 0x01,
710 NO_WRITE_PERM = 0x03,
712 INSUFF_AUTHENTICATION = 0x05,
713 UNSUPPORTED_REQUEST = 0x06,
714 INVALID_OFFSET = 0x07,
715 INSUFF_AUTHORIZATION = 0x08,
716 PREPARE_QUEUE_FULL = 0x09,
717 ATTRIBUTE_NOT_FOUND = 0x0A,
718 ATTRIBUTE_NOT_LONG = 0x0B,
719 INSUFF_ENCRYPTION_KEY_SIZE = 0x0C,
720 INVALID_ATTRIBUTE_VALUE_LEN = 0x0D,
721 UNLIKELY_ERROR = 0x0E,
722 INSUFF_ENCRYPTION = 0x0F,
723 UNSUPPORTED_GROUP_TYPE = 0x10,
724 INSUFFICIENT_RESOURCES = 0x11,
725 DB_OUT_OF_SYNC = 0x12,
726 FORBIDDEN_VALUE = 0x13
729 return static_cast<uint8_t
>(rhs);
756 std::string
getName() const noexcept
override {
757 return "AttErrorRsp";
799 std::string
getName() const noexcept
override {
800 return "AttExchangeMTU";
838 std::string
getName() const noexcept
override {
880 std::string
getName() const noexcept
override {
881 return "AttReadBlobReq";
924 if( value_offset > value.
size() ) {
939 std::string
getName() const noexcept
override {
940 return "AttReadNRsp";
993 std::string
getName() const noexcept
override {
994 return "AttWriteReq";
1029 return "AttWriteRsp";
1047 constexpr static jau::nsize_t pdu_value_offset = 1 + 2;
1077 return "AttWriteCmd";
1098 constexpr static jau::nsize_t pdu_value_offset = 1 + 2 + 2;
1151 return "AttPrepWrite";
1189 return "AttExeWriteReq";
1219 return "AttExeWriteRsp";
1244 constexpr static jau::nsize_t pdu_value_offset = 1 + 2;
1282 return "AttHandleValueRcv";
1321 return "AttHandleValueCfm";
1413 return "AttElementList";
1477 return "AttReadByNTypeReq";
1591 return Element(*
this, elementIdx);
1606 return "AttReadByTypeRsp";
1711 return Element(*
this, elementIdx);
1737 return "AttReadByGroupTypeRsp";
1784 return "AttFindInfoReq";
1816 if( 0x01 == format ) {
1818 }
else if( 0x02 == format ) {
1840 const std::unique_ptr<const jau::uuid_t>
uuid;
1912 return Element(*
this, elementIdx);
1931 return "AttFindInfoRsp";
1940 ", uuid "+e.
uuid.get()->toString();
1961 constexpr static jau::nsize_t pdu_value_offset = 1 + 2 + 2 + 2;
1974 getAttValueTypeSize();
1999 return pdu.
get_uuid(pdu_value_offset, getAttValueTypeSize());
2003 ERR_PRINT(
"invalid att uuid: Unknown exception");
2005 return std::make_unique<jau::uuid16_t>(0);
2009 return "AttFindByTypeValueReq";
2129 return "AttFindByTypeValueRsp";
virtual std::string addValueString() const
virtual jau::nsize_t getElementValueSize() const =0
Net element-value size, i.e.
constexpr_cxx20 jau::nsize_t getElementCount() const noexcept
Number of elements.
virtual jau::nsize_t getElementSize() const =0
Total size of one element.
AttElementList(const uint8_t *source, const jau::nsize_t length)
~AttElementList() noexcept override=default
std::string getName() const noexcept override
jau::nsize_t getElementPDUOffset(const jau::nsize_t elementIdx) const
uint8_t const * getElementPtr(const jau::nsize_t elementIdx) const
virtual std::string elementString(const jau::nsize_t idx) const
virtual void setElementSize(const uint8_t element_length)=0
Fixate element length.
std::string valueString() const noexcept override
void setElementCount(const jau::nsize_t count)
Fixate element count.
AttElementList(const Opcode opc, const jau::nsize_t size)
BT Core Spec v5.2: Vol 3, Part F ATT: 3.4.1.1 ATT_ERROR_RSP.
AttErrorRsp(const uint8_t *source, const jau::nsize_t length)
constexpr uint16_t getCausingHandle() const noexcept
static constexpr uint8_t number(const ErrorCode rhs) noexcept
AttErrorRsp(const ErrorCode error_code, const Opcode cause_opc, const uint16_t cause_handle)
static std::string getErrorCodeString(const ErrorCode errorCode) noexcept
constexpr Opcode getCausingOpcode() const noexcept
constexpr ErrorCode getErrorCode() const noexcept
constexpr_cxx20 jau::nsize_t getPDUValueOffset() const noexcept override
opcode + reqOpcodeCause + handleCause + errorCode
std::string getName() const noexcept override
std::string valueString() const noexcept override
AttException(std::string const &m, const char *file, int line) noexcept
AttException(std::string type, std::string const &m, const char *file, int line) noexcept
BT Core Spec v5.2: Vol 3, Part F ATT: 3.4.2.1 ATT_EXCHANGE_MTU_REQ BT Core Spec v5....
std::string valueString() const noexcept override
AttExchangeMTU(const ReqRespType type, const uint16_t mtuSize)
constexpr_cxx20 jau::nsize_t getPDUValueOffset() const noexcept override
opcode + mtu-size
AttExchangeMTU(const uint8_t *source, const jau::nsize_t length)
constexpr uint16_t getMTUSize() const noexcept
std::string getName() const noexcept override
BT Core Spec v5.2: Vol 3, Part F ATT: 3.4.6.3 ATT_EXECUTE_WRITE_REQ.
constexpr_cxx20 jau::nsize_t getPDUValueOffset() const noexcept override
opcode
AttExeWriteReq(const uint8_t flags)
std::string getName() const noexcept override
AttExeWriteReq(const uint8_t *source, const jau::nsize_t length)
constexpr uint8_t getFlags() const noexcept
BT Core Spec v5.2: Vol 3, Part F ATT: 3.4.6.4 ATT_EXECUTE_WRITE_RSP.
AttExeWriteRsp(const uint8_t *source, const jau::nsize_t length)
constexpr_cxx20 jau::nsize_t getPDUValueOffset() const noexcept override
opcode
std::string getName() const noexcept override
BT Core Spec v5.2: Vol 3, Part F ATT: 3.4.3.3 ATT_FIND_BY_TYPE_VALUE_REQ.
AttFindByTypeValueReq(const uint16_t startHandle, const uint16_t endHandle, const jau::uuid16_t &att_type, const jau::uuid_t &att_value)
jau::uuid16_t getAttType() const noexcept
std::string getName() const noexcept override
constexpr uint16_t getEndHandle() const noexcept
constexpr uint16_t getStartHandle() const noexcept
std::unique_ptr< const jau::uuid_t > getAttValue() const noexcept
constexpr_cxx20 jau::nsize_t getPDUValueOffset() const noexcept override
opcode + handle_start + handle_end + att_type
AttFindByTypeValueReq(const uint8_t *source, const jau::nsize_t length)
std::string valueString() const noexcept override
BT Core Spec v5.2: Vol 3, Part F ATT: 3.4.3.4 ATT_FIND_BY_TYPE_VALUE_RSP.
AttFindByTypeValueRsp(const jau::nsize_t total_length)
Create an incomplete response with maximal (MTU) length.
AttFindByTypeValueRsp(const uint8_t *source, const jau::nsize_t length)
void setElementHandles(const jau::nsize_t elementIdx, const uint16_t handle, const uint16_t handle_end)
std::string getName() const noexcept override
void setElementCount(const jau::nsize_t count)
Fixate element count.
uint8_t const * getElementPtr(const jau::nsize_t elementIdx) const
constexpr_cxx20 jau::nsize_t getElementCount() const noexcept
Number of elements.
constexpr jau::nsize_t getElementSize() const noexcept
Returns element size, 4 octets.
uint16_t getElementHandleEnd(const jau::nsize_t elementIdx) const
constexpr_cxx20 jau::nsize_t getPDUValueOffset() const noexcept override
opcode
std::string elementString(const jau::nsize_t idx) const
std::string valueString() const noexcept override
jau::nsize_t getElementPDUOffset(const jau::nsize_t elementIdx) const noexcept
uint16_t getElementHandle(const jau::nsize_t elementIdx) const
BT Core Spec v5.2: Vol 3, Part F ATT: 3.4.3.1 ATT_FIND_INFORMATION_REQ.
std::string valueString() const noexcept override
constexpr uint16_t getStartHandle() const noexcept
AttFindInfoReq(const uint8_t *source, const jau::nsize_t length)
AttFindInfoReq(const uint16_t startHandle, const uint16_t endHandle)
jau::nsize_t getPDUValueOffset() const noexcept override
opcode + handle_start + handle_end
constexpr uint16_t getEndHandle() const noexcept
std::string getName() const noexcept override
element := { uint16_t handle, UUID value }, with a UUID of UUID16 or UUID128
Element(const AttFindInfoRsp &p, const jau::nsize_t idx)
const std::unique_ptr< const jau::uuid_t > uuid
BT Core Spec v5.2: Vol 3, Part F ATT: 3.4.3.2 ATT_FIND_INFORMATION_RSP.
std::string elementString(const jau::nsize_t idx) const override
void setElementSize(const uint8_t element_length) override
Fixate element length.
AttFindInfoRsp(const jau::nsize_t total_length)
Create an incomplete response with maximal (MTU) length.
void setElementHandle(const jau::nsize_t elementIdx, const uint16_t h)
constexpr_cxx20 jau::nsize_t getPDUValueOffset() const noexcept override
opcode + format
std::string addValueString() const override
jau::uuid_t::TypeSize getElementValueFormat() const
uint16_t getElementHandle(const jau::nsize_t elementIdx) const
std::unique_ptr< const jau::uuid_t > getElementValue(const jau::nsize_t elementIdx) const
jau::nsize_t getElementSize() const override
Returns element size.
std::string getName() const noexcept override
AttFindInfoRsp(const uint8_t *source, const jau::nsize_t length)
void setElementValueUUID(const jau::nsize_t elementIdx, const jau::uuid_t &v)
jau::nsize_t getElementValueSize() const override
Net element-value size, i.e.
Element getElement(const jau::nsize_t elementIdx) const
ATT Protocol PDUs Vol 3, Part F 3.4.7.3.
jau::nsize_t getPDUValueOffset() const noexcept override
opcode
std::string getName() const noexcept override
AttHandleValueCfm(const uint8_t *source, const jau::nsize_t length)
ATT Protocol PDUs Vol 3, Part F 3.4.7.1 and 3.4.7.2.
constexpr uint8_t const * getValuePtr() const noexcept
AttHandleValueRcv(const uint8_t *source, const jau::nsize_t length)
bool isNotification() const noexcept
bool isIndication() const noexcept
jau::TOctetSlice const & getValue() const noexcept
std::string getName() const noexcept override
std::string valueString() const noexcept override
constexpr uint16_t getHandle() const noexcept
constexpr_cxx20 jau::nsize_t getPDUValueOffset() const noexcept override
opcode + handle
AttHandleValueRcv(const bool isNotify, const uint16_t handle, const jau::TROOctets &value, const jau::nsize_t mtu)
AttOpcodeException(std::string const &m, const char *file, int line) noexcept
Handles the Attribute Protocol (ATT) using Protocol Data Unit (PDU) encoded messages over L2CAP chann...
const uint64_t ts_creation
creation timestamp in milliseconds
virtual std::string valueString() const noexcept
static constexpr uint8_t number(const Opcode rhs) noexcept
Opcode
ATT Opcode Summary Vol 3, Part F 3.4.8.
@ READ_MULTIPLE_VARIABLE_RSP
@ MULTIPLE_HANDLE_VALUE_NTF
@ READ_MULTIPLE_VARIABLE_REQ
constexpr jau::nsize_t getAuthSigSize() const noexcept
ATT PDU Format Vol 3, Part F 3.3.1.
AttPDUMsg & operator=(AttPDUMsg &&o) noexcept=delete
static constexpr bool is_request(const ReqRespType rhs) noexcept
jau::POctets pdu
actual received PDU
static std::string getOpcodeString(const Opcode opc) noexcept
static constexpr OpcodeType get_type(const Opcode rhs) noexcept
virtual std::string getName() const noexcept
constexpr_cxx20 jau::nsize_t getPDUMinSize() const noexcept
Returns this PDU's minimum size, i.e.
constexpr bool getOpAuthSigFlag() const noexcept
ATT PDU Format Vol 3, Part F 3.3.1.
virtual std::string toString() const noexcept
static std::unique_ptr< const AttPDUMsg > getSpecialized(const uint8_t *buffer, jau::nsize_t const buffer_size) noexcept
Return a newly created specialized instance pointer to base class.
virtual ~AttPDUMsg() noexcept=default
void checkOpcode(const Opcode expected) const
constexpr_cxx20 jau::nsize_t getPDUValueSize() const noexcept
Returns the net octet size of this PDU's attributes value, i.e.
AttPDUMsg & operator=(const AttPDUMsg &o) noexcept=delete
AttPDUMsg(const uint8_t *source, const jau::nsize_t size)
Persistent memory, w/ ownership .
virtual std::string baseString() const noexcept
virtual constexpr_cxx20 jau::nsize_t getPDUValueOffset() const noexcept
Returns the octet offset to the value segment in this PDU including the mandatory opcode,...
void checkOpcode(const Opcode exp1, const Opcode exp2) const
constexpr Opcode getOpcode() const noexcept
ATT PDU Format Vol 3, Part F 3.3.1.
constexpr Opcode getOpMethod() const noexcept
ATT PDU Format Vol 3, Part F 3.3.1.
constexpr_cxx20 jau::nsize_t getMaxPDUValueSize(const jau::nsize_t mtu) const noexcept
Returns the theoretical maximum value size of a PDU's attribute value.
AttPDUMsg(AttPDUMsg &&o) noexcept=default
constexpr jau::nsize_t getPDUParamSize() const noexcept
ATT PDU Format Vol 3, Part F 3.3.1.
AttPDUMsg(const Opcode opc, const jau::nsize_t size)
Persistent memory, w/ ownership .
AttPDUMsg(const AttPDUMsg &o)=default
constexpr bool getOpCommandFlag() const noexcept
ATT PDU Format Vol 3, Part F 3.3.1.
Our own pseudo opcode, indicating no ATT PDU message.
constexpr_cxx20 jau::nsize_t getPDUValueOffset() const noexcept override
Returns the octet offset to the value segment in this PDU including the mandatory opcode,...
std::string getName() const noexcept override
AttPDUUndefined(const uint8_t *source, const jau::nsize_t length)
BT Core Spec v5.2: Vol 3, Part F ATT: 3.4.6.1 ATT_PREPARE_WRITE_REQ BT Core Spec v5....
constexpr_cxx20 jau::nsize_t getPDUValueOffset() const noexcept override
opcode + handle + value_offset
std::string getName() const noexcept override
AttPrepWrite(const uint8_t *source, const jau::nsize_t length)
AttPrepWrite(const bool isReq, const uint16_t handle, const jau::TROOctets &value, const uint16_t value_offset)
constexpr uint16_t getValueOffset() const noexcept
constexpr jau::TOctetSlice const & getValue() const noexcept
constexpr uint16_t getHandle() const noexcept
std::string valueString() const noexcept override
constexpr uint8_t const * getValuePtr() const noexcept
AttPrepWrite(const bool isReq, const AttPrepWrite &other)
AttPrepWrite(const AttPrepWrite &other)
BT Core Spec v5.2: Vol 3, Part F ATT: 3.4.4.5 ATT_BLOB_READ_REQ.
constexpr_cxx20 jau::nsize_t getPDUValueOffset() const noexcept override
opcode + handle + value_offset
constexpr uint16_t getHandle() const noexcept
std::string getName() const noexcept override
AttReadBlobReq(const uint16_t handle, const uint16_t value_offset)
constexpr uint16_t getValueOffset() const noexcept
std::string valueString() const noexcept override
AttReadBlobReq(const uint8_t *source, const jau::nsize_t length)
element := { uint16_t startHandle, uint16_t endHandle, uint8_t value[value-size] }
constexpr jau::nsize_t getValueSize() const noexcept
constexpr uint8_t const * getValuePtr() const noexcept
constexpr uint16_t getEndHandle() const noexcept
Element(const AttReadByGroupTypeRsp &p, const jau::nsize_t idx)
constexpr uint16_t getStartHandle() const noexcept
BT Core Spec v5.2: Vol 3, Part F ATT: 3.4.4.10 ATT_READ_BY_GROUP_TYPE_RSP.
void setElementSize(const uint8_t element_length) override
Fixate element length.
void setElementEndHandle(const jau::nsize_t elementIdx, const uint16_t h)
void setElementValueUUID(const jau::nsize_t elementIdx, const jau::uuid_t &v)
constexpr_cxx20 jau::nsize_t getPDUValueOffset() const noexcept override
opcode + element-size
uint16_t getElementStartHandle(const jau::nsize_t elementIdx) const
AttReadByGroupTypeRsp(const uint8_t *source, const jau::nsize_t length)
constexpr_cxx20 jau::nsize_t getElementSize() const noexcept override
Returns size of each element, i.e.
Element getElement(const jau::nsize_t elementIdx) const
constexpr_cxx20 jau::nsize_t getElementValueSize() const noexcept override
Net element-value size, i.e.
std::string getName() const noexcept override
uint16_t getElementEndHandle(const jau::nsize_t elementIdx) const
uint8_t * getElementValuePtr(const jau::nsize_t elementIdx)
std::string elementString(const jau::nsize_t idx) const override
AttReadByGroupTypeRsp(const jau::nsize_t total_length)
Create an incomplete response with maximal (MTU) length.
void setElementStartHandle(const jau::nsize_t elementIdx, const uint16_t h)
BT Core Spec v5.2: Vol 3, Part F ATT: 3.4.4.1 ATT_READ_BY_TYPE_REQ.
AttReadByNTypeReq(const bool groupTypeReq, const uint16_t startHandle, const uint16_t endHandle, const jau::uuid_t &uuid)
std::string getName() const noexcept override
constexpr_cxx20 jau::nsize_t getPDUValueOffset() const noexcept override
opcode + handle-start + handle-end
std::unique_ptr< const jau::uuid_t > getNType() const
std::string valueString() const noexcept override
constexpr uint16_t getStartHandle() const noexcept
AttReadByNTypeReq(const uint8_t *source, const jau::nsize_t length)
constexpr uint16_t getEndHandle() const noexcept
element := { uint16_t handle, uint8_t value[value-size] }
constexpr uint16_t getHandle() const noexcept
Element(const AttReadByTypeRsp &p, const jau::nsize_t idx)
constexpr uint8_t const * getValuePtr() const noexcept
std::string toString() const
constexpr jau::nsize_t getValueSize() const noexcept
BT Core Spec v5.2: Vol 3, Part F ATT: 3.4.4.2 ATT_READ_BY_TYPE_RSP.
Element getElement(const jau::nsize_t elementIdx) const
void setElementHandle(const jau::nsize_t elementIdx, const uint16_t h)
uint16_t getElementHandle(const jau::nsize_t elementIdx) const
std::string getName() const noexcept override
uint8_t * getElementValuePtr(const jau::nsize_t elementIdx)
constexpr_cxx20 jau::nsize_t getElementValueSize() const noexcept override
Net element-value size, i.e.
AttReadByTypeRsp(const jau::nsize_t total_length)
Create an incomplete response with maximal (MTU) length.
constexpr_cxx20 jau::nsize_t getElementSize() const noexcept override
Returns size of each element, i.e.
constexpr_cxx20 jau::nsize_t getPDUValueOffset() const noexcept override
opcode + element-size
std::string elementString(const jau::nsize_t idx) const override
void setElementSize(const uint8_t element_length) override
Fixate element length.
AttReadByTypeRsp(const uint8_t *source, const jau::nsize_t length)
BT Core Spec v5.2: Vol 3, Part F ATT: 3.4.4.4 ATT_READ_RSP BT Core Spec v5.2: Vol 3,...
std::string valueString() const noexcept override
std::string getName() const noexcept override
constexpr_cxx20 jau::nsize_t getPDUValueOffset() const noexcept override
opcode
constexpr uint8_t const * getValuePtr() const noexcept
AttReadNRsp(const uint8_t *source, const jau::nsize_t length)
constexpr jau::TOctetSlice const & getValue() const noexcept
AttReadNRsp(const bool blobRsp, const jau::TROOctets &value, jau::nsize_t value_offset=0)
BT Core Spec v5.2: Vol 3, Part F ATT: 3.4.4.3 ATT_READ_REQ.
std::string valueString() const noexcept override
constexpr_cxx20 jau::nsize_t getPDUValueOffset() const noexcept override
opcode + handle
constexpr uint16_t getHandle() const noexcept
AttReadReq(const uint16_t handle)
std::string getName() const noexcept override
AttReadReq(const uint8_t *source, const jau::nsize_t length)
AttValueException(std::string const &m, const char *file, int line) noexcept
BT Core Spec v5.2: Vol 3, Part F ATT: 3.4.5.3 ATT_WRITE_CMD.
AttWriteCmd(const uint16_t handle, const jau::TROOctets &value)
std::string valueString() const noexcept override
std::string getName() const noexcept override
constexpr jau::TOctetSlice const & getValue() const noexcept
AttWriteCmd(const uint8_t *source, const jau::nsize_t length)
constexpr uint16_t getHandle() const noexcept
constexpr uint8_t const * getValuePtr() const noexcept
constexpr_cxx20 jau::nsize_t getPDUValueOffset() const noexcept override
opcode + handle
BT Core Spec v5.2: Vol 3, Part F ATT: 3.4.5.1 ATT_WRITE_REQ.
constexpr jau::TOctetSlice const & getValue() const noexcept
constexpr uint8_t const * getValuePtr() const noexcept
std::string valueString() const noexcept override
constexpr uint16_t getHandle() const noexcept
std::string getName() const noexcept override
AttWriteReq(const uint16_t handle, const jau::TROOctets &value)
AttWriteReq(const uint8_t *source, const jau::nsize_t length)
constexpr_cxx20 jau::nsize_t getPDUValueOffset() const noexcept override
opcode + handle
BT Core Spec v5.2: Vol 3, Part F ATT: 3.4.5.2 ATT_WRITE_RSP.
AttWriteRsp(const uint8_t *source, const jau::nsize_t length)
std::string getName() const noexcept override
constexpr_cxx20 jau::nsize_t getPDUValueOffset() const noexcept override
opcode
const std::string & message() const 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
Transient endian aware octet data slice, i.e.
std::string toString() const noexcept
constexpr nsize_t size() const noexcept
constexpr uint16_t get_uint16_nc(const nsize_t i) const noexcept
constexpr uint8_t const * get_ptr_nc(const nsize_t i) const 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() noexcept
void put_uint16(const nsize_t i, const uint16_t v)
void put_uuid(const nsize_t i, const uuid_t &v)
void put_bytes(const nsize_t i, const uint8_t *source, const nsize_t byte_count)
void put_uint8(const nsize_t i, const uint8_t v)
Transient read only and endian aware octet data, i.e.
constexpr uint16_t get_uint16_nc(const nsize_t i) const noexcept
std::unique_ptr< const uuid_t > get_uuid(const nsize_t i, const uuid_t::TypeSize tsize) const
constexpr nsize_t size() const noexcept
Returns the used memory size for read and write operations, may be zero.
uuid16_t get_uuid16_nc(const nsize_t i) const noexcept
uint16_t get_uint16(const nsize_t i) const
void check_range(const nsize_t i, const nsize_t count, const char *file, int line) const
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
std::string toString() const noexcept override
Returns the string representation in BE network order, i.e.
static TypeSize toTypeSize(const jau::nsize_t size)
static constexpr jau::nsize_t number(const TypeSize rhs) noexcept
virtual jau::nsize_t put(uint8_t *const buffer, lb_endian_t const le_or_be) const noexcept=0
TypeSize getTypeSize() const noexcept
TypeSize
Underlying integer value present octet count.
std::string getTypeSizeString() const noexcept
virtual std::string toString() const noexcept=0
Returns the string representation in BE network order, i.e.
#define ERR_PRINT(...)
Use for unconditional error messages, prefix '[elapsed_time] Error @ FILE:LINE FUNC: '.
lb_endian_t
Simplified reduced endian type only covering little- and big-endian.
@ little
Identifier for little endian, equivalent to endian::little.
std::string to_string(const alphabet &v) noexcept
#define constexpr_cxx20
constexpr qualifier replacement for C++20 constexpr.
@ UNDEFINED
Undefined, e.g.
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.