From 2034b1bb10720a2f0e6cc97427346f2320c115bc Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 23 Nov 2018 09:40:48 +0100 Subject: o Starting to handle notifications and indications Cleaning up: o Using more of the shared_ptr typedefs. o Adding code styles used by CLion. --- include/ble/att.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'include/ble/att.h') 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 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; + ReadByGroupTypeRes, ReadByTypeRes, + HandleValueNotification, HandleValueIndication>; o 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); -- cgit v1.2.3