Update TLV8.md

This commit is contained in:
HomeSpan 2024-04-20 20:08:53 -05:00 committed by GitHub
parent e0f593bc2e
commit e83df601b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 1 deletions

View File

@ -118,6 +118,7 @@ To restrict the the printing range to a limited set of records, add optional sta
The output generated by `print()` can contain some very long lines, especially if the VALUE of some of the TLV8 records represents other complete TLV8 objects (known as sub-TLVs or "nested" TLVs). To recursively print all sub-TLV objects, use the following method:
* `void printAll()`
* recursively prints all TLV8 records, one per line, to the Serial Monitor
* inspects each TLV8 record and tries to parse as if the record represented a sub-TLV object
* if parsing is successful, prints the record and then calls `printAll()` on the sub-TLV
@ -128,7 +129,20 @@ The output generated by `print()` can contain some very long lines, especially i
[^subTLVs]:The `printAll()` method assumes that any VALUE that is consistent with the format of a sub-TLV must be a sub-TLV, even if its just a simple numeric value. For example, `add(10,65536)` yields a record with a TAG identifer of 10 and a 4-byte VALUE of 0x00000100. The `printAll()` method will display this record along with NUMERIC=65536, but it will also then interpret (and thus display) this VALUE as a sub-TLV containing one zero-length record with TAG identifier=0 and another zero-length record with TAG identifer=1, since the VALUE can be successfully parsed as such.
Once you have the iterator *myIT* pointing to the desired TLV8 record, you can then use any of the methods below to access the VALUE stored in the TLV8 record:
TLV8 objects manage all of their internal memory requirements, and free up all resources and memory when they go out of scope or are otherwise deleted. However, if you need to "erase" all the contents of a TLV8 object but stil retain the object so you can re-fill with new data, use the following method:
* `void wipe()`
* erases all TLV8 records and frees all associated memory
* leaves an empty TLV8 object ready for re-use
## *TLV8_it()*
Objects of type *TLV8_it* are iterators that point to a specific record in an TLV8 objects (or to *end()*). If you are using the TLV8 library correctly you should rarely, if ever, need to directly instatiate a TLV8_it using its constructor. Instead, simply use `auto` as described above.
TLV8 iterators are the **most imporant** part of the TLV8 library, since a TLV8 iterator is used to directly access the data contained in the TLV8 record to which it points. The methods to access this data are as follows: