diff options
Diffstat (limited to 'include/ble/att.h')
-rw-r--r-- | include/ble/att.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/include/ble/att.h b/include/ble/att.h index db21d2e..152a779 100644 --- a/include/ble/att.h +++ b/include/ble/att.h @@ -130,11 +130,26 @@ struct ReadByTypeRes { std::vector<AttributeData> attributes; }; +struct HandleValueNotification { + static constexpr auto att_pdu_type = AttPduType::HANDLE_VALUE_NOTIFICATION; + + uint16_t handle; + ByteBuffer data; +}; + +struct HandleValueIndication { + static constexpr auto att_pdu_type = AttPduType::HANDLE_VALUE_INDICATION; + + uint16_t handle; + ByteBuffer data; +}; + using AttVariant = std::variant<std::monostate, ErrorRes, ExchangeMtuReq, ExchangeMtuRes, FindInformationRes, - ReadByGroupTypeRes, ReadByTypeRes>; + ReadByGroupTypeRes, ReadByTypeRes, + HandleValueNotification, HandleValueIndication>; o<AttPduType> attPduType(const AttVariant &v); @@ -154,6 +169,10 @@ public: static FindInformationRes parseFindInformationRes(ByteBuffer &bytes); + static HandleValueNotification parseHandleValueNotification(ByteBuffer &bytes); + + static HandleValueIndication parseHandleValueIndication(ByteBuffer &bytes); + static void parseRead(ByteBuffer &bytes); static void parseWrite(ByteBuffer &bytes); |