Count the number of TLV elements within the specified TLV reader, descending into arrays or structures.
Details
Parameters
[in] aReader
A read-only reference to the TLV reader for which to count the number of TLV elements.
[in,out] aCount
A reference to storage for the returned count. This is initialized to zero (0) prior to counting and is set to the number of elements counted on success.
Count the number of TLV elements within the specified TLV reader, optionally descending into arrays or structures.
Details
Parameters
[in] aReader
A read-only reference to the TLV reader for which to count the number of TLV elements.
[in,out] aCount
A reference to storage for the returned count. This is initialized to zero (0) prior to counting and is set to the number of elements counted on success.
[in] aRecurse
A Boolean indicating whether (true) or not (false) any encountered arrays or structures should be descended into.
Search for the first element matching the predicate within the TLV reader descending into arrays or structures.
The aPredicate is applied to each visited TLV element; the aPredicate shall return WEAVE_ERROR_MAX for the matching elements, WEAVE_NO_ERROR for non-matching elements, and any other value to terminate the search.
Details
Parameters
[in] aReader
A read-only reference to the TLV reader in which to find the element matching the predicate.
[in] aPredicate
A predicate to be applied to each TLV element. To support the code reuse, aPredicate has the IterateHandler type. The return value of aPredicate controls the search: a WEAVE_ERROR_MAX signals that desired element has been found, WEAVE_NO_ERROR signals that the desired element has not been found, and all other values signal that the saerch should be terminated.
[in] aContext
An optional pointer to caller-provided context data.
[out] aResult
A reference to storage to a TLV reader which will be positioned at the specified tag on success.
Return Values
WEAVE_NO_ERROR
On success.
WEAVE_ERROR_TLV_TAG_NOT_FOUND
If the specified aPredicate did not locate the specified element
Search for the first element matching the predicate within the TLV reader optionally descending into arrays or structures.
The aPredicate is applied to each visited TLV element; the aPredicate shall return WEAVE_ERROR_MAX for the matching elements, WEAVE_NO_ERROR for non-matching elements, and any other value to terminate the search.
Details
Parameters
[in] aReader
A read-only reference to the TLV reader in which to find the element matching the predicate.
[in] aPredicate
A predicate to be applied to each TLV element. To support the code reuse, aPredicate has the IterateHandler type. The return value of aPredicate controls the search: a WEAVE_ERROR_MAX signals that desired element has been found, WEAVE_NO_ERROR signals that the desired element has not been found, and all other values signal that the saerch should be terminated.
[in] aContext
An optional pointer to caller-provided context data.
[out] aResult
A reference to storage to a TLV reader which will be positioned at the specified tag on success.
[in] aRecurse
A boolean indicating whether (true) or not (false) any encountered arrays or structures should be descended into.
Return Values
WEAVE_NO_ERROR
On success.
WEAVE_ERROR_TLV_TAG_NOT_FOUND
If the specified aPredicate did not locate the specified element
Iterate through the TLV data referenced by aReader and invoke aHandler for each visited TLV element in the context of aContext.
The iteration is aborted if aHandler returns anything other than WEAVE_NO_ERROR
Details
Parameters
[in] aReader
A reference to the TLV reader containing the TLV data to iterate.
[in] aHandler
A callback to invoke for the current TLV element being visited.
[in,out] aContext
An optional pointer to caller-provided context data.
[in] aRecurse
A Boolean indicating whether (true) or not (false) any encountered arrays or structures should be descended into.
Return Values
WEAVE_END_OF_TLV
On a successful iteration to the end of a TLV encoding, or to the end of a TLV container.
WEAVE_ERROR_INVALID_ARGUMENT
If aHandler is NULL.
The
last value returned by aHandler, if different than WEAVE_NO_ERROR
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. The OPENTHREAD and related marks are trademarks of the Thread Group and are used under license.
Last updated 2019-01-15 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2019-01-15 UTC."],[],[]]