Skip to content

Commit 390a241

Browse files
committed
Merge branch 'update-submodule-1-3' into 'release/v1.3'
[v1.3] connectedhomeip: update submodule to fix group clusters chunking issue See merge request app-frameworks/esp-matter!1015
2 parents ba10f49 + 3ad41ae commit 390a241

File tree

5 files changed

+31
-2
lines changed

5 files changed

+31
-2
lines changed

.gitlab-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ variables:
2525
IDF_CHECKOUT_REF: "v5.2.1"
2626
# This variable represents the short hash of the connectedhomeip submodule.
2727
# Note: Do change this short hash on submodule update MRs.
28-
CHIP_SHORT_HASH: "735b69f73e"
28+
CHIP_SHORT_HASH: "593d5c6f63"
2929
DOCKER_IMAGE_NAME: "espressif/chip-idf"
3030

3131
.add_gitlab_ssh_key: &add_gitlab_ssh_key |

components/esp_matter/esp_matter_cluster.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -1215,6 +1215,9 @@ const function_generic_t function_list[] = {
12151215
};
12161216
const int function_flags = CLUSTER_FLAG_INIT_FUNCTION;
12171217

1218+
static uint8_t server_cluster_count = 0;
1219+
uint8_t get_server_cluster_count() { return server_cluster_count; }
1220+
12181221
cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
12191222
{
12201223
cluster_t *cluster = cluster::create(endpoint, Groups::Id, flags);
@@ -1243,6 +1246,8 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
12431246
} else {
12441247
ESP_LOGE(TAG, "Config is NULL. Cannot add some attributes.");
12451248
}
1249+
1250+
server_cluster_count++;
12461251
}
12471252

12481253
/* Commands */

components/esp_matter/esp_matter_cluster.h

+1
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ typedef struct config {
306306
} config_t;
307307

308308
cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags);
309+
uint8_t get_server_cluster_count();
309310
} /* groups */
310311

311312
namespace scenes_management {

components/esp_matter/esp_matter_core.cpp

+23
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <app/util/attribute-storage.h>
2626
#include <credentials/DeviceAttestationCredsProvider.h>
2727
#include <credentials/FabricTable.h>
28+
#include <credentials/GroupDataProviderImpl.h>
2829
#include <lib/core/DataModelTypes.h>
2930
#include <platform/CHIPDeviceLayer.h>
3031
#include <platform/DeviceInfoProvider.h>
@@ -59,6 +60,10 @@ using chip::DeviceLayer::ThreadStackMgr;
5960
#define ESP_MATTER_NVS_PART_NAME CONFIG_ESP_MATTER_NVS_PART_NAME
6061
#define ESP_MATTER_MAX_DEVICE_TYPE_COUNT CONFIG_ESP_MATTER_MAX_DEVICE_TYPE_COUNT
6162

63+
// TODO: replace 4 with CONFIG_MAX_GROUPS_PER_FABRIC_PER_ENDPOINT
64+
// This will be fixed in https://github.com/project-chip/connectedhomeip/pull/35394
65+
#define MAX_GROUPS_PER_FABRIC_PER_ENDPOINT 4
66+
6267
static const char *TAG = "esp_matter_core";
6368
static bool esp_matter_started = false;
6469

@@ -891,8 +896,26 @@ static void esp_matter_chip_init_task(intptr_t context)
891896
{
892897
TaskHandle_t task_to_notify = reinterpret_cast<TaskHandle_t>(context);
893898
static chip::CommonCaseDeviceServerInitParams initParams;
899+
894900
initParams.InitializeStaticResourcesBeforeServerInit();
895901
initParams.appDelegate = &s_app_delegate;
902+
903+
#ifdef CONFIG_ESP_MATTER_ENABLE_DATA_MODEL
904+
// Group data provider injection for dynamic data model
905+
{
906+
uint8_t groups_server_cluster_count = cluster::groups::get_server_cluster_count();
907+
uint16_t max_groups_per_fabric = groups_server_cluster_count * MAX_GROUPS_PER_FABRIC_PER_ENDPOINT;
908+
909+
// since groupDataProvider is a static variable, it won't be released.
910+
static chip::Credentials::GroupDataProviderImpl groupDataProvider(max_groups_per_fabric, CHIP_CONFIG_MAX_GROUP_KEYS_PER_FABRIC);
911+
912+
groupDataProvider.SetStorageDelegate(initParams.persistentStorageDelegate);
913+
groupDataProvider.SetSessionKeystore(initParams.sessionKeystore);
914+
groupDataProvider.Init();
915+
initParams.groupDataProvider = &groupDataProvider;
916+
}
917+
#endif // CONFIG_ESP_MATTER_ENABLE_DATA_MODEL
918+
896919
CHIP_ERROR ret = chip::Server::GetInstance().GetFabricTable().AddFabricDelegate(&s_fabric_delegate);
897920
if (ret != CHIP_NO_ERROR)
898921
{

0 commit comments

Comments
 (0)