From a11eab4b37a099feb4d761e98736e6f4f7915868 Mon Sep 17 00:00:00 2001 From: Gregg Date: Wed, 27 Mar 2024 20:41:29 -0500 Subject: [PATCH] Fixed return value in TLV8::add() --- src/TLV8.cpp | 2 +- src/src.ino | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/TLV8.cpp b/src/TLV8.cpp index 2f19730..3a52bd9 100644 --- a/src/TLV8.cpp +++ b/src/TLV8.cpp @@ -75,7 +75,7 @@ TLV8_it TLV8::add(uint8_t tag, size_t len, const uint8_t* val){ else emplace_back(tag,len,val); - return(begin()); + return(--end()); } ///////////////////////////////////// diff --git a/src/src.ino b/src/src.ino index 7fda69a..e92ce80 100644 --- a/src/src.ino +++ b/src/src.ino @@ -50,10 +50,14 @@ void setup() { tlv.add(7,33); tlv.add(7,34); tlv.add(15,nMax,c); - tlv.print(); +// tlv.print(); + + tlv.print(--tlv.end(),tlv.end()); Serial.printf("\nSize=%d\n\n",tlv.pack_size()); + + uint8_t bOut[tlv.pack_size()]; tlv.pack(bOut);