esp-matter
esp-matter copied to clipboard
How to set Thread Network Diagnostics cluster feature flags? (CON-1619)
How can I set the Thread Network Diagnostics cluster feature flags?
There does not seem to be any feature flags defined in the SDK for the Thread Network Diagnostic cluster.
There is a lot of Thread diagnostics data missing in the Thread Network Diagnostics cluster by using the defaults.
Thanks for your issue report, can you help to describe your request clearly? We haven't add the features support for the thread diagnostic cluster in current esp-matter SDK, we can add support for this part later.
This is an example of data that would be relevant:
@Jerry-ESP How can I set these feature flags?
Current SDK have no api to set these features directly, we will add these apis soon.
@olavt we have added related apis to the latest main branch, please have a try: https://github.com/espressif/esp-matter
@Jerry-ESP I added this code to my project now:
cluster::thread_network_diagnostics::feature::error_counts::add(cluster);
cluster::thread_network_diagnostics::feature::mac_counts::add(cluster);
cluster::thread_network_diagnostics::feature::mle_counts::add(cluster);
cluster::thread_network_diagnostics::feature::packets_counts::add(cluster);
It builds fine, but I don't have access to my controller to check how it works yet.
@olavt The code is correct, but all the attributes in the MLECNT and MLECNT are optional, so we didn't add them in the feature create api by default, you need add them manually. Just as below: attribute::thread_network_diagnostics::create_detached_role_count(cluster, 0);
After you add all the attributes you want, you can test use the chip-tool, read the feature map and attributes to check.
@Jerry-ESP I'm getting a compilation error on this statement:
attribute::thread_network_diagnostics::create_detached_role_count(cluster, 0);
'esp_matter::attribute::thread_network_diagnostics' has not been declared
This line of code works:
attribute::create(cluster, ThreadNetworkDiagnostics::Attributes::TxTotalCount::Id, ATTRIBUTE_FLAG_MANAGED_INTERNALLY, esp_matter_uint32(0));
I have these at the top of the source file:
using namespace esp_matter; using namespace esp_matter::attribute; using namespace esp_matter::endpoint; using namespace chip::app::Clusters;
What is missing to use the create utility functions to create the attribute?
The code I posted is incorrect, it should be as below: esp_matter::attribute::thread_network_diagnostics::create_detached_role_count(cluster, 0);
I still get the same error:
'esp_matter::attribute::thread_network_diagnostics' has not been declared
I still get the same error:
'esp_matter::attribute::thread_network_diagnostics' has not been declared
Sorry, it should be esp_matter::cluster::thread_network_diagnostics::attribute::create_detached_role_count(cluster, 0);