[net-diag] vendor name, model, and sw version TLVs (#8898)

This commit adds new Network Diagnostic TLVs for vendor name, vendor
model and vendor software version. The TLVs follow similar format as
the MeshCoP TLVs with the same name, i.e., all of them use UTF8
strings as value with name and model limited to 32 characters, and
software version to 16 characters.

The values for these TLVs can be set at build-time using a set of
newly added configs `OPENTHREAD_CONFIG_NET_DIAG_VENDOR_*`, or their
equivalent CMake options (e.g., `OT_VENDOR_NAME`).

It is recommended that these parameters are set at build time using
the configs. This way they are stored as constant strings and won't
consume RAM. However, for situations where the OT stack is integrated
as a library into different projects/products, we can enable a
feature for APIs to be added to set these strings at run-time. In
this case, the `OPENTHREAD_CONFIG_NET_DIAG_VENDOR_*` are treated as
the default values (used when OT stack is initialized).

This commit also adds Thread Stack Version TLV which has a string
value (up to 64 characters) and provides the version string from
`otGetVersionString()`.

This commit also adds CLI commands to get and set (when enabled) the
vendor name, model, and sw version on device. Also adds a test case
`test-020-net-diag-vendor-info.py`.
This commit is contained in:
Abtin Keshavarzian
2023-05-03 13:57:25 -07:00
committed by GitHub
parent 6f909a1d6a
commit 4fed5ea0f0
20 changed files with 951 additions and 89 deletions
+3
View File
@@ -75,6 +75,9 @@ OT_BUILD_OPTIONS=(
"-DOT_SNTP_CLIENT=ON"
"-DOT_SRP_CLIENT=ON"
"-DOT_SRP_SERVER=ON"
"-DOT_VENDOR_NAME=OpenThread"
"-DOT_VENDOR_MODEL=Scan-build"
"-DOT_VENDOR_SW_VERSION=OT"
)
readonly OT_BUILD_OPTIONS