diff --git a/src/TLV8.cpp b/src/TLV8.cpp index 3156005..aae7686 100644 --- a/src/TLV8.cpp +++ b/src/TLV8.cpp @@ -272,6 +272,20 @@ void TLV8::print(TLV8_it it1, TLV8_it it2){ ////////////////////////////////////// +void TLV8::printAll_r(String label){ + + for(auto it=begin();it!=end();it++){ + Serial.printf("%s",label.c_str()); + print(it); + TLV8 tlv; + if(tlv.unpack(*it,(*it).getLen())==0) + tlv.printAll_r(label+String((*it).getTag())+"-"); + } + Serial.printf("%sDONE\n",label.c_str()); +} + +////////////////////////////////////// + void TLV8::osprint(std::ostream& os, TLV8_it it1, TLV8_it it2){ for(auto it=it1;it!=it2;it++) diff --git a/src/TLV8.h b/src/TLV8.h index f071b8a..2c08784 100644 --- a/src/TLV8.h +++ b/src/TLV8.h @@ -95,7 +95,9 @@ class TLV8 : public std::list> { const TLV8_names *names=NULL; int nNames=0; - + + void printAll_r(String label); + public: TLV8(){}; @@ -128,6 +130,7 @@ class TLV8 : public std::list> { void print(TLV8_it it1, TLV8_it it2); void print(TLV8_it it1){print(it1, std::next(it1));} void print(){print(begin(), end());} + void printAll(){printAll_r("");} void osprint(std::ostream& os, TLV8_it it1, TLV8_it it2); void osprint(std::ostream& os, TLV8_it it1){osprint(os, it1, std::next(it1));}