From 1856e151b84464cce8e0b88c71bbd47e2c563ca0 Mon Sep 17 00:00:00 2001 From: Chirag Atal Date: Mon, 6 Mar 2023 13:15:10 +0530 Subject: [PATCH] zap_generated: Add support to change the dynamic endpoint count through menuconfig Added some menuconfig options which can be helpful for memory optimisations. --- components/esp_matter/Kconfig | 29 +++++++++++ .../zap_common/zap-generated/gen_config.h | 48 ++++++++++--------- .../main/zap-generated/endpoint_config.h | 3 +- .../main/zap-generated/endpoint_config.h | 3 +- .../main/zap-generated/endpoint_config.h | 3 +- .../main/zap-generated/endpoint_config.h | 3 +- .../main/zap-generated/endpoint_config.h | 3 +- .../main/zap-generated/endpoint_config.h | 3 +- 8 files changed, 67 insertions(+), 28 deletions(-) diff --git a/components/esp_matter/Kconfig b/components/esp_matter/Kconfig index 91f99e127..e6e47afc9 100644 --- a/components/esp_matter/Kconfig +++ b/components/esp_matter/Kconfig @@ -2,6 +2,7 @@ menu "ESP Matter" config ESP_MATTER_MAX_DEVICE_TYPE_COUNT int "Maximum device types per endpoint" + range 1 255 default 16 help The maximum device type count supported per endpoint. @@ -36,4 +37,32 @@ menu "ESP Matter" endchoice + config ESP_MATTER_MAX_DYNAMIC_ENDPOINT_COUNT + int "Maximum dynamic endpoints" + range 1 255 + default 16 + help + The maximum dynamic endpoints supported. + + config ESP_MATTER_SCENES_TABLE_SIZE + int "Scenes table size" + range 1 255 + default 3 + help + Size of the scenes table. + + config ESP_MATTER_BINDING_TABLE_SIZE + int "Binding table size" + range 1 255 + default 10 + help + Size of the binding table. + + config ESP_MATTER_UNICAST_MESSAGE_COUNT + int "Unicast message count" + range 1 255 + default 10 + help + APS unicast message count. + endmenu diff --git a/components/esp_matter/zap_common/zap-generated/gen_config.h b/components/esp_matter/zap_common/zap-generated/gen_config.h index 323538260..681eb8a8c 100644 --- a/components/esp_matter/zap_common/zap-generated/gen_config.h +++ b/components/esp_matter/zap_common/zap-generated/gen_config.h @@ -20,13 +20,15 @@ // Prevent multiple inclusion #pragma once +#include + // User options for plugin Binding Table Library -#define EMBER_BINDING_TABLE_SIZE 10 +#define EMBER_BINDING_TABLE_SIZE CONFIG_ESP_MATTER_BINDING_TABLE_SIZE /**** Network Section ****/ #define EMBER_SUPPORTED_NETWORKS (1) -#define EMBER_APS_UNICAST_MESSAGE_COUNT 10 +#define EMBER_APS_UNICAST_MESSAGE_COUNT CONFIG_ESP_MATTER_UNICAST_MESSAGE_COUNT /* Cluster macros for all */ #define ZCL_USING_ACCESS_CONTROL_CLUSTER_SERVER @@ -167,25 +169,27 @@ /* Other cluster specific macros which are made generic */ -#define EMBER_AF_ACCOUNT_LOGIN_CLUSTER_SERVER_ENDPOINT_COUNT (16) // used in account login -#define EMBER_AF_APPLICATION_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT (16) // used in application basic -#define EMBER_AF_APPLICATION_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT (16) // used in application launcher -#define EMBER_AF_AUDIO_OUTPUT_CLUSTER_SERVER_ENDPOINT_COUNT (16) // used in audio output -#define EMBER_AF_CHANNEL_CLUSTER_SERVER_ENDPOINT_COUNT (16) // used in channel -#define EMBER_AF_COLOR_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (16) // used in color control -#define EMBER_AF_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT (16) // used in content launch -#define EMBER_AF_IDENTIFY_CLUSTER_SERVER_ENDPOINT_COUNT (16) // used in identify -#define EMBER_AF_KEYPAD_INPUT_CLUSTER_SERVER_ENDPOINT_COUNT (16) // used in keypad input -#define EMBER_AF_LEVEL_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (16) // used in level control -#define EMBER_AF_LOW_POWER_CLUSTER_SERVER_ENDPOINT_COUNT (16) // used in low power -#define EMBER_AF_MEDIA_INPUT_CLUSTER_SERVER_ENDPOINT_COUNT (16) // used in media input -#define EMBER_AF_MEDIA_PLAYBACK_CLUSTER_SERVER_ENDPOINT_COUNT (16) // used in media playback -#define EMBER_AF_ON_OFF_CLUSTER_SERVER_ENDPOINT_COUNT (16) // used in on off -#define EMBER_AF_OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT (16) // used in ota software update provider -#define EMBER_AF_TARGET_NAVIGATOR_CLUSTER_SERVER_ENDPOINT_COUNT (16) // used in target navigator -#define EMBER_AF_WAKE_ON_LAN_CLUSTER_SERVER_ENDPOINT_COUNT (16) // used in wake on lan -#define EMBER_AF_WINDOW_COVERING_CLUSTER_SERVER_ENDPOINT_COUNT (16) // used in window covering -#define EMBER_AF_DOOR_LOCK_CLUSTER_SERVER_ENDPOINT_COUNT (16) // used in door lock +#define DYNAMIC_ENDPOINTS CONFIG_ESP_MATTER_MAX_DYNAMIC_ENDPOINT_COUNT -#define MATTER_SCENES_TABLE_SIZE 3 // used in scenes // TODO: check this again +#define EMBER_AF_ACCOUNT_LOGIN_CLUSTER_SERVER_ENDPOINT_COUNT DYNAMIC_ENDPOINTS // used in account login +#define EMBER_AF_APPLICATION_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT DYNAMIC_ENDPOINTS // used in application basic +#define EMBER_AF_APPLICATION_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT DYNAMIC_ENDPOINTS // used in application launcher +#define EMBER_AF_AUDIO_OUTPUT_CLUSTER_SERVER_ENDPOINT_COUNT DYNAMIC_ENDPOINTS // used in audio output +#define EMBER_AF_CHANNEL_CLUSTER_SERVER_ENDPOINT_COUNT DYNAMIC_ENDPOINTS // used in channel +#define EMBER_AF_COLOR_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT DYNAMIC_ENDPOINTS // used in color control +#define EMBER_AF_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT DYNAMIC_ENDPOINTS // used in content launch +#define EMBER_AF_IDENTIFY_CLUSTER_SERVER_ENDPOINT_COUNT DYNAMIC_ENDPOINTS // used in identify +#define EMBER_AF_KEYPAD_INPUT_CLUSTER_SERVER_ENDPOINT_COUNT DYNAMIC_ENDPOINTS // used in keypad input +#define EMBER_AF_LEVEL_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT DYNAMIC_ENDPOINTS // used in level control +#define EMBER_AF_LOW_POWER_CLUSTER_SERVER_ENDPOINT_COUNT DYNAMIC_ENDPOINTS // used in low power +#define EMBER_AF_MEDIA_INPUT_CLUSTER_SERVER_ENDPOINT_COUNT DYNAMIC_ENDPOINTS // used in media input +#define EMBER_AF_MEDIA_PLAYBACK_CLUSTER_SERVER_ENDPOINT_COUNT DYNAMIC_ENDPOINTS // used in media playback +#define EMBER_AF_ON_OFF_CLUSTER_SERVER_ENDPOINT_COUNT DYNAMIC_ENDPOINTS // used in on off +#define EMBER_AF_OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT DYNAMIC_ENDPOINTS // used in ota +#define EMBER_AF_TARGET_NAVIGATOR_CLUSTER_SERVER_ENDPOINT_COUNT DYNAMIC_ENDPOINTS // used in target navigator +#define EMBER_AF_WAKE_ON_LAN_CLUSTER_SERVER_ENDPOINT_COUNT DYNAMIC_ENDPOINTS // used in wake on lan +#define EMBER_AF_WINDOW_COVERING_CLUSTER_SERVER_ENDPOINT_COUNT DYNAMIC_ENDPOINTS // used in window covering +#define EMBER_AF_DOOR_LOCK_CLUSTER_SERVER_ENDPOINT_COUNT DYNAMIC_ENDPOINTS // used in door lock + +#define MATTER_SCENES_TABLE_SIZE CONFIG_ESP_MATTER_SCENES_TABLE_SIZE // used in scenes // TODO: check this again diff --git a/examples/blemesh_bridge/main/zap-generated/endpoint_config.h b/examples/blemesh_bridge/main/zap-generated/endpoint_config.h index cfd7f6fc1..caafa958e 100644 --- a/examples/blemesh_bridge/main/zap-generated/endpoint_config.h +++ b/examples/blemesh_bridge/main/zap-generated/endpoint_config.h @@ -21,6 +21,7 @@ #pragma once #include +#include #define GENERATED_ATTRIBUTES \ {} @@ -46,7 +47,7 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, #ifdef CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT #undef CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT #endif -#define CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT (16) +#define CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT CONFIG_ESP_MATTER_MAX_DYNAMIC_ENDPOINT_COUNT // Array of endpoints that are supported, the data inside // the array is the endpoint number. diff --git a/examples/controller/main/zap-generated/endpoint_config.h b/examples/controller/main/zap-generated/endpoint_config.h index cfd7f6fc1..caafa958e 100644 --- a/examples/controller/main/zap-generated/endpoint_config.h +++ b/examples/controller/main/zap-generated/endpoint_config.h @@ -21,6 +21,7 @@ #pragma once #include +#include #define GENERATED_ATTRIBUTES \ {} @@ -46,7 +47,7 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, #ifdef CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT #undef CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT #endif -#define CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT (16) +#define CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT CONFIG_ESP_MATTER_MAX_DYNAMIC_ENDPOINT_COUNT // Array of endpoints that are supported, the data inside // the array is the endpoint number. diff --git a/examples/generic_switch/main/zap-generated/endpoint_config.h b/examples/generic_switch/main/zap-generated/endpoint_config.h index cfd7f6fc1..caafa958e 100644 --- a/examples/generic_switch/main/zap-generated/endpoint_config.h +++ b/examples/generic_switch/main/zap-generated/endpoint_config.h @@ -21,6 +21,7 @@ #pragma once #include +#include #define GENERATED_ATTRIBUTES \ {} @@ -46,7 +47,7 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, #ifdef CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT #undef CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT #endif -#define CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT (16) +#define CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT CONFIG_ESP_MATTER_MAX_DYNAMIC_ENDPOINT_COUNT // Array of endpoints that are supported, the data inside // the array is the endpoint number. diff --git a/examples/light/main/zap-generated/endpoint_config.h b/examples/light/main/zap-generated/endpoint_config.h index cfd7f6fc1..caafa958e 100644 --- a/examples/light/main/zap-generated/endpoint_config.h +++ b/examples/light/main/zap-generated/endpoint_config.h @@ -21,6 +21,7 @@ #pragma once #include +#include #define GENERATED_ATTRIBUTES \ {} @@ -46,7 +47,7 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, #ifdef CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT #undef CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT #endif -#define CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT (16) +#define CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT CONFIG_ESP_MATTER_MAX_DYNAMIC_ENDPOINT_COUNT // Array of endpoints that are supported, the data inside // the array is the endpoint number. diff --git a/examples/light_switch/main/zap-generated/endpoint_config.h b/examples/light_switch/main/zap-generated/endpoint_config.h index cfd7f6fc1..caafa958e 100644 --- a/examples/light_switch/main/zap-generated/endpoint_config.h +++ b/examples/light_switch/main/zap-generated/endpoint_config.h @@ -21,6 +21,7 @@ #pragma once #include +#include #define GENERATED_ATTRIBUTES \ {} @@ -46,7 +47,7 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, #ifdef CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT #undef CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT #endif -#define CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT (16) +#define CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT CONFIG_ESP_MATTER_MAX_DYNAMIC_ENDPOINT_COUNT // Array of endpoints that are supported, the data inside // the array is the endpoint number. diff --git a/examples/zigbee_bridge/main/zap-generated/endpoint_config.h b/examples/zigbee_bridge/main/zap-generated/endpoint_config.h index cfd7f6fc1..caafa958e 100644 --- a/examples/zigbee_bridge/main/zap-generated/endpoint_config.h +++ b/examples/zigbee_bridge/main/zap-generated/endpoint_config.h @@ -21,6 +21,7 @@ #pragma once #include +#include #define GENERATED_ATTRIBUTES \ {} @@ -46,7 +47,7 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, #ifdef CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT #undef CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT #endif -#define CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT (16) +#define CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT CONFIG_ESP_MATTER_MAX_DYNAMIC_ENDPOINT_COUNT // Array of endpoints that are supported, the data inside // the array is the endpoint number.