mirror of
https://github.com/espressif/openthread.git
synced 2025-05-17 15:26:16 +08:00

This commit updates `BorderAgent` modules to directly manage the registration of mDNS MeshCoP services. Previously, this was the responsibility of the platform or higher-level code. This behavior is enabled using `OPENTHREAD_CONFIG_BORDER_AGENT_MESHCOP_SERVICE_ENABLE` configuration option. When enabled, the `BorderAgent` module itself will register the `_meshcop._udp` service name with properly formatted TXT data. As the state changes, the service registration is updated accordingly. If the ephemeral key feature is enabled and used, the `BorderAgent` will also manage the registration of the `_meshcop-e._udp` service. The implementation allows the service instance name to be configured in different ways. The Thread specification recommends using a user-friendly name, such as "<VendorName> <ProductName>". The name can be set using a newly added configuration option, or alternatively, using a newly added public API for projects where the name needs to be set at run-time after device initialization. This commit also updates `test_border_agent`, validating all the newly added behaviors related to MeshCoP service registrations.