mirror of
https://github.com/espressif/openthread.git
synced 2026-06-05 21:14:49 +00:00
[cli] simplify dataset commands (#9366)
This commit simplifies the `Cli::Dataset` implementation by defining an array of `ComponentMapper` structures. Each `ComponentMapper` structure corresponds to a Dataset component, and provides the following information: - The component's CLI name - A method pointer to output that component - A method pointer to parse that component - A pointer to the component's mIsPresent boolean flag A new `LookupMapper()` method allows us to find (using binary search) the entry corresponding to a given component name. This model allows us to reuse code patterns for the main dataset sub-commands, `mgmtsetcommand`, and `mgmtgetcommand` commands when outputting or parsing dataset components.
This commit is contained in:
committed by
GitHub
parent
9dd3f2005b
commit
c10f650468
+539
-731
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user