From f5464e45ede67351b05fb2acc85747d2ac3cff8c Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Thu, 24 Apr 2025 13:11:54 +0530 Subject: [PATCH] components/esp_matter_rainmaker: add missing feature map attribute to rainmaker cluster --- components/esp_matter_rainmaker/esp_matter_rainmaker.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/esp_matter_rainmaker/esp_matter_rainmaker.cpp b/components/esp_matter_rainmaker/esp_matter_rainmaker.cpp index d2efdaeae..b658b07d5 100644 --- a/components/esp_matter_rainmaker/esp_matter_rainmaker.cpp +++ b/components/esp_matter_rainmaker/esp_matter_rainmaker.cpp @@ -16,6 +16,7 @@ #include #include +#include #include #include #include @@ -359,6 +360,7 @@ static esp_err_t sign_data_command_callback(const ConcreteCommandPath &command_p return sign_and_update_challenge_response(config_value); } +// This creates a server cluster static esp_err_t custom_cluster_create() { /* Get the endpoint */ @@ -367,7 +369,12 @@ static esp_err_t custom_cluster_create() /* Create custom rainmaker cluster */ cluster_t *cluster = esp_matter::cluster::create(endpoint, cluster::rainmaker::Id, CLUSTER_FLAG_SERVER); - attribute::create(cluster, Globals::Attributes::ClusterRevision::Id, ATTRIBUTE_FLAG_NONE, esp_matter_uint16(RAINMAKER_CLUSTER_REVISION)); + VerifyOrReturnError(cluster != NULL, ESP_FAIL, + ESP_LOGE(TAG, "Failed to create rainmaker cluster, id:0x%x", cluster::rainmaker::Id)); + + // global attributes + cluster::global::attribute::create_cluster_revision(cluster, RAINMAKER_CLUSTER_REVISION); + cluster::global::attribute::create_feature_map(cluster, 0); // There aren't any features for this cluster /* Create custom status attribute */ /* Update the value of the attribute after esp_rmaker_node_init() is done */