diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index 16c303e00307aa..52dd940b17d0ab 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -39,6 +39,7 @@ AppConfig ApplicationBasic ApplicationIdentifier ApplicationLauncher +ApplyUpdateRequest approver appspot aps @@ -340,6 +341,7 @@ env esd ESPPORT Espressif +esptool eth EthernetNetworkDiagnostics ethernets @@ -690,6 +692,11 @@ optionsMask optionsOverride orgs OTA +OTAProviderIpAddress +OTAProviderNodeId +OTAProviderSerialPort +OTARequesterImpl +OTARequestorSerialPort OTBR otcli PAA @@ -848,6 +855,7 @@ SetpointRaiseLower SetUpPINCode SetupQRCode sexualized +shubhamdp SIGINT SiLabs SiliconLabs diff --git a/config/ameba/args.gni b/config/ameba/args.gni index b3f7af63e284ab..5d9420e0fbb63c 100755 --- a/config/ameba/args.gni +++ b/config/ameba/args.gni @@ -31,7 +31,5 @@ chip_inet_config_enable_udp_endpoint = true chip_bypass_rendezvous = false chip_config_network_layer_ble = true -chip_ip_commissioning = true -chip_use_clusters_for_ip_commissioning = true custom_toolchain = "//third_party/connectedhomeip/config/ameba/toolchain:ameba" diff --git a/config/esp32/components/chip/CMakeLists.txt b/config/esp32/components/chip/CMakeLists.txt index 967c2c6fcfd374..e085a044ba2e01 100644 --- a/config/esp32/components/chip/CMakeLists.txt +++ b/config/esp32/components/chip/CMakeLists.txt @@ -39,6 +39,16 @@ if (CONFIG_OPENTHREAD_ENABLED) list(APPEND CHIP_REQURIE_COMPONENTS openthread) endif() +if (NOT CMAKE_BUILD_EARLY_EXPANSION) + if (CONFIG_COMPILER_OPTIMIZATION_DEFAULT OR CONFIG_COMPILER_OPTIMIZATION_NONE) + set(is_debug TRUE) + else() + if (NOT CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE) + message(FATAL_ERROR "CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE shall be set") + endif() + endif() +endif() + idf_component_register(SRCS chip.c chip.cpp PRIV_REQUIRES ${CHIP_REQURIE_COMPONENTS}) @@ -62,7 +72,7 @@ chip_gn_arg_append("esp32_ar" "\"${CMAKE_AR}\"") chip_gn_arg_append("esp32_cc" "\"${CMAKE_C_COMPILER}\"") chip_gn_arg_append("esp32_cxx" "\"${CMAKE_CXX_COMPILER}\"") chip_gn_arg_append("esp32_cpu" "\"esp32\"") -chip_gn_arg_bool("is_debug" is_debug) +chip_gn_arg_bool("is_debug" ${is_debug}) if(CONFIG_BT_ENABLED) chip_gn_arg_append("chip_config_network_layer_ble" "true") diff --git a/docs/guides/ip_commissioning.md b/docs/guides/ip_commissioning.md index feaf99993c5733..ca94e611bf0c62 100644 --- a/docs/guides/ip_commissioning.md +++ b/docs/guides/ip_commissioning.md @@ -40,7 +40,7 @@ device into commissioning mode. ### linux builds with an ethernet connection ```bash -gn gen out/debug --args='chip_ip_commissioning=true' +gn gen out/debug ninja -C out/debug ``` diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index f1e980a8a0225f..38ab7416b58898 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -1294,7 +1294,7 @@ "outgoing": 1 }, { - "name": "ApplyUpdateRequestResponse", + "name": "ApplyUpdateResponse", "code": 4, "mfgCode": null, "source": "server", @@ -1921,6 +1921,21 @@ "enabled": 1, "commands": [], "attributes": [ + { + "name": "ThreadMetrics", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "CurrentHeapFree", "code": 1, @@ -8380,7 +8395,7 @@ "outgoing": 1 }, { - "name": "ApplyUpdateRequestResponse", + "name": "ApplyUpdateResponse", "code": 4, "mfgCode": null, "source": "server", @@ -15636,6 +15651,276 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "unsupported", + "code": 255, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_boolean", + "code": 32768, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_bitmap8", + "code": 32769, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_bitmap16", + "code": 32770, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_bitmap32", + "code": 32771, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_bitmap64", + "code": 32772, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_int8u", + "code": 32773, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_int16u", + "code": 32774, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_int32u", + "code": 32776, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_int64u", + "code": 32780, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_int8s", + "code": 32781, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_int16s", + "code": 32782, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_int32s", + "code": 32784, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_int64s", + "code": 32788, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_enum8", + "code": 32789, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_enum16", + "code": 32790, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_octet_string", + "code": 32793, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_char_string", + "code": 32798, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, diff --git a/examples/all-clusters-app/ameba/README.md b/examples/all-clusters-app/ameba/README.md index 38615327fa233f..a21e4c926635a8 100644 --- a/examples/all-clusters-app/ameba/README.md +++ b/examples/all-clusters-app/ameba/README.md @@ -66,8 +66,6 @@ There are three commissioning modes supported by Ameba platform: 1. In "connectedhomeip/config/ameba/args.gni" - set `chip_bypass_rendezvous = true` - - Set `chip_ip_commissioning = false` - - Set `chip_use_clusters_for_ip_commissioning = false` - Set `chip_config_network_layer_ble = false` 2. In "connectedhomeip/src/platform/Ameba/CHIPDevicePlatformConfig.h" @@ -87,8 +85,6 @@ There are three commissioning modes supported by Ameba platform: 1. In "connectedhomeip/config/ameba/args.gni" - set `chip_bypass_rendezvous = false` - - Set `chip_ip_commissioning = false` - - Set `chip_use_clusters_for_ip_commissioning = false` - Set `chip_config_network_layer_ble = true` 2. In "connectedhomeip/src/platform/Ameba/CHIPDevicePlatformConfig.h" @@ -107,8 +103,6 @@ There are three commissioning modes supported by Ameba platform: 1. In "connectedhomeip/config/ameba/args.gni" - set `chip_bypass_rendezvous = false` - - Set `chip_ip_commissioning = true` - - Set `chip_use_clusters_for_ip_commissioning = true` - Set `chip_config_network_layer_ble = false` 2. In "connectedhomeip/src/platform/Ameba/CHIPDevicePlatformConfig.h" diff --git a/examples/all-clusters-app/esp32/README.md b/examples/all-clusters-app/esp32/README.md index 65e4eff495c53f..0ca5d729eaa545 100644 --- a/examples/all-clusters-app/esp32/README.md +++ b/examples/all-clusters-app/esp32/README.md @@ -41,13 +41,13 @@ The VSCode devcontainer has these components pre-installed, so you can skip this step. To install these components manually, follow these steps: - Clone the Espressif ESP-IDF and checkout - [v4.3 tag](https://github.com/espressif/esp-idf/releases/v4.3) + [v4.4 tag](https://github.com/espressif/esp-idf/releases/v4.4) $ mkdir ${HOME}/tools $ cd ${HOME}/tools $ git clone https://github.com/espressif/esp-idf.git $ cd esp-idf - $ git checkout v4.3 + $ git checkout release/v4.4 $ git submodule update --init $ ./install.sh diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index 6728949965494a..6554df86908ddd 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -27,6 +27,7 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/all-clusters-app/zap-generated" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/attributes" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/route_hook" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/shell_extension" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/util" diff --git a/examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp b/examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp index 9c6f54421bbe9b..6ec297cfb51f05 100644 --- a/examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp +++ b/examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp @@ -28,8 +28,11 @@ #include "Globals.h" #include "LEDWidget.h" #include "WiFiWidget.h" +#include "esp_check.h" +#include "esp_err.h" #include "esp_heap_caps.h" #include "esp_log.h" +#include "route_hook/esp_route_hook.h" #include #include #include @@ -83,6 +86,10 @@ void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_ // newly selected address. chip::app::DnssdServer::Instance().StartServer(); } + if (event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV6_Assigned) + { + ESP_ERROR_CHECK(esp_route_hook_init(esp_netif_get_handle_from_ifkey("WIFI_STA_DEF"))); + } break; } diff --git a/examples/all-clusters-app/esp32/sdkconfig.defaults b/examples/all-clusters-app/esp32/sdkconfig.defaults index 52d7e229e3337f..8cb1093fbfb606 100644 --- a/examples/all-clusters-app/esp32/sdkconfig.defaults +++ b/examples/all-clusters-app/esp32/sdkconfig.defaults @@ -44,3 +44,7 @@ CONFIG_DEVICE_PRODUCT_ID=0x4541 #enable debug shell CONFIG_ENABLE_CHIP_SHELL=y + +#enable lwIP route hooks +CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT=y +CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y diff --git a/examples/all-clusters-app/esp32/sdkconfig_c3devkit.defaults b/examples/all-clusters-app/esp32/sdkconfig_c3devkit.defaults index a636628c96567d..39f7907c458080 100644 --- a/examples/all-clusters-app/esp32/sdkconfig_c3devkit.defaults +++ b/examples/all-clusters-app/esp32/sdkconfig_c3devkit.defaults @@ -40,3 +40,6 @@ CONFIG_LWIP_IPV6_AUTOCONFIG=y CONFIG_PARTITION_TABLE_CUSTOM=y CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" +#enable lwIP route hooks +CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT=y +CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y diff --git a/examples/all-clusters-app/esp32/sdkconfig_m5stack.defaults b/examples/all-clusters-app/esp32/sdkconfig_m5stack.defaults index 8e79b8ea82df50..334cfe1b611cba 100644 --- a/examples/all-clusters-app/esp32/sdkconfig_m5stack.defaults +++ b/examples/all-clusters-app/esp32/sdkconfig_m5stack.defaults @@ -50,3 +50,7 @@ CONFIG_ESP_MAIN_TASK_STACK_SIZE=5120 #enable debug shell CONFIG_ENABLE_CHIP_SHELL=y + +#enable lwIP route hooks +CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT=y +CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y diff --git a/examples/bridge-app/bridge-common/bridge-app.zap b/examples/bridge-app/bridge-common/bridge-app.zap index 14fe77b851abce..442cab83bc7e03 100644 --- a/examples/bridge-app/bridge-common/bridge-app.zap +++ b/examples/bridge-app/bridge-common/bridge-app.zap @@ -894,6 +894,21 @@ "enabled": 1, "commands": [], "attributes": [ + { + "name": "ThreadMetrics", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "CurrentHeapFree", "code": 1, diff --git a/examples/bridge-app/esp32/README.md b/examples/bridge-app/esp32/README.md index add83d3346f770..6b83621d791d49 100644 --- a/examples/bridge-app/esp32/README.md +++ b/examples/bridge-app/esp32/README.md @@ -84,13 +84,13 @@ The VSCode devcontainer has these components pre-installed, so you can skip this step. To install these components manually, follow these steps: - Clone the Espressif ESP-IDF and checkout - [v4.3 tag](https://github.com/espressif/esp-idf/releases/v4.3) + [v4.4 tag](https://github.com/espressif/esp-idf/releases/v4.4) $ mkdir ${HOME}/tools $ cd ${HOME}/tools $ git clone https://github.com/espressif/esp-idf.git $ cd esp-idf - $ git checkout v4.3 + $ git checkout release/v4.4 $ git submodule update --init $ ./install.sh diff --git a/examples/bridge-app/esp32/main/CMakeLists.txt b/examples/bridge-app/esp32/main/CMakeLists.txt index 9d524d5d131721..f718d005201fb8 100644 --- a/examples/bridge-app/esp32/main/CMakeLists.txt +++ b/examples/bridge-app/esp32/main/CMakeLists.txt @@ -33,13 +33,14 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread_network_diagnostics_server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi_network_diagnostics_server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software_diagnostics_server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general_diagnostics_server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general_diagnostics_server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/descriptor" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/on-off-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/route_hook" PRIV_REQUIRES chip QRCode bt) -set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 14) +set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 14) target_compile_options(${COMPONENT_LIB} PRIVATE "-DLWIP_IPV6_SCOPES=0" "-DCHIP_HAVE_CONFIG_H") diff --git a/examples/bridge-app/esp32/main/DeviceCallbacks.cpp b/examples/bridge-app/esp32/main/DeviceCallbacks.cpp index 48c3863feec7a3..a0491fc2df7af5 100644 --- a/examples/bridge-app/esp32/main/DeviceCallbacks.cpp +++ b/examples/bridge-app/esp32/main/DeviceCallbacks.cpp @@ -17,8 +17,11 @@ */ #include "DeviceCallbacks.h" +#include "esp_check.h" +#include "esp_err.h" #include "esp_heap_caps.h" #include "esp_log.h" +#include "route_hook/esp_route_hook.h" #include #include #include @@ -81,6 +84,7 @@ void DeviceCallbacks::OnInternetConnectivityChange(const ChipDeviceEvent * event { ESP_LOGI(TAG, "IPv6 Server ready..."); chip::app::DnssdServer::Instance().StartServer(); + ESP_ERROR_CHECK(esp_route_hook_init(esp_netif_get_handle_from_ifkey("WIFI_STA_DEF"))); } else if (event->InternetConnectivityChange.IPv6 == kConnectivity_Lost) { diff --git a/examples/bridge-app/esp32/sdkconfig.defaults b/examples/bridge-app/esp32/sdkconfig.defaults index 956dcfe0eecedd..6a6589e1040577 100644 --- a/examples/bridge-app/esp32/sdkconfig.defaults +++ b/examples/bridge-app/esp32/sdkconfig.defaults @@ -36,3 +36,6 @@ CONFIG_LWIP_IPV6_AUTOCONFIG=y # Use a custom partition table CONFIG_PARTITION_TABLE_CUSTOM=y CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" + +CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT=y +CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y diff --git a/examples/chip-tool/BUILD.gn b/examples/chip-tool/BUILD.gn index 10741799f6e8a6..cfbffd3fcceadd 100644 --- a/examples/chip-tool/BUILD.gn +++ b/examples/chip-tool/BUILD.gn @@ -54,6 +54,7 @@ executable("chip-tool") { deps = [ "${chip_root}/src/app/server", + "${chip_root}/src/app/tests/suites/pics", "${chip_root}/src/controller/data_model", "${chip_root}/src/lib", "${chip_root}/src/platform", diff --git a/examples/chip-tool/commands/clusters/ModelCommand.h b/examples/chip-tool/commands/clusters/ModelCommand.h index b7135a5dc49ca8..71f79d4a2b3b08 100644 --- a/examples/chip-tool/commands/clusters/ModelCommand.h +++ b/examples/chip-tool/commands/clusters/ModelCommand.h @@ -24,10 +24,6 @@ #include #include -// Limits on endpoint values. -#define CHIP_ZCL_ENDPOINT_MIN 0x00 -#define CHIP_ZCL_ENDPOINT_MAX 0xF0 - class ModelCommand : public CHIPCommand { public: diff --git a/examples/chip-tool/commands/common/Command.cpp b/examples/chip-tool/commands/common/Command.cpp index e1c9ba153c1d82..9206545fcefa19 100644 --- a/examples/chip-tool/commands/common/Command.cpp +++ b/examples/chip-tool/commands/common/Command.cpp @@ -37,10 +37,19 @@ bool Command::InitArguments(int argc, char ** argv) bool isValidCommand = false; size_t argsCount = mArgs.size(); - VerifyOrExit(argsCount == (size_t)(argc), + size_t argsOptionalCount = 0; + for (size_t i = 0; i < argsCount; i++) + { + if (mArgs[i].optional) + { + argsOptionalCount++; + } + } + + VerifyOrExit((size_t)(argc) >= (argsCount - argsOptionalCount) && (size_t)(argc) <= argsCount, ChipLogError(chipTool, "InitArgs: Wrong arguments number: %d instead of %zu", argc, argsCount)); - for (size_t i = 0; i < argsCount; i++) + for (size_t i = 0; i < (size_t) argc; i++) { if (!InitArgument(i, argv[i])) { @@ -48,6 +57,10 @@ bool Command::InitArguments(int argc, char ** argv) } } + for (size_t i = (size_t) argc; i < argsCount; i++) + { + } + isValidCommand = true; exit: @@ -93,12 +106,16 @@ bool Command::InitArgument(size_t argIndex, char * argValue) switch (arg.type) { case ArgumentType::Attribute: { + if (arg.optional) + arg.value = &(reinterpret_cast *>(arg.value))->Emplace(); char * value = reinterpret_cast(arg.value); isValidArgument = (strcmp(argValue, value) == 0); break; } case ArgumentType::String: { + if (arg.optional) + arg.value = &(reinterpret_cast *>(arg.value))->Emplace(); const char ** value = reinterpret_cast(arg.value); *value = argValue; isValidArgument = true; @@ -106,6 +123,8 @@ bool Command::InitArgument(size_t argIndex, char * argValue) } case ArgumentType::CharString: { + if (arg.optional) + arg.value = &(reinterpret_cast> *>(arg.value))->Emplace(); auto * value = static_cast *>(arg.value); *value = chip::Span(argValue, strlen(argValue)); isValidArgument = true; @@ -113,6 +132,8 @@ bool Command::InitArgument(size_t argIndex, char * argValue) } case ArgumentType::OctetString: { + if (arg.optional) + arg.value = &(reinterpret_cast *>(arg.value))->Emplace(); auto * value = static_cast(arg.value); // We support two ways to pass an octet string argument. If it happens // to be all-ASCII, you can just pass it in. Otherwise you can pass in @@ -167,6 +188,8 @@ bool Command::InitArgument(size_t argIndex, char * argValue) case ArgumentType::Boolean: case ArgumentType::Number_uint8: { + if (arg.optional) + arg.value = &(reinterpret_cast *>(arg.value))->Emplace(); uint8_t * value = reinterpret_cast(arg.value); // stringstream treats uint8_t as char, which is not what we want here. @@ -190,6 +213,8 @@ bool Command::InitArgument(size_t argIndex, char * argValue) } case ArgumentType::Number_uint16: { + if (arg.optional) + arg.value = &(reinterpret_cast *>(arg.value))->Emplace(); uint16_t * value = reinterpret_cast(arg.value); std::stringstream ss; isHexNotation ? ss << std::hex << argValue : ss << argValue; @@ -202,6 +227,8 @@ bool Command::InitArgument(size_t argIndex, char * argValue) } case ArgumentType::Number_uint32: { + if (arg.optional) + arg.value = &(reinterpret_cast *>(arg.value))->Emplace(); uint32_t * value = reinterpret_cast(arg.value); std::stringstream ss; isHexNotation ? ss << std::hex << argValue : ss << argValue; @@ -214,6 +241,8 @@ bool Command::InitArgument(size_t argIndex, char * argValue) } case ArgumentType::Number_uint64: { + if (arg.optional) + arg.value = &(reinterpret_cast *>(arg.value))->Emplace(); uint64_t * value = reinterpret_cast(arg.value); std::stringstream ss; isHexNotation ? ss << std::hex << argValue : ss << argValue; @@ -226,6 +255,8 @@ bool Command::InitArgument(size_t argIndex, char * argValue) } case ArgumentType::Number_int8: { + if (arg.optional) + arg.value = &(reinterpret_cast *>(arg.value))->Emplace(); int8_t * value = reinterpret_cast(arg.value); // stringstream treats int8_t as char, which is not what we want here. @@ -249,6 +280,8 @@ bool Command::InitArgument(size_t argIndex, char * argValue) } case ArgumentType::Number_int16: { + if (arg.optional) + arg.value = &(reinterpret_cast *>(arg.value))->Emplace(); int16_t * value = reinterpret_cast(arg.value); std::stringstream ss; isHexNotation ? ss << std::hex << argValue : ss << argValue; @@ -261,6 +294,8 @@ bool Command::InitArgument(size_t argIndex, char * argValue) } case ArgumentType::Number_int32: { + if (arg.optional) + arg.value = &(reinterpret_cast *>(arg.value))->Emplace(); int32_t * value = reinterpret_cast(arg.value); std::stringstream ss; isHexNotation ? ss << std::hex << argValue : ss << argValue; @@ -273,6 +308,8 @@ bool Command::InitArgument(size_t argIndex, char * argValue) } case ArgumentType::Number_int64: { + if (arg.optional) + arg.value = &(reinterpret_cast *>(arg.value))->Emplace(); int64_t * value = reinterpret_cast(arg.value); std::stringstream ss; isHexNotation ? ss << std::hex << argValue : ss << argValue; @@ -285,6 +322,8 @@ bool Command::InitArgument(size_t argIndex, char * argValue) } case ArgumentType::Address: { + if (arg.optional) + arg.value = &(reinterpret_cast *>(arg.value))->Emplace(); AddressWithInterface * value = reinterpret_cast(arg.value); isValidArgument = ParseAddressWithInterface(argValue, value); break; @@ -299,82 +338,89 @@ bool Command::InitArgument(size_t argIndex, char * argValue) return isValidArgument; } -size_t Command::AddArgument(const char * name, const char * value) +size_t Command::AddArgument(const char * name, const char * value, bool optional) { Argument arg; - arg.type = ArgumentType::Attribute; - arg.name = name; - arg.value = const_cast(reinterpret_cast(value)); + arg.type = ArgumentType::Attribute; + arg.name = name; + arg.value = const_cast(reinterpret_cast(value)); + arg.optional = optional; mArgs.emplace_back(arg); return mArgs.size(); } -size_t Command::AddArgument(const char * name, char ** value) +size_t Command::AddArgument(const char * name, char ** value, bool optional) { Argument arg; - arg.type = ArgumentType::CharString; - arg.name = name; - arg.value = reinterpret_cast(value); + arg.type = ArgumentType::CharString; + arg.name = name; + arg.value = reinterpret_cast(value); + arg.optional = optional; mArgs.emplace_back(arg); return mArgs.size(); } -size_t Command::AddArgument(const char * name, chip::CharSpan * value) +size_t Command::AddArgument(const char * name, chip::CharSpan * value, bool optional) { Argument arg; - arg.type = ArgumentType::CharString; - arg.name = name; - arg.value = reinterpret_cast(value); + arg.type = ArgumentType::CharString; + arg.name = name; + arg.value = reinterpret_cast(value); + arg.optional = optional; mArgs.emplace_back(arg); return mArgs.size(); } -size_t Command::AddArgument(const char * name, chip::ByteSpan * value) +size_t Command::AddArgument(const char * name, chip::ByteSpan * value, bool optional) { Argument arg; - arg.type = ArgumentType::OctetString; - arg.name = name; - arg.value = reinterpret_cast(value); + arg.type = ArgumentType::OctetString; + arg.name = name; + arg.value = reinterpret_cast(value); + arg.optional = optional; mArgs.emplace_back(arg); return mArgs.size(); } -size_t Command::AddArgument(const char * name, AddressWithInterface * out) +size_t Command::AddArgument(const char * name, AddressWithInterface * out, bool optional) { Argument arg; - arg.type = ArgumentType::Address; - arg.name = name; - arg.value = reinterpret_cast(out); + arg.type = ArgumentType::Address; + arg.name = name; + arg.value = reinterpret_cast(out); + arg.optional = optional; mArgs.emplace_back(arg); return mArgs.size(); } -size_t Command::AddArgument(const char * name, int64_t min, uint64_t max, void * out, ArgumentType type) +size_t Command::AddArgument(const char * name, int64_t min, uint64_t max, void * out, ArgumentType type, bool optional) { Argument arg; - arg.type = type; - arg.name = name; - arg.value = out; - arg.min = min; - arg.max = max; + arg.type = type; + arg.name = name; + arg.value = out; + arg.min = min; + arg.max = max; + arg.optional = optional; mArgs.emplace_back(arg); return mArgs.size(); } -size_t Command::AddArgument(const char * name, int64_t min, uint64_t max, void * out) +size_t Command::AddArgument(const char * name, int64_t min, uint64_t max, void * out, bool optional) { Argument arg; - arg.type = ArgumentType::Number_uint8; - arg.name = name; - arg.value = out; - arg.min = min; - arg.max = max; + arg.type = ArgumentType::Number_uint8; + arg.name = name; + arg.value = out; + arg.min = min; + arg.max = max; + arg.optional = optional; mArgs.emplace_back(arg); return mArgs.size(); diff --git a/examples/chip-tool/commands/common/Command.h b/examples/chip-tool/commands/common/Command.h index e3da77dd679108..29b480d5fd2ff0 100644 --- a/examples/chip-tool/commands/common/Command.h +++ b/examples/chip-tool/commands/common/Command.h @@ -34,6 +34,10 @@ class Command; +// Limits on endpoint values. +#define CHIP_ZCL_ENDPOINT_MIN 0x00 +#define CHIP_ZCL_ENDPOINT_MAX 0xF0 + template std::unique_ptr make_unique(Args &&... args) { @@ -74,6 +78,7 @@ struct Argument int64_t min; uint64_t max; void * value; + bool optional; }; class Command @@ -91,10 +96,11 @@ class Command const char * GetName(void) const { return mName; } const char * GetAttribute(void) const; const char * GetArgumentName(size_t index) const; + bool GetArgumentIsOptional(size_t index) const { return mArgs[index].optional; } size_t GetArgumentsCount(void) const { return mArgs.size(); } bool InitArguments(int argc, char ** argv); - size_t AddArgument(const char * name, const char * value); + size_t AddArgument(const char * name, const char * value, bool optional = false); /** * @brief * Add a char string command argument @@ -103,90 +109,89 @@ class Command * @param value A pointer to a `char *` where the argv value will be stored * @returns The number of arguments currently added to the command */ - size_t AddArgument(const char * name, char ** value); + size_t AddArgument(const char * name, char ** value, bool optional = false); /** * Add an octet string command argument */ - size_t AddArgument(const char * name, chip::ByteSpan * value); - size_t AddArgument(const char * name, chip::Span * value); - size_t AddArgument(const char * name, AddressWithInterface * out); - size_t AddArgument(const char * name, int64_t min, uint64_t max, bool * out) + size_t AddArgument(const char * name, chip::ByteSpan * value, bool optional = false); + size_t AddArgument(const char * name, chip::Span * value, bool optional = false); + size_t AddArgument(const char * name, AddressWithInterface * out, bool optional = false); + size_t AddArgument(const char * name, int64_t min, uint64_t max, bool * out, bool optional = false) { - return AddArgument(name, min, max, reinterpret_cast(out), Boolean); + return AddArgument(name, min, max, reinterpret_cast(out), Boolean, optional); } - size_t AddArgument(const char * name, int64_t min, uint64_t max, int8_t * out) + size_t AddArgument(const char * name, int64_t min, uint64_t max, int8_t * out, bool optional = false) { - return AddArgument(name, min, max, reinterpret_cast(out), Number_int8); + return AddArgument(name, min, max, reinterpret_cast(out), Number_int8, optional); } - size_t AddArgument(const char * name, int64_t min, uint64_t max, int16_t * out) + size_t AddArgument(const char * name, int64_t min, uint64_t max, int16_t * out, bool optional = false) { - return AddArgument(name, min, max, reinterpret_cast(out), Number_int16); + return AddArgument(name, min, max, reinterpret_cast(out), Number_int16, optional); } - size_t AddArgument(const char * name, int64_t min, uint64_t max, int32_t * out) + size_t AddArgument(const char * name, int64_t min, uint64_t max, int32_t * out, bool optional = false) { - return AddArgument(name, min, max, reinterpret_cast(out), Number_int32); + return AddArgument(name, min, max, reinterpret_cast(out), Number_int32, optional); } - size_t AddArgument(const char * name, int64_t min, uint64_t max, int64_t * out) + size_t AddArgument(const char * name, int64_t min, uint64_t max, int64_t * out, bool optional = false) { - return AddArgument(name, min, max, reinterpret_cast(out), Number_int64); + return AddArgument(name, min, max, reinterpret_cast(out), Number_int64, optional); } - size_t AddArgument(const char * name, int64_t min, uint64_t max, uint8_t * out) + size_t AddArgument(const char * name, int64_t min, uint64_t max, uint8_t * out, bool optional = false) { - return AddArgument(name, min, max, reinterpret_cast(out), Number_uint8); + return AddArgument(name, min, max, reinterpret_cast(out), Number_uint8, optional); } - size_t AddArgument(const char * name, int64_t min, uint64_t max, uint16_t * out) + size_t AddArgument(const char * name, int64_t min, uint64_t max, uint16_t * out, bool optional = false) { - return AddArgument(name, min, max, reinterpret_cast(out), Number_uint16); + return AddArgument(name, min, max, reinterpret_cast(out), Number_uint16, optional); } - size_t AddArgument(const char * name, int64_t min, uint64_t max, uint32_t * out) + size_t AddArgument(const char * name, int64_t min, uint64_t max, uint32_t * out, bool optional = false) { - return AddArgument(name, min, max, reinterpret_cast(out), Number_uint32); + return AddArgument(name, min, max, reinterpret_cast(out), Number_uint32, optional); } - size_t AddArgument(const char * name, int64_t min, uint64_t max, uint64_t * out) + size_t AddArgument(const char * name, int64_t min, uint64_t max, uint64_t * out, bool optional = false) { - return AddArgument(name, min, max, reinterpret_cast(out), Number_uint64); + return AddArgument(name, min, max, reinterpret_cast(out), Number_uint64, optional); } template ::value>> - size_t AddArgument(const char * name, int64_t min, uint64_t max, T * out) + size_t AddArgument(const char * name, int64_t min, uint64_t max, T * out, bool optional = false) { - return AddArgument(name, min, max, reinterpret_cast *>(out)); + return AddArgument(name, min, max, reinterpret_cast *>(out), optional); } template size_t AddArgument(const char * name, chip::Optional * value) { - // We always require our args to be provided for the moment. - return AddArgument(name, &value->Emplace()); + return AddArgument(name, reinterpret_cast(value), true); } template size_t AddArgument(const char * name, int64_t min, uint64_t max, chip::Optional * value) { - // We always require our args to be provided for the moment. - return AddArgument(name, min, max, &value->Emplace()); + return AddArgument(name, min, max, reinterpret_cast(value), true); } template - size_t AddArgument(const char * name, chip::app::DataModel::Nullable * value) + size_t AddArgument(const char * name, chip::app::DataModel::Nullable * value, bool optional = false) { // We always require our args to be provided for the moment. - return AddArgument(name, &value->SetNonNull()); + return AddArgument(name, &value->SetNonNull(), optional); } template - size_t AddArgument(const char * name, int64_t min, uint64_t max, chip::app::DataModel::Nullable * value) + size_t AddArgument(const char * name, int64_t min, uint64_t max, chip::app::DataModel::Nullable * value, + bool optional = false) { // We always require our args to be provided for the moment. - return AddArgument(name, min, max, &value->SetNonNull()); + return AddArgument(name, min, max, &value->SetNonNull(), optional); } virtual CHIP_ERROR Run() = 0; private: bool InitArgument(size_t argIndex, char * argValue); - size_t AddArgument(const char * name, int64_t min, uint64_t max, void * out, ArgumentType type); - size_t AddArgument(const char * name, int64_t min, uint64_t max, void * out); + size_t AddArgument(const char * name, int64_t min, uint64_t max, void * out, ArgumentType type, bool optional); + size_t AddArgument(const char * name, int64_t min, uint64_t max, void * out, bool optional); const char * mName = nullptr; std::vector mArgs; diff --git a/examples/chip-tool/commands/common/Commands.cpp b/examples/chip-tool/commands/common/Commands.cpp index 18550d724853e7..c99ea1a274eee3 100644 --- a/examples/chip-tool/commands/common/Commands.cpp +++ b/examples/chip-tool/commands/common/Commands.cpp @@ -255,7 +255,16 @@ void Commands::ShowCommand(std::string executable, std::string clusterName, Comm for (size_t i = 0; i < argumentsCount; i++) { arguments += " "; + bool isOptional = command->GetArgumentIsOptional(i); + if (isOptional) + { + arguments += "["; + } arguments += command->GetArgumentName(i); + if (isOptional) + { + arguments += "]"; + } } fprintf(stderr, " %s %s %s\n", executable.c_str(), clusterName.c_str(), arguments.c_str()); } diff --git a/examples/chip-tool/commands/pairing/PairingCommand.cpp b/examples/chip-tool/commands/pairing/PairingCommand.cpp index b8507afb96dc3d..d8a8efaacb55ef 100644 --- a/examples/chip-tool/commands/pairing/PairingCommand.cpp +++ b/examples/chip-tool/commands/pairing/PairingCommand.cpp @@ -248,10 +248,7 @@ CHIP_ERROR PairingCommand::SetupNetwork() { case PairingNetworkType::None: case PairingNetworkType::Ethernet: - // Nothing to do other than to resolve the device's operational address. - err = UpdateNetworkAddress(); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(chipTool, "Setup failure! Error calling UpdateNetworkAddress: %s", ErrorStr(err))); + // Nothing to do here - device address has been resolved as part of the commissioning process. break; case PairingNetworkType::WiFi: case PairingNetworkType::Thread: diff --git a/examples/chip-tool/commands/reporting/ReportingCommand.h b/examples/chip-tool/commands/reporting/ReportingCommand.h index 0aa5169f4f2e95..4547f256926167 100644 --- a/examples/chip-tool/commands/reporting/ReportingCommand.h +++ b/examples/chip-tool/commands/reporting/ReportingCommand.h @@ -23,10 +23,6 @@ #include -// Limits on endpoint values. -#define CHIP_ZCL_ENDPOINT_MIN 0x00 -#define CHIP_ZCL_ENDPOINT_MAX 0xF0 - class ReportingCommand : public CHIPCommand { public: diff --git a/examples/chip-tool/commands/tests/TestCommand.cpp b/examples/chip-tool/commands/tests/TestCommand.cpp index 02d77dcd98a702..7263614751e3d9 100644 --- a/examples/chip-tool/commands/tests/TestCommand.cpp +++ b/examples/chip-tool/commands/tests/TestCommand.cpp @@ -29,6 +29,11 @@ void TestCommand::OnDeviceConnectedFn(void * context, chip::DeviceProxy * device auto * command = static_cast(context); VerifyOrReturn(command != nullptr, ChipLogError(chipTool, "Device connected, but cannot run the test, as the context is null")); command->mDevice = device; + + if (command->mPICSFilePath.HasValue()) + { + command->PICS.SetValue(PICSBooleanReader::Read(command->mPICSFilePath.Value())); + } command->NextTest(); } @@ -132,3 +137,21 @@ bool TestCommand::CheckValueAsString(const char * itemName, chip::CharSpan curre return true; } + +bool TestCommand::ShouldSkip(const char * expression) +{ + // If there is no PICS configuration file, considers that nothing should be skipped. + if (!PICS.HasValue()) + { + return false; + } + + std::map pics(PICS.Value()); + bool shouldSkip = !PICSBooleanExpressionParser::Eval(expression, pics); + if (shouldSkip) + { + ChipLogProgress(chipTool, " **** Skipping: %s == false\n", expression); + WaitForMs(0); + } + return shouldSkip; +} diff --git a/examples/chip-tool/commands/tests/TestCommand.h b/examples/chip-tool/commands/tests/TestCommand.h index 0e8ed8974624d7..ae1a28a915ef13 100644 --- a/examples/chip-tool/commands/tests/TestCommand.h +++ b/examples/chip-tool/commands/tests/TestCommand.h @@ -21,6 +21,8 @@ #include "../common/CHIPCommand.h" #include #include +#include +#include #include #include #include @@ -36,6 +38,8 @@ class TestCommand : public CHIPCommand { AddArgument("node-id", 0, UINT64_MAX, &mNodeId); AddArgument("delayInMs", 0, UINT64_MAX, &mDelayInMs); + AddArgument("endpoint-id", CHIP_ZCL_ENDPOINT_MIN, CHIP_ZCL_ENDPOINT_MAX, &mEndpointId); + AddArgument("PICS", &mPICSFilePath); } /////////// CHIPCommand Interface ///////// @@ -214,12 +218,17 @@ class TestCommand : public CHIPCommand chip::Callback::Callback mOnDeviceConnectedCallback; chip::Callback::Callback mOnDeviceConnectionFailureCallback; + bool ShouldSkip(const char * expression); + void Wait() { - if (mDelayInMs) + if (mDelayInMs.HasValue()) { - chip::test_utils::SleepMillis(mDelayInMs); + chip::test_utils::SleepMillis(mDelayInMs.Value()); } }; - uint64_t mDelayInMs = 0; + chip::Optional mDelayInMs; + chip::Optional mPICSFilePath; + chip::Optional mEndpointId; + chip::Optional> PICS; }; diff --git a/examples/chip-tool/templates/partials/test_cluster.zapt b/examples/chip-tool/templates/partials/test_cluster.zapt index 52176922bded08..ec9cd981380685 100644 --- a/examples/chip-tool/templates/partials/test_cluster.zapt +++ b/examples/chip-tool/templates/partials/test_cluster.zapt @@ -32,7 +32,7 @@ class {{filename}}: public TestCommand {{#chip_tests_items}} case {{index}}: ChipLogProgress(chipTool, " ***** Test Step {{index}} : {{label}}\n"); - err = Test{{asUpperCamelCase label}}_{{index}}(); + err = {{#if PICS}}ShouldSkip("{{PICS}}") ? CHIP_NO_ERROR : {{/if}}Test{{asUpperCamelCase label}}_{{index}}(); break; {{/chip_tests_items}} } @@ -122,11 +122,12 @@ class {{filename}}: public TestCommand {{else if isWait}} CHIP_ERROR {{>testCommand}}() { - ChipLogError(chipTool, "[Endpoint: {{endpoint}} Cluster: {{cluster}} {{#if isAttribute}}Attribute: {{attribute}}{{else}}Command: {{wait}}{{/if}}] {{label}}"); + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : {{endpoint}}; + ChipLogError(chipTool, "[Endpoint: 0x%08x Cluster: {{cluster}} {{#if isAttribute}}Attribute: {{attribute}}{{else}}Command: {{wait}}{{/if}}] {{label}}", endpoint); {{#*inline "waitForTypeName"}}{{#if isAttribute}}Attribute{{else}}Command{{/if}}{{/inline}} {{#*inline "waitForTypeId"}}chip::app::Clusters::{{asUpperCamelCase cluster}}::{{#if isAttribute}}Attributes::{{attribute}}{{else}}Commands::{{wait}}{{/if}}::Id{{/inline}} ClearAttributeAndCommandPaths(); - m{{>waitForTypeName}}Path = chip::app::Concrete{{>waitForTypeName}}Path({{endpoint}}, chip::app::Clusters::{{asUpperCamelCase cluster}}::Id, {{>waitForTypeId}}); + m{{>waitForTypeName}}Path = chip::app::Concrete{{>waitForTypeName}}Path(endpoint, chip::app::Clusters::{{asUpperCamelCase cluster}}::Id, {{>waitForTypeId}}); return CHIP_NO_ERROR; } {{else}} @@ -137,6 +138,7 @@ class {{filename}}: public TestCommand CHIP_ERROR {{>testCommand}}() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : {{endpoint}}; {{#if isCommand}} using RequestType = chip::app::Clusters::{{asUpperCamelCase cluster}}::Commands::{{asUpperCamelCase command}}::Type; @@ -153,11 +155,11 @@ class {{filename}}: public TestCommand (static_cast<{{filename}} *>(context))->OnFailureResponse_{{index}}(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, {{endpoint}}, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); {{#unless async}}return CHIP_NO_ERROR;{{/unless}} {{else}} chip::Controller::{{asUpperCamelCase cluster}}ClusterTest cluster; - cluster.Associate(mDevice, {{endpoint}}); + cluster.Associate(mDevice, endpoint); {{#chip_tests_item_parameters}} {{zapTypeToEncodableClusterObjectType type ns=parent.cluster}} {{asLowerCamelCase name}}Argument; diff --git a/examples/ipv6only-app/esp32/README.md b/examples/ipv6only-app/esp32/README.md index 209db56e5a000d..e53262f096adcb 100644 --- a/examples/ipv6only-app/esp32/README.md +++ b/examples/ipv6only-app/esp32/README.md @@ -26,7 +26,7 @@ step. To install these components manually, follow these steps: $ cd ${HOME}/tools $ git clone https://github.com/espressif/esp-idf.git $ cd esp-idf - $ git checkout release/v4.3 + $ git checkout release/v4.4 $ git submodule update --init $ ./install.sh diff --git a/examples/lighting-app/lighting-common/lighting-app.zap b/examples/lighting-app/lighting-common/lighting-app.zap index f4dcd0a195ac45..c0db8f6f38d742 100644 --- a/examples/lighting-app/lighting-common/lighting-app.zap +++ b/examples/lighting-app/lighting-common/lighting-app.zap @@ -1780,6 +1780,21 @@ "enabled": 1, "commands": [], "attributes": [ + { + "name": "ThreadMetrics", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "CurrentHeapFree", "code": 1, diff --git a/examples/lock-app/esp32/README.md b/examples/lock-app/esp32/README.md index ea9b03d7b1ee14..8b3daffbac7009 100644 --- a/examples/lock-app/esp32/README.md +++ b/examples/lock-app/esp32/README.md @@ -24,13 +24,13 @@ The VSCode devcontainer has these components pre-installed, so you can skip this step. To install these components manually, follow these steps: - Clone the Espressif ESP-IDF and checkout - [v4.3 tag](https://github.com/espressif/esp-idf/releases/v4.3) + [v4.4 tag](https://github.com/espressif/esp-idf/releases/v4.4) $ mkdir ${HOME}/tools $ cd ${HOME}/tools $ git clone https://github.com/espressif/esp-idf.git $ cd esp-idf - $ git checkout v4.3 + $ git checkout release/v4.4 $ git submodule update --init $ ./install.sh diff --git a/examples/lock-app/esp32/main/CMakeLists.txt b/examples/lock-app/esp32/main/CMakeLists.txt index ccc299805c384d..d4454e3f9ff9c5 100644 --- a/examples/lock-app/esp32/main/CMakeLists.txt +++ b/examples/lock-app/esp32/main/CMakeLists.txt @@ -127,6 +127,7 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/attributes" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/lock-app/zap-generated" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/route_hook" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/shell_extension" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/util" diff --git a/examples/lock-app/esp32/main/DeviceCallbacks.cpp b/examples/lock-app/esp32/main/DeviceCallbacks.cpp index 2804dea38a81af..00fe2a1d4928df 100644 --- a/examples/lock-app/esp32/main/DeviceCallbacks.cpp +++ b/examples/lock-app/esp32/main/DeviceCallbacks.cpp @@ -27,8 +27,11 @@ #include "AppConfig.h" #include "BoltLockManager.h" +#include "esp_check.h" +#include "esp_err.h" #include "esp_heap_caps.h" #include "esp_log.h" +#include "route_hook/esp_route_hook.h" #include #include #include @@ -63,11 +66,16 @@ void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_ // newly selected address. chip::app::DnssdServer::Instance().StartServer(); } + if (event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV6_Assigned) + { + ESP_ERROR_CHECK(esp_route_hook_init(esp_netif_get_handle_from_ifkey("WIFI_STA_DEF"))); + } break; } ESP_LOGI(TAG, "Current free heap: %d\n", heap_caps_get_free_size(MALLOC_CAP_8BIT)); } + void DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, ClusterId clusterId, AttributeId attributeId, uint8_t mask, uint8_t type, uint16_t size, uint8_t * value) { diff --git a/examples/lock-app/esp32/sdkconfig.defaults b/examples/lock-app/esp32/sdkconfig.defaults index e655288014f86d..0ac0ec53eed33f 100644 --- a/examples/lock-app/esp32/sdkconfig.defaults +++ b/examples/lock-app/esp32/sdkconfig.defaults @@ -36,3 +36,7 @@ CONFIG_LWIP_IPV6_AUTOCONFIG=y # Use a custom partition table CONFIG_PARTITION_TABLE_CUSTOM=y CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" + +#enable lwIP route hooks +CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT=y +CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y diff --git a/examples/lock-app/lock-common/lock-app.zap b/examples/lock-app/lock-common/lock-app.zap index 0c88117b4096b6..c8d90934bed2e3 100644 --- a/examples/lock-app/lock-common/lock-app.zap +++ b/examples/lock-app/lock-common/lock-app.zap @@ -1688,6 +1688,21 @@ "enabled": 1, "commands": [], "attributes": [ + { + "name": "ThreadMetrics", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "CurrentHeapFree", "code": 1, diff --git a/examples/minimal-mdns/AllInterfaceListener.h b/examples/minimal-mdns/AllInterfaceListener.h index 178c91b189e8e4..4744583a7f0762 100644 --- a/examples/minimal-mdns/AllInterfaceListener.h +++ b/examples/minimal-mdns/AllInterfaceListener.h @@ -39,7 +39,7 @@ class AllInterfaces : public mdns::Minimal::ListenIterator if (mState == State::kIpV4) { #if INET_CONFIG_ENABLE_IPV4 - *id = Inet::InterfaceId::Null(); + *id = chip::Inet::InterfaceId::Null(); *type = chip::Inet::IPAddressType::kIPv4; #endif mState = State::kIpV6; @@ -113,7 +113,7 @@ class AllInterfaces : public mdns::Minimal::ListenIterator return true; } - printf("Usable interface: %s (%d)\n", name, static_cast(mIterator.GetInterfaceId())); + printf("Usable interface: %s\n", name); return false; } diff --git a/examples/minimal-mdns/client.cpp b/examples/minimal-mdns/client.cpp index 2788d813dc9c17..cacb5fcf438420 100644 --- a/examples/minimal-mdns/client.cpp +++ b/examples/minimal-mdns/client.cpp @@ -186,7 +186,10 @@ class ReportDelegate : public mdns::Minimal::ServerDelegate char addr[32]; info->SrcAddress.ToString(addr, sizeof(addr)); - printf("QUERY from: %-15s on port %d, via interface %d\n", addr, info->SrcPort, info->Interface); + char ifName[64]; + VerifyOrDie(info->Interface.GetInterfaceName(ifName, sizeof(ifName)) == CHIP_NO_ERROR); + + printf("QUERY from: %-15s on port %d, via interface %s\n", addr, info->SrcPort, ifName); Report("QUERY: ", data); } @@ -195,7 +198,10 @@ class ReportDelegate : public mdns::Minimal::ServerDelegate char addr[32]; info->SrcAddress.ToString(addr, sizeof(addr)); - printf("RESPONSE from: %-15s on port %d, via interface %d\n", addr, info->SrcPort, info->Interface); + char ifName[64]; + VerifyOrDie(info->Interface.GetInterfaceName(ifName, sizeof(ifName)) == CHIP_NO_ERROR); + + printf("RESPONSE from: %-15s on port %d, via interface %s\n", addr, info->SrcPort, ifName); Report("RESPONSE: ", data); } @@ -328,7 +334,7 @@ int main(int argc, char ** args) BroadcastPacket(&mdnsServer); err = DeviceLayer::SystemLayer().StartTimer( - gOptions.runtimeMs, + chip::System::Clock::Milliseconds32(gOptions.runtimeMs), [](System::Layer *, void *) { DeviceLayer::PlatformMgr().StopEventLoopTask(); DeviceLayer::PlatformMgr().Shutdown(); diff --git a/examples/minimal-mdns/server.cpp b/examples/minimal-mdns/server.cpp index 8ea5cda16ec028..1d310b9618851b 100644 --- a/examples/minimal-mdns/server.cpp +++ b/examples/minimal-mdns/server.cpp @@ -115,7 +115,10 @@ class ReplyDelegate : public mdns::Minimal::ServerDelegate, public mdns::Minimal char addr[INET6_ADDRSTRLEN]; info->SrcAddress.ToString(addr, sizeof(addr)); - printf("QUERY from: %-15s on port %d, via interface %d\n", addr, info->SrcPort, info->Interface); + char ifName[64]; + VerifyOrDie(info->Interface.GetInterfaceName(ifName, sizeof(ifName)) == CHIP_NO_ERROR); + + printf("QUERY from: %-15s on port %d, via interface %s\n", addr, info->SrcPort, ifName); Report("QUERY: ", data); mCurrentSource = info; @@ -131,7 +134,10 @@ class ReplyDelegate : public mdns::Minimal::ServerDelegate, public mdns::Minimal char addr[INET6_ADDRSTRLEN]; info->SrcAddress.ToString(addr, sizeof(addr)); - printf("RESPONSE from: %-15s on port %d, via interface %d\n", addr, info->SrcPort, info->Interface); + char ifName[64]; + VerifyOrDie(info->Interface.GetInterfaceName(ifName, sizeof(ifName)) == CHIP_NO_ERROR); + + printf("RESPONSE from: %-15s on port %d, via interface %s\n", addr, info->SrcPort, ifName); } // ParserDelegate diff --git a/examples/ota-provider-app/esp32/.gitignore b/examples/ota-provider-app/esp32/.gitignore new file mode 100644 index 00000000000000..234526a082ad26 --- /dev/null +++ b/examples/ota-provider-app/esp32/.gitignore @@ -0,0 +1,5 @@ +*.vscode + +/build/ +/sdkconfig +/sdkconfig.old diff --git a/examples/ota-provider-app/esp32/CMakeLists.txt b/examples/ota-provider-app/esp32/CMakeLists.txt new file mode 100644 index 00000000000000..07edf22b17cb82 --- /dev/null +++ b/examples/ota-provider-app/esp32/CMakeLists.txt @@ -0,0 +1,33 @@ +# +# Copyright (c) 2021 Project CHIP Authors +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# The following lines of boilerplate have to be in your project's +# CMakeLists in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.5) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/../../common/cmake/idf_flashing.cmake) + +set(EXTRA_COMPONENT_DIRS + "${CMAKE_CURRENT_LIST_DIR}/third_party/connectedhomeip/config/esp32/components" + "${CMAKE_CURRENT_LIST_DIR}/../../common/QRCode" +) + +project(chip-ota-provider-app) +idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DLWIP_IPV6_SCOPES=0;-DCHIP_HAVE_CONFIG_H" APPEND) +idf_build_set_property(C_COMPILE_OPTIONS "-Os;-DLWIP_IPV6_SCOPES=0" APPEND) + +flashing_script() diff --git a/examples/ota-provider-app/esp32/README.md b/examples/ota-provider-app/esp32/README.md new file mode 100644 index 00000000000000..5cf19e3aebe287 --- /dev/null +++ b/examples/ota-provider-app/esp32/README.md @@ -0,0 +1,73 @@ +# CHIP ESP32 OTA Provider Example + +A prototype application that demonstrates OTA provider capabilities. + +## Supported Devices + +- This example supports ESP32 and ESP32C3. For details please check + [here](https://github.com/shubhamdp/connectedhomeip/tree/shubhamdp-patch-1/examples/all-clusters-app/esp32#supported-devices). + +## Building the Example Application + +- If you are building for the first time please check + [Building the Example Application](https://github.com/shubhamdp/connectedhomeip/tree/shubhamdp-patch-1/examples/all-clusters-app/esp32#building-the-example-application) + guide. +- Otherwise, `idf.py build` works! + +## Flashing the Example Application + +``` +idf.py -p flash +``` + +## Flashing the hello-world.bin OTA image + +Flash hello-world OTA image on OTA Provider's "ota_data" flash partition. Please +find hello-world.bin +[here](http://shubhamdp.github.io/esp_ota/esp32/hello-world-flash-in-ota-provider-partition.bin). +This OTA image is built for ESP32, it will not work on other devices. This is +the OTA upgrade image and will be sent to OTA requestor. + +``` +esptool.py -p write_flash 0x206400 hello-world-flash-in-ota-provider-partition.bin +``` + +NOTE: This is a modified binary which contains the size of OTA image at first 4 +bytes. + +Run the idf monitor + +``` +idf.py -p monitor +``` + +## Commissioning over BLE using chip-tool + +- Please build the standalone chip-tool as described [here](../../chip-tool) +- Commissioning the OTA Provider + +``` +./out/debug/chip-tool pairing ble-wifi 12345 0 20202021 3841 +``` + +--- + +Please note down the IP Address and Node ID of OTA Provider, these are required +for [OTA Requestor Example](../../ota-requestor-app/esp32). Once OTA provider is +commissioned then head over to +[OTA Requestor Example](../../ota-requestor-app/esp32). + +--- + +## Features + +- Can complete full BDX transfer +- Provide the full OTA image to Requestor + +## Limitations + +- Synchronous BDX transfer only +- Does not check VID/PID +- Only one transfer at a time +- Does not check incoming UpdateTokens +- Does not support the header defined in Matter Specification. diff --git a/examples/ota-provider-app/esp32/main/BdxOtaSender.cpp b/examples/ota-provider-app/esp32/main/BdxOtaSender.cpp new file mode 100644 index 00000000000000..34677c17c00496 --- /dev/null +++ b/examples/ota-provider-app/esp32/main/BdxOtaSender.cpp @@ -0,0 +1,193 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include +#include +#include +#include +#include +#include + +using chip::bdx::StatusCode; +using chip::bdx::TransferControlFlags; +using chip::bdx::TransferSession; + +void BdxOtaSender::SetCallbacks(BdxOtaSenderCallbacks callbacks) +{ + mOnBlockQueryCallback = callbacks.onBlockQuery; + mOnTransferCompleteCallback = callbacks.onTransferComplete; + mOnTransferFailedCallback = callbacks.onTransferFailed; +} + +void BdxOtaSender::HandleTransferSessionOutput(TransferSession::OutputEvent & event) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + if (event.EventType != TransferSession::OutputEventType::kNone) + { + ChipLogDetail(BDX, "OutputEvent type: %s", event.ToString(event.EventType)); + } + + switch (event.EventType) + { + case TransferSession::OutputEventType::kNone: + break; + case TransferSession::OutputEventType::kMsgToSend: { + chip::Messaging::SendFlags sendFlags; + if (!event.msgTypeData.HasMessageType(chip::Protocols::SecureChannel::MsgType::StatusReport)) + { + // All messages sent from the Sender expect a response, except for a StatusReport which would indicate an error and the + // end of the transfer. + sendFlags.Set(chip::Messaging::SendMessageFlags::kExpectResponse); + } + VerifyOrReturn(mExchangeCtx != nullptr, ChipLogError(BDX, "%s: mExchangeCtx is null", __FUNCTION__)); + err = mExchangeCtx->SendMessage(event.msgTypeData.ProtocolId, event.msgTypeData.MessageType, std::move(event.MsgData), + sendFlags); + if (err != CHIP_NO_ERROR) + { + ChipLogError(BDX, "SendMessage failed: %s", chip::ErrorStr(err)); + } + break; + } + case TransferSession::OutputEventType::kInitReceived: { + // TransferSession will automatically reject a transfer if there are no + // common supported control modes. It will also default to the smaller + // block size. + TransferSession::TransferAcceptData acceptData; + acceptData.ControlMode = TransferControlFlags::kReceiverDrive; // OTA must use receiver drive + acceptData.MaxBlockSize = mTransfer.GetTransferBlockSize(); + acceptData.StartOffset = mTransfer.GetStartOffset(); + acceptData.Length = mTransfer.GetTransferLength(); + VerifyOrReturn(mTransfer.AcceptTransfer(acceptData) == CHIP_NO_ERROR, + ChipLogError(BDX, "%s: %s", __FUNCTION__, chip::ErrorStr(err))); + break; + } + case TransferSession::OutputEventType::kQueryReceived: { + TransferSession::BlockData blockData; + uint16_t blockSize = mTransfer.GetTransferBlockSize(); + uint16_t bytesToRead = blockSize; + + chip::System::PacketBufferHandle blockBuf = chip::System::PacketBufferHandle::New(bytesToRead); + if (blockBuf.IsNull()) + { + // TODO: AbortTransfer() needs to support GeneralStatusCode failures as well as BDX specific errors. + mTransfer.AbortTransfer(StatusCode::kUnknown); + return; + } + + if (mOnBlockQueryCallback != nullptr && mOnBlockQueryCallback->mCall != nullptr) + { + if (CHIP_NO_ERROR != + mOnBlockQueryCallback->mCall(mOnBlockQueryCallback->mContext, blockBuf, blockData.Length, blockData.IsEof, + mNumBytesSent)) + { + ChipLogError(BDX, "onBlockQuery Callback failed"); + mTransfer.AbortTransfer(StatusCode::kUnknown); + return; + } + } + else + { + ChipLogError(BDX, "onBlockQuery Callback not set"); + mTransfer.AbortTransfer(StatusCode::kUnknown); + return; + } + + blockData.Data = blockBuf->Start(); + mNumBytesSent = static_cast(mNumBytesSent + blockData.Length); + + VerifyOrReturn(CHIP_NO_ERROR == mTransfer.PrepareBlock(blockData), + ChipLogError(BDX, "%s: PrepareBlock failed: %s", __FUNCTION__, chip::ErrorStr(err))); + break; + } + case TransferSession::OutputEventType::kAckReceived: + break; + case TransferSession::OutputEventType::kAckEOFReceived: + ChipLogDetail(BDX, "Transfer completed, got AckEOF"); + if (mOnTransferCompleteCallback != nullptr && mOnTransferCompleteCallback->mCall != nullptr) + { + mOnTransferCompleteCallback->mCall(mOnTransferCompleteCallback->mContext); + } + else + { + ChipLogError(BDX, "onTransferComplete Callback not set"); + } + Reset(); + break; + case TransferSession::OutputEventType::kStatusReceived: + ChipLogError(BDX, "Got StatusReport %x", static_cast(event.statusData.statusCode)); + if (mOnTransferFailedCallback != nullptr && mOnTransferFailedCallback->mCall != nullptr) + { + mOnTransferFailedCallback->mCall(mOnTransferFailedCallback->mContext, kErrorBdxSenderStatusReceived); + } + else + { + ChipLogError(BDX, "onTransferFailed Callback not set"); + } + Reset(); + break; + case TransferSession::OutputEventType::kInternalError: + ChipLogError(BDX, "InternalError"); + if (mOnTransferFailedCallback != nullptr && mOnTransferFailedCallback->mCall != nullptr) + { + mOnTransferFailedCallback->mCall(mOnTransferFailedCallback->mContext, kErrorBdxSenderInternal); + } + { + ChipLogError(BDX, "onTransferFailed Callback not set"); + } + Reset(); + break; + case TransferSession::OutputEventType::kTransferTimeout: + ChipLogError(BDX, "Transfer timed out"); + if (mOnTransferFailedCallback != nullptr && mOnTransferFailedCallback->mCall != nullptr) + { + mOnTransferFailedCallback->mCall(mOnTransferFailedCallback->mContext, kErrorBdxSenderTimeOut); + } + { + ChipLogError(BDX, "onTransferFailed Callback not set"); + } + Reset(); + break; + case TransferSession::OutputEventType::kAcceptReceived: + case TransferSession::OutputEventType::kBlockReceived: + default: + // TransferSession should prevent this case from happening. + ChipLogError(BDX, "%s: unsupported event type", __FUNCTION__); + } +} + +void BdxOtaSender::Reset() +{ + mTransfer.Reset(); + if (mExchangeCtx != nullptr) + { + mExchangeCtx->Close(); + } + mNumBytesSent = 0; +} + +uint16_t BdxOtaSender::GetTransferBlockSize(void) +{ + return mTransfer.GetTransferBlockSize(); +} + +uint64_t BdxOtaSender::GetTransferLength() +{ + return mTransfer.GetTransferLength(); +} diff --git a/examples/ota-provider-app/esp32/main/CHIPDeviceManager.cpp b/examples/ota-provider-app/esp32/main/CHIPDeviceManager.cpp new file mode 100644 index 00000000000000..9a24074d6cceef --- /dev/null +++ b/examples/ota-provider-app/esp32/main/CHIPDeviceManager.cpp @@ -0,0 +1,105 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * This file implements the CHIP Device Interface that is used by + * applications to interact with the CHIP stack + * + */ + +#include + +#include "CHIPDeviceManager.h" +#include +#include +#include +#include +#include +#include + +using namespace ::chip; + +namespace chip { + +namespace DeviceManager { + +using namespace ::chip::DeviceLayer; + +void CHIPDeviceManager::CommonDeviceEventHandler(const ChipDeviceEvent * event, intptr_t arg) +{ + CHIPDeviceManagerCallbacks * cb = reinterpret_cast(arg); + if (cb != nullptr) + { + cb->DeviceEventCallback(event, reinterpret_cast(cb)); + } +} + +CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb) +{ + CHIP_ERROR err; + mCB = cb; + RendezvousInformationFlags flags = RendezvousInformationFlags(CONFIG_RENDEZVOUS_MODE); + + // Initialize the CHIP stack. + err = PlatformMgr().InitChipStack(); + SuccessOrExit(err); + + if (flags.Has(RendezvousInformationFlag::kBLE)) + { + ConnectivityMgr().SetBLEAdvertisingEnabled(true); + } + else if (flags.Has(RendezvousInformationFlag::kSoftAP)) + { + // TODO(cecille): Fix for the case where BLE and SoftAP are both enabled.` + ConnectivityMgr().SetBLEAdvertisingEnabled(false); + ConnectivityMgr().SetWiFiAPMode(ConnectivityManager::kWiFiAPMode_Enabled); + } + else + { + // If rendezvous is bypassed, enable SoftAP so that the device can still + // be communicated with via its SoftAP as needed. + ConnectivityMgr().SetWiFiAPMode(ConnectivityManager::kWiFiAPMode_Enabled); + } + + err = Platform::MemoryInit(); + SuccessOrExit(err); + + // Register a function to receive events from the CHIP device layer. Note that calls to + // this function will happen on the CHIP event loop thread, not the app_main thread. + PlatformMgr().AddEventHandler(CHIPDeviceManager::CommonDeviceEventHandler, reinterpret_cast(cb)); + + // Start a task to run the CHIP Device event loop. + err = PlatformMgr().StartEventLoopTask(); + SuccessOrExit(err); + +exit: + return err; +} +} // namespace DeviceManager +} // namespace chip + +void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & path, uint8_t mask, uint8_t type, uint16_t size, + uint8_t * value) +{ + chip::DeviceManager::CHIPDeviceManagerCallbacks * cb = + chip::DeviceManager::CHIPDeviceManager::GetInstance().GetCHIPDeviceManagerCallbacks(); + if (cb != nullptr) + { + cb->PostAttributeChangeCallback(path.mEndpointId, path.mClusterId, path.mAttributeId, mask, type, size, value); + } +} diff --git a/examples/ota-provider-app/esp32/main/CMakeLists.txt b/examples/ota-provider-app/esp32/main/CMakeLists.txt new file mode 100644 index 00000000000000..a85dcdb35d4b82 --- /dev/null +++ b/examples/ota-provider-app/esp32/main/CMakeLists.txt @@ -0,0 +1,51 @@ +# +# Copyright (c) 2021 Project CHIP Authors +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) +idf_component_register(PRIV_INCLUDE_DIRS + "${CMAKE_CURRENT_LIST_DIR}/include" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/ota-provider-app/" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/ota-provider-app" + SRC_DIRS + "${CMAKE_CURRENT_LIST_DIR}" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/ota-provider-app/zap-generated" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/attributes" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/util" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/reporting" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/administrator-commissioning-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/basic" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/bindings" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/descriptor" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/diagnostic-logs-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet_network_diagnostics_server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread_network_diagnostics_server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi_network_diagnostics_server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software_diagnostics_server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general_diagnostics_server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ota-provider" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/ota-provider-app/ota-provider-common" + EXCLUDE_SRCS + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/ota-provider-app/ota-provider-common/BdxOtaSender.cpp" + PRIV_REQUIRES chip QRCode bt console) + +set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 14) +target_compile_options(${COMPONENT_LIB} PRIVATE "-DLWIP_IPV6_SCOPES=0" "-DCHIP_HAVE_CONFIG_H") diff --git a/examples/ota-provider-app/esp32/main/DeviceCallbacks.cpp b/examples/ota-provider-app/esp32/main/DeviceCallbacks.cpp new file mode 100644 index 00000000000000..043d452011e7a4 --- /dev/null +++ b/examples/ota-provider-app/esp32/main/DeviceCallbacks.cpp @@ -0,0 +1,109 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file DeviceCallbacks.cpp + * + * Implements all the callbacks to the application from the CHIP Stack + * + **/ +#include "DeviceCallbacks.h" + +#include "esp_heap_caps.h" +#include "esp_log.h" +#include +#include +#include +#include + +static const char * TAG = "echo-devicecallbacks"; + +using namespace ::chip; +using namespace ::chip::Inet; +using namespace ::chip::System; +using namespace ::chip::DeviceLayer; + +void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_t arg) +{ + switch (event->Type) + { + case DeviceEventType::kInternetConnectivityChange: + OnInternetConnectivityChange(event); + break; + + case DeviceEventType::kSessionEstablished: + OnSessionEstablished(event); + break; + case DeviceEventType::kInterfaceIpAddressChanged: + if ((event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV4_Assigned) || + (event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV6_Assigned)) + { + // MDNS server restart on any ip assignment: if link local ipv6 is configured, that + // will not trigger a 'internet connectivity change' as there is no internet + // connectivity. MDNS still wants to refresh its listening interfaces to include the + // newly selected address. + chip::app::DnssdServer::Instance().StartServer(); + } + break; + } + ESP_LOGI(TAG, "Current free heap: %d\n", heap_caps_get_free_size(MALLOC_CAP_8BIT)); +} + +void DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, ClusterId clusterId, AttributeId attributeId, uint8_t mask, + uint8_t type, uint16_t size, uint8_t * value) +{ + ESP_LOGI(TAG, + "PostAttributeChangeCallback - Cluster ID: '" ChipLogFormatMEI + "', EndPoint ID: '0x%02x', Attribute ID: '" ChipLogFormatMEI "'", + ChipLogValueMEI(clusterId), endpointId, ChipLogValueMEI(attributeId)); + + // TODO handle this callback in switch statement + ESP_LOGI(TAG, "Unhandled cluster ID: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); + + ESP_LOGI(TAG, "Current free heap: %d\n", heap_caps_get_free_size(MALLOC_CAP_8BIT)); +} + +void DeviceCallbacks::OnInternetConnectivityChange(const ChipDeviceEvent * event) +{ + if (event->InternetConnectivityChange.IPv4 == kConnectivity_Established) + { + ESP_LOGI(TAG, "Server ready at: %s:%d", event->InternetConnectivityChange.address, CHIP_PORT); + chip::app::DnssdServer::Instance().StartServer(); + } + else if (event->InternetConnectivityChange.IPv4 == kConnectivity_Lost) + { + ESP_LOGE(TAG, "Lost IPv4 connectivity..."); + } + if (event->InternetConnectivityChange.IPv6 == kConnectivity_Established) + { + ESP_LOGI(TAG, "IPv6 Server ready..."); + chip::app::DnssdServer::Instance().StartServer(); + } + else if (event->InternetConnectivityChange.IPv6 == kConnectivity_Lost) + { + ESP_LOGE(TAG, "Lost IPv6 connectivity..."); + } +} + +void DeviceCallbacks::OnSessionEstablished(const ChipDeviceEvent * event) +{ + if (event->SessionEstablished.IsCommissioner) + { + ESP_LOGI(TAG, "Commissioner detected!"); + } +} diff --git a/examples/ota-provider-app/esp32/main/Kconfig.projbuild b/examples/ota-provider-app/esp32/main/Kconfig.projbuild new file mode 100644 index 00000000000000..96a7f14d5c69ec --- /dev/null +++ b/examples/ota-provider-app/esp32/main/Kconfig.projbuild @@ -0,0 +1,50 @@ +# +# Copyright (c) 2020 Project CHIP Authors +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Description: +# Configuration options CHIP ESP32 demo application. +# + +menu "Demo" + + choice + prompt "Rendezvous Mode" + default RENDEZVOUS_MODE_BLE + help + Specifies the Rendezvous mode of the peripheral. + + config RENDEZVOUS_MODE_BYPASS + bool "Bypass" + config RENDEZVOUS_MODE_WIFI + bool "Wi-Fi" + config RENDEZVOUS_MODE_BLE + bool "BLE" + config RENDEZVOUS_MODE_THREAD + bool "Thread" + config RENDEZVOUS_MODE_ETHERNET + bool "Ethernet" + endchoice + + config RENDEZVOUS_MODE + int + range 0 8 + default 0 if RENDEZVOUS_MODE_BYPASS + default 1 if RENDEZVOUS_MODE_WIFI + default 2 if RENDEZVOUS_MODE_BLE + default 4 if RENDEZVOUS_MODE_THREAD + default 8 if RENDEZVOUS_MODE_ETHERNET + +endmenu diff --git a/examples/ota-provider-app/esp32/main/include/BdxOtaSender.h b/examples/ota-provider-app/esp32/main/include/BdxOtaSender.h new file mode 100644 index 00000000000000..4940d676dedd58 --- /dev/null +++ b/examples/ota-provider-app/esp32/main/include/BdxOtaSender.h @@ -0,0 +1,103 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#pragma once + +enum BdxSenderErrorTypes +{ + kErrorBdxSenderNoError = 0, + kErrorBdxSenderStatusReceived, + kErrorBdxSenderInternal, + kErrorBdxSenderTimeOut, +}; + +/** + * @brief + * This callback is called when bdx session receives a BlockQuery message. + * + * @param[in] context User context + * @param[out] blockBuf Preallocated PacketBuffer, implementor should fill the block buf with the data + * @param[out] size Size of data + * @param[out] isEof Flag which tells whether it is final block or not + * @param[in] offset Offset to read data from + * + * @return CHIP_NO_ERROR on success; return appropriate error code otherwise + */ +typedef CHIP_ERROR (*OnBdxBlockQuery)(void * context, chip::System::PacketBufferHandle & blockBuf, size_t & size, bool & isEof, + uint32_t offset); + +/** + * @brief + * This callback is called when bdx session receives BlockAckEOF message + * + * @param[in] context User contex + */ +typedef void (*OnBdxTransferComplete)(void * context); + +/** + * @brief + * This callback is called when bdx transfer receives StatusReport messages, + * if there is any internal error, or transfer timed out + * + * @param[in] context User context + * @param[in] status Error code + */ +typedef void (*OnBdxTransferFailed)(void * context, BdxSenderErrorTypes status); + +struct BdxOtaSenderCallbacks +{ + chip::Callback::Callback * onBlockQuery = nullptr; + chip::Callback::Callback * onTransferComplete = nullptr; + chip::Callback::Callback * onTransferFailed = nullptr; +}; + +class BdxOtaSender : public chip::bdx::Responder +{ +public: + void SetCallbacks(BdxOtaSenderCallbacks callbacks); + + /** + * @brief + * Get negotiated bdx tranfer block size + * + * @return Negotiated bdx tranfer block size + */ + uint16_t GetTransferBlockSize(void); + + /** + * @brief + * Get the predetermined definite length for the transfer + * + * @return Predetermined definite length for the transfer + */ + uint64_t GetTransferLength(void); + +private: + // Inherited from bdx::TransferFacilitator + void HandleTransferSessionOutput(chip::bdx::TransferSession::OutputEvent & event) override; + + void Reset(); + + uint32_t mNumBytesSent = 0; + + chip::Callback::Callback * mOnBlockQueryCallback = nullptr; + chip::Callback::Callback * mOnTransferCompleteCallback = nullptr; + chip::Callback::Callback * mOnTransferFailedCallback = nullptr; +}; diff --git a/examples/ota-provider-app/esp32/main/include/CHIPDeviceManager.h b/examples/ota-provider-app/esp32/main/include/CHIPDeviceManager.h new file mode 100644 index 00000000000000..ee424b366df1b8 --- /dev/null +++ b/examples/ota-provider-app/esp32/main/include/CHIPDeviceManager.h @@ -0,0 +1,127 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * This file contains definitions for the CHIP DeviceManager Interface + * + * This object will co-ordinate multiple activities such as + * initialisation, rendezvous, session mgmt and other such + * activities within the CHIP stack. This is a singleton object. + */ + +#ifndef CHIP_DEVICEMANAGER_H_ +#define CHIP_DEVICEMANAGER_H_ + +#include +#include +#include + +#include + +#include +#include + +#include + +namespace chip { +namespace DeviceManager { + +/** + * @brief + * This class provides a skeleton for all the callback functions. The functions will be + * called by other objects within the CHIP stack for specific events. + * Applications interested in receiving specific callbacks can specialize this class and handle + * these events in their implementation of this class. + */ +class DLL_EXPORT CHIPDeviceManagerCallbacks +{ +public: + /** + * @brief + * Called when CHIP Device events (PublicEventTypes) are triggered. + * + * @param event ChipDeviceEvent that occurred + * @param arg arguments specific to the event, if any + */ + virtual void DeviceEventCallback(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg); + + /** + * @brief + * Called after an attribute has been changed + * + * @param endpoint endpoint id + * @param clusterID cluster id + * @param attributeId attribute id that was changed + * @param mask mask of the attribute + * @param manufacturerCode manufacturer code + * @param type attribute type + * @param size size of the attribute + * @param value pointer to the new value + */ + virtual void PostAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, + uint8_t mask, uint8_t type, uint16_t size, uint8_t * value) + {} + virtual ~CHIPDeviceManagerCallbacks() {} +}; + +/** + * @brief + * A common class that drives other components of the CHIP stack + */ +class DLL_EXPORT CHIPDeviceManager +{ +public: + CHIPDeviceManager(const CHIPDeviceManager &) = delete; + CHIPDeviceManager(const CHIPDeviceManager &&) = delete; + CHIPDeviceManager & operator=(const CHIPDeviceManager &) = delete; + + static CHIPDeviceManager & GetInstance() + { + static CHIPDeviceManager instance; + return instance; + } + + /** + * @brief + * Initialise CHIPDeviceManager + * + * @param cb Application's instance of the CHIPDeviceManagerCallbacks for consuming events + */ + CHIP_ERROR Init(CHIPDeviceManagerCallbacks * cb); + + /** + * @brief + * Fetch a pointer to the registered CHIPDeviceManagerCallbacks object. + * + */ + CHIPDeviceManagerCallbacks * GetCHIPDeviceManagerCallbacks() { return mCB; } + + /** + * Use internally for registration of the ChipDeviceEvents + */ + static void CommonDeviceEventHandler(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg); + +private: + CHIPDeviceManagerCallbacks * mCB = nullptr; + CHIPDeviceManager() {} +}; + +} // namespace DeviceManager +} // namespace chip + +#endif /* CHIP_DEVICEMANAGER_H_ */ diff --git a/examples/ota-provider-app/esp32/main/include/DeviceCallbacks.h b/examples/ota-provider-app/esp32/main/include/DeviceCallbacks.h new file mode 100644 index 00000000000000..d94560b8448d86 --- /dev/null +++ b/examples/ota-provider-app/esp32/main/include/DeviceCallbacks.h @@ -0,0 +1,47 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file DeviceCallbacks.h + * + * Implementations for the DeviceManager callbacks for this application + * + **/ + +#ifndef DEVICE_CALLBACKS_H +#define DEVICE_CALLBACKS_H + +#include "CHIPDeviceManager.h" +#include +#include + +class DeviceCallbacks : public chip::DeviceManager::CHIPDeviceManagerCallbacks +{ +public: + virtual void DeviceEventCallback(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg); + virtual void PostAttributeChangeCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, chip::AttributeId attributeId, + uint8_t mask, uint8_t type, uint16_t size, uint8_t * value); + +private: + void OnInternetConnectivityChange(const chip::DeviceLayer::ChipDeviceEvent * event); + void OnSessionEstablished(const chip::DeviceLayer::ChipDeviceEvent * event); + void OnOnOffPostAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value); + void OnIdentifyPostAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value); +}; + +#endif // DEVICE_CALLBACKS_H diff --git a/examples/ota-provider-app/esp32/main/main.cpp b/examples/ota-provider-app/esp32/main/main.cpp new file mode 100644 index 00000000000000..3d2191c6afef96 --- /dev/null +++ b/examples/ota-provider-app/esp32/main/main.cpp @@ -0,0 +1,234 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "CHIPDeviceManager.h" +#include "DeviceCallbacks.h" +#include "esp_heap_caps_init.h" +#include "esp_log.h" +#include "esp_netif.h" +#include "esp_spi_flash.h" +#include "esp_system.h" +#include "esp_wifi.h" +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "nvs_flash.h" +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include + +using chip::BitFlags; +using chip::app::Clusters::OTAProviderDelegate; +using chip::bdx::TransferControlFlags; +using chip::Callback::Callback; +using chip::Messaging::ExchangeManager; +using namespace ::chip; +using namespace ::chip::System; +using namespace ::chip::Credentials; +using namespace ::chip::DeviceManager; +using namespace ::chip::DeviceLayer; + +CHIP_ERROR OnBlockQuery(void * context, chip::System::PacketBufferHandle & blockBuf, size_t & size, bool & isEof, uint32_t offset); +void OnTransferComplete(void * context); +void OnTransferFailed(void * context, BdxSenderErrorTypes status); + +namespace { +const char * TAG = "ota-provider-app"; +static DeviceCallbacks EchoCallbacks; +BdxOtaSender bdxServer; + +// TODO: this should probably be done dynamically +constexpr chip::EndpointId kOtaProviderEndpoint = 0; +constexpr uint32_t kMaxBdxBlockSize = 1024; +constexpr chip::System::Clock::Timeout kBdxTimeout = chip::System::Clock::Seconds16(5 * 60); // Specification mandates >= 5 minutes +constexpr chip::System::Clock::Timeout kBdxPollFreq = chip::System::Clock::Milliseconds32(500); +const char * otaFilename = "hello-world.bin"; +const esp_partition_t * otaPartition = nullptr; +uint32_t otaImageLen = 0; +uint32_t otaTransferInProgress = false; + +chip::Callback::Callback onBlockQueryCallback(OnBlockQuery, nullptr); +chip::Callback::Callback onTransferCompleteCallback(OnTransferComplete, nullptr); +chip::Callback::Callback onTransferFailedCallback(OnTransferFailed, nullptr); +} // namespace + +CHIP_ERROR OnBlockQuery(void * context, chip::System::PacketBufferHandle & blockBuf, size_t & size, bool & isEof, uint32_t offset) +{ + if (otaTransferInProgress == false) + { + if (otaPartition == nullptr || otaImageLen == 0) + { + ESP_LOGE(TAG, "OTA partition not found"); + return CHIP_ERROR_OPEN_FAILED; + } + otaTransferInProgress = true; + } + + uint16_t blockBufAvailableLength = blockBuf->AvailableDataLength(); + uint16_t transferBlockSize = bdxServer.GetTransferBlockSize(); + + size = (blockBufAvailableLength < transferBlockSize) ? blockBufAvailableLength : transferBlockSize; + + // There are two types of messages requestor can use to query a block: `BlockQuery` and `BlockQueryWithSkip` so, + // to handle both case in a single callback offset is used which is managed by the `BdxOtaSender`. + // So, offset + size will not overflow and even if it overflows the esp_partition_read API will return an error. + if (offset + size >= otaImageLen) + { + size = otaImageLen - offset; + isEof = true; + } + else + { + isEof = false; + } + + esp_err_t err = esp_partition_read(otaPartition, offset + sizeof(otaImageLen), blockBuf->Start(), size); + if (err != ESP_OK) + { + ESP_LOGI(TAG, "Failed to read %d bytes from offset %d", size, offset + sizeof(otaImageLen)); + size = 0; + isEof = false; + return CHIP_ERROR_READ_FAILED; + } + + ESP_LOGI(TAG, "Read %d bytes from offset %d", size, offset + sizeof(otaImageLen)); + return CHIP_NO_ERROR; +} + +void OnTransferComplete(void * context) +{ + ESP_LOGI(TAG, "OTA Image Transfer Complete"); + otaTransferInProgress = false; +} + +void OnTransferFailed(void * context, BdxSenderErrorTypes status) +{ + ESP_LOGI(TAG, "OTA Image Transfer Failed, status:%x", status); + otaTransferInProgress = false; +} + +extern "C" void app_main() +{ + ESP_LOGI(TAG, "OTA Provider!"); + + /* Print chip information */ + esp_chip_info_t chip_info; + esp_chip_info(&chip_info); + ESP_LOGI(TAG, "This is ESP32 chip with %d CPU cores, WiFi%s%s, ", chip_info.cores, + (chip_info.features & CHIP_FEATURE_BT) ? "/BT" : "", (chip_info.features & CHIP_FEATURE_BLE) ? "/BLE" : ""); + + ESP_LOGI(TAG, "silicon revision %d, ", chip_info.revision); + + ESP_LOGI(TAG, "%dMB %s flash\n", spi_flash_get_chip_size() / (1024 * 1024), + (chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external"); + + // Initialize the ESP NVS layer. + esp_err_t err = nvs_flash_init(); + if (err != ESP_OK) + { + ESP_LOGE(TAG, "nvs_flash_init() failed: %s", esp_err_to_name(err)); + return; + } + + OTAProviderExample otaProvider; + + CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance(); + + CHIP_ERROR error = deviceMgr.Init(&EchoCallbacks); + if (error != CHIP_NO_ERROR) + { + ESP_LOGE(TAG, "device.Init() failed: %s", ErrorStr(error)); + return; + } + + chip::Server::GetInstance().Init(); + + // Initialize device attestation config + SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); + + // Register handler to handle bdx messages + error = chip::Server::GetInstance().GetExchangeManager().RegisterUnsolicitedMessageHandlerForProtocol(chip::Protocols::BDX::Id, + &bdxServer); + if (error != CHIP_NO_ERROR) + { + ESP_LOGE(TAG, "RegisterUnsolicitedMessageHandler failed: %s", chip::ErrorStr(error)); + return; + } + + BdxOtaSenderCallbacks callbacks; + callbacks.onBlockQuery = &onBlockQueryCallback; + callbacks.onTransferComplete = &onTransferCompleteCallback; + callbacks.onTransferFailed = &onTransferFailedCallback; + bdxServer.SetCallbacks(callbacks); + + // If OTA image is available in flash storage then set to update available + otaPartition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_NVS, "ota_data"); + if (otaPartition != nullptr) + { + ESP_LOGI(TAG, "Partition found %s address:0x%x size:0x%x", otaPartition->label, otaPartition->address, otaPartition->size); + + // TODO: Use the OTA image header specified in the specification + // Right now we are using just image length instead of full header + esp_partition_read(otaPartition, 0, &otaImageLen, sizeof(otaImageLen)); + if (otaImageLen > otaPartition->size) + { + otaImageLen = 0; + } + ESP_LOGI(TAG, "OTA image length %d bytes", otaImageLen); + } + else + { + ESP_LOGE(TAG, "OTA partition not found"); + } + + if (otaImageLen > 0) + { + otaProvider.SetQueryImageBehavior(OTAProviderExample::kRespondWithUpdateAvailable); + otaProvider.SetOTAFilePath(otaFilename); + } + + chip::app::Clusters::OTAProvider::SetDelegate(kOtaProviderEndpoint, &otaProvider); + + BitFlags bdxFlags; + bdxFlags.Set(TransferControlFlags::kReceiverDrive); + error = bdxServer.PrepareForTransfer(&chip::DeviceLayer::SystemLayer(), chip::bdx::TransferRole::kSender, bdxFlags, + kMaxBdxBlockSize, kBdxTimeout, kBdxPollFreq); + if (error != CHIP_NO_ERROR) + { + ChipLogError(BDX, "Failed to init BDX server: %s", chip::ErrorStr(error)); + return; + } + + // Run the UI Loop + while (true) + { + vTaskDelay(50 / portTICK_PERIOD_MS); + } +} diff --git a/examples/ota-provider-app/esp32/partitions.csv b/examples/ota-provider-app/esp32/partitions.csv new file mode 100644 index 00000000000000..671212345e7887 --- /dev/null +++ b/examples/ota-provider-app/esp32/partitions.csv @@ -0,0 +1,10 @@ +# Name, Type, SubType, Offset, Size, Flags +# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap +nvs, data, nvs, , 0x6000, +otadata, data, ota, , 0x2000, +phy_init, data, phy, , 0x1000, +# Factory partition size about 1.9MB +factory, app, factory, , 1945K, +# OTA partition of size 1M +ota_data, data, nvs, , 1M, +# ota_1, app, ota_1, , 512K, diff --git a/examples/ota-provider-app/esp32/sdkconfig.defaults b/examples/ota-provider-app/esp32/sdkconfig.defaults new file mode 100644 index 00000000000000..aaae13fbb5c092 --- /dev/null +++ b/examples/ota-provider-app/esp32/sdkconfig.defaults @@ -0,0 +1,57 @@ +# +# Copyright (c) 2020 Project CHIP Authors +# Copyright (c) 2018 Nest Labs, Inc. +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Description: +# Some useful defaults for the demo app configuration. +# + + +# Default to 921600 baud when flashing and monitoring device +CONFIG_ESPTOOLPY_BAUD_921600B=y +CONFIG_ESPTOOLPY_BAUD=921600 +CONFIG_ESPTOOLPY_COMPRESSED=y +CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B=y +CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 + +#enable BT +CONFIG_BT_ENABLED=y +CONFIG_BT_NIMBLE_ENABLED=y + +#enable lwip ipv6 autoconfig +CONFIG_LWIP_IPV6_AUTOCONFIG=y + +# Use a custom partition table +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" + +# Add RTC memory to system heap +CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=y + +# Product id +CONFIG_DEVICE_VENDOR_ID=0x235A +CONFIG_DEVICE_PRODUCT_ID=0x4591 + +# Main task needs a bit more stack than the default +# default is 3584, bump this up to 6k. +CONFIG_ESP_MAIN_TASK_STACK_SIZE=6144 + +# Serial Flasher config +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +CONFIG_ESPTOOLPY_FLASHSIZE="4MB" + +# discriminator +CONFIG_USE_TEST_SETUP_DISCRIMINATOR=0xF01 diff --git a/examples/ota-provider-app/esp32/third_party/connectedhomeip b/examples/ota-provider-app/esp32/third_party/connectedhomeip new file mode 120000 index 00000000000000..11a54ed360106c --- /dev/null +++ b/examples/ota-provider-app/esp32/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../../ \ No newline at end of file diff --git a/examples/ota-provider-app/ota-provider-common/OTAProviderExample.cpp b/examples/ota-provider-app/ota-provider-common/OTAProviderExample.cpp index 379301ef4d70e9..3cc95d329c7b58 100644 --- a/examples/ota-provider-app/ota-provider-common/OTAProviderExample.cpp +++ b/examples/ota-provider-app/ota-provider-common/OTAProviderExample.cpp @@ -62,14 +62,14 @@ bool GenerateBdxUri(const Span & fileDesignator, Span outUri, size_t static constexpr char bdxPrefix[] = "bdx://"; chip::NodeId nodeId = chip::kTestDeviceNodeId; // TODO: read this dynamically size_t nodeIdHexStrLen = sizeof(nodeId) * 2; - size_t expectedLength = strlen(bdxPrefix) + nodeIdHexStrLen + fileDesignator.size(); + size_t expectedLength = strlen(bdxPrefix) + nodeIdHexStrLen + 1 + fileDesignator.size(); if (expectedLength >= availableSize) { return false; } - size_t written = static_cast(snprintf(outUri.data(), availableSize, "%s" ChipLogFormatX64 "%s", bdxPrefix, + size_t written = static_cast(snprintf(outUri.data(), availableSize, "%s" ChipLogFormatX64 "/%s", bdxPrefix, ChipLogValueX64(nodeId), fileDesignator.data())); return expectedLength == written; diff --git a/examples/ota-requestor-app/esp32/.gitignore b/examples/ota-requestor-app/esp32/.gitignore new file mode 100644 index 00000000000000..234526a082ad26 --- /dev/null +++ b/examples/ota-requestor-app/esp32/.gitignore @@ -0,0 +1,5 @@ +*.vscode + +/build/ +/sdkconfig +/sdkconfig.old diff --git a/examples/ota-requestor-app/esp32/CMakeLists.txt b/examples/ota-requestor-app/esp32/CMakeLists.txt new file mode 100644 index 00000000000000..2e98c02cef57b8 --- /dev/null +++ b/examples/ota-requestor-app/esp32/CMakeLists.txt @@ -0,0 +1,33 @@ +# +# Copyright (c) 2021 Project CHIP Authors +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# The following lines of boilerplate have to be in your project's +# CMakeLists in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.5) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/../../common/cmake/idf_flashing.cmake) + +set(EXTRA_COMPONENT_DIRS + "${CMAKE_CURRENT_LIST_DIR}/third_party/connectedhomeip/config/esp32/components" + "${CMAKE_CURRENT_LIST_DIR}/../../common/QRCode" +) + +project(chip-ota-requester-app) +idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DLWIP_IPV6_SCOPES=0;-DCHIP_HAVE_CONFIG_H" APPEND) +idf_build_set_property(C_COMPILE_OPTIONS "-Os;-DLWIP_IPV6_SCOPES=0" APPEND) + +flashing_script() diff --git a/examples/ota-requestor-app/esp32/README.md b/examples/ota-requestor-app/esp32/README.md new file mode 100644 index 00000000000000..1d9a783db5bdee --- /dev/null +++ b/examples/ota-requestor-app/esp32/README.md @@ -0,0 +1,97 @@ +# CHIP ESP32 OTA Requestor Example + +A prototype application that demonstrates OTA Requestor capabilities. + +## Prerequisite + +Before moving ahead, make sure you have +[OTA Provider](../../ota-provider-app/esp32) is commissioned and running. + +## Supported Devices + +- This example supports ESP32 and ESP32C3. For details please check + [here](https://github.com/shubhamdp/connectedhomeip/tree/shubhamdp-patch-1/examples/all-clusters-app/esp32#supported-devices). + +## Building the Example Application + +- If you are building for the first time please check + [Building the Example Application](https://github.com/shubhamdp/connectedhomeip/tree/shubhamdp-patch-1/examples/all-clusters-app/esp32#building-the-example-application) + guide. +- Otherwise, `idf.py build` works! + +## Flashing the Example Application + +``` +idf.py -p flash monitor +``` + +## Commissioning over BLE using chip-tool + +- Please build the standalone chip-tool as described [here](../../chip-tool) +- Commissioning the OTA Requestor + +``` +./out/debug/chip-tool pairing ble-wifi 12346 0 20202021 3840 +``` + +## Query for an OTA Image + +After commissioning is successful, query for OTA image. Head over to ESP32 +console and fire the following command. This command creates a CASE session with +OTA Provider and start the OTA image transfer using BDX protocol. + +``` +esp32> QueryImage +``` + +OTA image transfer takes some time and once done it prints following log + +``` +I (322620) OTARequesterImpl: Transfer complete! +``` + +## Apply update request + +Once transfer is complete OTA Requestor should take permission from the OTA +Provider for applying the OTA image. + +``` +esp32> ApplyUpdateRequest +``` + +After this step device should reboot and start running hello world example. + +## ESP32 OTA Requestor with Linux OTA Provider + +- Build the [Linux OTA Provider](../../ota-provider-app/linux) +- Run the Linux OTA Provider with + [hello world OTA image](http://shubhamdp.github.io/esp_ota/esp32/hello-world-flash-in-ota-provider-partition.bin). + This OTA image is built for ESP32, it will not work on other devices. + +``` +./out/debug/chip-ota-provider-app -f hello-world-flash-in-ota-provider-partition.bin +``` + +- Provision the Linux OTA Provider using chip-tool + +``` +./out/debug/chip-tool pairing 12345 20202021 +``` + +- Note down the OTA Provider IP address and Node Id and repeat the steps for + ESP32 OTA Requestor app + +--- + +## Features + +- Can perform the actual OTA if the image provided is valid +- Code for running a full BDX download exists in BDX +- Can send QueryImage and ApplyUpdateRequest commands triggered from console +- Downloads a file over BDX served by an OTA Provider server + +## Limitations + +- Does not verify QueryImageResponse status +- Does not support AnnounceOTAProvider command or OTA Requestor attributes +- Does not support the header defined in Matter Specification. diff --git a/examples/ota-requestor-app/esp32/main/BDXDownloader.cpp b/examples/ota-requestor-app/esp32/main/BDXDownloader.cpp new file mode 100644 index 00000000000000..db1f08f1f40f25 --- /dev/null +++ b/examples/ota-requestor-app/esp32/main/BDXDownloader.cpp @@ -0,0 +1,155 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "BDXDownloader.h" + +#include +#include +#include +#include + +using namespace chip::bdx; + +void BdxDownloader::SetInitialExchange(chip::Messaging::ExchangeContext * ec) +{ + mExchangeCtx = ec; +} + +void BdxDownloader::SetCallbacks(BdxDownloaderCallbacks callbacks) +{ + mOnBlockReceivedCallback = callbacks.onBlockReceived; + mOnTransferCompleteCallback = callbacks.onTransferComplete; + mOnTransferFailedCallback = callbacks.onTransferFailed; +} + +void BdxDownloader::HandleTransferSessionOutput(TransferSession::OutputEvent & event) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + if (event.EventType != TransferSession::OutputEventType::kNone) + { + ChipLogDetail(BDX, "OutputEvent type: %s", event.ToString(event.EventType)); + } + + switch (event.EventType) + { + case TransferSession::OutputEventType::kNone: + if (mIsTransferComplete) + { + if (mOnTransferCompleteCallback != nullptr && mOnTransferCompleteCallback->mCall != nullptr) + { + mOnTransferCompleteCallback->mCall(mOnTransferCompleteCallback->mContext); + } + else + { + ChipLogError(BDX, "onTransferComplete Callback not set"); + } + mTransfer.Reset(); + mIsTransferComplete = false; + } + break; + case TransferSession::OutputEventType::kMsgToSend: { + chip::Messaging::SendFlags sendFlags; + VerifyOrReturn(mExchangeCtx != nullptr, ChipLogError(BDX, "mExchangeContext is null, cannot proceed")); + if (event.msgTypeData.MessageType == static_cast(MessageType::ReceiveInit)) + { + sendFlags.Set(chip::Messaging::SendMessageFlags::kFromInitiator); + } + if (event.msgTypeData.MessageType != static_cast(MessageType::BlockAckEOF)) + { + sendFlags.Set(chip::Messaging::SendMessageFlags::kExpectResponse); + } + err = mExchangeCtx->SendMessage(event.msgTypeData.ProtocolId, event.msgTypeData.MessageType, std::move(event.MsgData), + sendFlags); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(BDX, "SendMessage failed: %" CHIP_ERROR_FORMAT, err.Format())); + break; + } + case TransferSession::OutputEventType::kAcceptReceived: + VerifyOrReturn(CHIP_NO_ERROR == mTransfer.PrepareBlockQuery(), ChipLogError(BDX, "PrepareBlockQuery failed")); + break; + case TransferSession::OutputEventType::kBlockReceived: { + ChipLogDetail(BDX, "Got block length %zu", event.blockdata.Length); + + // TODO: while convenient, we should not do a synchronous block write in our example application - this is bad practice + if (mOnBlockReceivedCallback != nullptr && mOnBlockReceivedCallback->mCall != nullptr) + { + mOnBlockReceivedCallback->mCall(mOnBlockReceivedCallback->mContext, event.blockdata); + } + else + { + ChipLogError(BDX, "onBlockReceived Callback not set"); + } + if (event.blockdata.IsEof) + { + err = mTransfer.PrepareBlockAck(); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(BDX, "PrepareBlockAck failed: %" CHIP_ERROR_FORMAT, err.Format())); + mIsTransferComplete = true; + } + else + { + err = mTransfer.PrepareBlockQuery(); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(BDX, "PrepareBlockQuery failed: %" CHIP_ERROR_FORMAT, err.Format())); + } + break; + } + case TransferSession::OutputEventType::kStatusReceived: + ChipLogError(BDX, "Got StatusReport %x", static_cast(event.statusData.statusCode)); + if (mOnTransferFailedCallback != nullptr && mOnTransferFailedCallback->mCall != nullptr) + { + mOnTransferFailedCallback->mCall(mOnTransferFailedCallback->mContext, kErrorBdxDownloaderStatusReceived); + } + else + { + ChipLogError(BDX, "onTransferFailed Callback not set"); + } + mTransfer.Reset(); + mExchangeCtx->Close(); + break; + case TransferSession::OutputEventType::kInternalError: + ChipLogError(BDX, "InternalError"); + if (mOnTransferFailedCallback != nullptr && mOnTransferFailedCallback->mCall != nullptr) + { + mOnTransferFailedCallback->mCall(mOnTransferFailedCallback->mContext, kErrorBdxDownloaderInternal); + } + else + { + ChipLogError(BDX, "onTransferFailed Callback not set"); + } + mTransfer.Reset(); + mExchangeCtx->Close(); + break; + case TransferSession::OutputEventType::kTransferTimeout: + ChipLogError(BDX, "Transfer timed out"); + if (mOnTransferFailedCallback != nullptr && mOnTransferFailedCallback->mCall != nullptr) + { + mOnTransferFailedCallback->mCall(mOnTransferFailedCallback->mContext, kErrorBdxDownloaderTimeOut); + } + else + { + ChipLogError(BDX, "onTransferFailed Callback not set"); + } + mTransfer.Reset(); + mExchangeCtx->Close(); + break; + case TransferSession::OutputEventType::kInitReceived: + case TransferSession::OutputEventType::kAckReceived: + case TransferSession::OutputEventType::kQueryReceived: + case TransferSession::OutputEventType::kAckEOFReceived: + default: + ChipLogError(BDX, "Unexpected BDX event type: %" PRIu16, static_cast(event.EventType)); + } +} diff --git a/examples/ota-requestor-app/esp32/main/CHIPDeviceManager.cpp b/examples/ota-requestor-app/esp32/main/CHIPDeviceManager.cpp new file mode 100644 index 00000000000000..9a24074d6cceef --- /dev/null +++ b/examples/ota-requestor-app/esp32/main/CHIPDeviceManager.cpp @@ -0,0 +1,105 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * This file implements the CHIP Device Interface that is used by + * applications to interact with the CHIP stack + * + */ + +#include + +#include "CHIPDeviceManager.h" +#include +#include +#include +#include +#include +#include + +using namespace ::chip; + +namespace chip { + +namespace DeviceManager { + +using namespace ::chip::DeviceLayer; + +void CHIPDeviceManager::CommonDeviceEventHandler(const ChipDeviceEvent * event, intptr_t arg) +{ + CHIPDeviceManagerCallbacks * cb = reinterpret_cast(arg); + if (cb != nullptr) + { + cb->DeviceEventCallback(event, reinterpret_cast(cb)); + } +} + +CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb) +{ + CHIP_ERROR err; + mCB = cb; + RendezvousInformationFlags flags = RendezvousInformationFlags(CONFIG_RENDEZVOUS_MODE); + + // Initialize the CHIP stack. + err = PlatformMgr().InitChipStack(); + SuccessOrExit(err); + + if (flags.Has(RendezvousInformationFlag::kBLE)) + { + ConnectivityMgr().SetBLEAdvertisingEnabled(true); + } + else if (flags.Has(RendezvousInformationFlag::kSoftAP)) + { + // TODO(cecille): Fix for the case where BLE and SoftAP are both enabled.` + ConnectivityMgr().SetBLEAdvertisingEnabled(false); + ConnectivityMgr().SetWiFiAPMode(ConnectivityManager::kWiFiAPMode_Enabled); + } + else + { + // If rendezvous is bypassed, enable SoftAP so that the device can still + // be communicated with via its SoftAP as needed. + ConnectivityMgr().SetWiFiAPMode(ConnectivityManager::kWiFiAPMode_Enabled); + } + + err = Platform::MemoryInit(); + SuccessOrExit(err); + + // Register a function to receive events from the CHIP device layer. Note that calls to + // this function will happen on the CHIP event loop thread, not the app_main thread. + PlatformMgr().AddEventHandler(CHIPDeviceManager::CommonDeviceEventHandler, reinterpret_cast(cb)); + + // Start a task to run the CHIP Device event loop. + err = PlatformMgr().StartEventLoopTask(); + SuccessOrExit(err); + +exit: + return err; +} +} // namespace DeviceManager +} // namespace chip + +void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & path, uint8_t mask, uint8_t type, uint16_t size, + uint8_t * value) +{ + chip::DeviceManager::CHIPDeviceManagerCallbacks * cb = + chip::DeviceManager::CHIPDeviceManager::GetInstance().GetCHIPDeviceManagerCallbacks(); + if (cb != nullptr) + { + cb->PostAttributeChangeCallback(path.mEndpointId, path.mClusterId, path.mAttributeId, mask, type, size, value); + } +} diff --git a/examples/ota-requestor-app/esp32/main/CMakeLists.txt b/examples/ota-requestor-app/esp32/main/CMakeLists.txt new file mode 100644 index 00000000000000..72c8734dab8d02 --- /dev/null +++ b/examples/ota-requestor-app/esp32/main/CMakeLists.txt @@ -0,0 +1,50 @@ +# +# Copyright (c) 2021 Project CHIP Authors +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) +idf_component_register(PRIV_INCLUDE_DIRS + "${CMAKE_CURRENT_LIST_DIR}/include" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/ota-requestor-app/" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/ota-requestor-app/ota-requestor-common" + SRC_DIRS + "${CMAKE_CURRENT_LIST_DIR}" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/ota-requestor-app/zap-generated" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/attributes" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/util" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/reporting" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/administrator-commissioning-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/basic" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/bindings" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/descriptor" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/diagnostic-logs-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet_network_diagnostics_server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread_network_diagnostics_server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi_network_diagnostics_server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software_diagnostics_server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general_diagnostics_server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/ota-requestor-app/ota-requestor-common" + EXCLUDE_SRCS + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/ota-requestor-app/ota-requestor-common/BDXDownloader.cpp" + PRIV_REQUIRES chip QRCode bt console app_update) + +set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 14) +target_compile_options(${COMPONENT_LIB} PRIVATE "-DLWIP_IPV6_SCOPES=0" "-DCHIP_HAVE_CONFIG_H") diff --git a/examples/ota-requestor-app/esp32/main/DeviceCallbacks.cpp b/examples/ota-requestor-app/esp32/main/DeviceCallbacks.cpp new file mode 100644 index 00000000000000..043d452011e7a4 --- /dev/null +++ b/examples/ota-requestor-app/esp32/main/DeviceCallbacks.cpp @@ -0,0 +1,109 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file DeviceCallbacks.cpp + * + * Implements all the callbacks to the application from the CHIP Stack + * + **/ +#include "DeviceCallbacks.h" + +#include "esp_heap_caps.h" +#include "esp_log.h" +#include +#include +#include +#include + +static const char * TAG = "echo-devicecallbacks"; + +using namespace ::chip; +using namespace ::chip::Inet; +using namespace ::chip::System; +using namespace ::chip::DeviceLayer; + +void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_t arg) +{ + switch (event->Type) + { + case DeviceEventType::kInternetConnectivityChange: + OnInternetConnectivityChange(event); + break; + + case DeviceEventType::kSessionEstablished: + OnSessionEstablished(event); + break; + case DeviceEventType::kInterfaceIpAddressChanged: + if ((event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV4_Assigned) || + (event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV6_Assigned)) + { + // MDNS server restart on any ip assignment: if link local ipv6 is configured, that + // will not trigger a 'internet connectivity change' as there is no internet + // connectivity. MDNS still wants to refresh its listening interfaces to include the + // newly selected address. + chip::app::DnssdServer::Instance().StartServer(); + } + break; + } + ESP_LOGI(TAG, "Current free heap: %d\n", heap_caps_get_free_size(MALLOC_CAP_8BIT)); +} + +void DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, ClusterId clusterId, AttributeId attributeId, uint8_t mask, + uint8_t type, uint16_t size, uint8_t * value) +{ + ESP_LOGI(TAG, + "PostAttributeChangeCallback - Cluster ID: '" ChipLogFormatMEI + "', EndPoint ID: '0x%02x', Attribute ID: '" ChipLogFormatMEI "'", + ChipLogValueMEI(clusterId), endpointId, ChipLogValueMEI(attributeId)); + + // TODO handle this callback in switch statement + ESP_LOGI(TAG, "Unhandled cluster ID: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); + + ESP_LOGI(TAG, "Current free heap: %d\n", heap_caps_get_free_size(MALLOC_CAP_8BIT)); +} + +void DeviceCallbacks::OnInternetConnectivityChange(const ChipDeviceEvent * event) +{ + if (event->InternetConnectivityChange.IPv4 == kConnectivity_Established) + { + ESP_LOGI(TAG, "Server ready at: %s:%d", event->InternetConnectivityChange.address, CHIP_PORT); + chip::app::DnssdServer::Instance().StartServer(); + } + else if (event->InternetConnectivityChange.IPv4 == kConnectivity_Lost) + { + ESP_LOGE(TAG, "Lost IPv4 connectivity..."); + } + if (event->InternetConnectivityChange.IPv6 == kConnectivity_Established) + { + ESP_LOGI(TAG, "IPv6 Server ready..."); + chip::app::DnssdServer::Instance().StartServer(); + } + else if (event->InternetConnectivityChange.IPv6 == kConnectivity_Lost) + { + ESP_LOGE(TAG, "Lost IPv6 connectivity..."); + } +} + +void DeviceCallbacks::OnSessionEstablished(const ChipDeviceEvent * event) +{ + if (event->SessionEstablished.IsCommissioner) + { + ESP_LOGI(TAG, "Commissioner detected!"); + } +} diff --git a/examples/ota-requestor-app/esp32/main/Kconfig.projbuild b/examples/ota-requestor-app/esp32/main/Kconfig.projbuild new file mode 100644 index 00000000000000..96a7f14d5c69ec --- /dev/null +++ b/examples/ota-requestor-app/esp32/main/Kconfig.projbuild @@ -0,0 +1,50 @@ +# +# Copyright (c) 2020 Project CHIP Authors +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Description: +# Configuration options CHIP ESP32 demo application. +# + +menu "Demo" + + choice + prompt "Rendezvous Mode" + default RENDEZVOUS_MODE_BLE + help + Specifies the Rendezvous mode of the peripheral. + + config RENDEZVOUS_MODE_BYPASS + bool "Bypass" + config RENDEZVOUS_MODE_WIFI + bool "Wi-Fi" + config RENDEZVOUS_MODE_BLE + bool "BLE" + config RENDEZVOUS_MODE_THREAD + bool "Thread" + config RENDEZVOUS_MODE_ETHERNET + bool "Ethernet" + endchoice + + config RENDEZVOUS_MODE + int + range 0 8 + default 0 if RENDEZVOUS_MODE_BYPASS + default 1 if RENDEZVOUS_MODE_WIFI + default 2 if RENDEZVOUS_MODE_BLE + default 4 if RENDEZVOUS_MODE_THREAD + default 8 if RENDEZVOUS_MODE_ETHERNET + +endmenu diff --git a/examples/ota-requestor-app/esp32/main/OTARequesterImpl.cpp b/examples/ota-requestor-app/esp32/main/OTARequesterImpl.cpp new file mode 100644 index 00000000000000..8c523855e5573a --- /dev/null +++ b/examples/ota-requestor-app/esp32/main/OTARequesterImpl.cpp @@ -0,0 +1,328 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include + +#include + +#include "BDXDownloader.h" +#include "OTARequesterImpl.h" +#include "OTAUpdater.h" + +#define TAG "OTARequesterImpl" + +using chip::ByteSpan; +using chip::CharSpan; +using chip::DeviceProxy; +using chip::EndpointId; +using chip::FabricIndex; +using chip::NodeId; +using chip::OnDeviceConnected; +using chip::OnDeviceConnectionFailure; +using chip::Optional; +using chip::PeerId; +using chip::Server; +using chip::VendorId; +using chip::bdx::TransferSession; +using chip::Callback::Callback; +using chip::Inet::IPAddress; +using chip::System::Layer; +using chip::Transport::PeerAddress; +using namespace chip::Messaging; +using namespace chip::app::Clusters::OtaSoftwareUpdateProvider::Commands; + +void OnQueryImageResponse(void * context, const QueryImageResponse::DecodableType & response); +void OnQueryImageFailure(void * context, EmberAfStatus status); +void OnApplyUpdateResponse(void * context, const ApplyUpdateResponse::DecodableType & response); +void OnApplyUpdateRequestFailure(void * context, EmberAfStatus status); + +void OnConnected(void * context, chip::DeviceProxy * deviceProxy); +void OnConnectionFailure(void * context, NodeId deviceId, CHIP_ERROR error); + +void OnBlockReceived(void * context, const chip::bdx::TransferSession::BlockData & blockdata); +void OnTransferComplete(void * context); +void OnTransferFailed(void * context, BdxDownloaderErrorTypes status); + +enum OTARequestorCommands +{ + kCommandQueryImage = 0, + kCommandApplyUpdateRequest, + kCommandNotifyUpdateApplied, +}; + +namespace { +// TODO: Encapsulate these globals and the callbacks in some class +ExchangeContext * exchangeCtx = nullptr; +BdxDownloader bdxDownloader; +enum OTARequestorCommands operationalDeviceContext; + +constexpr uint8_t kMaxUpdateTokenLen = 32; // must be between 8 and 32 +uint8_t otaUpdateToken[kMaxUpdateTokenLen] = { 0 }; +uint8_t otaUpdateTokenLen = 0; + +/* Callbacks for operational device proxy connect response */ +Callback onConnectedCallback(OnConnected, &operationalDeviceContext); +Callback onConnectionFailureCallback(OnConnectionFailure, nullptr); + +/* Callbacks for BDX data transfer */ +Callback onBlockReceivedCallback(OnBlockReceived, nullptr); +Callback onTransferCompleteCallback(OnTransferComplete, nullptr); +Callback onTransferFailedCallback(OnTransferFailed, nullptr); + +FabricIndex providerFabricIndex = 1; +} // namespace + +void OnQueryImageResponse(void * context, const QueryImageResponse::DecodableType & response) +{ + ChipLogDetail(SoftwareUpdate, "QueryImageResponse responded with action %" PRIu8, response.status); + + if (response.updateToken.HasValue()) + { + otaUpdateTokenLen = response.updateToken.Value().size(); + memcpy(otaUpdateToken, response.updateToken.Value().data(), otaUpdateTokenLen); + } + if (response.imageURI.HasValue() == false) + { + ChipLogError(BDX, "OTA image URI missing"); + return; + } + + // TODO: Handle image URI for protocol other than bdx + // Ignore the first 23 "bdx:///" + char fileDesignator[128]; // 128 is arbitrary value + memset(fileDesignator, 0, sizeof(fileDesignator)); + size_t fileDesignatorLength = response.imageURI.Value().size() - 23 + 1; // + 1 for \0 + if ((response.imageURI.Value().size() - 23) > sizeof(fileDesignator)) + { + fileDesignatorLength = sizeof(fileDesignator); + } + strlcpy(fileDesignator, response.imageURI.Value().data() + 23, fileDesignatorLength); + + TransferSession::TransferInitData initOptions; + initOptions.TransferCtlFlags = chip::bdx::TransferControlFlags::kReceiverDrive; + initOptions.MaxBlockSize = 1024; + initOptions.FileDesLength = static_cast(fileDesignatorLength); + initOptions.FileDesignator = reinterpret_cast(fileDesignator); + + chip::OperationalDeviceProxy * operationalDeviceProxy = Server::GetInstance().GetOperationalDeviceProxy(); + if (operationalDeviceProxy != nullptr) + { + chip::Messaging::ExchangeManager * exchangeMgr = operationalDeviceProxy->GetExchangeManager(); + chip::Optional session = operationalDeviceProxy->GetSecureSession(); + if (exchangeMgr != nullptr && session.HasValue()) + { + exchangeCtx = exchangeMgr->NewContext(session.Value(), &bdxDownloader); + } + if (exchangeCtx == nullptr) + { + ChipLogError(BDX, "unable to allocate ec: exchangeMgr=%p sessionExists? %u", exchangeMgr, session.HasValue()); + return; + } + } + else + { + ChipLogError(BDX, "Failed to get OperationalDeviceProxy"); + return; + } + + bdxDownloader.SetInitialExchange(exchangeCtx); + + BdxDownloaderCallbacks bdxCallbacks; + bdxCallbacks.onBlockReceived = &onBlockReceivedCallback; + bdxCallbacks.onTransferComplete = &onTransferCompleteCallback; + bdxCallbacks.onTransferFailed = &onTransferFailedCallback; + bdxDownloader.SetCallbacks(bdxCallbacks); + + // This will kick of a timer which will regularly check for updates to the bdx::TransferSession state machine. + bdxDownloader.InitiateTransfer(&chip::DeviceLayer::SystemLayer(), chip::bdx::TransferRole::kReceiver, initOptions, + chip::System::Clock::Seconds16(20)); +} + +void OnApplyUpdateResponse(void * context, const ApplyUpdateResponse::DecodableType & response) +{ + ChipLogDetail(SoftwareUpdate, "ApplyUpdateResponse responded with action %" PRIu8, response.action); + // Providing arbitrary value + OTAUpdater::GetInstance().Apply(3); +} + +void OnQueryImageFailure(void * context, EmberAfStatus status) +{ + ChipLogDetail(SoftwareUpdate, "QueryImage failure response %" PRIu8, status); +} + +void OnApplyUpdateRequestFailure(void * context, EmberAfStatus status) +{ + ChipLogDetail(SoftwareUpdate, "ApplyUpdateRequest failure response %" PRIu8, status); +} + +void OnConnected(void * context, chip::DeviceProxy * deviceProxy) +{ + ChipLogDetail(SoftwareUpdate, "Callback OnConnected"); + uint8_t * command = reinterpret_cast(context); + + chip::Controller::OtaSoftwareUpdateProviderCluster cluster; + constexpr EndpointId kOtaProviderEndpoint = 0; + + CHIP_ERROR err = cluster.Associate(deviceProxy, kOtaProviderEndpoint); + if (err != CHIP_NO_ERROR) + { + ChipLogError(SoftwareUpdate, "Associate() failed: %s", chip::ErrorStr(err)); + return; + } + + switch (*command) + { + case kCommandQueryImage: { + // These parameters are chosen arbitrarily + constexpr VendorId kExampleVendorId = VendorId::Common; + constexpr uint16_t kExampleProductId = CONFIG_DEVICE_PRODUCT_ID; + constexpr uint16_t kExampleHWVersion = 0; + constexpr uint16_t kExampleSoftwareVersion = 0; + constexpr EmberAfOTADownloadProtocol kExampleProtocolsSupported[] = { EMBER_ZCL_OTA_DOWNLOAD_PROTOCOL_BDX_SYNCHRONOUS }; + const char locationBuf[] = { 'U', 'S' }; + CharSpan exampleLocation(locationBuf); + constexpr bool kExampleClientCanConsent = false; + ByteSpan metadata; + + QueryImage::Type args; + args.vendorId = kExampleVendorId; + args.productId = kExampleProductId; + args.softwareVersion = kExampleSoftwareVersion; + args.protocolsSupported = kExampleProtocolsSupported; + args.hardwareVersion.Emplace(kExampleHWVersion); + args.location.Emplace(exampleLocation); + args.requestorCanConsent.Emplace(kExampleClientCanConsent); + args.metadataForProvider.Emplace(metadata); + + err = cluster.InvokeCommand(args, nullptr, OnQueryImageResponse, OnQueryImageFailure); + if (err != CHIP_NO_ERROR) + { + ChipLogError(SoftwareUpdate, "QueryImage() failed: %" CHIP_ERROR_FORMAT, err.Format()); + } + break; + } + case kCommandApplyUpdateRequest: { + constexpr uint32_t kNewVersion = 1; + + ApplyUpdateRequest::Type args; + args.updateToken = ByteSpan(otaUpdateToken, otaUpdateTokenLen); + args.newVersion = kNewVersion; + + err = cluster.InvokeCommand(args, nullptr, OnApplyUpdateResponse, OnApplyUpdateRequestFailure); + if (err != CHIP_NO_ERROR) + { + ChipLogError(SoftwareUpdate, "ApplyUpdateRequest() failed: %s", chip::ErrorStr(err)); + } + break; + } + default: + break; + } +} + +void OnConnectionFailure(void * context, NodeId deviceId, CHIP_ERROR error) +{ + ChipLogError(SoftwareUpdate, "failed to connect to 0x%" PRIX64 ": %" CHIP_ERROR_FORMAT, deviceId, error.Format()); +} + +void OnBlockReceived(void * context, const chip::bdx::TransferSession::BlockData & blockdata) +{ + if (OTAUpdater::GetInstance().IsInProgress() == false) + { + OTAUpdater::GetInstance().Begin(); + } + // TODO: Process/skip the Matter OTA header + OTAUpdater::GetInstance().Write(reinterpret_cast(blockdata.Data), blockdata.Length); +} + +void OnTransferComplete(void * context) +{ + ESP_LOGI(TAG, "Transfer complete!"); + OTAUpdater::GetInstance().End(); +} + +void OnTransferFailed(void * context, BdxDownloaderErrorTypes status) +{ + ESP_LOGI(TAG, "Transfer Failed, status:%x", status); + OTAUpdater::GetInstance().Abort(); +} + +void ConnectToProvider(const char * ipAddress, uint32_t nodeId) +{ + NodeId providerNodeId = nodeId; + + chip::OperationalDeviceProxy * operationalDeviceProxy = Server::GetInstance().GetOperationalDeviceProxy(); + if (operationalDeviceProxy != nullptr && operationalDeviceProxy->GetDeviceId() != providerNodeId) + { + operationalDeviceProxy->Disconnect(); + delete operationalDeviceProxy; + operationalDeviceProxy = nullptr; + } + + if (operationalDeviceProxy == nullptr) + { + Server * server = &(Server::GetInstance()); + chip::FabricInfo * fabric = server->GetFabricTable().FindFabricWithIndex(providerFabricIndex); + + chip::DeviceProxyInitParams initParams = { + .sessionManager = &(server->GetSecureSessionManager()), + .exchangeMgr = &(server->GetExchangeManager()), + .idAllocator = &(server->GetSessionIDAllocator()), + .fabricInfo = fabric, + // TODO: Determine where this should be instantiated + .imDelegate = chip::Platform::New(), + }; + + PeerId peerID = fabric->GetPeerId(); + peerID.SetNodeId(providerNodeId); + operationalDeviceProxy = new chip::OperationalDeviceProxy(initParams, peerID); + server->SetOperationalDeviceProxy(operationalDeviceProxy); + + // Explicitly calling UpdateDeviceData() should not be needed once OperationalDeviceProxy can resolve IP address from node + // ID and fabric index + IPAddress ipAddr; + IPAddress::FromString(ipAddress, ipAddr); + PeerAddress addr = PeerAddress::UDP(ipAddr, CHIP_PORT); + uint32_t idleInterval; + uint32_t activeInterval; + operationalDeviceProxy->GetMRPIntervals(idleInterval, activeInterval); + operationalDeviceProxy->UpdateDeviceData(addr, idleInterval, activeInterval); + } + + CHIP_ERROR err = operationalDeviceProxy->Connect(&onConnectedCallback, &onConnectionFailureCallback); + if (err != CHIP_NO_ERROR) + { + ChipLogError(SoftwareUpdate, "Cannot establish connection to peer device: %" CHIP_ERROR_FORMAT, err.Format()); + } +} + +void OTARequesterImpl::SendQueryImageCommand(const char * ipAddress, uint32_t nodeId) +{ + operationalDeviceContext = kCommandQueryImage; + ConnectToProvider(ipAddress, nodeId); +} + +void OTARequesterImpl::SendApplyUpdateRequestCommand(const char * ipAddress, uint32_t nodeId) +{ + operationalDeviceContext = kCommandApplyUpdateRequest; + ConnectToProvider(ipAddress, nodeId); +} diff --git a/examples/ota-requestor-app/esp32/main/OTAUpdater.cpp b/examples/ota-requestor-app/esp32/main/OTAUpdater.cpp new file mode 100644 index 00000000000000..82156fee97a10c --- /dev/null +++ b/examples/ota-requestor-app/esp32/main/OTAUpdater.cpp @@ -0,0 +1,155 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include +#include +#include +#include + +#include + +using namespace ::chip; +using namespace ::chip::System; +using namespace ::chip::DeviceLayer; + +namespace { + +const char * TAG = "OTAUpdate"; +bool otaUpdateInProgress = false; +const esp_partition_t * otaUpdatePartition = nullptr; +esp_ota_handle_t otaUpdateHandle; +uint32_t otaUpdateImageLen = 0; + +} // namespace + +bool OTAUpdater::IsInProgress(void) +{ + return otaUpdateInProgress; +} + +esp_err_t OTAUpdater::Begin(void) +{ + if (otaUpdateInProgress == true) + { + ESP_LOGW(TAG, "Already in progress"); + return ESP_ERR_INVALID_STATE; + } + + ESP_LOGI(TAG, "Begin"); + otaUpdatePartition = esp_ota_get_next_update_partition(NULL); + if (otaUpdatePartition == NULL) + { + ESP_LOGE(TAG, "Partition not found"); + return ESP_ERR_NOT_FOUND; + } + ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%x", otaUpdatePartition->subtype, otaUpdatePartition->address); + + esp_err_t err = esp_ota_begin(otaUpdatePartition, OTA_WITH_SEQUENTIAL_WRITES, &otaUpdateHandle); + if (err != ESP_OK) + { + ESP_LOGE(TAG, "esp_ota_begin failed (%s)", esp_err_to_name(err)); + return err; + } + otaUpdateImageLen = 0; + otaUpdateInProgress = true; + return ESP_OK; +} + +esp_err_t OTAUpdater::Write(const void * data, size_t length) +{ + if (otaUpdateInProgress == false) + { + return ESP_ERR_INVALID_STATE; + } + + esp_err_t err = esp_ota_write(otaUpdateHandle, data, length); + if (err != ESP_OK) + { + ESP_LOGE(TAG, "esp_ota_write failed (%s)", esp_err_to_name(err)); + Abort(); + return err; + } + + otaUpdateImageLen += length; + ESP_LOGI(TAG, "Written image length %d", otaUpdateImageLen); + return ESP_OK; +} + +esp_err_t OTAUpdater::Abort(void) +{ + if (otaUpdateInProgress == false) + { + return ESP_ERR_INVALID_STATE; + } + + ESP_LOGI(TAG, "Abort"); + otaUpdateInProgress = false; + otaUpdateImageLen = 0; + return esp_ota_abort(otaUpdateHandle); +} + +esp_err_t OTAUpdater::End(void) +{ + if (otaUpdateInProgress == false) + { + return ESP_ERR_INVALID_STATE; + } + + ESP_LOGI(TAG, "OTA image length %d bytes", otaUpdateImageLen); + esp_err_t err = esp_ota_end(otaUpdateHandle); + if (err != ESP_OK) + { + if (err == ESP_ERR_OTA_VALIDATE_FAILED) + { + ESP_LOGE(TAG, "Image validation failed, image is corrupted"); + } + else + { + ESP_LOGE(TAG, "esp_ota_end failed (%s)!", esp_err_to_name(err)); + } + } + otaUpdateInProgress = false; + return err; +} + +void RestartTimerHandler(Layer * systemLayer, void * appState) +{ + ESP_LOGI(TAG, "Prepare to restart system!"); + esp_restart(); +} + +// TODO: Apply update after delayed action time +// TODO: Handle applying update after reboot +esp_err_t OTAUpdater::Apply(uint32_t delayedActionTime) +{ + if (otaUpdateInProgress == true) + { + return ESP_ERR_INVALID_STATE; + } + + esp_err_t err = esp_ota_set_boot_partition(otaUpdatePartition); + if (err != ESP_OK) + { + ESP_LOGE(TAG, "esp_ota_set_boot_partition failed (%s)!", esp_err_to_name(err)); + return err; + } + + ESP_LOGI(TAG, "Applying, Boot partition set offset:0x%x", otaUpdatePartition->address); + // Allow requestor to send the Ack for the previous message + chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Milliseconds32(delayedActionTime * 1000), RestartTimerHandler, + nullptr); + return ESP_OK; +} diff --git a/examples/ota-requestor-app/esp32/main/include/BDXDownloader.h b/examples/ota-requestor-app/esp32/main/include/BDXDownloader.h new file mode 100644 index 00000000000000..a05b772cea0008 --- /dev/null +++ b/examples/ota-requestor-app/esp32/main/include/BDXDownloader.h @@ -0,0 +1,85 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include + +#pragma once + +enum BdxDownloaderErrorTypes +{ + kErrorBdxDownloaderNoError = 0, + kErrorBdxDownloaderStatusReceived, + kErrorBdxDownloaderInternal, + kErrorBdxDownloaderTimeOut, +}; + +/** + * @brief + * This callback is called when bdx transfer receives Block or BlockEOF message + * + * @param[in] context User context + * @param[in] blockData BlockData structure which contains pointer to data, length of data and IsEof flag + */ +typedef void (*OnBdxBlockReceived)(void * context, const chip::bdx::TransferSession::BlockData & blockdata); + +/** + * @brief + * This callback is called after BlockEOF message is processed + * + * @param[in] context User context + */ +typedef void (*OnBdxTransferComplete)(void * context); + +/** + * @brief + * This callback is called when bdx transfer receives StatusReport messages, + * if there is any internal error, or transfer timed out + * + * @param[in] context User context + * @param[in] status Error code + */ +typedef void (*OnBdxTransferFailed)(void * context, BdxDownloaderErrorTypes status); + +// TODO: With this approach we might end up adding callback for every bdx event/message. +// Can be refactored into a single callback with events +struct BdxDownloaderCallbacks +{ + chip::Callback::Callback * onBlockReceived = nullptr; + chip::Callback::Callback * onTransferComplete = nullptr; + chip::Callback::Callback * onTransferFailed = nullptr; +}; + +class BdxDownloader : public chip::bdx::Initiator +{ +public: + void SetInitialExchange(chip::Messaging::ExchangeContext * ec); + + void SetCallbacks(BdxDownloaderCallbacks callbacks); + +private: + // inherited from bdx::Endpoint + void HandleTransferSessionOutput(chip::bdx::TransferSession::OutputEvent & event); + + bool mIsTransferComplete = false; + + chip::Callback::Callback * mOnBlockReceivedCallback = nullptr; + chip::Callback::Callback * mOnTransferCompleteCallback = nullptr; + chip::Callback::Callback * mOnTransferFailedCallback = nullptr; +}; diff --git a/examples/ota-requestor-app/esp32/main/include/CHIPDeviceManager.h b/examples/ota-requestor-app/esp32/main/include/CHIPDeviceManager.h new file mode 100644 index 00000000000000..ee424b366df1b8 --- /dev/null +++ b/examples/ota-requestor-app/esp32/main/include/CHIPDeviceManager.h @@ -0,0 +1,127 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * This file contains definitions for the CHIP DeviceManager Interface + * + * This object will co-ordinate multiple activities such as + * initialisation, rendezvous, session mgmt and other such + * activities within the CHIP stack. This is a singleton object. + */ + +#ifndef CHIP_DEVICEMANAGER_H_ +#define CHIP_DEVICEMANAGER_H_ + +#include +#include +#include + +#include + +#include +#include + +#include + +namespace chip { +namespace DeviceManager { + +/** + * @brief + * This class provides a skeleton for all the callback functions. The functions will be + * called by other objects within the CHIP stack for specific events. + * Applications interested in receiving specific callbacks can specialize this class and handle + * these events in their implementation of this class. + */ +class DLL_EXPORT CHIPDeviceManagerCallbacks +{ +public: + /** + * @brief + * Called when CHIP Device events (PublicEventTypes) are triggered. + * + * @param event ChipDeviceEvent that occurred + * @param arg arguments specific to the event, if any + */ + virtual void DeviceEventCallback(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg); + + /** + * @brief + * Called after an attribute has been changed + * + * @param endpoint endpoint id + * @param clusterID cluster id + * @param attributeId attribute id that was changed + * @param mask mask of the attribute + * @param manufacturerCode manufacturer code + * @param type attribute type + * @param size size of the attribute + * @param value pointer to the new value + */ + virtual void PostAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, + uint8_t mask, uint8_t type, uint16_t size, uint8_t * value) + {} + virtual ~CHIPDeviceManagerCallbacks() {} +}; + +/** + * @brief + * A common class that drives other components of the CHIP stack + */ +class DLL_EXPORT CHIPDeviceManager +{ +public: + CHIPDeviceManager(const CHIPDeviceManager &) = delete; + CHIPDeviceManager(const CHIPDeviceManager &&) = delete; + CHIPDeviceManager & operator=(const CHIPDeviceManager &) = delete; + + static CHIPDeviceManager & GetInstance() + { + static CHIPDeviceManager instance; + return instance; + } + + /** + * @brief + * Initialise CHIPDeviceManager + * + * @param cb Application's instance of the CHIPDeviceManagerCallbacks for consuming events + */ + CHIP_ERROR Init(CHIPDeviceManagerCallbacks * cb); + + /** + * @brief + * Fetch a pointer to the registered CHIPDeviceManagerCallbacks object. + * + */ + CHIPDeviceManagerCallbacks * GetCHIPDeviceManagerCallbacks() { return mCB; } + + /** + * Use internally for registration of the ChipDeviceEvents + */ + static void CommonDeviceEventHandler(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg); + +private: + CHIPDeviceManagerCallbacks * mCB = nullptr; + CHIPDeviceManager() {} +}; + +} // namespace DeviceManager +} // namespace chip + +#endif /* CHIP_DEVICEMANAGER_H_ */ diff --git a/examples/ota-requestor-app/esp32/main/include/DeviceCallbacks.h b/examples/ota-requestor-app/esp32/main/include/DeviceCallbacks.h new file mode 100644 index 00000000000000..d94560b8448d86 --- /dev/null +++ b/examples/ota-requestor-app/esp32/main/include/DeviceCallbacks.h @@ -0,0 +1,47 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file DeviceCallbacks.h + * + * Implementations for the DeviceManager callbacks for this application + * + **/ + +#ifndef DEVICE_CALLBACKS_H +#define DEVICE_CALLBACKS_H + +#include "CHIPDeviceManager.h" +#include +#include + +class DeviceCallbacks : public chip::DeviceManager::CHIPDeviceManagerCallbacks +{ +public: + virtual void DeviceEventCallback(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg); + virtual void PostAttributeChangeCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, chip::AttributeId attributeId, + uint8_t mask, uint8_t type, uint16_t size, uint8_t * value); + +private: + void OnInternetConnectivityChange(const chip::DeviceLayer::ChipDeviceEvent * event); + void OnSessionEstablished(const chip::DeviceLayer::ChipDeviceEvent * event); + void OnOnOffPostAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value); + void OnIdentifyPostAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value); +}; + +#endif // DEVICE_CALLBACKS_H diff --git a/examples/ota-requestor-app/esp32/main/include/OTARequesterImpl.h b/examples/ota-requestor-app/esp32/main/include/OTARequesterImpl.h new file mode 100644 index 00000000000000..01fb7c701dba0e --- /dev/null +++ b/examples/ota-requestor-app/esp32/main/include/OTARequesterImpl.h @@ -0,0 +1,36 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +class OTARequesterImpl +{ +public: + static OTARequesterImpl & GetInstance(void) + { + static OTARequesterImpl instance; + return instance; + } + + void SendQueryImageCommand(const char * ipAddress, uint32_t nodeId); + + void SendApplyUpdateRequestCommand(const char * ipAddress, uint32_t nodeId); + + void SendNotifyUpdateAppliedCommand(const char * ipAddress, uint32_t nodeId); + +private: + OTARequesterImpl() {} +}; diff --git a/examples/ota-requestor-app/esp32/main/include/OTAUpdater.h b/examples/ota-requestor-app/esp32/main/include/OTAUpdater.h new file mode 100644 index 00000000000000..725ea7bbcd62ba --- /dev/null +++ b/examples/ota-requestor-app/esp32/main/include/OTAUpdater.h @@ -0,0 +1,105 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include + +#pragma once + +/** + * @class OTAUpdater + * + * @brief This is a helper class to perform OTA on ESP devices. + * It supports preparing the flash region for new OTA image, + * writing OTA data to the flash region, successfully ending an OTA, + * aborting the OTA process, and booting from the new OTA image. + */ +class OTAUpdater +{ +public: + static OTAUpdater & GetInstance(void) + { + static OTAUpdater instance; + return instance; + } + + /** + * @brief + * Test if OTA is in progress or not. + * + * @return \c true if OTA is in progress; + * return \c false if OTA is not in progress; + */ + bool IsInProgress(void); + + /** + * @brief + * Begins an OTA data writing. + * This function finds the available flash region to write the OTA data and erase the region. + * + * @return \c ESP_OK on success; + * return \c ESP_ERR_INVALID_STATE if OTA is in progress; + * return appropriate error code otherwise; + */ + esp_err_t Begin(void); + + /** + * @brief + * Finish OTA update and validate newly written OTA image. + * + * @return \c ESP_OK on success; + * return \c ESP_ERR_INVALID_STATE if OTA is not in progress; + * return \c ESP_ERR_OTA_VALIDATE_FAILED if OTA image is invalid; + * return appropriate error code otherwise; + */ + esp_err_t End(void); + + /** + * @brief + * Write OTA data. This function can be called multiple times as data is received during the OTA operation. + * Data is written sequentially to the partition. + * + * @param[in] data OTA data + * @param[in] length Length of OTA data + * + * @return \c ESP_OK on success; + * return \c ESP_ERR_OTA_VALIDATE_FAILED First byte of image contains invalid app image magic byte; + * return appropriate error code otherwise; + */ + esp_err_t Write(const void * data, size_t length); + + /** + * @brief + * Abort the OTA. + * + * @return \c ESP_OK on success; + * return appropriate error code otherwise; + */ + esp_err_t Abort(void); + + /** + * @brief + * Apply an OTA update. + * Configures the boot partition to newly written OTA partition and restart device to boot from new app. + * + * @return \c ESP_OK on success; + * return appropriate error code otherwise; + */ + esp_err_t Apply(uint32_t delayedActionTime); + +private: + OTAUpdater(void) {} + ~OTAUpdater() {} +}; diff --git a/examples/ota-requestor-app/esp32/main/main.cpp b/examples/ota-requestor-app/esp32/main/main.cpp new file mode 100644 index 00000000000000..b12cc9c056f030 --- /dev/null +++ b/examples/ota-requestor-app/esp32/main/main.cpp @@ -0,0 +1,188 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "CHIPDeviceManager.h" +#include "DeviceCallbacks.h" +#include "esp_heap_caps_init.h" +#include "esp_log.h" +#include "esp_netif.h" +#include "esp_spi_flash.h" +#include "esp_system.h" +#include "esp_wifi.h" +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "nvs_flash.h" +#include + +#include +#include +#include +#include + +#include +#include + +#include + +#include "OTARequesterImpl.h" +#include +#include + +using namespace ::chip; +using namespace ::chip::System; +using namespace ::chip::Credentials; +using namespace ::chip::DeviceManager; +using namespace ::chip::DeviceLayer; + +struct CmdArgs +{ + struct arg_str * ipAddr; + struct arg_int * nodeId; + struct arg_end * end; +}; + +namespace { +const char * TAG = "ota-requester-app"; +static DeviceCallbacks EchoCallbacks; +CmdArgs queryImageCmdArgs, applyUpdateCmdArgs; +} // namespace + +void QueryImageTimerHandler(Layer * systemLayer, void * appState) +{ + ESP_LOGI(TAG, "Calling SendQueryImageCommand()"); + OTARequesterImpl::GetInstance().SendQueryImageCommand(queryImageCmdArgs.ipAddr->sval[0], queryImageCmdArgs.nodeId->ival[0]); +} + +void ApplyUpdateTimerHandler(Layer * systemLayer, void * appState) +{ + ESP_LOGI(TAG, "Calling SendApplyUpdateRequestCommand()"); + OTARequesterImpl::GetInstance().SendApplyUpdateRequestCommand(queryImageCmdArgs.ipAddr->sval[0], + queryImageCmdArgs.nodeId->ival[0]); +} + +int ESPQueryImageCmdHandler(int argc, char ** argv) +{ + int nerrors = arg_parse(argc, argv, (void **) &queryImageCmdArgs); + if (nerrors != 0) + { + arg_print_errors(stderr, queryImageCmdArgs.end, argv[0]); + return 1; + } + ESP_LOGI(TAG, "ipAddr:%s nodeId:%x", queryImageCmdArgs.ipAddr->sval[0], queryImageCmdArgs.nodeId->ival[0]); + + /* Start one shot timer with 1 second timeout to send ApplyUpdateRequest command */ + chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Milliseconds32(1 * 1000), QueryImageTimerHandler, nullptr); + return 0; +} + +int ESPApplyUpdateCmdHandler(int argc, char ** argv) +{ + int nerrors = arg_parse(argc, argv, (void **) &applyUpdateCmdArgs); + if (nerrors != 0) + { + arg_print_errors(stderr, applyUpdateCmdArgs.end, argv[0]); + return 1; + } + ESP_LOGI(TAG, "ipAddr:%s nodeId:%x", applyUpdateCmdArgs.ipAddr->sval[0], applyUpdateCmdArgs.nodeId->ival[0]); + + /* Start one shot timer with 1 second timeout to Query for OTA image */ + chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Milliseconds32(1 * 1000), ApplyUpdateTimerHandler, nullptr); + return 0; +} + +void ESPInitConsole(void) +{ + esp_console_repl_t * repl = NULL; + esp_console_repl_config_t replConfig = ESP_CONSOLE_REPL_CONFIG_DEFAULT(); + esp_console_dev_uart_config_t uartConfig = ESP_CONSOLE_DEV_UART_CONFIG_DEFAULT(); + /* Prompt to be printed before each line. + * This can be customized, made dynamic, etc. + */ + replConfig.prompt = "esp32 >"; + + esp_console_register_help_command(); + + esp_console_cmd_t queryImageCommand, applyUpdateCommand; + memset(&queryImageCommand, 0, sizeof(queryImageCommand)); + memset(&applyUpdateCommand, 0, sizeof(applyUpdateCommand)); + + queryImageCmdArgs.ipAddr = arg_str0(NULL, NULL, "", "OTA Provider IP Address"); + queryImageCmdArgs.nodeId = arg_int0(NULL, NULL, "", "OTA Provider Node ID in decimal"); + queryImageCmdArgs.end = arg_end(1); + + queryImageCommand.command = "QueryImage", queryImageCommand.help = "Query for OTA image", + queryImageCommand.func = &ESPQueryImageCmdHandler, queryImageCommand.argtable = &queryImageCmdArgs; + + applyUpdateCmdArgs.ipAddr = arg_str0(NULL, NULL, "", "OTA Provider IP Address"); + applyUpdateCmdArgs.nodeId = arg_int0(NULL, NULL, "", "OTA Provider Node ID in decimal"); + applyUpdateCmdArgs.end = arg_end(1); + + applyUpdateCommand.command = "ApplyUpdateRequest", applyUpdateCommand.help = "Request to OTA update image", + applyUpdateCommand.func = &ESPApplyUpdateCmdHandler, applyUpdateCommand.argtable = &applyUpdateCmdArgs; + + esp_console_cmd_register(&queryImageCommand); + esp_console_cmd_register(&applyUpdateCommand); + + esp_console_new_repl_uart(&uartConfig, &replConfig, &repl); + esp_console_start_repl(repl); +} + +extern "C" void app_main() +{ + ESP_LOGI(TAG, "OTA Requester!"); + + /* Print chip information */ + esp_chip_info_t chip_info; + esp_chip_info(&chip_info); + ESP_LOGI(TAG, "This is ESP32 chip with %d CPU cores, WiFi%s%s, ", chip_info.cores, + (chip_info.features & CHIP_FEATURE_BT) ? "/BT" : "", (chip_info.features & CHIP_FEATURE_BLE) ? "/BLE" : ""); + + ESP_LOGI(TAG, "silicon revision %d, ", chip_info.revision); + + ESP_LOGI(TAG, "%dMB %s flash\n", spi_flash_get_chip_size() / (1024 * 1024), + (chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external"); + + // Initialize the ESP NVS layer. + esp_err_t err = nvs_flash_init(); + if (err != ESP_OK) + { + ESP_LOGE(TAG, "nvs_flash_init() failed: %s", esp_err_to_name(err)); + return; + } + + CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance(); + + CHIP_ERROR error = deviceMgr.Init(&EchoCallbacks); + if (error != CHIP_NO_ERROR) + { + ESP_LOGE(TAG, "device.Init() failed: %s", ErrorStr(error)); + return; + } + + chip::Server::GetInstance().Init(); + + // Initialize device attestation config + SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); + + ESPInitConsole(); + + // Run the UI Loop + while (true) + { + vTaskDelay(50 / portTICK_PERIOD_MS); + } +} diff --git a/examples/ota-requestor-app/esp32/partitions.csv b/examples/ota-requestor-app/esp32/partitions.csv new file mode 100644 index 00000000000000..56849bb3037058 --- /dev/null +++ b/examples/ota-requestor-app/esp32/partitions.csv @@ -0,0 +1,8 @@ +# Name, Type, SubType, Offset, Size, Flags +# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap +nvs, data, nvs, , 0x6000, +otadata, data, ota, , 0x2000, +phy_init, data, phy, , 0x1000, +# OTA partitions of size 1.5M each +ota_0, app, ota_0, , 1524K, +ota_1, app, ota_1, , 1524K, diff --git a/examples/ota-requestor-app/esp32/sdkconfig.defaults b/examples/ota-requestor-app/esp32/sdkconfig.defaults new file mode 100644 index 00000000000000..aa3e6cb62047a6 --- /dev/null +++ b/examples/ota-requestor-app/esp32/sdkconfig.defaults @@ -0,0 +1,54 @@ +# +# Copyright (c) 2020 Project CHIP Authors +# Copyright (c) 2018 Nest Labs, Inc. +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Description: +# Some useful defaults for the demo app configuration. +# + + +# Default to 921600 baud when flashing and monitoring device +CONFIG_ESPTOOLPY_BAUD_921600B=y +CONFIG_ESPTOOLPY_BAUD=921600 +CONFIG_ESPTOOLPY_COMPRESSED=y +CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B=y +CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 + +#enable BT +CONFIG_BT_ENABLED=y +CONFIG_BT_NIMBLE_ENABLED=y + +#enable lwip ipv6 autoconfig +CONFIG_LWIP_IPV6_AUTOCONFIG=y + +# Use a custom partition table +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" + +# Add RTC memory to system heap +CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=y + +# Product id +CONFIG_DEVICE_VENDOR_ID=0x235A +CONFIG_DEVICE_PRODUCT_ID=0x4590 + +# Main task needs a bit more stack than the default +# default is 3584, bump this up to 4k. +CONFIG_ESP_MAIN_TASK_STACK_SIZE=4096 + +# Serial Flasher config +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +CONFIG_ESPTOOLPY_FLASHSIZE="4MB" diff --git a/examples/ota-requestor-app/esp32/third_party/connectedhomeip b/examples/ota-requestor-app/esp32/third_party/connectedhomeip new file mode 120000 index 00000000000000..11a54ed360106c --- /dev/null +++ b/examples/ota-requestor-app/esp32/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../../ \ No newline at end of file diff --git a/examples/persistent-storage/esp32/README.md b/examples/persistent-storage/esp32/README.md index dc318548e49928..86525f46512a5a 100644 --- a/examples/persistent-storage/esp32/README.md +++ b/examples/persistent-storage/esp32/README.md @@ -43,13 +43,13 @@ The VSCode devcontainer has these components pre-installed, so you can skip this step. To install these components manually, follow these steps: - Clone the Espressif ESP-IDF and checkout - [v4.3 tag](https://github.com/espressif/esp-idf/releases/v4.3) + [v4.4 tag](https://github.com/espressif/esp-idf/releases/v4.4) $ mkdir ${HOME}/tools $ cd ${HOME}/tools $ git clone https://github.com/espressif/esp-idf.git $ cd esp-idf - $ git checkout v4.3 + $ git checkout release/v4.4 $ git submodule update --init $ ./install.sh diff --git a/examples/pigweed-app/esp32/README.md b/examples/pigweed-app/esp32/README.md index 4a2f54e25acad2..f9d8beea77f5f0 100644 --- a/examples/pigweed-app/esp32/README.md +++ b/examples/pigweed-app/esp32/README.md @@ -36,13 +36,13 @@ The VSCode devcontainer has these components pre-installed, so you can skip this step. To install these components manually, follow these steps: - Clone the Espressif ESP-IDF and checkout - [v4.3 tag](https://github.com/espressif/esp-idf/releases/v4.3) + [v4.4 tag](https://github.com/espressif/esp-idf/releases/v4.4) $ mkdir ${HOME}/tools $ cd ${HOME}/tools $ git clone https://github.com/espressif/esp-idf.git $ cd esp-idf - $ git checkout v4.3 + $ git checkout release/v4.4 $ git submodule update --init $ ./install.sh diff --git a/examples/placeholder/linux/BUILD.gn b/examples/placeholder/linux/BUILD.gn index 3b193356b15154..0e0b8601990e5f 100644 --- a/examples/placeholder/linux/BUILD.gn +++ b/examples/placeholder/linux/BUILD.gn @@ -41,6 +41,7 @@ executable("chip-${chip_tests_zap_config}") { deps = [ ":configuration", "${chip_root}/examples/platform/linux:app-main", + "${chip_root}/src/app/tests/suites/pics", "${chip_root}/src/lib", ] diff --git a/examples/placeholder/linux/include/MatterCallbacks.h b/examples/placeholder/linux/include/MatterCallbacks.h index c4c2a6d7d608c7..b7a9c45de6dd76 100644 --- a/examples/placeholder/linux/include/MatterCallbacks.h +++ b/examples/placeholder/linux/include/MatterCallbacks.h @@ -18,6 +18,8 @@ #pragma once +#include "Options.h" + #include #include #include @@ -25,54 +27,59 @@ #include -TestCommand * gTestCommand = nullptr; - -void OnPlatformEvent(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg) +TestCommand * GetTargetTest() { - switch (event->Type) + const char * command = LinuxDeviceOptions::GetInstance().command; + if (command == nullptr) + { + return nullptr; + } + + static auto test = GetTestCommand(command); + if (test.get() == nullptr) { - case chip::DeviceLayer::DeviceEventType::kCommissioningComplete: - ChipLogError(Zcl, "Commissioning complete"); - - TestCommand * command = reinterpret_cast(arg); - if (command == nullptr) - { - ChipLogError(Zcl, "No tests."); - return; - } - - gTestCommand = command; - gTestCommand->NextTest(); - break; + ChipLogError(chipTool, "Specified test command does not exist: %s", command); + return nullptr; } + + const char * PICSFilePath = LinuxDeviceOptions::GetInstance().PICS; + if (PICSFilePath != nullptr) + { + test->PICS.SetValue(PICSBooleanReader::Read(PICSFilePath)); + } + + return test.get(); } void MatterPostCommandReceivedCallback(const chip::app::ConcreteCommandPath & commandPath) { - VerifyOrReturn(gTestCommand != nullptr); + auto test = GetTargetTest(); + VerifyOrReturn(test != nullptr && test->isRunning); ChipLogError(Zcl, "Receive command: Endpoint: %u, Cluster: " ChipLogFormatMEI ", Command: " ChipLogFormatMEI, commandPath.mEndpointId, ChipLogValueMEI(commandPath.mClusterId), ChipLogValueMEI(commandPath.mCommandId)); - gTestCommand->CheckCommandPath(commandPath); + test->CheckCommandPath(commandPath); } void MatterPostAttributeReadCallback(const chip::app::ConcreteAttributePath & attributePath) { - VerifyOrReturn(gTestCommand != nullptr); + auto test = GetTargetTest(); + VerifyOrReturn(test != nullptr && test->isRunning); ChipLogError(Zcl, "Receive READ attribute command: Endpoint: %u, Cluster: " ChipLogFormatMEI ", Attribute: " ChipLogFormatMEI, attributePath.mEndpointId, ChipLogValueMEI(attributePath.mClusterId), ChipLogValueMEI(attributePath.mAttributeId)); - gTestCommand->CheckAttributePath(attributePath); + test->CheckAttributePath(attributePath); } void MatterPostAttributeWriteCallback(const chip::app::ConcreteAttributePath & attributePath) { - VerifyOrReturn(gTestCommand != nullptr); + auto test = GetTargetTest(); + VerifyOrReturn(test != nullptr && test->isRunning); ChipLogError(Zcl, "Receive WRITE attribute command: Endpoint: %u, Cluster: " ChipLogFormatMEI ", Attribute: " ChipLogFormatMEI, attributePath.mEndpointId, ChipLogValueMEI(attributePath.mClusterId), ChipLogValueMEI(attributePath.mAttributeId)); - gTestCommand->CheckAttributePath(attributePath); + test->CheckAttributePath(attributePath); } diff --git a/examples/placeholder/linux/include/TestCommand.h b/examples/placeholder/linux/include/TestCommand.h index 6aad332a399396..d4fcf6512f5d26 100644 --- a/examples/placeholder/linux/include/TestCommand.h +++ b/examples/placeholder/linux/include/TestCommand.h @@ -18,9 +18,14 @@ #pragma once +#include + #include #include +#include +#include + #include #include #include @@ -46,6 +51,27 @@ class TestCommand return CHIP_NO_ERROR; } + CHIP_ERROR WaitForCommissioning() + { + isRunning = false; + return chip::DeviceLayer::PlatformMgr().AddEventHandler(OnPlatformEvent, reinterpret_cast(this)); + } + + static void OnPlatformEvent(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg) + { + switch (event->Type) + { + case chip::DeviceLayer::DeviceEventType::kCommissioningComplete: + ChipLogProgress(chipTool, "Commissioning complete"); + chip::DeviceLayer::PlatformMgr().RemoveEventHandler(OnPlatformEvent, arg); + + TestCommand * command = reinterpret_cast(arg); + command->isRunning = true; + command->NextTest(); + break; + } + } + void CheckCommandPath(const chip::app::ConcreteCommandPath & commandPath) { if (commandPath == mCommandPath) @@ -76,6 +102,28 @@ class TestCommand mAttributePath = chip::app::ConcreteAttributePath(0, 0, 0); } + bool ShouldSkip(const char * expression) + { + // If there is no PICS configuration file, considers that nothing should be skipped. + if (!PICS.HasValue()) + { + return false; + } + + std::map pics(PICS.Value()); + bool shouldSkip = !PICSBooleanExpressionParser::Eval(expression, pics); + if (shouldSkip) + { + ChipLogProgress(chipTool, " **** Skipping: %s == false\n", expression); + NextTest(); + } + return shouldSkip; + } + + chip::Optional> PICS; + + std::atomic_bool isRunning{ true }; + protected: chip::app::ConcreteCommandPath mCommandPath; chip::app::ConcreteAttributePath mAttributePath; diff --git a/examples/placeholder/linux/main.cpp b/examples/placeholder/linux/main.cpp index 2535f5052c3953..78744a6849ec67 100644 --- a/examples/placeholder/linux/main.cpp +++ b/examples/placeholder/linux/main.cpp @@ -17,35 +17,18 @@ */ #include "AppMain.h" -#include "Options.h" - -#include - #include "MatterCallbacks.h" -std::unique_ptr RunTestCommand() +int main(int argc, char * argv[]) { - const char * command = LinuxDeviceOptions::GetInstance().command; - if (command == nullptr) - { - return nullptr; - } + VerifyOrDie(ChipLinuxAppInit(argc, argv) == 0); - auto test = GetTestCommand(command); - if (test.get() == nullptr) + auto test = GetTargetTest(); + if (test != nullptr) { - ChipLogError(chipTool, "Specified test command does not exists: %s", command); - return nullptr; + test->NextTest(); } - chip::DeviceLayer::PlatformMgr().AddEventHandler(OnPlatformEvent, reinterpret_cast(test.get())); - return test; -} - -int main(int argc, char * argv[]) -{ - VerifyOrDie(ChipLinuxAppInit(argc, argv) == 0); - auto test = RunTestCommand(); ChipLinuxAppMainLoop(); return 0; } diff --git a/examples/platform/esp32/route_hook/esp_route_hook.c b/examples/platform/esp32/route_hook/esp_route_hook.c new file mode 100644 index 00000000000000..201619f301a574 --- /dev/null +++ b/examples/platform/esp32/route_hook/esp_route_hook.c @@ -0,0 +1,206 @@ +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp_route_hook.h" + +#include +#include + +#include "esp_check.h" +#include "esp_err.h" +#include "esp_netif.h" +#include "esp_route_table.h" + +#include "lwip/icmp6.h" +#include "lwip/mld6.h" +#include "lwip/netif.h" +#include "lwip/prot/icmp6.h" +#include "lwip/prot/ip6.h" +#include "lwip/prot/nd6.h" +#include "lwip/raw.h" + +#define HOPLIM_MAX 255 +#define PIO_FLAG_ON_LINK (1 << 7) +#define PIO_FLAG_AUTO_CONFIG (1 << 6) + +#define TAG "ROUTE_HOOK" + +typedef struct esp_route_hook_t +{ + struct netif * netif; + struct raw_pcb * pcb; + struct esp_route_hook_t * next; +} esp_route_hook_t; + +PACK_STRUCT_BEGIN +struct rio_header_t +{ + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t length); + PACK_STRUCT_FLD_8(u8_t prefix_length); + PACK_STRUCT_FLD_8(u8_t preference); + PACK_STRUCT_FIELD(u32_t route_lifetime); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END + +typedef struct rio_header_t rio_header_t; + +static esp_route_hook_t * s_hooks; + +static bool is_self_address(struct netif * netif, const ip6_addr_t * addr) +{ + for (size_t i = 0; i < LWIP_ARRAYSIZE(netif->ip6_addr); i++) + { + if (ip6_addr_isvalid(netif_ip6_addr_state(netif, i)) && + memcmp(addr->addr, netif_ip6_addr(netif, i)->addr, sizeof(addr->addr)) == 0) + { + return true; + } + } + return false; +} + +static void ra_recv_handler(struct netif * netif, const uint8_t * icmp_payload, uint16_t payload_len, const ip6_addr_t * src_addr) +{ + if (payload_len < sizeof(struct ra_header)) + { + return; + } + icmp_payload += sizeof(struct ra_header); + payload_len -= sizeof(struct ra_header); + + while (payload_len >= 2) + { + uint8_t opt_type = icmp_payload[0]; + uint8_t opt_len = icmp_payload[1] << 3; + + if (opt_type == ND6_OPTION_TYPE_ROUTE_INFO && opt_len >= sizeof(rio_header_t) && !is_self_address(netif, src_addr) && + payload_len >= opt_len) + { + rio_header_t rio_header; + memcpy(&rio_header, icmp_payload, sizeof(rio_header)); + + // skip if prefix is longer than IPv6 address. + if (rio_header.prefix_length > 128) + { + break; + } + uint8_t prefix_len_bytes = (rio_header.prefix_length + 7) / 8; + int8_t preference = -2 * ((rio_header.preference >> 4) & 1) + (((rio_header.preference) >> 3) & 1); + const uint8_t * rio_data = &icmp_payload[sizeof(rio_header_t)]; + uint8_t rio_data_len = opt_len - sizeof(rio_header_t); + + ESP_LOGI(TAG, "Received RIO"); + for (; rio_data_len >= prefix_len_bytes; rio_data_len -= prefix_len_bytes, rio_data += prefix_len_bytes) + { + ip6_addr_t prefix; + esp_route_entry_t route; + + memset(&prefix, 0, sizeof(prefix)); + memcpy(&prefix.addr, rio_data, prefix_len_bytes); + route.netif = netif; + route.gateway = *src_addr; + route.prefix_length = rio_header.prefix_length; + route.prefix = prefix; + route.preference = preference; + route.lifetime_seconds = lwip_ntohl(rio_header.route_lifetime); + ESP_LOGI(TAG, "prefix %s lifetime %u\n", ip6addr_ntoa(&prefix), route.lifetime_seconds); + if (esp_route_table_add_route_entry(&route) == NULL) + { + ESP_LOGI(TAG, "Failed to add route table entry\n"); + } + } + } + icmp_payload += opt_len; + payload_len -= opt_len; + } +} + +static uint8_t icmp6_raw_recv_handler(void * arg, struct raw_pcb * pcb, struct pbuf * p, const ip_addr_t * addr) +{ + uint8_t * icmp_payload = NULL; + uint16_t icmp_payload_len; + struct ip6_hdr * ip6_header = (struct ip6_hdr *) p->payload; + struct icmp6_hdr * icmp6_header; + ip6_addr_t src; + ip6_addr_t dest; + esp_route_hook_t * hook = (esp_route_hook_t *) arg; + + memcpy(src.addr, ip6_header->src.addr, sizeof(src.addr)); + memcpy(dest.addr, ip6_header->dest.addr, sizeof(dest.addr)); +#if LWIP_IPV6_SCOPES + src.zone = 0; +#endif + + if (p->tot_len != p->len) + { + ESP_LOGW(TAG, "Ignore segmented ICMP packet"); + return 0; + } + if (p->tot_len <= sizeof(struct ip6_hdr) + sizeof(struct icmp6_hdr)) + { + ESP_LOGW(TAG, "Ignore invalid ICMP packet"); + return 0; + } + if (!ip6_addr_islinklocal(&dest) && !ip6_addr_isallnodes_linklocal(&dest) && !ip6_addr_isallrouters_linklocal(&dest)) + { + return 0; + } + + icmp_payload_len = p->tot_len - sizeof(struct ip6_hdr); + icmp_payload = p->payload + sizeof(struct ip6_hdr); + + icmp6_header = (struct icmp6_hdr *) icmp_payload; + if (icmp6_header->type == ICMP6_TYPE_RA) + { + ra_recv_handler(hook->netif, icmp_payload, icmp_payload_len, &src); + } + return 0; +} + +esp_err_t esp_route_hook_init(esp_netif_t * netif) +{ + struct netif * lwip_netif; + ip_addr_t router_group = IPADDR6_INIT_HOST(0xFF020000, 0, 0, 0x02); + esp_route_hook_t * hook = NULL; + esp_err_t ret = ESP_OK; + + ESP_RETURN_ON_FALSE(netif != NULL, ESP_ERR_INVALID_ARG, TAG, "Invalid network interface"); + lwip_netif = netif_get_by_index(esp_netif_get_netif_impl_index(netif)); + ESP_RETURN_ON_FALSE(lwip_netif != NULL, ESP_ERR_INVALID_ARG, TAG, "Invalid network interface"); + + for (esp_route_hook_t * iter = s_hooks; iter != NULL; iter++) + { + if (iter->netif == lwip_netif) + { + ESP_LOGI(TAG, "Hook already installed on netif, skip..."); + return ESP_OK; + } + } + + hook = (esp_route_hook_t *) malloc(sizeof(esp_route_hook_t)); + ESP_RETURN_ON_FALSE(hook != NULL, ESP_ERR_NO_MEM, TAG, "Cannot allocate hook"); + + ESP_GOTO_ON_FALSE(mld6_joingroup_netif(lwip_netif, ip_2_ip6(&router_group)) == ESP_OK, ESP_FAIL, exit, TAG, + "Failed to join multicast group"); + hook->netif = lwip_netif; + hook->pcb = raw_new_ip_type(IPADDR_TYPE_V6, IP6_NEXTH_ICMP6); + hook->pcb->flags |= RAW_FLAGS_MULTICAST_LOOP; + hook->pcb->chksum_reqd = 1; + // The ICMPv6 header checksum offset + hook->pcb->chksum_offset = 2; + raw_bind_netif(hook->pcb, lwip_netif); + raw_recv(hook->pcb, icmp6_raw_recv_handler, hook); + hook->next = s_hooks; + s_hooks = hook; + +exit: + if (ret != ESP_OK && hook != NULL) + { + free(hook); + } + return ret; +} diff --git a/examples/platform/esp32/route_hook/esp_route_hook.h b/examples/platform/esp32/route_hook/esp_route_hook.h new file mode 100644 index 00000000000000..9f62fb9fa4743e --- /dev/null +++ b/examples/platform/esp32/route_hook/esp_route_hook.h @@ -0,0 +1,18 @@ +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp_err.h" +#include "esp_netif.h" + +#ifdef __cplusplus +extern "C" { +#endif + +esp_err_t esp_route_hook_init(esp_netif_t * netif); + +#ifdef __cplusplus +} +#endif diff --git a/examples/platform/esp32/route_hook/esp_route_table.c b/examples/platform/esp32/route_hook/esp_route_table.c new file mode 100644 index 00000000000000..f7395306566e0e --- /dev/null +++ b/examples/platform/esp32/route_hook/esp_route_table.c @@ -0,0 +1,180 @@ +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp_route_table.h" + +#include + +#include "esp_err.h" +#include "esp_log.h" +#include "lwip/ip6_addr.h" +#include "lwip/netif.h" +#include "lwip/timeouts.h" + +#define MAX_RIO_ROUTE 20 + +#define TAG "ROUTE_HOOK" + +static esp_route_entry_t s_route_entries[MAX_RIO_ROUTE]; + +static esp_route_entry_t * find_route_entry(const esp_route_entry_t * route_entry) +{ + for (size_t i = 0; i < LWIP_ARRAYSIZE(s_route_entries); i++) + { + if (s_route_entries[i].netif == NULL) + { + break; + } + if (s_route_entries[i].netif == route_entry->netif && s_route_entries[i].prefix_length == route_entry->prefix_length && + memcmp(s_route_entries[i].gateway.addr, route_entry->gateway.addr, sizeof(route_entry->gateway.addr)) == 0 && + memcmp(s_route_entries[i].prefix.addr, route_entry->prefix.addr, route_entry->prefix_length / 8) == 0) + { + return &s_route_entries[i]; + } + } + return NULL; +} + +static esp_route_entry_t * find_empty_route_entry(void) +{ + for (size_t i = 0; i < LWIP_ARRAYSIZE(s_route_entries); i++) + { + if (s_route_entries[i].netif == NULL) + { + return &s_route_entries[i]; + } + } + return NULL; +} + +static void route_timeout_handler(void * arg) +{ + esp_route_entry_t * route = (esp_route_entry_t *) arg; + + esp_route_table_remove_route_entry(route); +} + +esp_route_entry_t * esp_route_table_add_route_entry(const esp_route_entry_t * route_entry) +{ + if (route_entry == NULL) + { + return NULL; + } + + esp_route_entry_t * entry = find_route_entry(route_entry); + + if (entry == NULL) + { + entry = find_empty_route_entry(); + if (entry == NULL) + { + return NULL; + } + entry->netif = route_entry->netif; + entry->gateway = route_entry->gateway; + ip6_addr_assign_zone(&entry->gateway, IP6_UNICAST, entry->netif); + entry->prefix = route_entry->prefix; + entry->prefix_length = route_entry->prefix_length; + } + else + { + sys_untimeout(route_timeout_handler, entry); + } + entry->preference = route_entry->preference; + entry->lifetime_seconds = route_entry->lifetime_seconds; + sys_timeout(entry->lifetime_seconds * 1000, route_timeout_handler, entry); + return entry; +} + +esp_err_t esp_route_table_remove_route_entry(esp_route_entry_t * route_entry) +{ + if (route_entry < &s_route_entries[0] || route_entry > &s_route_entries[LWIP_ARRAYSIZE(s_route_entries)]) + { + return ESP_ERR_INVALID_ARG; + } + route_entry->netif = NULL; + for (esp_route_entry_t * moved = route_entry; moved < &s_route_entries[LWIP_ARRAYSIZE(s_route_entries) - 1]; moved++) + { + *moved = *(moved + 1); + if (moved->netif == NULL) + { + break; + } + } + return ESP_OK; +} + +static inline bool is_better_route(const esp_route_entry_t * lhs, const esp_route_entry_t * rhs) +{ + if (rhs == NULL) + { + return true; + } + if (lhs == NULL) + { + return false; + } + return (lhs->prefix_length > rhs->prefix_length) || + (lhs->prefix_length == rhs->prefix_length && lhs->preference > rhs->preference); +} + +static inline bool route_match(const esp_route_entry_t * route, const ip6_addr_t * dest) +{ + return memcmp(dest, route->prefix.addr, route->prefix_length / 8) == 0; +} + +struct netif * lwip_hook_ip6_route(const ip6_addr_t * src, const ip6_addr_t * dest) +{ + esp_route_entry_t * route = NULL; + + for (size_t i = 0; i < LWIP_ARRAYSIZE(s_route_entries); i++) + { + if (s_route_entries[i].netif == NULL) + { + break; + } + if (route_match(&s_route_entries[i], dest) && is_better_route(&s_route_entries[i], route)) + { + route = &s_route_entries[i]; + } + } + + if (route) + { + return route->netif; + } + else + { + return NULL; + } +} + +const ip6_addr_t * lwip_hook_nd6_get_gw(struct netif * netif, const ip6_addr_t * dest) +{ + esp_route_entry_t * route = NULL; + + for (size_t i = 0; i < LWIP_ARRAYSIZE(s_route_entries); i++) + { + if (s_route_entries[i].netif == NULL) + { + break; + } + if (s_route_entries[i].netif == netif && route_match(&s_route_entries[i], dest) && + is_better_route(&s_route_entries[i], route)) + { + route = &s_route_entries[i]; + } + } + + if (route) + { + return &route->gateway; + } + else + { + return NULL; + } +} diff --git a/examples/platform/esp32/route_hook/esp_route_table.h b/examples/platform/esp32/route_hook/esp_route_table.h new file mode 100644 index 00000000000000..e69fee1ad293bf --- /dev/null +++ b/examples/platform/esp32/route_hook/esp_route_table.h @@ -0,0 +1,81 @@ +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp_err.h" +#include "lwip/ip6_addr.h" +#include "lwip/netif.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Route table entry + * + */ +typedef struct +{ + ip6_addr_t prefix; + uint8_t prefix_length; + ip6_addr_t gateway; + int8_t preference; + uint32_t lifetime_seconds; + struct netif * netif; +} esp_route_entry_t; + +/** + * @brief Adds an entry to the route table + * + * @param[in] route_entry The route entry to be added + * + * @return + * - The pointer to the added route entry on success + * - NULL on failure + * + */ +esp_route_entry_t * esp_route_table_add_route_entry(const esp_route_entry_t * route_entry); + +/** + * @brief Removes an entry from the route table + * + * @param[in] route_entry The route entry to be removed + * + * @return + * - ESP_OK + * - ESP_ERR_INVALID_ARG The provided route_entry is not in the route table. + * + */ +esp_err_t esp_route_table_remove_route_entry(esp_route_entry_t * route_entry); + +/** + * @brief The lwIP ip6 route hook, called by the lwIP function ip6_route when sending packets. + * + * @param[in] src The source address + * @param[in] dest The destination address + * + * @return + * - The target interface when route found + * - NULL when route not found + * + */ +struct netif * lwip_hook_ip6_route(const ip6_addr_t * src, const ip6_addr_t * dest); + +/** + * @brief The lwIP gateway hook, called by the lwIP when deciding next hop. + * + * @param[in] netif The output network interface + * @param[in] dest The destination address + * + * @return + * - The gateway address when route found + * - NULL when route not found + * + */ +const ip6_addr_t * lwip_hook_nd6_get_gw(struct netif * netif, const ip6_addr_t * dest); + +#ifdef __cplusplus +} +#endif diff --git a/examples/platform/linux/BUILD.gn b/examples/platform/linux/BUILD.gn index 239f32bb3e4555..3237823efce162 100644 --- a/examples/platform/linux/BUILD.gn +++ b/examples/platform/linux/BUILD.gn @@ -39,10 +39,6 @@ source_set("app-main") { if (chip_enable_pw_rpc) { defines += [ "PW_RPC_ENABLED" ] } - if (chip_ip_commissioning) { - # BLE and on-network. Code defaults to BLE if this is not set. - defines += [ "CONFIG_RENDEZVOUS_MODE=6" ] - } if (chip_build_libshell) { defines += [ "ENABLE_CHIP_SHELL" ] } diff --git a/examples/platform/linux/Options.cpp b/examples/platform/linux/Options.cpp index 320e60837aa543..b68e34dd28a1d5 100644 --- a/examples/platform/linux/Options.cpp +++ b/examples/platform/linux/Options.cpp @@ -46,7 +46,8 @@ enum kDeviceOption_SecuredDevicePort = 0x100a, kDeviceOption_SecuredCommissionerPort = 0x100b, kDeviceOption_UnsecuredCommissionerPort = 0x100c, - kDeviceOption_Command = 0x100d + kDeviceOption_Command = 0x100d, + kDeviceOption_PICS = 0x100e }; constexpr unsigned kAppUsageLength = 64; @@ -72,6 +73,7 @@ OptionDef sDeviceOptionDefs[] = { { "secured-commissioner-port", kArgumentRequired, kDeviceOption_SecuredCommissionerPort }, { "unsecured-commissioner-port", kArgumentRequired, kDeviceOption_UnsecuredCommissionerPort }, { "command", kArgumentRequired, kDeviceOption_Command }, + { "PICS", kArgumentRequired, kDeviceOption_PICS }, {} }; @@ -124,6 +126,9 @@ const char * sDeviceOptionHelp = "\n" " --command \n" " A name for a command to execute during startup.\n" + "\n" + " --PICS \n" + " A file containing PICS items.\n" "\n"; bool HandleOption(const char * aProgram, OptionSet * aOptions, int aIdentifier, const char * aName, const char * aValue) @@ -193,6 +198,10 @@ bool HandleOption(const char * aProgram, OptionSet * aOptions, int aIdentifier, LinuxDeviceOptions::GetInstance().command = aValue; break; + case kDeviceOption_PICS: + LinuxDeviceOptions::GetInstance().PICS = aValue; + break; + default: PrintArgError("%s: INTERNAL ERROR: Unhandled option: %s\n", aProgram, aName); retval = false; diff --git a/examples/platform/linux/Options.h b/examples/platform/linux/Options.h index 2f1ee87627aed0..8bb086c1b184c0 100644 --- a/examples/platform/linux/Options.h +++ b/examples/platform/linux/Options.h @@ -39,6 +39,7 @@ struct LinuxDeviceOptions uint32_t securedCommissionerPort = CHIP_PORT + 2; uint32_t unsecuredCommissionerPort = CHIP_UDC_PORT; const char * command = nullptr; + const char * PICS = nullptr; static LinuxDeviceOptions & GetInstance(); }; diff --git a/examples/pump-app/pump-common/pump-app.zap b/examples/pump-app/pump-common/pump-app.zap index 82b200d9b25ab2..7ee4ce2889826e 100644 --- a/examples/pump-app/pump-common/pump-app.zap +++ b/examples/pump-app/pump-common/pump-app.zap @@ -1602,6 +1602,21 @@ "enabled": 1, "commands": [], "attributes": [ + { + "name": "ThreadMetrics", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "CurrentHeapFree", "code": 1, diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap b/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap index 03ff9f3fad5cc4..6f2de206f36062 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap @@ -1602,6 +1602,21 @@ "enabled": 1, "commands": [], "attributes": [ + { + "name": "ThreadMetrics", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "CurrentHeapFree", "code": 1, diff --git a/examples/temperature-measurement-app/esp32/README.md b/examples/temperature-measurement-app/esp32/README.md index fe49ebced3167d..e1f74180bb3d51 100644 --- a/examples/temperature-measurement-app/esp32/README.md +++ b/examples/temperature-measurement-app/esp32/README.md @@ -24,13 +24,13 @@ The VSCode devcontainer has these components pre-installed, so you can skip this step. To install these components manually, follow these steps: - Clone the Espressif ESP-IDF and checkout - [v4.3 tag](https://github.com/espressif/esp-idf/releases/v4.3) + [v4.4 tag](https://github.com/espressif/esp-idf/releases/v4.4) $ mkdir ${HOME}/tools $ cd ${HOME}/tools $ git clone https://github.com/espressif/esp-idf.git $ cd esp-idf - $ git checkout v4.3 + $ git checkout release/v4.4 $ git submodule update --init $ ./install.sh diff --git a/examples/temperature-measurement-app/esp32/main/CMakeLists.txt b/examples/temperature-measurement-app/esp32/main/CMakeLists.txt index e6f66af4bbbe28..b41bc41e3c33dc 100644 --- a/examples/temperature-measurement-app/esp32/main/CMakeLists.txt +++ b/examples/temperature-measurement-app/esp32/main/CMakeLists.txt @@ -16,9 +16,10 @@ # # # (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) -idf_component_register(PRIV_INCLUDE_DIRS +idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/temperature-measurement-app/" "${CMAKE_CURRENT_LIST_DIR}/include" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32" SRC_DIRS "${CMAKE_CURRENT_LIST_DIR}" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/temperature-measurement-app/zap-generated" @@ -36,11 +37,12 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread_network_diagnostics_server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi_network_diagnostics_server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software_diagnostics_server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general_diagnostics_server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general_diagnostics_server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/route_hook" PRIV_REQUIRES chip QRCode bt) -set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 14) +set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 14) target_compile_options(${COMPONENT_LIB} PRIVATE "-DLWIP_IPV6_SCOPES=0" "-DCHIP_HAVE_CONFIG_H") diff --git a/examples/temperature-measurement-app/esp32/main/DeviceCallbacks.cpp b/examples/temperature-measurement-app/esp32/main/DeviceCallbacks.cpp index 62251e904ab541..b5ddca53ade197 100644 --- a/examples/temperature-measurement-app/esp32/main/DeviceCallbacks.cpp +++ b/examples/temperature-measurement-app/esp32/main/DeviceCallbacks.cpp @@ -24,8 +24,11 @@ **/ #include "DeviceCallbacks.h" +#include "esp_check.h" +#include "esp_err.h" #include "esp_heap_caps.h" #include "esp_log.h" +#include "route_hook/esp_route_hook.h" #include #include #include @@ -59,6 +62,10 @@ void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_ // newly selected address. chip::app::DnssdServer::Instance().StartServer(); } + if (event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV6_Assigned) + { + ESP_ERROR_CHECK(esp_route_hook_init(esp_netif_get_handle_from_ifkey("WIFI_STA_DEF"))); + } break; } diff --git a/examples/temperature-measurement-app/esp32/sdkconfig.defaults b/examples/temperature-measurement-app/esp32/sdkconfig.defaults index a24175c5b32d76..0f43fb5079c635 100644 --- a/examples/temperature-measurement-app/esp32/sdkconfig.defaults +++ b/examples/temperature-measurement-app/esp32/sdkconfig.defaults @@ -79,3 +79,7 @@ CONFIG_DEVICE_PRODUCT_ID=0x4554 # Main task needs a bit more stack than the default # default is 3584, bump this up to 4k. CONFIG_ESP_MAIN_TASK_STACK_SIZE=4096 + +#enable lwIP route hooks +CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT=y +CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y diff --git a/examples/thermostat/thermostat-common/thermostat.zap b/examples/thermostat/thermostat-common/thermostat.zap index 356fb518453243..cc32bbe5248aa1 100644 --- a/examples/thermostat/thermostat-common/thermostat.zap +++ b/examples/thermostat/thermostat-common/thermostat.zap @@ -1271,7 +1271,7 @@ "outgoing": 1 }, { - "name": "ApplyUpdateRequestResponse", + "name": "ApplyUpdateResponse", "code": 4, "mfgCode": null, "source": "server", @@ -1801,6 +1801,21 @@ "enabled": 1, "commands": [], "attributes": [ + { + "name": "ThreadMetrics", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "CurrentHeapFree", "code": 1, @@ -7821,7 +7836,7 @@ "outgoing": 1 }, { - "name": "ApplyUpdateRequestResponse", + "name": "ApplyUpdateResponse", "code": 4, "mfgCode": null, "source": "server", diff --git a/examples/tv-app/linux/args.gni b/examples/tv-app/linux/args.gni index 8d724f9f9d50ac..1c8eb57e4d1e09 100644 --- a/examples/tv-app/linux/args.gni +++ b/examples/tv-app/linux/args.gni @@ -25,4 +25,3 @@ chip_project_config_include_dirs = chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ] chip_build_libshell = true -chip_use_clusters_for_ip_commissioning = true diff --git a/examples/tv-app/tv-common/tv-app.zap b/examples/tv-app/tv-common/tv-app.zap index 8c587d6e9e371a..503adda2911b7d 100644 --- a/examples/tv-app/tv-common/tv-app.zap +++ b/examples/tv-app/tv-common/tv-app.zap @@ -1256,7 +1256,7 @@ "outgoing": 1 }, { - "name": "ApplyUpdateRequestResponse", + "name": "ApplyUpdateResponse", "code": 4, "mfgCode": null, "source": "server", @@ -1786,6 +1786,21 @@ "enabled": 1, "commands": [], "attributes": [ + { + "name": "ThreadMetrics", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "CurrentHeapFree", "code": 1, diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap b/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap index c214342f5dde1d..e5b35ad9009e4a 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap @@ -1271,7 +1271,7 @@ "outgoing": 1 }, { - "name": "ApplyUpdateRequestResponse", + "name": "ApplyUpdateResponse", "code": 4, "mfgCode": null, "source": "server", @@ -1801,6 +1801,21 @@ "enabled": 1, "commands": [], "attributes": [ + { + "name": "ThreadMetrics", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "CurrentHeapFree", "code": 1, @@ -7821,7 +7836,7 @@ "outgoing": 1 }, { - "name": "ApplyUpdateRequestResponse", + "name": "ApplyUpdateResponse", "code": 4, "mfgCode": null, "source": "server", diff --git a/examples/window-app/common/window-app.zap b/examples/window-app/common/window-app.zap index 5e28551a45ce3c..091958f6aa9332 100644 --- a/examples/window-app/common/window-app.zap +++ b/examples/window-app/common/window-app.zap @@ -1350,6 +1350,21 @@ "enabled": 1, "commands": [], "attributes": [ + { + "name": "ThreadMetrics", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "CurrentHeapFree", "code": 1, diff --git a/integrations/docker/images/chip-build-ameba/Dockerfile b/integrations/docker/images/chip-build-ameba/Dockerfile index ec3a956f21699b..d074286fa7386c 100644 --- a/integrations/docker/images/chip-build-ameba/Dockerfile +++ b/integrations/docker/images/chip-build-ameba/Dockerfile @@ -11,6 +11,9 @@ RUN set -x \ && cd ambd_sdk_with_chip_non_NDA \ && git reset --hard ae7ff59 \ && git submodule update --depth 1 --init --progress \ + && cd project/realtek_amebaD_va0_example/GCC-RELEASE/project_hp/toolchain \ + && cat asdk/asdk-9.3.0-linux-newlib-build-3483-x86_64.tar.bz2.part* > asdk/asdk-9.3.0-linux-newlib-build-3483-x86_64.tar.bz2 \ + && mkdir -p linux && tar -jxvf asdk/asdk-9.3.0-linux-newlib-build-3483-x86_64.tar.bz2 -C linux/ \ && : # last line ENV AMEBA_PATH=${AMEBA_DIR}/ambd_sdk_with_chip_non_NDA diff --git a/integrations/docker/images/chip-build/version b/integrations/docker/images/chip-build/version index e9104ddaacb70a..76bc92702b8b8a 100644 --- a/integrations/docker/images/chip-build/version +++ b/integrations/docker/images/chip-build/version @@ -1 +1 @@ -0.5.27 Version bump reason: [ESP32] Update ESP-IDF to v4.4 release +0.5.28 Version bump reason: [Ameba] Decompress toolchain in Docker diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index bfe09d3128103c..4c7d45573589bc 100644 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -105,13 +105,17 @@ def HostTargets(): targets.append(target.Extend('arm64', board=HostBoard.ARM64)) app_targets = [] + + # RPC console compilation only for native + app_targets.append( + targets[0].Extend('rpc-console', app=HostApp.RPC_CONSOLE)) + for target in targets: app_targets.append(target.Extend( 'all-clusters', app=HostApp.ALL_CLUSTERS)) app_targets.append(target.Extend('chip-tool', app=HostApp.CHIP_TOOL)) app_targets.append(target.Extend('thermostat', app=HostApp.THERMOSTAT)) - app_targets.append(target.Extend( - 'rpc-console', app=HostApp.RPC_CONSOLE)) + app_targets.append(target.Extend('minmdns', app=HostApp.MIN_MDNS)) for target in app_targets: yield target diff --git a/scripts/build/builders/android.py b/scripts/build/builders/android.py index 71ee5907267ca7..68eabb29fc7b90 100644 --- a/scripts/build/builders/android.py +++ b/scripts/build/builders/android.py @@ -143,7 +143,6 @@ def generate(self): gn_args['target_cpu'] = self.board.TargetCpuName() gn_args['android_ndk_root'] = os.environ['ANDROID_NDK_HOME'] gn_args['android_sdk_root'] = os.environ['ANDROID_HOME'] - gn_args['chip_use_clusters_for_ip_commissioning'] = True gn_args.update(self.app.AppGnArgs()) args_str = "" diff --git a/scripts/build/builders/host.py b/scripts/build/builders/host.py index b913d5fd2325dc..548358092d48e0 100644 --- a/scripts/build/builders/host.py +++ b/scripts/build/builders/host.py @@ -25,6 +25,7 @@ class HostApp(Enum): CHIP_TOOL = auto() THERMOSTAT = auto() RPC_CONSOLE = auto() + MIN_MDNS = auto() def ExamplePath(self): if self == HostApp.ALL_CLUSTERS: @@ -35,18 +36,30 @@ def ExamplePath(self): return 'thermostat/linux' elif self == HostApp.RPC_CONSOLE: return 'common/pigweed/rpc_console' + if self == HostApp.MIN_MDNS: + return 'minimal-mdns' else: raise Exception('Unknown app type: %r' % self) - def BinaryName(self): + def OutputNames(self): if self == HostApp.ALL_CLUSTERS: - return 'chip-all-clusters-app' + yield 'chip-all-clusters-app' + yield 'chip-all-clusters-app.map' elif self == HostApp.CHIP_TOOL: - return 'chip-tool' + yield 'chip-tool' + yield 'chip-tool.map' elif self == HostApp.THERMOSTAT: - return 'thermostat-app' + yield 'thermostat-app' + yield 'thermostat-app.map' elif self == HostApp.RPC_CONSOLE: - return 'rpc-console' + yield 'chip_rpc_console_wheels' + elif self == HostApp.MIN_MDNS: + yield 'mdns-advertiser' + yield 'mdns-advertiser.map' + yield 'minimal-mdns-client' + yield 'minimal-mdns-client.map' + yield 'minimal-mdns-server' + yield 'minimal-mdns-server.map' else: raise Exception('Unknown app type: %r' % self) @@ -91,12 +104,11 @@ def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE, enable_ip root=os.path.join(root, 'examples', app.ExamplePath()), runner=runner) - self.app_name = app.BinaryName() - self.map_name = self.app_name + '.map' + self.app = app self.board = board self.extra_gn_options = [] - if 'rpc-console' not in self.app_name and not enable_ipv4: + if not enable_ipv4: self.extra_gn_options.append('chip_inet_config_enable_ipv4=false') def GnBuildArgs(self): @@ -106,18 +118,12 @@ def GnBuildArgs(self): self.extra_gn_options.extend( [ 'target_cpu="arm64"', - 'is_clang=true' + 'is_clang=true', + 'chip_crypto="mbedtls"', + 'sysroot="%s"' % self.SysRootPath('SYSROOT_AARCH64') ] ) - if 'rpc-console' not in self.app_name: - self.extra_gn_options.extend( - [ - 'chip_crypto="mbedtls"', - 'sysroot="%s"' % self.SysRootPath('SYSROOT_AARCH64') - ] - ) - return self.extra_gn_options else: raise Exception('Unknown host board type: %r' % self) @@ -139,19 +145,18 @@ def SysRootPath(self, name): def build_outputs(self): outputs = {} - if 'rpc-console' not in self.app_name: - outputs.update( - { - self.app_name: os.path.join(self.output_dir, self.app_name), - self.map_name: os.path.join(self.output_dir, self.map_name) - } - ) - else: - outputs.update( - { - self.app_name: os.path.join( - self.output_dir, "chip_rpc_console_wheels") - } - ) + + for name in self.app.OutputNames(): + path = os.path.join(self.output_dir, name) + if os.path.isdir(path): + for root, dirs, files in os.walk(path): + for file in files: + outputs.update({ + file: os.path.join(root, file) + }) + else: + outputs.update({ + name: os.path.join(self.output_dir, name) + }) return outputs diff --git a/scripts/build/testdata/build_all_except_host.txt b/scripts/build/testdata/build_all_except_host.txt index 3678a22f4717db..62857177faf18b 100644 --- a/scripts/build/testdata/build_all_except_host.txt +++ b/scripts/build/testdata/build_all_except_host.txt @@ -11,7 +11,7 @@ python3 build/chip/java/tests/generate_jars_for_test.py python3 third_party/android_deps/set_up_android_deps.py # Generating android-androidstudio-arm-chip-tool -gn gen --check --fail-on-unused-args {out}/android-androidstudio-arm-chip-tool '--args=target_os="android" target_cpu="arm" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" chip_use_clusters_for_ip_commissioning=true ' --ide=json --json-ide-script=//scripts/examples/gn_to_cmakelists.py +gn gen --check --fail-on-unused-args {out}/android-androidstudio-arm-chip-tool '--args=target_os="android" target_cpu="arm" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" ' --ide=json --json-ide-script=//scripts/examples/gn_to_cmakelists.py # Accepting NDK licenses @ tools bash -c 'yes | TEST_ANDROID_HOME/tools/bin/sdkmanager --licenses >/dev/null' @@ -23,7 +23,7 @@ python3 build/chip/java/tests/generate_jars_for_test.py python3 third_party/android_deps/set_up_android_deps.py # Generating android-androidstudio-arm64-chip-tool -gn gen --check --fail-on-unused-args {out}/android-androidstudio-arm64-chip-tool '--args=target_os="android" target_cpu="arm64" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" chip_use_clusters_for_ip_commissioning=true ' --ide=json --json-ide-script=//scripts/examples/gn_to_cmakelists.py +gn gen --check --fail-on-unused-args {out}/android-androidstudio-arm64-chip-tool '--args=target_os="android" target_cpu="arm64" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" ' --ide=json --json-ide-script=//scripts/examples/gn_to_cmakelists.py # Accepting NDK licenses @ tools bash -c 'yes | TEST_ANDROID_HOME/tools/bin/sdkmanager --licenses >/dev/null' @@ -35,7 +35,7 @@ python3 build/chip/java/tests/generate_jars_for_test.py python3 third_party/android_deps/set_up_android_deps.py # Generating android-androidstudio-x64-chip-tool -gn gen --check --fail-on-unused-args {out}/android-androidstudio-x64-chip-tool '--args=target_os="android" target_cpu="x64" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" chip_use_clusters_for_ip_commissioning=true ' --ide=json --json-ide-script=//scripts/examples/gn_to_cmakelists.py +gn gen --check --fail-on-unused-args {out}/android-androidstudio-x64-chip-tool '--args=target_os="android" target_cpu="x64" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" ' --ide=json --json-ide-script=//scripts/examples/gn_to_cmakelists.py # Accepting NDK licenses @ tools bash -c 'yes | TEST_ANDROID_HOME/tools/bin/sdkmanager --licenses >/dev/null' @@ -47,7 +47,7 @@ python3 build/chip/java/tests/generate_jars_for_test.py python3 third_party/android_deps/set_up_android_deps.py # Generating android-androidstudio-x86-chip-tool -gn gen --check --fail-on-unused-args {out}/android-androidstudio-x86-chip-tool '--args=target_os="android" target_cpu="x86" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" chip_use_clusters_for_ip_commissioning=true ' --ide=json --json-ide-script=//scripts/examples/gn_to_cmakelists.py +gn gen --check --fail-on-unused-args {out}/android-androidstudio-x86-chip-tool '--args=target_os="android" target_cpu="x86" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" ' --ide=json --json-ide-script=//scripts/examples/gn_to_cmakelists.py # Accepting NDK licenses @ tools bash -c 'yes | TEST_ANDROID_HOME/tools/bin/sdkmanager --licenses >/dev/null' @@ -59,7 +59,7 @@ python3 build/chip/java/tests/generate_jars_for_test.py python3 third_party/android_deps/set_up_android_deps.py # Generating android-arm-chip-tool -gn gen --check --fail-on-unused-args {out}/android-arm-chip-tool '--args=target_os="android" target_cpu="arm" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" chip_use_clusters_for_ip_commissioning=true ' +gn gen --check --fail-on-unused-args {out}/android-arm-chip-tool '--args=target_os="android" target_cpu="arm" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" ' # Accepting NDK licenses @ tools bash -c 'yes | TEST_ANDROID_HOME/tools/bin/sdkmanager --licenses >/dev/null' @@ -71,7 +71,7 @@ python3 build/chip/java/tests/generate_jars_for_test.py python3 third_party/android_deps/set_up_android_deps.py # Generating android-arm64-chip-test -gn gen --check --fail-on-unused-args {out}/android-arm64-chip-test '--args=target_os="android" target_cpu="arm64" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" chip_use_clusters_for_ip_commissioning=true ' +gn gen --check --fail-on-unused-args {out}/android-arm64-chip-test '--args=target_os="android" target_cpu="arm64" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" ' # Accepting NDK licenses @ tools bash -c 'yes | TEST_ANDROID_HOME/tools/bin/sdkmanager --licenses >/dev/null' @@ -83,7 +83,7 @@ python3 build/chip/java/tests/generate_jars_for_test.py python3 third_party/android_deps/set_up_android_deps.py # Generating android-arm64-chip-tool -gn gen --check --fail-on-unused-args {out}/android-arm64-chip-tool '--args=target_os="android" target_cpu="arm64" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" chip_use_clusters_for_ip_commissioning=true ' +gn gen --check --fail-on-unused-args {out}/android-arm64-chip-tool '--args=target_os="android" target_cpu="arm64" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" ' # Accepting NDK licenses @ tools bash -c 'yes | TEST_ANDROID_HOME/tools/bin/sdkmanager --licenses >/dev/null' @@ -95,7 +95,7 @@ python3 build/chip/java/tests/generate_jars_for_test.py python3 third_party/android_deps/set_up_android_deps.py # Generating android-arm64-chip-tvserver -gn gen --check --fail-on-unused-args {out}/android-arm64-chip-tvserver '--args=target_os="android" target_cpu="arm64" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" chip_use_clusters_for_ip_commissioning=true chip_config_network_layer_ble=false ' +gn gen --check --fail-on-unused-args {out}/android-arm64-chip-tvserver '--args=target_os="android" target_cpu="arm64" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" chip_config_network_layer_ble=false ' # Accepting NDK licenses @ tools bash -c 'yes | TEST_ANDROID_HOME/tools/bin/sdkmanager --licenses >/dev/null' @@ -107,7 +107,7 @@ python3 build/chip/java/tests/generate_jars_for_test.py python3 third_party/android_deps/set_up_android_deps.py # Generating android-x64-chip-tool -gn gen --check --fail-on-unused-args {out}/android-x64-chip-tool '--args=target_os="android" target_cpu="x64" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" chip_use_clusters_for_ip_commissioning=true ' +gn gen --check --fail-on-unused-args {out}/android-x64-chip-tool '--args=target_os="android" target_cpu="x64" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" ' # Accepting NDK licenses @ tools bash -c 'yes | TEST_ANDROID_HOME/tools/bin/sdkmanager --licenses >/dev/null' @@ -119,7 +119,7 @@ python3 build/chip/java/tests/generate_jars_for_test.py python3 third_party/android_deps/set_up_android_deps.py # Generating android-x86-chip-tool -gn gen --check --fail-on-unused-args {out}/android-x86-chip-tool '--args=target_os="android" target_cpu="x86" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" chip_use_clusters_for_ip_commissioning=true ' +gn gen --check --fail-on-unused-args {out}/android-x86-chip-tool '--args=target_os="android" target_cpu="x86" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" ' # Accepting NDK licenses @ tools bash -c 'yes | TEST_ANDROID_HOME/tools/bin/sdkmanager --licenses >/dev/null' diff --git a/scripts/build/testdata/build_linux_on_x64.txt b/scripts/build/testdata/build_linux_on_x64.txt index 184665ebbef17d..99c49ec1d5ddeb 100644 --- a/scripts/build/testdata/build_linux_on_x64.txt +++ b/scripts/build/testdata/build_linux_on_x64.txt @@ -21,10 +21,15 @@ bash -c ' PKG_CONFIG_PATH="SYSROOT_AARCH64/lib/aarch64-linux-gnu/pkgconfig" \ gn gen --check --fail-on-unused-args --root={root}/examples/chip-tool '"'"'--args=chip_inet_config_enable_ipv4=false target_cpu="arm64" is_clang=true chip_crypto="mbedtls" sysroot="SYSROOT_AARCH64"'"'"' {out}/linux-arm64-chip-tool-ipv6only' -# Generating linux-arm64-rpc-console +# Generating linux-arm64-minmdns bash -c ' PKG_CONFIG_PATH="SYSROOT_AARCH64/lib/aarch64-linux-gnu/pkgconfig" \ - gn gen --check --fail-on-unused-args --root={root}/examples/common/pigweed/rpc_console '"'"'--args=target_cpu="arm64" is_clang=true'"'"' {out}/linux-arm64-rpc-console' + gn gen --check --fail-on-unused-args --root={root}/examples/minimal-mdns '"'"'--args=target_cpu="arm64" is_clang=true chip_crypto="mbedtls" sysroot="SYSROOT_AARCH64"'"'"' {out}/linux-arm64-minmdns' + +# Generating linux-arm64-minmdns-ipv6only +bash -c ' +PKG_CONFIG_PATH="SYSROOT_AARCH64/lib/aarch64-linux-gnu/pkgconfig" \ + gn gen --check --fail-on-unused-args --root={root}/examples/minimal-mdns '"'"'--args=chip_inet_config_enable_ipv4=false target_cpu="arm64" is_clang=true chip_crypto="mbedtls" sysroot="SYSROOT_AARCH64"'"'"' {out}/linux-arm64-minmdns-ipv6only' # Generating linux-arm64-thermostat bash -c ' @@ -48,6 +53,12 @@ gn gen --check --fail-on-unused-args --root={root}/examples/chip-tool {out}/linu # Generating linux-x64-chip-tool-ipv6only gn gen --check --fail-on-unused-args --root={root}/examples/chip-tool --args=chip_inet_config_enable_ipv4=false {out}/linux-x64-chip-tool-ipv6only +# Generating linux-x64-minmdns +gn gen --check --fail-on-unused-args --root={root}/examples/minimal-mdns {out}/linux-x64-minmdns + +# Generating linux-x64-minmdns-ipv6only +gn gen --check --fail-on-unused-args --root={root}/examples/minimal-mdns --args=chip_inet_config_enable_ipv4=false {out}/linux-x64-minmdns-ipv6only + # Generating linux-x64-rpc-console gn gen --check --fail-on-unused-args --root={root}/examples/common/pigweed/rpc_console {out}/linux-x64-rpc-console @@ -69,8 +80,11 @@ ninja -C {out}/linux-arm64-chip-tool # Building linux-arm64-chip-tool-ipv6only ninja -C {out}/linux-arm64-chip-tool-ipv6only -# Building linux-arm64-rpc-console -ninja -C {out}/linux-arm64-rpc-console +# Building linux-arm64-minmdns +ninja -C {out}/linux-arm64-minmdns + +# Building linux-arm64-minmdns-ipv6only +ninja -C {out}/linux-arm64-minmdns-ipv6only # Building linux-arm64-thermostat ninja -C {out}/linux-arm64-thermostat @@ -90,6 +104,12 @@ ninja -C {out}/linux-x64-chip-tool # Building linux-x64-chip-tool-ipv6only ninja -C {out}/linux-x64-chip-tool-ipv6only +# Building linux-x64-minmdns +ninja -C {out}/linux-x64-minmdns + +# Building linux-x64-minmdns-ipv6only +ninja -C {out}/linux-x64-minmdns-ipv6only + # Building linux-x64-rpc-console ninja -C {out}/linux-x64-rpc-console diff --git a/scripts/build_python.sh b/scripts/build_python.sh index cfc565a04b5f64..7d26083947657e 100755 --- a/scripts/build_python.sh +++ b/scripts/build_python.sh @@ -41,7 +41,6 @@ ENVIRONMENT_ROOT="$CHIP_ROOT/out/python_env" declare chip_detail_logging=false declare enable_pybindings=false declare chip_mdns -declare clusters=true declare case_retry_delta help() { @@ -55,8 +54,6 @@ Input Options: By default it is false. -m, --chip_mdns ChipMDNSValue Specify ChipMDNSValue as platform or minimal. By default it is minimal. - -c, --clusters_for_ip_commissioning true/false Specify whether to use clusters for IP commissioning. - By default it is true. -p, --enable_pybindings EnableValue Specify whether to enable pybindings as python controller. -t --time_between_case_retries MRPActiveRetryInterval Specify MRPActiveRetryInterval value @@ -80,10 +77,6 @@ while (($#)); do chip_mdns=$2 shift ;; - --clusters_for_ip_commissioning | -c) - clusters=$2 - shift - ;; --enable_pybindings | -p) enable_pybindings=$2 shift @@ -111,7 +104,7 @@ source "$CHIP_ROOT/scripts/activate.sh" [[ -n "$chip_mdns" ]] && chip_mdns_arg="chip_mdns=\"$chip_mdns\"" || chip_mdns_arg="" [[ -n "$chip_case_retry_delta" ]] && chip_case_retry_arg="chip_case_retry_delta=$chip_case_retry_delta" || chip_case_retry_arg="" -gn --root="$CHIP_ROOT" gen "$OUTPUT_ROOT" --args="chip_detail_logging=$chip_detail_logging enable_pylib=$enable_pybindings enable_rtti=$enable_pybindings chip_use_clusters_for_ip_commissioning=$clusters chip_project_config_include_dirs=[\"//config/python\"] $chip_mdns_arg $chip_case_retry_arg" +gn --root="$CHIP_ROOT" gen "$OUTPUT_ROOT" --args="chip_detail_logging=$chip_detail_logging enable_pylib=$enable_pybindings enable_rtti=$enable_pybindings chip_project_config_include_dirs=[\"//config/python\"] $chip_mdns_arg $chip_case_retry_arg" # Compiles python files # Check pybindings was requested diff --git a/scripts/examples/android_app_ide.sh b/scripts/examples/android_app_ide.sh index bd9db3de28c6a3..b5a221bce121b5 100755 --- a/scripts/examples/android_app_ide.sh +++ b/scripts/examples/android_app_ide.sh @@ -43,4 +43,4 @@ python3 third_party/android_deps/set_up_android_deps.py # Build CMake for Android Studio echo "build ide" -gn gen --check --fail-on-unused-args out/"android_$TARGET_CPU" --args="target_os=\"android\" target_cpu=\"$TARGET_CPU\" android_ndk_root=\"$ANDROID_NDK_HOME\" android_sdk_root=\"$ANDROID_HOME\" chip_use_clusters_for_ip_commissioning=\"true\"" --ide=json --json-ide-script=//scripts/examples/gn_to_cmakelists.py +gn gen --check --fail-on-unused-args out/"android_$TARGET_CPU" --args="target_os=\"android\" target_cpu=\"$TARGET_CPU\" android_ndk_root=\"$ANDROID_NDK_HOME\" android_sdk_root=\"$ANDROID_HOME\"" --ide=json --json-ide-script=//scripts/examples/gn_to_cmakelists.py diff --git a/src/BUILD.gn b/src/BUILD.gn index 79e18e0afc490a..648b70a9f2028c 100644 --- a/src/BUILD.gn +++ b/src/BUILD.gn @@ -101,7 +101,10 @@ if (chip_build_tests) { if (chip_device_platform != "nrfconnect" && chip_device_platform != "efr32") { # TODO(#10447): Controller test has HF on EFR32. - deps += [ "${chip_root}/src/controller/tests" ] + deps += [ + "${chip_root}/src/controller/tests", + "${chip_root}/src/controller/tests/data_model", + ] } if (current_os != "zephyr" && current_os != "mbed" && diff --git a/src/android/CHIPTool/.idea/runConfigurations.xml b/src/android/CHIPTool/.idea/runConfigurations.xml new file mode 100644 index 00000000000000..7f68460d8b38ac --- /dev/null +++ b/src/android/CHIPTool/.idea/runConfigurations.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/clusterinteraction/ClusterDetailFragment.kt b/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/clusterinteraction/ClusterDetailFragment.kt index bb8def19a7e2c0..268841a7cf95e3 100644 --- a/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/clusterinteraction/ClusterDetailFragment.kt +++ b/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/clusterinteraction/ClusterDetailFragment.kt @@ -15,7 +15,7 @@ import androidx.core.view.forEach import androidx.fragment.app.Fragment import chip.clusterinfo.ClusterCommandCallback import chip.clusterinfo.ClusterInfo -import chip.clusterinfo.CommandInfo +import chip.clusterinfo.InteractionInfo import chip.clusterinfo.CommandResponseInfo import chip.clusterinfo.DelegatedClusterCallback import chip.devicecontroller.ChipClusters @@ -53,7 +53,7 @@ class ClusterDetailFragment : Fragment() { private lateinit var selectedClusterInfo: ClusterInfo private lateinit var selectedCluster: ChipClusters.BaseChipCluster private lateinit var selectedCommandCallback: DelegatedClusterCallback - private lateinit var selectedCommandInfo: CommandInfo + private lateinit var selectedInteractionInfo: InteractionInfo private var devicePtr = 0L private var endpointId = 0 @@ -80,12 +80,12 @@ class ClusterDetailFragment : Fragment() { val commandArguments = HashMap() parameterList.forEach { val type = - selectedCommandInfo.commandParameters[it.clusterParameterNameTv.text.toString()]!!.type + selectedInteractionInfo.commandParameters[it.clusterParameterNameTv.text.toString()]!!.type val data = castStringToType(it.clusterParameterData.text.toString(), type)!! commandArguments[it.clusterParameterNameTv.text.toString()] = data } - selectedCommandInfo.getCommandFunction() + selectedInteractionInfo.getCommandFunction() .invokeCommand(selectedCluster, selectedCommandCallback, commandArguments) } } @@ -94,7 +94,6 @@ class ClusterDetailFragment : Fragment() { private fun castStringToType(data: String, type: Class<*>): Any? { return when (type) { Int::class.java -> data.toInt() - String::class.java -> data Boolean::class.java -> data.toBoolean() else -> data } @@ -141,8 +140,8 @@ class ClusterDetailFragment : Fragment() { callbackList.removeAllViews() selectedCluster = selectedClusterInfo.createClusterFunction.create(devicePtr, endpointId) val selectedCommand: String = commandAutoComplete.adapter.getItem(position).toString() - selectedCommandInfo = selectedClusterInfo.commands[selectedCommand]!! - selectedCommandCallback = selectedCommandInfo.commandCallbackSupplier.get() + selectedInteractionInfo = selectedClusterInfo.commands[selectedCommand]!! + selectedCommandCallback = selectedInteractionInfo.commandCallbackSupplier.get() populateCommandParameter(inflater, parameterList) selectedCommandCallback.setCallbackDelegate(object : ClusterCommandCallback { override fun onSuccess(responseValues: Map) { @@ -167,7 +166,7 @@ class ClusterDetailFragment : Fragment() { } private fun populateCommandParameter(inflater: LayoutInflater, parameterList: LinearLayout) { - selectedCommandInfo.commandParameters.forEach { (paramName, paramInfo) -> + selectedInteractionInfo.commandParameters.forEach { (paramName, paramInfo) -> val param = inflater.inflate(R.layout.cluster_parameter_item, null, false) as ConstraintLayout param.clusterParameterNameTv.text = "${paramName}" param.clusterParameterTypeTv.text = "${paramInfo.type}" @@ -182,37 +181,55 @@ class ClusterDetailFragment : Fragment() { ) { responseValues.forEach { (variableNameType, response) -> if (response is List<*>) { - if (response.size == 0) { - val emptyCallback = - inflater.inflate(R.layout.cluster_callback_item, null, false) as ConstraintLayout - emptyCallback.clusterCallbackNameTv.text = "Result is empty" - callbackList.addView(emptyCallback) - } else { - response.forEachIndexed { index, it -> - val objectCallback = - inflater.inflate(R.layout.cluster_callback_item, null, false) as ConstraintLayout - objectCallback.clusterCallbackNameTv.text = variableNameType.name + "[$index]" - val objectDeserializationString = it.toString() - val callbackClassName = it!!.javaClass.toString().split('$').last() - objectCallback.clusterCallbackDataTv.text = callbackClassName - objectCallback.clusterCallbackDataTv.setOnClickListener { - AlertDialog.Builder(requireContext()) - .setTitle(callbackClassName) - .setMessage(objectDeserializationString) - .create() - .show() - } - objectCallback.clusterCallbackTypeTv.text = "List<$callbackClassName>" - callbackList.addView(objectCallback) - } - } + createListReadAttributeView(response, inflater, callbackList, variableNameType) } else { - val callback = + createBasicReadAttributeView(response, inflater, callbackList, variableNameType) + } + } + } + + private fun createBasicReadAttributeView( + response: Any, + inflater: LayoutInflater, + callbackList: LinearLayout, + variableNameType: CommandResponseInfo + ) { + val callbackItem = + inflater.inflate(R.layout.cluster_callback_item, null, false) as ConstraintLayout + callbackItem.clusterCallbackNameTv.text = variableNameType.name + callbackItem.clusterCallbackDataTv.text = response.toString() + callbackItem.clusterCallbackTypeTv.text = variableNameType.type + callbackList.addView(callbackItem) + } + + private fun createListReadAttributeView( + response: List<*>, + inflater: LayoutInflater, + callbackList: LinearLayout, + variableNameType: CommandResponseInfo + ) { + if (response.isEmpty()) { + val emptyCallback = + inflater.inflate(R.layout.cluster_callback_item, null, false) as ConstraintLayout + emptyCallback.clusterCallbackNameTv.text = "Result is empty" + callbackList.addView(emptyCallback) + } else { + response.forEachIndexed { index, it -> + val readAttributeCallbackItem = inflater.inflate(R.layout.cluster_callback_item, null, false) as ConstraintLayout - callback.clusterCallbackNameTv.text = variableNameType.name - callback.clusterCallbackDataTv.text = response.toString() - callback.clusterCallbackTypeTv.text = variableNameType.type - callbackList.addView(callback) + readAttributeCallbackItem.clusterCallbackNameTv.text = variableNameType.name + "[$index]" + val objectString = it.toString() + val callbackClassName = it!!.javaClass.toString().split('$').last() + readAttributeCallbackItem.clusterCallbackDataTv.text = callbackClassName + readAttributeCallbackItem.clusterCallbackDataTv.setOnClickListener { + AlertDialog.Builder(requireContext()) + .setTitle(callbackClassName) + .setMessage(objectString) + .create() + .show() + } + readAttributeCallbackItem.clusterCallbackTypeTv.text = "List<$callbackClassName>" + callbackList.addView(readAttributeCallbackItem) } } } diff --git a/src/app/AttributePathExpandIterator.cpp b/src/app/AttributePathExpandIterator.cpp new file mode 100644 index 00000000000000..f77160df52cdd8 --- /dev/null +++ b/src/app/AttributePathExpandIterator.cpp @@ -0,0 +1,182 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace chip; + +// TODO: Need to make it so that declarations of things that don't depend on generated files are not intermixed in af.h with +// dependencies on generated files, so we don't have to re-declare things here. +// Note: Some of the generated files that depended by af.h are gen_config.h and gen_tokens.h +typedef uint8_t EmberAfClusterMask; + +extern uint16_t emberAfEndpointCount(void); +extern uint16_t emberAfIndexFromEndpoint(EndpointId endpoint); +extern uint8_t emberAfClusterCount(EndpointId endpoint, bool server); +extern uint16_t emberAfGetServerAttributeCount(chip::EndpointId endpoint, chip::ClusterId cluster); +extern uint16_t emberAfGetServerAttributeIndexByAttributeId(chip::EndpointId endpoint, chip::ClusterId cluster, + chip::AttributeId attributeId); +extern chip::EndpointId emberAfEndpointFromIndex(uint16_t index); +extern Optional emberAfGetNthClusterId(chip::EndpointId endpoint, uint8_t n, bool server); +extern Optional emberAfGetServerAttributeIdByIndex(chip::EndpointId endpoint, chip::ClusterId cluster, + uint16_t attributeIndex); +extern uint8_t emberAfClusterIndex(EndpointId endpoint, ClusterId clusterId, EmberAfClusterMask mask); + +namespace chip { +namespace app { + +AttributePathExpandIterator::AttributePathExpandIterator(ClusterInfo * aClusterInfo) +{ + mpClusterInfo = aClusterInfo; + + // Reset iterator state + mEndpointIndex = UINT16_MAX; + mClusterIndex = UINT8_MAX; + mAttributeIndex = UINT16_MAX; + + // Make the iterator ready to emit the first valid path in the list. + Next(); +} + +void AttributePathExpandIterator::PrepareEndpointIndexRange(const ClusterInfo & aClusterInfo) +{ + if (aClusterInfo.HasWildcardEndpointId()) + { + mEndpointIndex = 0; + mEndEndpointIndex = emberAfEndpointCount(); + } + else + { + mEndpointIndex = emberAfIndexFromEndpoint(aClusterInfo.mEndpointId); + // If the given cluster id does not exist on the given endpoint, it will return uint16(0xFFFF), then endEndpointIndex + // will be 0, means we should iterate a null endpoint set (skip it). + mEndEndpointIndex = static_cast(mEndpointIndex + 1); + } +} + +void AttributePathExpandIterator::PrepareClusterIndexRange(const ClusterInfo & aClusterInfo, EndpointId aEndpointId) +{ + if (aClusterInfo.HasWildcardClusterId()) + { + mClusterIndex = 0; + mEndClusterIndex = emberAfClusterCount(aEndpointId, true /* server */); + } + else + { + mClusterIndex = emberAfClusterIndex(aEndpointId, aClusterInfo.mClusterId, CLUSTER_MASK_SERVER); + // If the given cluster id does not exist on the given endpoint, it will return uint8(0xFF), then endClusterIndex + // will be 0, means we should iterate a null cluster set (skip it). + mEndClusterIndex = static_cast(mClusterIndex + 1); + } +} + +void AttributePathExpandIterator::PrepareAttributeIndexRange(const ClusterInfo & aClusterInfo, EndpointId aEndpointId, + ClusterId aClusterId) +{ + if (aClusterInfo.HasWildcardAttributeId()) + { + mAttributeIndex = 0; + mEndAttributeIndex = emberAfGetServerAttributeCount(aEndpointId, aClusterId); + } + else + { + mAttributeIndex = emberAfGetServerAttributeIndexByAttributeId(aEndpointId, aClusterId, aClusterInfo.mAttributeId); + // If the given attribute id does not exist on the given endpoint, it will return uint16(0xFFFF), then endAttributeIndex + // will be 0, means we should iterate a null attribute set (skip it). + mEndAttributeIndex = static_cast(mAttributeIndex + 1); + } +} + +bool AttributePathExpandIterator::Next() +{ + for (; mpClusterInfo != nullptr; (mpClusterInfo = mpClusterInfo->mpNext, mEndpointIndex = UINT16_MAX)) + { + if (mEndpointIndex == UINT16_MAX) + { + // Special case: If this is a concrete path, we just return its value as-is. + if (!mpClusterInfo->HasWildcard()) + { + mOutputPath.mEndpointId = mpClusterInfo->mEndpointId; + mOutputPath.mClusterId = mpClusterInfo->mClusterId; + mOutputPath.mAttributeId = mpClusterInfo->mAttributeId; + + // Prepare for next iteration + mEndpointIndex = mEndEndpointIndex = 0; + return true; + } + + PrepareEndpointIndexRange(*mpClusterInfo); + mClusterIndex = UINT8_MAX; + } + + for (; mEndpointIndex < mEndEndpointIndex; (mEndpointIndex++, mClusterIndex = UINT8_MAX, mAttributeIndex = UINT16_MAX)) + { + EndpointId endpointId = emberAfEndpointFromIndex(mEndpointIndex); + + if (mClusterIndex == UINT8_MAX) + { + PrepareClusterIndexRange(*mpClusterInfo, endpointId); + mAttributeIndex = UINT16_MAX; + } + + for (; mClusterIndex < mEndClusterIndex; (mClusterIndex++, mAttributeIndex = UINT16_MAX)) + { + // emberAfGetNthClusterId must return a valid cluster id here since we have verified the mClusterIndex does + // not exceed the mEndClusterIndex. + ClusterId clusterId = emberAfGetNthClusterId(endpointId, mClusterIndex, true /* server */).Value(); + if (mAttributeIndex == UINT16_MAX) + { + PrepareAttributeIndexRange(*mpClusterInfo, endpointId, clusterId); + } + + if (mAttributeIndex < mEndAttributeIndex) + { + // GetServerAttributeIdByIdex must return a valid attribute here since we have verified the mAttributeIndex does + // not exceed the mEndAttributeIndex. + mOutputPath.mAttributeId = emberAfGetServerAttributeIdByIndex(endpointId, clusterId, mAttributeIndex).Value(); + mOutputPath.mClusterId = clusterId; + mOutputPath.mEndpointId = endpointId; + mAttributeIndex++; + // We found a valid attribute path, now return and increase the attribute index for next iteration. + // Return true will skip the increment of mClusterIndex, mEndpointIndex and mpClusterInfo. + return true; + } + // We have exhausted all attributes of this cluster, continue iterating over attributes of next cluster. + } + // We have exhausted all clusters of this endpoint, continue iterating over clusters of next endpoint. + } + // We have exhausted all endpoints in this cluster info, continue iterating over next cluster info item. + } + + // Reset to default, invalid value. + mOutputPath = ConcreteAttributePath(); + return false; +} +} // namespace app +} // namespace chip diff --git a/src/app/AttributePathExpandIterator.h b/src/app/AttributePathExpandIterator.h new file mode 100644 index 00000000000000..23e5e63237d268 --- /dev/null +++ b/src/app/AttributePathExpandIterator.h @@ -0,0 +1,122 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Defines an iterator for iterating all possible paths from a list of ClusterInfo-s according to spec section 8.9.2.2 (Valid + * Attribute Paths) + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace chip { +namespace app { + +/** + * AttributePathExpandIterator is used to iterate over a linked list of ClusterInfo-s. + * The AttributePathExpandIterator is copiable, however, the given cluster info must be valid when calling Next(). + * + * AttributePathExpandIterator will expand attribute paths with wildcards, and only emit existing paths for ClusterInfo with + * wildcards. For ClusterInfo with a concrete path (i.e. does not contain wildcards), AttributePathExpandIterator will emit them + * as-is. + * + * The typical use of AttributePathExpandIterator may look like: + * ConcreteAttributePath path; + * for (AttributePathExpandIterator iterator(clusterInfo); iterator.Get(path); iterator.Next()) {...} + * + * The iterator does not copy the given ClusterInfo, The given ClusterInfo must be valid when using the iterator. + * If the set of endpoints, clusters, or attributes that are supported changes, AttributePathExpandIterator must be reinitialized. + * + * A initialized iterator will return the first valid path, no need to call Next() before calling Get() for the first time. + * + * Note: The Next() and Get() are two separate operations by design since a possible call of this iterator might be: + * - Get() + * - Chunk full, return + * - In a new chunk, Get() + * + * TODO: The ClusterInfo may support a group id, the iterator should be able to call group data provider to expand the group id. + */ +class AttributePathExpandIterator +{ +public: + AttributePathExpandIterator(ClusterInfo * aClusterInfo); + + /** + * Proceed the iterator to the next attribute path in the given cluster info. + * + * Returns false if AttributePathExpandIterator has exhausted all paths in the given ClusterInfo list. + */ + bool Next(); + + /** + * Fills the aPath with the path the iterator currently points to. + * Returns false if the iterator is not pointing to a valid path (i.e. it has exhausted the cluster info). + */ + bool Get(ConcreteAttributePath & aPath) + { + aPath = mOutputPath; + return Valid(); + } + + /** + * Returns if the iterator is valid (not exhausted). An iterator is exhausted if and only if: + * - Next() is called after iterating last path. + * - Iterator is initialized with a null ClusterInfo. + */ + inline bool Valid() const { return mpClusterInfo != nullptr; } + +private: + ClusterInfo * mpClusterInfo; + + uint16_t mEndpointIndex, mEndEndpointIndex; + // Note: should use decltype(EmberAfEndpointType::clusterCount) here, but af-types is including app specific generated files. + uint8_t mClusterIndex, mEndClusterIndex; + uint16_t mAttributeIndex, mEndAttributeIndex; + + ConcreteAttributePath mOutputPath; + + /** + * Prepare*IndexRange will update mBegin*Index and mEnd*Index variables. + * If ClusterInfo contains a wildcard field, it will set mBegin*Index to 0 and mEnd*Index to count. + * Or it will set mBegin*Index to the index of the Endpoint/Cluster/Attribute, and mEnd*Index to mBegin*Index + 1. + * + * If the Endpoint/Cluster/Attribute does not exist, mBegin*Index will be UINT*_MAX, and mEnd*Inde will be 0. + * + * The index can be used with emberAfEndpointFromIndex, emberAfGetNthClusterId and emberAfGetServerAttributeIdByIndex. + */ + void PrepareEndpointIndexRange(const ClusterInfo & aClusterInfo); + void PrepareClusterIndexRange(const ClusterInfo & aClusterInfo, EndpointId aEndpointId); + void PrepareAttributeIndexRange(const ClusterInfo & aClusterInfo, EndpointId aEndpointId, ClusterId aClusterId); +}; +} // namespace app +} // namespace chip diff --git a/src/app/AttributePathParams.h b/src/app/AttributePathParams.h index 3a696a26d8d9b2..855587f3661acd 100644 --- a/src/app/AttributePathParams.h +++ b/src/app/AttributePathParams.h @@ -58,12 +58,12 @@ struct AttributePathParams */ bool IsValidAttributePath() const { return HasWildcardListIndex() || !HasWildcardAttributeId(); } - inline bool HasWildcardEndpointId() const { return mEndpointId == ClusterInfo::kInvalidEndpointId; } + inline bool HasWildcardEndpointId() const { return mEndpointId == kInvalidEndpointId; } inline bool HasWildcardClusterId() const { return mClusterId == ClusterInfo::kInvalidClusterId; } inline bool HasWildcardAttributeId() const { return mAttributeId == ClusterInfo::kInvalidAttributeId; } inline bool HasWildcardListIndex() const { return mListIndex == ClusterInfo::kInvalidListIndex; } - EndpointId mEndpointId = ClusterInfo::kInvalidEndpointId; + EndpointId mEndpointId = kInvalidEndpointId; ClusterId mClusterId = ClusterInfo::kInvalidClusterId; AttributeId mAttributeId = ClusterInfo::kInvalidAttributeId; ListIndex mListIndex = ClusterInfo::kInvalidListIndex; diff --git a/src/app/BUILD.gn b/src/app/BUILD.gn index 05c460035c7125..793fc2a6bfc3b0 100644 --- a/src/app/BUILD.gn +++ b/src/app/BUILD.gn @@ -35,7 +35,10 @@ static_library("app") { output_name = "libCHIPDataModel" sources = [ + "AttributePathExpandIterator.cpp", + "AttributePathExpandIterator.h", "AttributePathParams.cpp", + "AttributePathParams.h", "Command.cpp", "Command.h", "CommandHandler.cpp", @@ -120,13 +123,6 @@ static_library("app") { "reporting/Engine.h", ] - if (chip_ip_commissioning) { - defines = [ - "CONFIG_USE_CLUSTERS_FOR_IP_COMMISSIONING=1", - "CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY=1", - ] - } - public_deps = [ ":app_buildconfig", "${chip_root}/src/app/util:device_callbacks_manager", diff --git a/src/app/ClusterInfo.h b/src/app/ClusterInfo.h index b7dad7d88b8a5e..c07d3491623b9f 100644 --- a/src/app/ClusterInfo.h +++ b/src/app/ClusterInfo.h @@ -37,8 +37,7 @@ struct ClusterInfo private: // Allow AttributePathParams access these constants. friend struct AttributePathParams; - // Endpoint Id is a uint16 number, and should between 0 and 0xFFFE - static constexpr EndpointId kInvalidEndpointId = 0xFFFF; + // The ClusterId, AttributeId and EventId are MEIs, // 0xFFFF is not a valid manufacturer code, thus 0xFFFF'FFFF is not a valid MEI static constexpr ClusterId kInvalidClusterId = 0xFFFF'FFFF; diff --git a/src/app/ConcreteAttributePath.h b/src/app/ConcreteAttributePath.h index b3b44a8a2f359c..8b05580fa12c8a 100644 --- a/src/app/ConcreteAttributePath.h +++ b/src/app/ConcreteAttributePath.h @@ -28,6 +28,7 @@ namespace app { */ struct ConcreteAttributePath { + ConcreteAttributePath() {} ConcreteAttributePath(EndpointId aEndpointId, ClusterId aClusterId, AttributeId aAttributeId) : mEndpointId(aEndpointId), mClusterId(aClusterId), mAttributeId(aAttributeId) {} diff --git a/src/app/WriteClient.cpp b/src/app/WriteClient.cpp index 26699e402b76a3..8f2acc3adf3b93 100644 --- a/src/app/WriteClient.cpp +++ b/src/app/WriteClient.cpp @@ -244,21 +244,15 @@ CHIP_ERROR WriteClient::SendWriteRequest(SessionHandle session, System::Clock::T // Create a new exchange context. mpExchangeCtx = mpExchangeMgr->NewContext(session, this); VerifyOrExit(mpExchangeCtx != nullptr, err = CHIP_ERROR_NO_MEMORY); - if (session.IsGroupSession()) - { - // Exchange will be closed by WriteClientHandle::SendWriteRequest for group messages - err = mpExchangeCtx->SendMessage(Protocols::InteractionModel::MsgType::WriteRequest, std::move(packet), - Messaging::SendFlags(Messaging::SendMessageFlags::kNoAutoRequestAck)); - } - else - { - mpExchangeCtx->SetResponseTimeout(timeout); - err = mpExchangeCtx->SendMessage(Protocols::InteractionModel::MsgType::WriteRequest, std::move(packet), - Messaging::SendFlags(Messaging::SendMessageFlags::kExpectResponse)); - SuccessOrExit(err); - MoveToState(State::AwaitingResponse); - } + mpExchangeCtx->SetResponseTimeout(timeout); + + // kExpectResponse is ignored by ExchangeContext in case of groupcast + err = mpExchangeCtx->SendMessage(Protocols::InteractionModel::MsgType::WriteRequest, std::move(packet), + Messaging::SendFlags(Messaging::SendMessageFlags::kExpectResponse)); + SuccessOrExit(err); + + MoveToState(State::AwaitingResponse); exit: if (err != CHIP_NO_ERROR) @@ -266,6 +260,12 @@ CHIP_ERROR WriteClient::SendWriteRequest(SessionHandle session, System::Clock::T ClearExistingExchangeContext(); } + if (session.IsGroupSession()) + { + // Always shutdown on Group communication + Shutdown(); + } + return err; } @@ -361,7 +361,7 @@ CHIP_ERROR WriteClientHandle::SendWriteRequest(SessionHandle session, System::Cl // Transferring ownership of the underlying WriteClient to the IM layer. IM will manage its lifetime. // For groupcast writes, there is no transfer of ownership since the interaction is done upon transmission of the action - if (err == CHIP_NO_ERROR && !session.IsGroupSession()) + if (err == CHIP_NO_ERROR) { // Release the WriteClient without closing it. mpWriteClient = nullptr; diff --git a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp index 3af39b6c45e95d..633353b6ee7bd0 100644 --- a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp +++ b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp @@ -552,10 +552,7 @@ bool emberAfOperationalCredentialsClusterAttestationRequestCallback(app::Command // TODO: retrieve vendor information to populate the fields below. uint32_t timestamp = 0; ByteSpan firmwareInfo; - ByteSpan * vendorReservedArray = nullptr; - size_t vendorReservedArraySize = 0; - uint16_t vendorId = 0; - uint16_t profileNum = 0; + Credentials::DeviceAttestationVendorReservedConstructor emptyVendorReserved(nullptr, 0); SuccessOrExit(err = dacProvider->GetCertificationDeclaration(certDeclSpan)); // TODO: Retrieve firmware Information @@ -565,8 +562,7 @@ bool emberAfOperationalCredentialsClusterAttestationRequestCallback(app::Command MutableByteSpan attestationElementsSpan(attestationElements.Get(), attestationElementsLen); SuccessOrExit(err = Credentials::ConstructAttestationElements(certDeclSpan, attestationNonce, timestamp, firmwareInfo, - vendorReservedArray, vendorReservedArraySize, vendorId, - profileNum, attestationElementsSpan)); + emptyVendorReserved, attestationElementsSpan)); attestationElementsLen = attestationElementsSpan.size(); } diff --git a/src/app/clusters/ota-requestor/ota-downloader.h b/src/app/clusters/ota-requestor/ota-downloader.h new file mode 100644 index 00000000000000..1039a5994c14c3 --- /dev/null +++ b/src/app/clusters/ota-requestor/ota-downloader.h @@ -0,0 +1,60 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* This file contains the declarations for the OTADownloader class which + * abstracts the image download functionality from the particular protocol + * used for it. + * Applications and platforms implementing the OTA Requestor functionality + * must include this file + */ + +#include "ota-image-processor.h" + +#pragma once + +// A class that abstracts the image download functionality from the particular +// protocol used for that (BDX or possibly HTTPS) +class OTADownloader +{ +public: + // API declarations start + + // Application calls this method to direct OTADownloader to begin the download + void virtual BeginDownload(); + + // Platform calls this method upon the completion of PrepareDownload() processing + void virtual OnPreparedForDownload(); + + // Action parameter type for the OnBlockProcessed() + enum BlockActionType + { + kGetNext, + kEnd + }; + + // Platform calls this method upon the completion of ProcessBlock() processing + void virtual OnBlockProcessed(BlockActionType action); + + // A setter for the delegate class pointer + void SetImageProcessorDelegate(OTAImageProcessorDriver * delegate); + + // API declarations end + +private: + OTAImageProcessorDriver * mImageProcessorDelegate; +}; diff --git a/src/app/clusters/ota-requestor/ota-image-processor.h b/src/app/clusters/ota-requestor/ota-image-processor.h new file mode 100644 index 00000000000000..b9a7ee9856c261 --- /dev/null +++ b/src/app/clusters/ota-requestor/ota-image-processor.h @@ -0,0 +1,47 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* This file contains the declarations for OTAImageProcessor, a platform-agnostic + * interface for processing downloaded chunks of OTA image data. + * Each platform should provide an implementation of this interface. + */ + +#pragma once + +// This is a platform-agnostic interface for processing downloaded +// chunks of OTA image data (data could be raw image data meant for flash or +// metadata). Each platform should provide an implementation of this +// interface. +class OTAImageProcessorDriver +{ +public: + // Open file, find block of space in persistent memory, or allocate a buffer, etc. + virtual CHIP_ERROR PrepareDownload() = 0; + + // Must not be a blocking call to support cases that require IO to elements such as // external peripherals/radios + virtual CHIP_ERROR ProcessBlock(ByteSpan & data) = 0; + + // Close file, close persistent storage, etc + virtual CHIP_ERROR Finalize() = 0; + + virtual chip::Optional PercentComplete() = 0; + + // Clean up the download which could mean erasing everything that was written, + // releasing buffers, etc. + virtual CHIP_ERROR Abort() = 0; +}; diff --git a/src/app/clusters/ota-requestor/ota-requestor-driver.h b/src/app/clusters/ota-requestor/ota-requestor-driver.h new file mode 100644 index 00000000000000..786c49c27c6715 --- /dev/null +++ b/src/app/clusters/ota-requestor/ota-requestor-driver.h @@ -0,0 +1,39 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* This file contains the declaration for the OTARequestorDriver class, an interface + * that abstracts the OTA-related business logic out of the Requestor functionality in + * the Matter SDK. Applications implementing the OTA Requestor functionality must include + * this file. + */ + +#pragma once + +// Interface class to abstract the OTA-related business logic. Each application +// must implement this interface. All calls must be non-blocking unless stated otherwise +class OTARequestorDriver +{ +public: + // A call into the application logic to give it a chance to allow or stop the Requestor + // from proceeding with actual image download. Returning TRUE will allow the download + // to proceed, returning FALSE will abort the download process. + virtual bool CheckImageDownloadAllowed() = 0; + + // Notify the application that the download is complete and the image can be applied + virtual void ImageDownloadComplete() = 0; +}; diff --git a/src/app/clusters/ota-requestor/ota-requestor-interface.h b/src/app/clusters/ota-requestor/ota-requestor-interface.h new file mode 100644 index 00000000000000..a6c5c592d67d63 --- /dev/null +++ b/src/app/clusters/ota-requestor/ota-requestor-interface.h @@ -0,0 +1,43 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* This file contains the declaration for the OTA Requestor interface. + * Any implementation of the OTA Requestor (e.g. the OTARequestor class) must implement + * this interface. + */ + +#pragma once + +// Interface class to connect the OTA Software Update Requestor cluster command processing +// with the core OTA Requestor logic. The OTARequestor class implements this interface +class OTARequestorInterface +{ +public: + // Handler for the AnnounceOTAProvider command + virtual bool HandleAnnounceOTAProvider( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::OtaSoftwareUpdateRequestor::Commands::AnnounceOtaProvider::DecodableType & commandData ch) = 0; + + // Handler for the QueryImageResponse command + virtual bool HandleQueryImageResponse(void * context, uint8_t status, uint32_t delayedActionTime, CharSpan imageURI, + uint32_t softwareVersion, CharSpan softwareVersionString, ByteSpan updateToken, + bool userConsentNeeded, ByteSpan metadataForRequester) = 0; + + // Handler for the ApplyUpdateResponse command + virtual bool HandleApplyUpdateResponse(ApplyUpdateResponse::DecodableType); +}; diff --git a/src/app/clusters/ota-requestor/ota-requestor.h b/src/app/clusters/ota-requestor/ota-requestor.h new file mode 100644 index 00000000000000..4cfacba97b64f1 --- /dev/null +++ b/src/app/clusters/ota-requestor/ota-requestor.h @@ -0,0 +1,49 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* This file contains the declarations for the Matter OTA Requestor implementation and API. + * Applications implementing the OTA Requestor functionality must include this file. + */ + +#include "ota-requestor-driver.h" +#include "ota-requestor-interface.h" + +#pragma once + +// This class implements all of the core logic of the OTA Requestor +class OTARequestor : public OTARequestorInterface +{ +public: + // Application interface declarations start + + // Application directs the Requestor to start the Image Query process + // and download the new image if available + void TriggerImmediateQuery(); + + // Application directs the Requestor to abort any processing related to + // the image update + void AbortImageUpdate(); + + // A setter for the delegate class pointer + void SetOtaRequestorDriver(OTARequestorDriver * driver); + + // Application interface declarations end + +private: + OTARequestorDriver * mOtaRequestorDriver; +}; diff --git a/src/app/clusters/software_diagnostics_server/software_diagnostics_server.cpp b/src/app/clusters/software_diagnostics_server/software_diagnostics_server.cpp index 07cab4013f6b0c..d07bbd890aa610 100644 --- a/src/app/clusters/software_diagnostics_server/software_diagnostics_server.cpp +++ b/src/app/clusters/software_diagnostics_server/software_diagnostics_server.cpp @@ -46,6 +46,7 @@ class SoftwareDiagosticsAttrAccess : public AttributeAccessInterface private: CHIP_ERROR ReadIfSupported(CHIP_ERROR (PlatformManager::*getter)(uint64_t &), AttributeValueEncoder & aEncoder); + CHIP_ERROR ReadThreadMetrics(AttributeValueEncoder & aEncoder); }; SoftwareDiagosticsAttrAccess gAttrAccess; @@ -69,6 +70,9 @@ CHIP_ERROR SoftwareDiagosticsAttrAccess::Read(const ConcreteAttributePath & aPat case CurrentHeapHighWatermark::Id: { return ReadIfSupported(&PlatformManager::GetCurrentHeapHighWatermark, aEncoder); } + case ThreadMetrics::Id: { + return ReadThreadMetrics(aEncoder); + } default: { break; } @@ -92,6 +96,32 @@ CHIP_ERROR SoftwareDiagosticsAttrAccess::ReadIfSupported(CHIP_ERROR (PlatformMan return aEncoder.Encode(data); } + +CHIP_ERROR SoftwareDiagosticsAttrAccess::ReadThreadMetrics(AttributeValueEncoder & aEncoder) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + DeviceLayer::ThreadMetrics * threadMetrics; + + if (DeviceLayer::PlatformMgr().GetThreadMetrics(&threadMetrics) == CHIP_NO_ERROR) + { + err = aEncoder.EncodeList([&threadMetrics](const TagBoundEncoder & encoder) -> CHIP_ERROR { + for (DeviceLayer::ThreadMetrics * thread = threadMetrics; thread != nullptr; thread = thread->Next) + { + ReturnErrorOnFailure(encoder.Encode(*thread)); + } + + return CHIP_NO_ERROR; + }); + + DeviceLayer::PlatformMgr().ReleaseThreadMetrics(threadMetrics); + } + else + { + err = aEncoder.Encode(DataModel::List()); + } + + return err; +} } // anonymous namespace bool emberAfSoftwareDiagnosticsClusterResetWatermarksCallback(app::CommandHandler * commandObj, diff --git a/src/app/common_flags.gni b/src/app/common_flags.gni index 45e98373af3d0b..1d4309810d57e8 100644 --- a/src/app/common_flags.gni +++ b/src/app/common_flags.gni @@ -15,5 +15,4 @@ declare_args() { # Temporary flag for interaction model and echo protocols, set it to true to enable chip_app_use_echo = false - chip_ip_commissioning = false } diff --git a/src/app/tests/BUILD.gn b/src/app/tests/BUILD.gn index 1cb62b6cc93d83..d58ba38ec83e56 100644 --- a/src/app/tests/BUILD.gn +++ b/src/app/tests/BUILD.gn @@ -41,6 +41,7 @@ chip_test_suite("tests") { output_name = "libAppTests" test_sources = [ + "TestAttributePathExpandIterator.cpp", "TestAttributeValueEncoder.cpp", "TestBuilderParser.cpp", "TestCHIPDeviceCallbacksMgr.cpp", @@ -65,6 +66,7 @@ chip_test_suite("tests") { "${chip_root}/src/app/common:cluster-objects", "${chip_root}/src/app/tests:helpers", "${chip_root}/src/app/util:device_callbacks_manager", + "${chip_root}/src/app/util/mock:mock_ember", "${chip_root}/src/lib/core", "${nlunit_test_root}:nlunit-test", ] diff --git a/src/app/tests/TestAttributePathExpandIterator.cpp b/src/app/tests/TestAttributePathExpandIterator.cpp new file mode 100644 index 00000000000000..b13457c6981e7d --- /dev/null +++ b/src/app/tests/TestAttributePathExpandIterator.cpp @@ -0,0 +1,323 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +using namespace chip; +using namespace chip::Test; +using namespace chip::app; + +namespace { + +using P = app::ConcreteAttributePath; + +void TestAllWildcard(nlTestSuite * apSuite, void * apContext) +{ + app::ClusterInfo clusInfo; + + app::ConcreteAttributePath path; + P paths[] = { + { kMockEndpoint1, MockClusterId(1), Clusters::Globals::Attributes::ClusterRevision::Id }, + { kMockEndpoint1, MockClusterId(1), Clusters::Globals::Attributes::FeatureMap::Id }, + { kMockEndpoint1, MockClusterId(2), Clusters::Globals::Attributes::ClusterRevision::Id }, + { kMockEndpoint1, MockClusterId(2), Clusters::Globals::Attributes::FeatureMap::Id }, + { kMockEndpoint1, MockClusterId(2), MockAttributeId(1) }, + { kMockEndpoint2, MockClusterId(1), Clusters::Globals::Attributes::ClusterRevision::Id }, + { kMockEndpoint2, MockClusterId(1), Clusters::Globals::Attributes::FeatureMap::Id }, + { kMockEndpoint2, MockClusterId(2), Clusters::Globals::Attributes::ClusterRevision::Id }, + { kMockEndpoint2, MockClusterId(2), Clusters::Globals::Attributes::FeatureMap::Id }, + { kMockEndpoint2, MockClusterId(2), MockAttributeId(1) }, + { kMockEndpoint2, MockClusterId(2), MockAttributeId(2) }, + { kMockEndpoint2, MockClusterId(3), Clusters::Globals::Attributes::ClusterRevision::Id }, + { kMockEndpoint2, MockClusterId(3), Clusters::Globals::Attributes::FeatureMap::Id }, + { kMockEndpoint2, MockClusterId(3), MockAttributeId(1) }, + { kMockEndpoint2, MockClusterId(3), MockAttributeId(2) }, + { kMockEndpoint2, MockClusterId(3), MockAttributeId(3) }, + { kMockEndpoint3, MockClusterId(1), Clusters::Globals::Attributes::ClusterRevision::Id }, + { kMockEndpoint3, MockClusterId(1), Clusters::Globals::Attributes::FeatureMap::Id }, + { kMockEndpoint3, MockClusterId(1), MockAttributeId(1) }, + { kMockEndpoint3, MockClusterId(2), Clusters::Globals::Attributes::ClusterRevision::Id }, + { kMockEndpoint3, MockClusterId(2), Clusters::Globals::Attributes::FeatureMap::Id }, + { kMockEndpoint3, MockClusterId(2), MockAttributeId(1) }, + { kMockEndpoint3, MockClusterId(2), MockAttributeId(2) }, + { kMockEndpoint3, MockClusterId(2), MockAttributeId(3) }, + { kMockEndpoint3, MockClusterId(2), MockAttributeId(4) }, + { kMockEndpoint3, MockClusterId(3), Clusters::Globals::Attributes::ClusterRevision::Id }, + { kMockEndpoint3, MockClusterId(3), Clusters::Globals::Attributes::FeatureMap::Id }, + { kMockEndpoint3, MockClusterId(4), Clusters::Globals::Attributes::ClusterRevision::Id }, + { kMockEndpoint3, MockClusterId(4), Clusters::Globals::Attributes::FeatureMap::Id }, + }; + + size_t index = 0; + + for (app::AttributePathExpandIterator iter(&clusInfo); iter.Get(path); iter.Next()) + { + ChipLogDetail(AppServer, "Visited Attribute: 0x%04" PRIX16 " / " ChipLogFormatMEI " / " ChipLogFormatMEI, path.mEndpointId, + ChipLogValueMEI(path.mClusterId), ChipLogValueMEI(path.mAttributeId)); + NL_TEST_ASSERT(apSuite, index < ArraySize(paths) && paths[index] == path); + index++; + } + NL_TEST_ASSERT(apSuite, index == ArraySize(paths)); +} + +void TestWildcardEndpoint(nlTestSuite * apSuite, void * apContext) +{ + app::ClusterInfo clusInfo; + clusInfo.mClusterId = Test::MockClusterId(3); + clusInfo.mAttributeId = Test::MockAttributeId(3); + + app::ConcreteAttributePath path; + P paths[] = { + { kMockEndpoint2, MockClusterId(3), MockAttributeId(3) }, + }; + + size_t index = 0; + + for (app::AttributePathExpandIterator iter(&clusInfo); iter.Get(path); iter.Next()) + { + ChipLogDetail(AppServer, "Visited Attribute: 0x%04" PRIX16 " / " ChipLogFormatMEI " / " ChipLogFormatMEI, path.mEndpointId, + ChipLogValueMEI(path.mClusterId), ChipLogValueMEI(path.mAttributeId)); + NL_TEST_ASSERT(apSuite, index < ArraySize(paths) && paths[index] == path); + index++; + } + NL_TEST_ASSERT(apSuite, index == ArraySize(paths)); +} + +void TestWildcardCluster(nlTestSuite * apSuite, void * apContext) +{ + app::ClusterInfo clusInfo; + clusInfo.mEndpointId = Test::kMockEndpoint3; + clusInfo.mAttributeId = app::Clusters::Globals::Attributes::ClusterRevision::Id; + + app::ConcreteAttributePath path; + P paths[] = { + { kMockEndpoint3, MockClusterId(1), Clusters::Globals::Attributes::ClusterRevision::Id }, + { kMockEndpoint3, MockClusterId(2), Clusters::Globals::Attributes::ClusterRevision::Id }, + { kMockEndpoint3, MockClusterId(3), Clusters::Globals::Attributes::ClusterRevision::Id }, + { kMockEndpoint3, MockClusterId(4), Clusters::Globals::Attributes::ClusterRevision::Id }, + }; + + size_t index = 0; + + for (app::AttributePathExpandIterator iter(&clusInfo); iter.Get(path); iter.Next()) + { + ChipLogDetail(AppServer, "Visited Attribute: 0x%04" PRIX16 " / " ChipLogFormatMEI " / " ChipLogFormatMEI, path.mEndpointId, + ChipLogValueMEI(path.mClusterId), ChipLogValueMEI(path.mAttributeId)); + NL_TEST_ASSERT(apSuite, index < ArraySize(paths) && paths[index] == path); + index++; + } + NL_TEST_ASSERT(apSuite, index == ArraySize(paths)); +} + +void TestWildcardAttribute(nlTestSuite * apSuite, void * apContext) +{ + app::ClusterInfo clusInfo; + clusInfo.mEndpointId = Test::kMockEndpoint2; + clusInfo.mClusterId = Test::MockClusterId(3); + + app::ConcreteAttributePath path; + P paths[] = { + { kMockEndpoint2, MockClusterId(3), Clusters::Globals::Attributes::ClusterRevision::Id }, + { kMockEndpoint2, MockClusterId(3), Clusters::Globals::Attributes::FeatureMap::Id }, + { kMockEndpoint2, MockClusterId(3), MockAttributeId(1) }, + { kMockEndpoint2, MockClusterId(3), MockAttributeId(2) }, + { kMockEndpoint2, MockClusterId(3), MockAttributeId(3) }, + }; + + size_t index = 0; + + for (app::AttributePathExpandIterator iter(&clusInfo); iter.Get(path); iter.Next()) + { + ChipLogDetail(AppServer, "Visited Attribute: 0x%04" PRIX16 " / " ChipLogFormatMEI " / " ChipLogFormatMEI, path.mEndpointId, + ChipLogValueMEI(path.mClusterId), ChipLogValueMEI(path.mAttributeId)); + NL_TEST_ASSERT(apSuite, index < ArraySize(paths) && paths[index] == path); + index++; + } + NL_TEST_ASSERT(apSuite, index == ArraySize(paths)); +} + +void TestNoWildcard(nlTestSuite * apSuite, void * apContext) +{ + app::ClusterInfo clusInfo; + clusInfo.mEndpointId = Test::kMockEndpoint2; + clusInfo.mClusterId = Test::MockClusterId(3); + clusInfo.mAttributeId = Test::MockAttributeId(3); + + app::ConcreteAttributePath path; + P paths[] = { + { kMockEndpoint2, MockClusterId(3), MockAttributeId(3) }, + }; + + size_t index = 0; + + for (app::AttributePathExpandIterator iter(&clusInfo); iter.Get(path); iter.Next()) + { + ChipLogDetail(AppServer, "Visited Attribute: 0x%04" PRIX16 " / " ChipLogFormatMEI " / " ChipLogFormatMEI, path.mEndpointId, + ChipLogValueMEI(path.mClusterId), ChipLogValueMEI(path.mAttributeId)); + NL_TEST_ASSERT(apSuite, index < ArraySize(paths) && paths[index] == path); + index++; + } + NL_TEST_ASSERT(apSuite, index == ArraySize(paths)); +} + +void TestMultipleClusInfo(nlTestSuite * apSuite, void * apContext) +{ + + app::ClusterInfo clusInfo1; + + app::ClusterInfo clusInfo2; + clusInfo2.mClusterId = Test::MockClusterId(3); + clusInfo2.mAttributeId = Test::MockAttributeId(3); + + app::ClusterInfo clusInfo3; + clusInfo3.mEndpointId = Test::kMockEndpoint3; + clusInfo3.mAttributeId = app::Clusters::Globals::Attributes::ClusterRevision::Id; + + app::ClusterInfo clusInfo4; + clusInfo4.mEndpointId = Test::kMockEndpoint2; + clusInfo4.mClusterId = Test::MockClusterId(3); + + app::ClusterInfo clusInfo5; + clusInfo5.mEndpointId = Test::kMockEndpoint2; + clusInfo5.mClusterId = Test::MockClusterId(3); + clusInfo5.mAttributeId = Test::MockAttributeId(3); + + clusInfo1.mpNext = &clusInfo2; + clusInfo2.mpNext = &clusInfo3; + clusInfo3.mpNext = &clusInfo4; + clusInfo4.mpNext = &clusInfo5; + + app::ConcreteAttributePath path; + P paths[] = { + { kMockEndpoint1, MockClusterId(1), Clusters::Globals::Attributes::ClusterRevision::Id }, + { kMockEndpoint1, MockClusterId(1), Clusters::Globals::Attributes::FeatureMap::Id }, + { kMockEndpoint1, MockClusterId(2), Clusters::Globals::Attributes::ClusterRevision::Id }, + { kMockEndpoint1, MockClusterId(2), Clusters::Globals::Attributes::FeatureMap::Id }, + { kMockEndpoint1, MockClusterId(2), MockAttributeId(1) }, + { kMockEndpoint2, MockClusterId(1), Clusters::Globals::Attributes::ClusterRevision::Id }, + { kMockEndpoint2, MockClusterId(1), Clusters::Globals::Attributes::FeatureMap::Id }, + { kMockEndpoint2, MockClusterId(2), Clusters::Globals::Attributes::ClusterRevision::Id }, + { kMockEndpoint2, MockClusterId(2), Clusters::Globals::Attributes::FeatureMap::Id }, + { kMockEndpoint2, MockClusterId(2), MockAttributeId(1) }, + { kMockEndpoint2, MockClusterId(2), MockAttributeId(2) }, + { kMockEndpoint2, MockClusterId(3), Clusters::Globals::Attributes::ClusterRevision::Id }, + { kMockEndpoint2, MockClusterId(3), Clusters::Globals::Attributes::FeatureMap::Id }, + { kMockEndpoint2, MockClusterId(3), MockAttributeId(1) }, + { kMockEndpoint2, MockClusterId(3), MockAttributeId(2) }, + { kMockEndpoint2, MockClusterId(3), MockAttributeId(3) }, + { kMockEndpoint3, MockClusterId(1), Clusters::Globals::Attributes::ClusterRevision::Id }, + { kMockEndpoint3, MockClusterId(1), Clusters::Globals::Attributes::FeatureMap::Id }, + { kMockEndpoint3, MockClusterId(1), MockAttributeId(1) }, + { kMockEndpoint3, MockClusterId(2), Clusters::Globals::Attributes::ClusterRevision::Id }, + { kMockEndpoint3, MockClusterId(2), Clusters::Globals::Attributes::FeatureMap::Id }, + { kMockEndpoint3, MockClusterId(2), MockAttributeId(1) }, + { kMockEndpoint3, MockClusterId(2), MockAttributeId(2) }, + { kMockEndpoint3, MockClusterId(2), MockAttributeId(3) }, + { kMockEndpoint3, MockClusterId(2), MockAttributeId(4) }, + { kMockEndpoint3, MockClusterId(3), Clusters::Globals::Attributes::ClusterRevision::Id }, + { kMockEndpoint3, MockClusterId(3), Clusters::Globals::Attributes::FeatureMap::Id }, + { kMockEndpoint3, MockClusterId(4), Clusters::Globals::Attributes::ClusterRevision::Id }, + { kMockEndpoint3, MockClusterId(4), Clusters::Globals::Attributes::FeatureMap::Id }, + { kMockEndpoint2, MockClusterId(3), MockAttributeId(3) }, + { kMockEndpoint3, MockClusterId(1), Clusters::Globals::Attributes::ClusterRevision::Id }, + { kMockEndpoint3, MockClusterId(2), Clusters::Globals::Attributes::ClusterRevision::Id }, + { kMockEndpoint3, MockClusterId(3), Clusters::Globals::Attributes::ClusterRevision::Id }, + { kMockEndpoint3, MockClusterId(4), Clusters::Globals::Attributes::ClusterRevision::Id }, + { kMockEndpoint2, MockClusterId(3), Clusters::Globals::Attributes::ClusterRevision::Id }, + { kMockEndpoint2, MockClusterId(3), Clusters::Globals::Attributes::FeatureMap::Id }, + { kMockEndpoint2, MockClusterId(3), MockAttributeId(1) }, + { kMockEndpoint2, MockClusterId(3), MockAttributeId(2) }, + { kMockEndpoint2, MockClusterId(3), MockAttributeId(3) }, + { kMockEndpoint2, MockClusterId(3), MockAttributeId(3) }, + }; + + size_t index = 0; + + for (app::AttributePathExpandIterator iter(&clusInfo1); iter.Get(path); iter.Next()) + { + ChipLogDetail(AppServer, "Visited Attribute: 0x%04" PRIX16 " / " ChipLogFormatMEI " / " ChipLogFormatMEI, path.mEndpointId, + ChipLogValueMEI(path.mClusterId), ChipLogValueMEI(path.mAttributeId)); + NL_TEST_ASSERT(apSuite, index < ArraySize(paths) && paths[index] == path); + index++; + } + NL_TEST_ASSERT(apSuite, index == ArraySize(paths)); +} + +static int TestSetup(void * inContext) +{ + return SUCCESS; +} + +/** + * Tear down the test suite. + */ +static int TestTeardown(void * inContext) +{ + return SUCCESS; +} + +/** + * Test Suite. It lists all the test functions. + */ + +// clang-format off +const nlTest sTests[] = +{ + NL_TEST_DEF("TestAllWildcard", TestAllWildcard), + NL_TEST_DEF("TestWildcardEndpoint", TestWildcardEndpoint), + NL_TEST_DEF("TestWildcardCluster", TestWildcardCluster), + NL_TEST_DEF("TestWildcardAttribute", TestWildcardAttribute), + NL_TEST_DEF("TestNoWildcard", TestNoWildcard), + NL_TEST_DEF("TestMultipleClusInfo", TestMultipleClusInfo), + NL_TEST_SENTINEL() +}; +// clang-format on + +// clang-format off +nlTestSuite sSuite = +{ + "TestAttributePathExpandIterator", + &sTests[0], + TestSetup, + TestTeardown, +}; +// clang-format on + +} // namespace + +int TestAttributePathExpandIterator() +{ + nlTestRunner(&sSuite, nullptr); + return (nlTestRunnerStats(&sSuite)); +} + +CHIP_REGISTER_TEST_SUITE(TestAttributePathExpandIterator) diff --git a/src/app/tests/suites/TestClusterComplexTypes.yaml b/src/app/tests/suites/TestClusterComplexTypes.yaml index 244b56dae38330..cc0312c49e67a6 100644 --- a/src/app/tests/suites/TestClusterComplexTypes.yaml +++ b/src/app/tests/suites/TestClusterComplexTypes.yaml @@ -528,3 +528,683 @@ tests: value: true - name: "originalValue" value: null + + # Nullable attributes + + # Tests for nullable Boolean attribute + + - label: "Write attribute NULLABLE_BOOLEAN null" + command: "writeAttribute" + attribute: "nullable_boolean" + arguments: + value: null + + - label: "Read attribute NULLABLE_BOOLEAN null" + command: "readAttribute" + attribute: "nullable_boolean" + response: + value: null + + - label: "Write attribute NULLABLE_BOOLEAN True" + command: "writeAttribute" + attribute: "nullable_boolean" + arguments: + value: true + + - label: "Read attribute NULLABLE_BOOLEAN True" + command: "readAttribute" + attribute: "nullable_boolean" + response: + value: true + + # Tests for nullable Bitmap8 attribute + + - label: "Write attribute NULLABLE_BITMAP8 Max Value" + command: "writeAttribute" + attribute: "nullable_bitmap8" + arguments: + value: 254 + + - label: "Read attribute NULLABLE_BITMAP8 Max Value" + command: "readAttribute" + attribute: "nullable_bitmap8" + response: + value: 254 + + - label: "Write attribute NULLABLE_BITMAP8 Invalid Value" + command: "writeAttribute" + attribute: "nullable_bitmap8" + arguments: + value: 255 + response: + error: 1 + + - label: "Read attribute NULLABLE_BITMAP8 unchanged Value" + command: "readAttribute" + attribute: "nullable_bitmap8" + response: + value: 254 + + - label: "Write attribute NULLABLE_BITMAP8 null Value" + command: "writeAttribute" + attribute: "nullable_bitmap8" + arguments: + value: null + + - label: "Read attribute NULLABLE_BITMAP8 null Value" + command: "readAttribute" + attribute: "nullable_bitmap8" + response: + value: null + + # Tests for nullable Bitmap16 attribute + + - label: "Write attribute NULLABLE_BITMAP16 Max Value" + command: "writeAttribute" + attribute: "nullable_bitmap16" + arguments: + value: 65534 + + - label: "Read attribute NULLABLE_BITMAP16 Max Value" + command: "readAttribute" + attribute: "nullable_bitmap16" + response: + value: 65534 + + - label: "Write attribute NULLABLE_BITMAP16 Invalid Value" + command: "writeAttribute" + attribute: "nullable_bitmap16" + arguments: + value: 65535 + response: + error: 1 + + - label: "Read attribute NULLABLE_BITMAP16 unchanged Value" + command: "readAttribute" + attribute: "nullable_bitmap16" + response: + value: 65534 + + - label: "Write attribute NULLABLE_BITMAP16 null Value" + command: "writeAttribute" + attribute: "nullable_bitmap16" + arguments: + value: null + + - label: "Read attribute NULLABLE_BITMAP16 null Value" + command: "readAttribute" + attribute: "nullable_bitmap16" + response: + value: null + + # Tests for nullable Bitmap32 attribute + + - label: "Write attribute NULLABLE_BITMAP32 Max Value" + command: "writeAttribute" + attribute: "nullable_bitmap32" + arguments: + value: 4294967294 + + - label: "Read attribute NULLABLE_BITMAP32 Max Value" + command: "readAttribute" + attribute: "nullable_bitmap32" + response: + value: 4294967294 + + - label: "Write attribute NULLABLE_BITMAP32 Invalid Value" + command: "writeAttribute" + attribute: "nullable_bitmap32" + arguments: + value: 4294967295 + response: + error: 1 + + - label: "Read attribute NULLABLE_BITMAP32 unchanged Value" + command: "readAttribute" + attribute: "nullable_bitmap32" + response: + value: 4294967294 + + - label: "Write attribute NULLABLE_BITMAP32 null Value" + command: "writeAttribute" + attribute: "nullable_bitmap32" + arguments: + value: null + + - label: "Read attribute NULLABLE_BITMAP32 null Value" + command: "readAttribute" + attribute: "nullable_bitmap32" + response: + value: null + + # Tests for nullable Bitmap64 attribute + + - label: "Write attribute NULLABLE_BITMAP64 Max Value" + command: "writeAttribute" + attribute: "nullable_bitmap64" + arguments: + value: "18446744073709551614" + + - label: "Read attribute NULLABLE_BITMAP64 Max Value" + command: "readAttribute" + attribute: "nullable_bitmap64" + response: + value: "18446744073709551614" + + - label: "Write attribute NULLABLE_BITMAP64 Invalid Value" + command: "writeAttribute" + attribute: "nullable_bitmap64" + arguments: + value: "18446744073709551615" + response: + error: 1 + + - label: "Read attribute NULLABLE_BITMAP64 unchanged Value" + command: "readAttribute" + attribute: "nullable_bitmap64" + response: + value: "18446744073709551614" + + - label: "Write attribute NULLABLE_BITMAP64 null Value" + command: "writeAttribute" + attribute: "nullable_bitmap64" + arguments: + value: null + + - label: "Read attribute NULLABLE_BITMAP64 null Value" + command: "readAttribute" + attribute: "nullable_bitmap64" + response: + value: null + + # Tests for UInt8 attribute + + - label: "Write attribute NULLABLE_INT8U Max Value" + command: "writeAttribute" + attribute: "nullable_int8u" + arguments: + value: 254 + + - label: "Read attribute NULLABLE_INT8U Max Value" + command: "readAttribute" + attribute: "nullable_int8u" + response: + value: 254 + + - label: "Write attribute NULLABLE_INT8U Invalid Value" + command: "writeAttribute" + attribute: "nullable_int8u" + arguments: + value: 255 + response: + error: 1 + + - label: "Read attribute NULLABLE_INT8U unchanged Value" + command: "readAttribute" + attribute: "nullable_int8u" + response: + value: 254 + + - label: "Write attribute NULLABLE_INT8U null Value" + command: "writeAttribute" + attribute: "nullable_int8u" + arguments: + value: null + + - label: "Read attribute NULLABLE_INT8U null Value" + command: "readAttribute" + attribute: "nullable_int8u" + response: + value: null + + # Tests for UInt16 attribute + + - label: "Write attribute NULLABLE_INT16U Max Value" + command: "writeAttribute" + attribute: "nullable_int16u" + arguments: + value: 65534 + + - label: "Read attribute NULLABLE_INT16U Max Value" + command: "readAttribute" + attribute: "nullable_int16u" + response: + value: 65534 + + - label: "Write attribute NULLABLE_INT16U Invalid Value" + command: "writeAttribute" + attribute: "nullable_int16u" + arguments: + value: 65535 + response: + error: 1 + + - label: "Read attribute NULLABLE_INT16U unchanged Value" + command: "readAttribute" + attribute: "nullable_int16u" + response: + value: 65534 + + - label: "Write attribute NULLABLE_INT16U null Value" + command: "writeAttribute" + attribute: "nullable_int16u" + arguments: + value: null + + - label: "Read attribute NULLABLE_INT16U null Value" + command: "readAttribute" + attribute: "nullable_int16u" + response: + value: null + + # Tests for UInt32 attribute + + - label: "Write attribute NULLABLE_INT32U Max Value" + command: "writeAttribute" + attribute: "nullable_int32u" + arguments: + value: 4294967294 + + - label: "Read attribute NULLABLE_INT32U Max Value" + command: "readAttribute" + attribute: "nullable_int32u" + response: + value: 4294967294 + + - label: "Write attribute NULLABLE_INT32U Invalid Value" + command: "writeAttribute" + attribute: "nullable_int32u" + arguments: + value: 4294967295 + response: + error: 1 + + - label: "Read attribute NULLABLE_INT32U unchanged Value" + command: "readAttribute" + attribute: "nullable_int32u" + response: + value: 4294967294 + + - label: "Write attribute NULLABLE_INT32U null Value" + command: "writeAttribute" + attribute: "nullable_int32u" + arguments: + value: null + + - label: "Read attribute NULLABLE_INT32U null Value" + command: "readAttribute" + attribute: "nullable_int32u" + response: + value: null + + # Tests for UInt64 attribute + + - label: "Write attribute NULLABLE_INT64U Max Value" + command: "writeAttribute" + attribute: "nullable_int64u" + arguments: + value: "18446744073709551614" + + - label: "Read attribute NULLABLE_INT64U Max Value" + command: "readAttribute" + attribute: "nullable_int64u" + response: + value: "18446744073709551614" + + - label: "Write attribute NULLABLE_INT64U Invalid Value" + command: "writeAttribute" + attribute: "nullable_int64u" + arguments: + value: "18446744073709551615" + response: + error: 1 + + - label: "Read attribute NULLABLE_INT64U unchanged Value" + command: "readAttribute" + attribute: "nullable_int64u" + response: + value: "18446744073709551614" + + - label: "Write attribute NULLABLE_INT64U null Value" + command: "writeAttribute" + attribute: "nullable_int64u" + arguments: + value: null + + - label: "Read attribute NULLABLE_INT64U null Value" + command: "readAttribute" + attribute: "nullable_int64u" + response: + value: null + + # Tests for Int8 attribute + + - label: "Write attribute NULLABLE_INT8S Min Value" + command: "writeAttribute" + attribute: "nullable_int8s" + arguments: + value: -127 + + - label: "Read attribute NULLABLE_INT8S Min Value" + command: "readAttribute" + attribute: "nullable_int8s" + response: + value: -127 + + - label: "Write attribute NULLABLE_INT8S Invalid Value" + command: "writeAttribute" + attribute: "nullable_int8s" + arguments: + value: -128 + response: + error: 1 + + - label: "Read attribute NULLABLE_INT8S unchanged Value" + command: "readAttribute" + attribute: "nullable_int8s" + response: + value: -127 + + - label: "Write attribute NULLABLE_INT8S null Value" + command: "writeAttribute" + attribute: "nullable_int8s" + arguments: + value: null + + - label: "Read attribute NULLABLE_INT8S null Value" + command: "readAttribute" + attribute: "nullable_int8s" + response: + value: null + + # Tests for Int16 attribute + + - label: "Write attribute NULLABLE_INT16S Min Value" + command: "writeAttribute" + attribute: "nullable_int16s" + arguments: + value: -32767 + + - label: "Read attribute NULLABLE_INT16S Min Value" + command: "readAttribute" + attribute: "nullable_int16s" + response: + value: -32767 + + - label: "Write attribute NULLABLE_INT16S Invalid Value" + command: "writeAttribute" + attribute: "nullable_int16s" + arguments: + value: -32768 + response: + error: 1 + + - label: "Read attribute NULLABLE_INT16S unchanged Value" + command: "readAttribute" + attribute: "nullable_int16s" + response: + value: -32767 + + - label: "Write attribute NULLABLE_INT16S null Value" + command: "writeAttribute" + attribute: "nullable_int16s" + arguments: + value: null + + - label: "Read attribute NULLABLE_INT16S null Value" + command: "readAttribute" + attribute: "nullable_int16s" + response: + value: null + + # Tests for Int32 attribute + + - label: "Write attribute NULLABLE_INT32S Min Value" + command: "writeAttribute" + attribute: "nullable_int32s" + arguments: + value: -2147483647 + + - label: "Read attribute NULLABLE_INT32S Min Value" + command: "readAttribute" + attribute: "nullable_int32s" + response: + value: -2147483647 + + - label: "Write attribute NULLABLE_INT32S Invalid Value" + command: "writeAttribute" + attribute: "nullable_int32s" + arguments: + value: -2147483648 + response: + error: 1 + + - label: "Read attribute NULLABLE_INT32S unchanged Value" + command: "readAttribute" + attribute: "nullable_int32s" + response: + value: -2147483647 + + - label: "Write attribute NULLABLE_INT32S null Value" + command: "writeAttribute" + attribute: "nullable_int32s" + arguments: + value: null + + - label: "Read attribute NULLABLE_INT32S null Value" + command: "readAttribute" + attribute: "nullable_int32s" + response: + value: null + + # Tests for Int64 attribute + + - label: "Write attribute NULLABLE_INT64S Min Value" + command: "writeAttribute" + attribute: "nullable_int64s" + arguments: + value: "-9223372036854775807" + + - label: "Read attribute NULLABLE_INT64S Min Value" + command: "readAttribute" + attribute: "nullable_int64s" + response: + value: "-9223372036854775807" + + - label: "Write attribute NULLABLE_INT64S Invalid Value" + command: "writeAttribute" + attribute: "nullable_int64s" + arguments: + # This is a nasty hack: -9223372036854775808 is not a valid way to + # write a long long in C++, leading to warnings. So this tries to + # work around that. + value: "-9223372036854775807LL - 1" + response: + error: 1 + + - label: "Read attribute NULLABLE_INT64S unchanged Value" + command: "readAttribute" + attribute: "nullable_int64s" + response: + value: "-9223372036854775807" + + - label: "Write attribute NULLABLE_INT64S null Value" + command: "writeAttribute" + attribute: "nullable_int64s" + arguments: + value: null + + - label: "Read attribute NULLABLE_INT64S null Value" + command: "readAttribute" + attribute: "nullable_int64s" + response: + value: null + + # Tests for Enum8 attribute + + - label: "Write attribute NULLABLE_ENUM8 Max Value" + command: "writeAttribute" + attribute: "nullable_enum8" + arguments: + value: 254 + + - label: "Read attribute NULLABLE_ENUM8 Max Value" + command: "readAttribute" + attribute: "nullable_enum8" + response: + value: 254 + + - label: "Write attribute NULLABLE_ENUM8 Invalid Value" + command: "writeAttribute" + attribute: "nullable_enum8" + arguments: + value: 255 + response: + error: 1 + + - label: "Read attribute NULLABLE_ENUM8 unchanged Value" + command: "readAttribute" + attribute: "nullable_enum8" + response: + value: 254 + + - label: "Write attribute NULLABLE_ENUM8 null Value" + command: "writeAttribute" + attribute: "nullable_enum8" + arguments: + value: null + + - label: "Read attribute NULLABLE_ENUM8 null Value" + command: "readAttribute" + attribute: "nullable_enum8" + response: + value: null + + # Tests for Enum16 attribute + + - label: "Write attribute NULLABLE_ENUM16 Max Value" + command: "writeAttribute" + attribute: "nullable_enum16" + arguments: + value: 65534 + + - label: "Read attribute NULLABLE_ENUM16 Max Value" + command: "readAttribute" + attribute: "nullable_enum16" + response: + value: 65534 + + - label: "Write attribute NULLABLE_ENUM16 Invalid Value" + command: "writeAttribute" + attribute: "nullable_enum16" + arguments: + value: 65535 + response: + error: 1 + + - label: "Read attribute NULLABLE_ENUM16 unchanged Value" + command: "readAttribute" + attribute: "nullable_enum16" + response: + value: 65534 + + - label: "Write attribute NULLABLE_ENUM16 null Value" + command: "writeAttribute" + attribute: "nullable_enum16" + arguments: + value: null + + - label: "Read attribute NULLABLE_ENUM16 null Value" + command: "readAttribute" + attribute: "nullable_enum16" + response: + value: null + + # Tests for Octet String attribute + + - label: "Read attribute NULLABLE_OCTET_STRING Default Value" + command: "readAttribute" + attribute: "nullable_octet_string" + response: + value: "" + + - label: "Write attribute NULLABLE_OCTET_STRING" + command: "writeAttribute" + attribute: "nullable_octet_string" + arguments: + value: "TestValue" + + - label: "Read attribute NULLABLE_OCTET_STRING" + command: "readAttribute" + attribute: "nullable_octet_string" + response: + value: "TestValue" + + - label: "Write attribute NULLABLE_OCTET_STRING" + command: "writeAttribute" + attribute: "nullable_octet_string" + arguments: + value: null + + - label: "Read attribute NULLABLE_OCTET_STRING" + command: "readAttribute" + attribute: "nullable_octet_string" + response: + value: null + + - label: "Write attribute NULLABLE_OCTET_STRING" + command: "writeAttribute" + attribute: "nullable_octet_string" + arguments: + value: "" + + - label: "Read attribute NULLABLE_OCTET_STRING" + command: "readAttribute" + attribute: "nullable_octet_string" + response: + value: "" + + # Tests for Char String attribute + + - label: "Read attribute NULLABLE_CHAR_STRING Default Value" + command: "readAttribute" + attribute: "nullable_char_string" + response: + value: "" + + - label: "Write attribute NULLABLE_CHAR_STRING" + command: "writeAttribute" + attribute: "nullable_char_string" + arguments: + value: "☉T☉" + + - label: "Read attribute NULLABLE_CHAR_STRING" + command: "readAttribute" + attribute: "nullable_char_string" + disabled: true + response: + value: "☉T☉" + + - label: "Write attribute NULLABLE_CHAR_STRING - Value too long" + command: "writeAttribute" + attribute: "nullable_char_string" + arguments: + value: null + + - label: "Read attribute NULLABLE_CHAR_STRING" + command: "readAttribute" + attribute: "nullable_char_string" + response: + value: null + + - label: "Write attribute NULLABLE_CHAR_STRING - Empty" + command: "writeAttribute" + attribute: "nullable_char_string" + arguments: + value: "" + + - label: "Read attribute NULLABLE_CHAR_STRING" + command: "readAttribute" + attribute: "nullable_char_string" + response: + value: "" diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index 94d70422ee3ca5..c730e07ef46992 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -17,20 +17,15 @@ name: PICS Items PICS: - label: "Does the device support discovery over Bluetooth Low Power (BLE)" id: BLE - value: false - label: "Does the device support discovery over WiFi?" id: WIFI - value: true - label: "Does the device support manufacturing date" id: MANF_DATE - value: true - label: "Does the device support part number" id: PART_NUM - value: true - label: "Does the device support Intermediate CA Certificate" id: DM_ICACERT - value: true diff --git a/src/app/tests/suites/certification/Test_TC_DM_1_3_Simulated.yaml b/src/app/tests/suites/certification/Test_TC_DM_1_3_Simulated.yaml index 393462dcb59588..a2892e38cfc38e 100644 --- a/src/app/tests/suites/certification/Test_TC_DM_1_3_Simulated.yaml +++ b/src/app/tests/suites/certification/Test_TC_DM_1_3_Simulated.yaml @@ -19,6 +19,10 @@ config: endpoint: 0 tests: + - label: "Wait for the device to be commissioned" + cluster: "DelayCommands" + command: "WaitForCommissioning" + - label: "Log OnOff Test Startup" cluster: "LogCommands" command: "Log" diff --git a/src/app/tests/suites/pics/BUILD.gn b/src/app/tests/suites/pics/BUILD.gn new file mode 100644 index 00000000000000..4517f460684977 --- /dev/null +++ b/src/app/tests/suites/pics/BUILD.gn @@ -0,0 +1,31 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") + +static_library("pics") { + output_name = "libPICS" + + sources = [ + "PICSBooleanExpressionParser.cpp", + "PICSBooleanExpressionParser.h", + "PICSBooleanReader.cpp", + "PICSBooleanReader.h", + ] + + cflags = [ "-Wconversion" ] + + public_deps = [ "${chip_root}/src/lib/support" ] +} diff --git a/src/app/tests/suites/pics/PICSBooleanExpressionParser.cpp b/src/app/tests/suites/pics/PICSBooleanExpressionParser.cpp new file mode 100644 index 00000000000000..15263b754ebfb6 --- /dev/null +++ b/src/app/tests/suites/pics/PICSBooleanExpressionParser.cpp @@ -0,0 +1,167 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "PICSBooleanExpressionParser.h" + +#include + +bool PICSBooleanExpressionParser::Eval(std::string expression, std::map & PICS) +{ + std::vector tokens; + uint8_t index = 0; + + Tokenize(expression, tokens); + return EvaluateExpression(tokens, PICS, index); +} + +void PICSBooleanExpressionParser::Tokenize(std::string & expression, std::vector & tokens) +{ + if (expression.empty()) + { + return; + } + + std::string s; + + for (size_t i = 0; i < expression.size(); i++) + { + char c = expression[i]; + switch (c) + { + case ' ': + case '\n': + case '\t': + if (s.empty()) + { + continue; + } + break; + + case '(': + case ')': + case '!': + if (!s.empty() > 0) + { + tokens.push_back(s); + s.clear(); + } + + tokens.push_back(std::string(1, c)); + break; + + case '&': + case '|': + if (!s.empty() && s.back() == c) + { + s.pop_back(); + if (s.size()) + { + tokens.push_back(s); + s.clear(); + } + + tokens.push_back(std::string(1, c) + std::string(1, c)); + break; + } + + s.push_back(c); + break; + + default: + s.push_back(c); + break; + } + } + + if (s.size()) + { + tokens.push_back(s); + } +} + +bool PICSBooleanExpressionParser::EvaluateExpression(std::vector & tokens, std::map & PICS, + uint8_t & index) +{ + bool leftExpr = EvaluateSubExpression(tokens, PICS, index); + if (index >= tokens.size()) + { + return leftExpr; + } + + if (tokens[index] == ")") + { + return leftExpr; + } + + std::string token = tokens[index]; + if (token == "&&") + { + index++; + bool rightExpr = EvaluateExpression(tokens, PICS, index); + return leftExpr && rightExpr; + } + else if (token == "||") + { + index++; + bool rightExpr = EvaluateExpression(tokens, PICS, index); + return leftExpr || rightExpr; + } + else + { + ChipLogError(chipTool, "Unknown token: '%s'", token.c_str()); + abort(); + } +} + +bool PICSBooleanExpressionParser::EvaluateSubExpression(std::vector & tokens, std::map & PICS, + uint8_t & index) +{ + std::string token = tokens[index]; + if (token == "(") + { + index++; + bool expr = EvaluateExpression(tokens, PICS, index); + if (tokens[index] != ")") + { + ChipLogError(chipTool, "Missing ')'"); + abort(); + } + + index++; + return expr; + } + else if (token == "!") + { + index++; + bool expr = EvaluateSubExpression(tokens, PICS, index); + return !expr; + } + else + { + index++; + + if (PICS.find(token) == PICS.end()) + { + // By default, let's consider that if a PICS item is not defined, it is |false|. + // It allows to create a file that only contains enabled features. + return false; + } + + return PICS[token]; + } +} diff --git a/src/app/tests/suites/pics/PICSBooleanExpressionParser.h b/src/app/tests/suites/pics/PICSBooleanExpressionParser.h new file mode 100644 index 00000000000000..a9ecd8b36713b5 --- /dev/null +++ b/src/app/tests/suites/pics/PICSBooleanExpressionParser.h @@ -0,0 +1,48 @@ +/** + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @brief Declaration of PICS Boolean Expression parser, a class that + * implements PICS condition parsing for YAML tests. + */ + +#include +#include +#include + +class PICSBooleanExpressionParser +{ +public: + /** + * @brief + * This function returns a boolean which is the result of evaluating the + * boolean logic expressed into the PICS expression. + * + * @param [in] expression An expression containing PICS code such as + * "!DT_CTRL_CONCATENATED_QR_CODE_1 && DT_CTRL_CONCATENATED_QR_CODE_2" + * @param [in] PICS A map of enabled/disabled PICS code + * + * @returns A boolean as the result of evaluating the expression. + */ + static bool Eval(std::string expression, std::map & PICS); + +private: + static void Tokenize(std::string & expression, std::vector & tokens); + static bool EvaluateExpression(std::vector & tokens, std::map & PICS, uint8_t & index); + static bool EvaluateSubExpression(std::vector & tokens, std::map & PICS, uint8_t & index); +}; diff --git a/src/app/tests/suites/pics/PICSBooleanReader.cpp b/src/app/tests/suites/pics/PICSBooleanReader.cpp new file mode 100644 index 00000000000000..909f68aa3b4bdf --- /dev/null +++ b/src/app/tests/suites/pics/PICSBooleanReader.cpp @@ -0,0 +1,74 @@ +/** + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "PICSBooleanReader.h" + +#include + +#include +#include + +std::map PICSBooleanReader::Read(std::string filepath) +{ + std::ifstream f(filepath); + if (!f.is_open()) + { + ChipLogError(chipTool, "Error reading: %s", filepath.c_str()); + abort(); + } + + std::map PICS; + std::string line; + std::string key; + std::string value; + uint16_t lineNumber = 0; + while (std::getline(f, line)) + { + if (line.empty()) + { + continue; + } + + std::stringstream ss(line); + + std::getline(ss, key, '='); + if (key.empty()) + { + ChipLogError(chipTool, "Missing PICS key at line %u", lineNumber + 1); + abort(); + } + + std::getline(ss, value); + if (value == "0") + { + PICS[key] = false; + } + else if (value == "1") + { + PICS[key] = true; + } + else + { + ChipLogError(chipTool, "%s: PICS value should be either '0' or '1', got '%s'", key.c_str(), value.c_str()); + abort(); + } + + lineNumber++; + } + + return PICS; +} diff --git a/src/app/tests/suites/pics/PICSBooleanReader.h b/src/app/tests/suites/pics/PICSBooleanReader.h new file mode 100644 index 00000000000000..6f8e240c6678f1 --- /dev/null +++ b/src/app/tests/suites/pics/PICSBooleanReader.h @@ -0,0 +1,31 @@ +/** + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @brief Declaration of PICS Boolean Reader, a class that read and parse + * a file with PICS Code and their enabled/disabled state. + */ + +#include +#include + +class PICSBooleanReader +{ +public: + static std::map Read(std::string filepath); +}; diff --git a/src/app/util/af-types.h b/src/app/util/af-types.h index 4c81c8c219ba7b..570a77d0a508ef 100644 --- a/src/app/util/af-types.h +++ b/src/app/util/af-types.h @@ -164,12 +164,31 @@ union EmberAfDefaultOrMinMaxAttributeValue EmberAfAttributeMinMaxValue * ptrToMinMaxValue; }; +// Attribute masks modify how attributes are used by the framework +// +// Attribute that has this mask is NOT read-only +#define ATTRIBUTE_MASK_WRITABLE (0x01) +// Attribute that has this mask is saved to a token +#define ATTRIBUTE_MASK_TOKENIZE (0x02) +// Attribute that has this mask has a min/max values +#define ATTRIBUTE_MASK_MIN_MAX (0x04) +// Manufacturer specific attribute +#define ATTRIBUTE_MASK_MANUFACTURER_SPECIFIC (0x08) +// Attribute deferred to external storage +#define ATTRIBUTE_MASK_EXTERNAL_STORAGE (0x10) +// Attribute is singleton +#define ATTRIBUTE_MASK_SINGLETON (0x20) +// Attribute is a client attribute +#define ATTRIBUTE_MASK_CLIENT (0x40) +// Attribute is nullable +#define ATTRIBUTE_MASK_NULLABLE (0x80) + /** * @brief Each attribute has it's metadata stored in such struct. * * There is only one of these per attribute across all endpoints. */ -typedef struct +struct EmberAfAttributeMetadata { /** * Attribute ID, according to ZCL specs. @@ -185,8 +204,7 @@ typedef struct uint16_t size; /** * Attribute mask, tagging attribute with specific - * functionality. See ATTRIBUTE_MASK_ macros defined - * in att-storage.h. + * functionality. */ EmberAfAttributeMask mask; /** @@ -194,7 +212,12 @@ typedef struct * depends on the mask. */ EmberAfDefaultOrMinMaxAttributeValue defaultValue; -} EmberAfAttributeMetadata; + + /** + * Check whether this attribute is nullable. + */ + bool IsNullable() const { return mask & ATTRIBUTE_MASK_NULLABLE; } +}; /** * @brief Struct describing cluster diff --git a/src/app/util/attribute-storage-null-handling.h b/src/app/util/attribute-storage-null-handling.h new file mode 100644 index 00000000000000..b7a6d908fac6b3 --- /dev/null +++ b/src/app/util/attribute-storage-null-handling.h @@ -0,0 +1,72 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include + +namespace chip { +namespace app { + +template +struct NumericAttributeTraits +{ + // StorageType is the type used to represent this C++ type in the attribute + // store. + using StorageType = T; + + // The value reserved in the value space of StorageType to represent null, + // for cases when we have a nullable value. This value must match the value + // excluded from the valid value range in the spec, so that we don't confuse + // valid values with null. + static constexpr StorageType kNullValue = + std::is_signed::value ? std::numeric_limits::min() : std::numeric_limits::max(); + + static constexpr bool IsNullValue(StorageType value) { return value == kNullValue; } + + // Test whether a value can be represented in a "not null" value of the + // given type, which may be a nullable value or not. This needs to be + // implemented for both T and StorageType if the two are distinct. + static constexpr bool CanRepresentValue(bool isNullable, T value) + { + // For now, allow the null-marker value for non-nullable types. It's + // not what the spec says to do at the moment, but that might well + // change, and we have quite a number of tests relying on this behavior + // for now that we should only change once the spec really decides what + // it's doing. + return !isNullable || !IsNullValue(value); + } +}; + +template <> +struct NumericAttributeTraits +{ + using StorageType = uint8_t; + static constexpr StorageType kNullValue = 0xFF; + static constexpr bool IsNullValue(StorageType value) { return value == kNullValue; } + static constexpr bool CanRepresentValue(bool isNullable, StorageType value) + { + // This treats all nonzero values (except the null value) as true. + return !IsNullValue(value); + } + static constexpr bool CanRepresentValue(bool isNullable, bool value) { return true; } +}; + +} // namespace app +} // namespace chip diff --git a/src/app/util/attribute-storage.cpp b/src/app/util/attribute-storage.cpp index fedddb9ea5a572..6d435f5ead7b89 100644 --- a/src/app/util/attribute-storage.cpp +++ b/src/app/util/attribute-storage.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -1150,6 +1151,19 @@ EmberAfCluster * emberAfGetNthCluster(EndpointId endpoint, uint8_t n, bool serve return NULL; } +// Returns the cluster id of Nth server or client cluster, +// depending on server toggle. +// Returns Optional::Missing() if cluster does not exist. +Optional emberAfGetNthClusterId(EndpointId endpoint, uint8_t n, bool server) +{ + EmberAfCluster * cluster = emberAfGetNthCluster(endpoint, n, server); + if (cluster == nullptr) + { + return Optional::Missing(); + } + return Optional(cluster->clusterId); +} + // Returns number of clusters put into the passed cluster list // for the given endpoint and client/server polarity uint8_t emberAfGetClustersFromEndpoint(EndpointId endpoint, ClusterId * clusterList, uint8_t listLen, bool server) @@ -1364,3 +1378,36 @@ app::AttributeAccessInterface * findAttributeAccessOverride(EndpointId endpointI return nullptr; } + +uint16_t emberAfGetServerAttributeCount(chip::EndpointId endpoint, chip::ClusterId cluster) +{ + EmberAfCluster * clusterObj = emberAfFindCluster(endpoint, cluster, CLUSTER_MASK_SERVER); + VerifyOrReturnError(clusterObj != nullptr, 0); + return clusterObj->attributeCount; +} + +uint16_t emberAfGetServerAttributeIndexByAttributeId(chip::EndpointId endpoint, chip::ClusterId cluster, + chip::AttributeId attributeId) +{ + EmberAfCluster * clusterObj = emberAfFindCluster(endpoint, cluster, CLUSTER_MASK_SERVER); + VerifyOrReturnError(clusterObj != nullptr, UINT16_MAX); + + for (uint16_t i = 0; i < clusterObj->attributeCount; i++) + { + if (clusterObj->attributes[i].attributeId == attributeId) + { + return i; + } + } + return UINT16_MAX; +} + +Optional emberAfGetServerAttributeIdByIndex(EndpointId endpoint, ClusterId cluster, uint16_t attributeIndex) +{ + EmberAfCluster * clusterObj = emberAfFindCluster(endpoint, cluster, CLUSTER_MASK_SERVER); + if (clusterObj == nullptr || clusterObj->attributeCount <= attributeIndex) + { + return Optional::Missing(); + } + return Optional(clusterObj->attributes[attributeIndex].attributeId); +} diff --git a/src/app/util/attribute-storage.h b/src/app/util/attribute-storage.h index 641412b92f1833..e843a50a9cc298 100644 --- a/src/app/util/attribute-storage.h +++ b/src/app/util/attribute-storage.h @@ -151,10 +151,15 @@ uint8_t emberAfClusterIndex(chip::EndpointId endpoint, chip::ClusterId clusterId // otherwise number of client clusters on this endpoint uint8_t emberAfClusterCount(chip::EndpointId endpoint, bool server); -// Returns the clusterId of Nth server or client cluster, +// Returns the cluster of Nth server or client cluster, // depending on server toggle. EmberAfCluster * emberAfGetNthCluster(chip::EndpointId endpoint, uint8_t n, bool server); +// Returns the clusterId of Nth server or client cluster, +// depending on server toggle. +// Returns Optional::Missing if cluster does not exist. +chip::Optional emberAfGetNthClusterId(chip::EndpointId endpoint, uint8_t n, bool server); + // Returns number of clusters put into the passed cluster list // for the given endpoint and client/server polarity uint8_t emberAfGetClustersFromEndpoint(chip::EndpointId endpoint, chip::ClusterId * clusterList, uint8_t listLen, bool server); @@ -242,7 +247,7 @@ bool emberAfEndpointIsEnabled(chip::EndpointId endpoint); // and those indexes may be DIFFERENT than the indexes returned from // emberAfGetNthCluster(). In other words: // -// - Use emberAfGetClustersFromEndpoint() with emberAfGetNthCluster() +// - Use emberAfGetClustersFromEndpoint() with emberAfGetNthCluster() emberAfGetNthClusterId() // - Use emberAfGetClusterCountForEndpoint() with emberAfGetClusterByIndex() // // Don't mix them. @@ -255,6 +260,21 @@ EmberAfStatus emberAfSetDynamicEndpoint(uint16_t index, chip::EndpointId id, Emb chip::EndpointId emberAfClearDynamicEndpoint(uint16_t index); uint16_t emberAfGetDynamicIndexFromEndpoint(chip::EndpointId id); +// Get the number of attributes of the specific cluster under the endpoint. +// Returns 0 if the cluster does not exist. +uint16_t emberAfGetServerAttributeCount(chip::EndpointId endpoint, chip::ClusterId cluster); + +// Get the index of the given attribute of the specific cluster under the endpoint. +// Returns UINT16_MAX if the attribute does not exist. +uint16_t emberAfGetServerAttributeIndexByAttributeId(chip::EndpointId endpoint, chip::ClusterId cluster, + chip::AttributeId attributeId); + +// Get the attribute id at the attributeIndex of the cluster under the endpoint. This function is useful for iterating over the +// attributes. +// Returns Optional::Missing() if the attribute does not exist. +chip::Optional emberAfGetServerAttributeIdByIndex(chip::EndpointId endpoint, chip::ClusterId cluster, + uint16_t attributeIndex); + /** * Register an attribute access override. It will remain registered until * the endpoint it's registered for is disabled (or until shutdown if it's diff --git a/src/app/util/ember-compatibility-functions.cpp b/src/app/util/ember-compatibility-functions.cpp index ea1c7210754823..949dd6703c6745 100644 --- a/src/app/util/ember-compatibility-functions.cpp +++ b/src/app/util/ember-compatibility-functions.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -45,6 +46,8 @@ #include +#include + using namespace chip; using namespace chip::app; using namespace chip::app::Compatibility; @@ -178,7 +181,27 @@ void ResetEmberAfObjects() namespace { // Common buffer for ReadSingleClusterData & WriteSingleClusterData uint8_t attributeData[kAttributeReadBufferSize]; -} // namespace + +template +CHIP_ERROR attributeBufferToNumericTlvData(TLV::TLVWriter & writer, bool isNullable) +{ + typename NumericAttributeTraits::StorageType value; + memcpy(&value, attributeData, sizeof(value)); + TLV::Tag tag = TLV::ContextTag(to_underlying(AttributeDataIB::Tag::kData)); + if (isNullable && NumericAttributeTraits::IsNullValue(value)) + { + return writer.PutNull(tag); + } + + if (!NumericAttributeTraits::CanRepresentValue(isNullable, value)) + { + return CHIP_ERROR_INCORRECT_STATE; + } + + return writer.Put(tag, static_cast(value)); +} + +} // anonymous namespace bool ServerClusterCommandExists(const ConcreteCommandPath & aCommandPath) { @@ -227,123 +250,151 @@ CHIP_ERROR ReadSingleClusterData(FabricIndex aAccessingFabricIndex, const Concre } } - EmberAfAttributeType attributeType; - EmberAfStatus emberStatus = EMBER_ZCL_STATUS_SUCCESS; - emberStatus = emberAfReadAttribute(aPath.mEndpointId, aPath.mClusterId, aPath.mAttributeId, CLUSTER_MASK_SERVER, attributeData, - sizeof(attributeData), &attributeType); + EmberAfAttributeMetadata * metadata = NULL; + EmberAfAttributeSearchRecord record; + record.endpoint = aPath.mEndpointId; + record.clusterId = aPath.mClusterId; + record.clusterMask = CLUSTER_MASK_SERVER; + record.attributeId = aPath.mAttributeId; + record.manufacturerCode = EMBER_AF_NULL_MANUFACTURER_CODE; + EmberAfStatus emberStatus = emAfReadOrWriteAttribute(&record, &metadata, attributeData, sizeof(attributeData), + /* write = */ false); if (emberStatus == EMBER_ZCL_STATUS_SUCCESS) { - writer = attributeDataIBBuilder.GetWriter(); + EmberAfAttributeType attributeType = metadata->attributeType; + bool isNullable = metadata->IsNullable(); + writer = attributeDataIBBuilder.GetWriter(); VerifyOrReturnError(writer != nullptr, CHIP_NO_ERROR); - // TODO: ZCL_STRUCT_ATTRIBUTE_TYPE is not included in this switch case currently, should add support for structures. + TLV::Tag tag = TLV::ContextTag(to_underlying(AttributeDataIB::Tag::kData)); switch (BaseType(attributeType)) { case ZCL_NO_DATA_ATTRIBUTE_TYPE: // No data - ReturnErrorOnFailure(writer->PutNull(TLV::ContextTag(to_underlying(AttributeDataIB::Tag::kData)))); + ReturnErrorOnFailure(writer->PutNull(tag)); break; case ZCL_BOOLEAN_ATTRIBUTE_TYPE: // Boolean - ReturnErrorOnFailure( - writer->PutBoolean(TLV::ContextTag(to_underlying(AttributeDataIB::Tag::kData)), !!attributeData[0])); + ReturnErrorOnFailure(attributeBufferToNumericTlvData(*writer, isNullable)); break; case ZCL_INT8U_ATTRIBUTE_TYPE: // Unsigned 8-bit integer - ReturnErrorOnFailure(writer->Put(TLV::ContextTag(to_underlying(AttributeDataIB::Tag::kData)), attributeData[0])); + ReturnErrorOnFailure(attributeBufferToNumericTlvData(*writer, isNullable)); break; case ZCL_INT16U_ATTRIBUTE_TYPE: // Unsigned 16-bit integer { - uint16_t uint16_data; - memcpy(&uint16_data, attributeData, sizeof(uint16_data)); - ReturnErrorOnFailure(writer->Put(TLV::ContextTag(to_underlying(AttributeDataIB::Tag::kData)), uint16_data)); + ReturnErrorOnFailure(attributeBufferToNumericTlvData(*writer, isNullable)); break; } case ZCL_INT32U_ATTRIBUTE_TYPE: // Unsigned 32-bit integer { - uint32_t uint32_data; - memcpy(&uint32_data, attributeData, sizeof(uint32_data)); - ReturnErrorOnFailure(writer->Put(TLV::ContextTag(to_underlying(AttributeDataIB::Tag::kData)), uint32_data)); + ReturnErrorOnFailure(attributeBufferToNumericTlvData(*writer, isNullable)); break; } case ZCL_INT64U_ATTRIBUTE_TYPE: // Unsigned 64-bit integer { - uint64_t uint64_data; - memcpy(&uint64_data, attributeData, sizeof(uint64_data)); - ReturnErrorOnFailure(writer->Put(TLV::ContextTag(to_underlying(AttributeDataIB::Tag::kData)), uint64_data)); + ReturnErrorOnFailure(attributeBufferToNumericTlvData(*writer, isNullable)); break; } case ZCL_INT8S_ATTRIBUTE_TYPE: // Signed 8-bit integer { - int8_t int8_data; - memcpy(&int8_data, attributeData, sizeof(int8_data)); - ReturnErrorOnFailure(writer->Put(TLV::ContextTag(to_underlying(AttributeDataIB::Tag::kData)), int8_data)); + ReturnErrorOnFailure(attributeBufferToNumericTlvData(*writer, isNullable)); break; } case ZCL_INT16S_ATTRIBUTE_TYPE: // Signed 16-bit integer { - int16_t int16_data; - memcpy(&int16_data, attributeData, sizeof(int16_data)); - ReturnErrorOnFailure(writer->Put(TLV::ContextTag(to_underlying(AttributeDataIB::Tag::kData)), int16_data)); + ReturnErrorOnFailure(attributeBufferToNumericTlvData(*writer, isNullable)); break; } case ZCL_INT32S_ATTRIBUTE_TYPE: // Signed 32-bit integer { - int32_t int32_data; - memcpy(&int32_data, attributeData, sizeof(int32_data)); - ReturnErrorOnFailure(writer->Put(TLV::ContextTag(to_underlying(AttributeDataIB::Tag::kData)), int32_data)); + ReturnErrorOnFailure(attributeBufferToNumericTlvData(*writer, isNullable)); break; } case ZCL_INT64S_ATTRIBUTE_TYPE: // Signed 64-bit integer { - int64_t int64_data; - memcpy(&int64_data, attributeData, sizeof(int64_data)); - ReturnErrorOnFailure(writer->Put(TLV::ContextTag(to_underlying(AttributeDataIB::Tag::kData)), int64_data)); + ReturnErrorOnFailure(attributeBufferToNumericTlvData(*writer, isNullable)); break; } case ZCL_CHAR_STRING_ATTRIBUTE_TYPE: // Char string { char * actualData = reinterpret_cast(attributeData + 1); uint8_t dataLength = attributeData[0]; - if (dataLength == 0xFF /* invalid data, put empty value instead */) + if (dataLength == 0xFF) + { + if (isNullable) + { + ReturnErrorOnFailure(writer->PutNull(tag)); + } + else + { + return CHIP_ERROR_INCORRECT_STATE; + } + } + else { - dataLength = 0; + ReturnErrorOnFailure(writer->PutString(tag, actualData, dataLength)); } - ReturnErrorOnFailure( - writer->PutString(TLV::ContextTag(to_underlying(AttributeDataIB::Tag::kData)), actualData, dataLength)); break; } case ZCL_LONG_CHAR_STRING_ATTRIBUTE_TYPE: { char * actualData = reinterpret_cast(attributeData + 2); // The pascal string contains 2 bytes length uint16_t dataLength; memcpy(&dataLength, attributeData, sizeof(dataLength)); - if (dataLength == 0xFFFF /* invalid data, put empty value instead */) + if (dataLength == 0xFFFF) + { + if (isNullable) + { + ReturnErrorOnFailure(writer->PutNull(tag)); + } + else + { + return CHIP_ERROR_INCORRECT_STATE; + } + } + else { - dataLength = 0; + ReturnErrorOnFailure(writer->PutString(tag, actualData, dataLength)); } - ReturnErrorOnFailure( - writer->PutString(TLV::ContextTag(to_underlying(AttributeDataIB::Tag::kData)), actualData, dataLength)); break; } case ZCL_OCTET_STRING_ATTRIBUTE_TYPE: // Octet string { uint8_t * actualData = attributeData + 1; uint8_t dataLength = attributeData[0]; - if (dataLength == 0xFF /* invalid data, put empty value instead */) + if (dataLength == 0xFF) + { + if (isNullable) + { + ReturnErrorOnFailure(writer->PutNull(tag)); + } + else + { + return CHIP_ERROR_INCORRECT_STATE; + } + } + else { - dataLength = 0; + ReturnErrorOnFailure(writer->Put(tag, chip::ByteSpan(actualData, dataLength))); } - ReturnErrorOnFailure( - writer->Put(TLV::ContextTag(to_underlying(AttributeDataIB::Tag::kData)), chip::ByteSpan(actualData, dataLength))); break; } case ZCL_LONG_OCTET_STRING_ATTRIBUTE_TYPE: { uint8_t * actualData = attributeData + 2; // The pascal string contains 2 bytes length uint16_t dataLength; memcpy(&dataLength, attributeData, sizeof(dataLength)); - if (dataLength == 0xFFFF /* invalid data, put empty value instead */) + if (dataLength == 0xFFFF) + { + if (isNullable) + { + ReturnErrorOnFailure(writer->PutNull(tag)); + } + else + { + return CHIP_ERROR_INCORRECT_STATE; + } + } + else { - dataLength = 0; + ReturnErrorOnFailure(writer->Put(tag, chip::ByteSpan(actualData, dataLength))); } - ReturnErrorOnFailure( - writer->Put(TLV::ContextTag(to_underlying(AttributeDataIB::Tag::kData)), chip::ByteSpan(actualData, dataLength))); break; } case ZCL_ARRAY_ATTRIBUTE_TYPE: { @@ -400,63 +451,90 @@ CHIP_ERROR ReadSingleClusterData(FabricIndex aAccessingFabricIndex, const Concre } namespace { + template -CHIP_ERROR numericTlvDataToAttributeBuffer(TLV::TLVReader & aReader, uint16_t & dataLen) +CHIP_ERROR numericTlvDataToAttributeBuffer(TLV::TLVReader & aReader, bool isNullable, uint16_t & dataLen) { - T value; + typename NumericAttributeTraits::StorageType value; static_assert(sizeof(value) <= sizeof(attributeData), "Value cannot fit into attribute data"); - ReturnErrorOnFailure(aReader.Get(value)); + if (isNullable && aReader.GetType() == TLV::kTLVType_Null) + { + value = NumericAttributeTraits::kNullValue; + } + else + { + T val; + ReturnErrorOnFailure(aReader.Get(val)); + VerifyOrReturnError(NumericAttributeTraits::CanRepresentValue(isNullable, val), CHIP_ERROR_INVALID_ARGUMENT); + value = val; + } dataLen = sizeof(value); memcpy(attributeData, &value, sizeof(value)); return CHIP_NO_ERROR; } + template -CHIP_ERROR stringTlvDataToAttributeBuffer(TLV::TLVReader & aReader, uint16_t & dataLen) +CHIP_ERROR stringTlvDataToAttributeBuffer(TLV::TLVReader & aReader, bool isOctetString, bool isNullable, uint16_t & dataLen) { const uint8_t * data = nullptr; T len; - VerifyOrReturnError(aReader.GetType() == TLV::TLVType::kTLVType_ByteString || - aReader.GetType() == TLV::TLVType::kTLVType_UTF8String, - CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(CanCastTo(aReader.GetLength()), CHIP_ERROR_MESSAGE_TOO_LONG); - ReturnErrorOnFailure(aReader.GetDataPtr(data)); - len = static_cast(aReader.GetLength()); - VerifyOrReturnError(len + sizeof(len) /* length at the beginning of data */ <= sizeof(attributeData), - CHIP_ERROR_MESSAGE_TOO_LONG); - memcpy(&attributeData[0], &len, sizeof(len)); - memcpy(&attributeData[sizeof(len)], data, len); - dataLen = static_cast(len + sizeof(len)); + if (isNullable && aReader.GetType() == TLV::kTLVType_Null) + { + // Null is represented by an 0xFF or 0xFFFF length, respectively. + len = std::numeric_limits::max(); + memcpy(&attributeData[0], &len, sizeof(len)); + dataLen = sizeof(len); + } + else + { + VerifyOrReturnError((isOctetString && aReader.GetType() == TLV::TLVType::kTLVType_ByteString) || + (!isOctetString && aReader.GetType() == TLV::TLVType::kTLVType_UTF8String), + CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(CanCastTo(aReader.GetLength()), CHIP_ERROR_MESSAGE_TOO_LONG); + ReturnErrorOnFailure(aReader.GetDataPtr(data)); + len = static_cast(aReader.GetLength()); + VerifyOrReturnError(len != std::numeric_limits::max(), CHIP_ERROR_MESSAGE_TOO_LONG); + VerifyOrReturnError(len + sizeof(len) /* length at the beginning of data */ <= sizeof(attributeData), + CHIP_ERROR_MESSAGE_TOO_LONG); + memcpy(&attributeData[0], &len, sizeof(len)); + memcpy(&attributeData[sizeof(len)], data, len); + dataLen = static_cast(len + sizeof(len)); + } return CHIP_NO_ERROR; } -CHIP_ERROR prepareWriteData(EmberAfAttributeType expectedType, TLV::TLVReader & aReader, uint16_t & dataLen) +CHIP_ERROR prepareWriteData(const EmberAfAttributeMetadata * metadata, TLV::TLVReader & aReader, uint16_t & dataLen) { - switch (BaseType(expectedType)) + EmberAfAttributeType expectedType = BaseType(metadata->attributeType); + bool isNullable = metadata->IsNullable(); + switch (expectedType) { case ZCL_BOOLEAN_ATTRIBUTE_TYPE: // Boolean - return numericTlvDataToAttributeBuffer(aReader, dataLen); + return numericTlvDataToAttributeBuffer(aReader, isNullable, dataLen); case ZCL_INT8U_ATTRIBUTE_TYPE: // Unsigned 8-bit integer - return numericTlvDataToAttributeBuffer(aReader, dataLen); + return numericTlvDataToAttributeBuffer(aReader, isNullable, dataLen); case ZCL_INT16U_ATTRIBUTE_TYPE: // Unsigned 16-bit integer - return numericTlvDataToAttributeBuffer(aReader, dataLen); + return numericTlvDataToAttributeBuffer(aReader, isNullable, dataLen); case ZCL_INT32U_ATTRIBUTE_TYPE: // Unsigned 32-bit integer - return numericTlvDataToAttributeBuffer(aReader, dataLen); + return numericTlvDataToAttributeBuffer(aReader, isNullable, dataLen); case ZCL_INT64U_ATTRIBUTE_TYPE: // Unsigned 64-bit integer - return numericTlvDataToAttributeBuffer(aReader, dataLen); + return numericTlvDataToAttributeBuffer(aReader, isNullable, dataLen); case ZCL_INT8S_ATTRIBUTE_TYPE: // Signed 8-bit integer - return numericTlvDataToAttributeBuffer(aReader, dataLen); + return numericTlvDataToAttributeBuffer(aReader, isNullable, dataLen); case ZCL_INT16S_ATTRIBUTE_TYPE: // Signed 16-bit integer - return numericTlvDataToAttributeBuffer(aReader, dataLen); + return numericTlvDataToAttributeBuffer(aReader, isNullable, dataLen); case ZCL_INT32S_ATTRIBUTE_TYPE: // Signed 32-bit integer - return numericTlvDataToAttributeBuffer(aReader, dataLen); + return numericTlvDataToAttributeBuffer(aReader, isNullable, dataLen); case ZCL_INT64S_ATTRIBUTE_TYPE: // Signed 64-bit integer - return numericTlvDataToAttributeBuffer(aReader, dataLen); + return numericTlvDataToAttributeBuffer(aReader, isNullable, dataLen); case ZCL_OCTET_STRING_ATTRIBUTE_TYPE: // Octet string case ZCL_CHAR_STRING_ATTRIBUTE_TYPE: // Char string - return stringTlvDataToAttributeBuffer(aReader, dataLen); + return stringTlvDataToAttributeBuffer(aReader, expectedType == ZCL_OCTET_STRING_ATTRIBUTE_TYPE, isNullable, + dataLen); case ZCL_LONG_OCTET_STRING_ATTRIBUTE_TYPE: // Long octet string case ZCL_LONG_CHAR_STRING_ATTRIBUTE_TYPE: // Long char string - return stringTlvDataToAttributeBuffer(aReader, dataLen); + return stringTlvDataToAttributeBuffer(aReader, expectedType == ZCL_LONG_OCTET_STRING_ATTRIBUTE_TYPE, isNullable, + dataLen); default: ChipLogError(DataManagement, "Attribute type %x not handled", static_cast(expectedType)); return CHIP_ERROR_INVALID_DATA_LIST; @@ -479,9 +557,9 @@ static Protocols::InteractionModel::Status WriteSingleClusterDataInternal(Cluste CHIP_ERROR preparationError = CHIP_NO_ERROR; uint16_t dataLen = 0; - if ((preparationError = prepareWriteData(attributeMetadata->attributeType, aReader, dataLen)) != CHIP_NO_ERROR) + if ((preparationError = prepareWriteData(attributeMetadata, aReader, dataLen)) != CHIP_NO_ERROR) { - ChipLogDetail(Zcl, "Failed to preapre data to write: %s", ErrorStr(preparationError)); + ChipLogDetail(Zcl, "Failed to prepare data to write: %s", ErrorStr(preparationError)); return Protocols::InteractionModel::Status::InvalidValue; } diff --git a/src/app/util/mock/BUILD.gn b/src/app/util/mock/BUILD.gn new file mode 100644 index 00000000000000..4ffcbf1c85034d --- /dev/null +++ b/src/app/util/mock/BUILD.gn @@ -0,0 +1,27 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") + +source_set("mock_ember") { + sources = [ "attribute-storage.cpp" ] + + public_deps = [ + "${chip_root}/src/app", + "${chip_root}/src/lib/core", + "${chip_root}/src/lib/support", + ] + + cflags = [ "-Wconversion" ] +} diff --git a/src/app/util/mock/Constants.h b/src/app/util/mock/Constants.h new file mode 100644 index 00000000000000..2c515c8ebf1e95 --- /dev/null +++ b/src/app/util/mock/Constants.h @@ -0,0 +1,45 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * This file contains the constants for the mocked attribute-storage.cpp + */ + +#pragma once + +#include + +namespace chip { +namespace Test { +constexpr EndpointId kMockEndpoint1 = 0xFFFE; +constexpr EndpointId kMockEndpoint2 = 0xFFFD; +constexpr EndpointId kMockEndpoint3 = 0xFFFC; + +constexpr AttributeId MockAttributeId(const uint16_t & id) +{ + return (0xFFF1'0000 | id); +} + +constexpr AttributeId MockClusterId(const uint16_t & id) +{ + return (0xFFF1'0000 | id); +} + +} // namespace Test +} // namespace chip diff --git a/src/app/util/mock/attribute-storage.cpp b/src/app/util/mock/attribute-storage.cpp new file mode 100644 index 00000000000000..f9364ea9a37115 --- /dev/null +++ b/src/app/util/mock/attribute-storage.cpp @@ -0,0 +1,190 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * This file contains the mock implementation for the generated attribute-storage.cpp + * - It contains three endpoints, 0xFFFE, 0xFFFD, 0xFFFC + * - It contains four clusters: 0xFFF1'0001 to 0xFFF1'0004 + * - All cluster has two global attribute (0x0000'FFFC, 0x0000'FFFD) + * - Some clusters has some cluster-specific attributes, with 0xFFF1 prefix. + * + * Note: The ember's attribute-storage.cpp will include some app specific generated files. So we cannot use it directly. This + * might be fixed with a mock endpoint-config.h + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef uint8_t EmberAfClusterMask; + +using namespace chip; +using namespace chip::Test; +using namespace chip::app; + +namespace { + +EndpointId endpoints[] = { kMockEndpoint1, kMockEndpoint2, kMockEndpoint3 }; +uint16_t clusterIndex[] = { 0, 2, 5 }; +uint8_t clusterCount[] = { 2, 3, 4 }; +ClusterId clusters[] = { MockClusterId(1), MockClusterId(2), MockClusterId(1), MockClusterId(2), MockClusterId(3), + MockClusterId(1), MockClusterId(2), MockClusterId(3), MockClusterId(4) }; +uint16_t attributeIndex[] = { 0, 2, 5, 7, 11, 16, 19, 25, 27 }; +uint16_t attributeCount[] = { 2, 3, 2, 4, 5, 3, 6, 2, 2 }; +AttributeId attributes[] = { + // clang-format off + Clusters::Globals::Attributes::ClusterRevision::Id, Clusters::Globals::Attributes::FeatureMap::Id, + Clusters::Globals::Attributes::ClusterRevision::Id, Clusters::Globals::Attributes::FeatureMap::Id, MockAttributeId(1), + Clusters::Globals::Attributes::ClusterRevision::Id, Clusters::Globals::Attributes::FeatureMap::Id, + Clusters::Globals::Attributes::ClusterRevision::Id, Clusters::Globals::Attributes::FeatureMap::Id, MockAttributeId(1), MockAttributeId(2), + Clusters::Globals::Attributes::ClusterRevision::Id, Clusters::Globals::Attributes::FeatureMap::Id, MockAttributeId(1), MockAttributeId(2), MockAttributeId(3), + Clusters::Globals::Attributes::ClusterRevision::Id, Clusters::Globals::Attributes::FeatureMap::Id, MockAttributeId(1), + Clusters::Globals::Attributes::ClusterRevision::Id, Clusters::Globals::Attributes::FeatureMap::Id, MockAttributeId(1), MockAttributeId(2), MockAttributeId(3), MockAttributeId(4), + Clusters::Globals::Attributes::ClusterRevision::Id, Clusters::Globals::Attributes::FeatureMap::Id, + Clusters::Globals::Attributes::ClusterRevision::Id, Clusters::Globals::Attributes::FeatureMap::Id + // clang-format on +}; + +} // namespace + +uint16_t emberAfEndpointCount(void) +{ + return ArraySize(endpoints); +} + +uint16_t emberAfIndexFromEndpoint(chip::EndpointId endpoint) +{ + for (uint16_t i = 0; i < ArraySize(endpoints); i++) + { + if (endpoints[i] == endpoint) + { + return i; + } + } + return UINT16_MAX; +} + +uint8_t emberAfClusterCount(chip::EndpointId endpoint, bool server) +{ + for (uint16_t i = 0; i < ArraySize(endpoints); i++) + { + if (endpoints[i] == endpoint) + { + return clusterCount[i]; + } + } + return 0; +} + +uint16_t emberAfGetServerAttributeCount(chip::EndpointId endpoint, chip::ClusterId cluster) +{ + uint16_t endpointIndex = emberAfIndexFromEndpoint(endpoint); + uint16_t clusterCountOnEndpoint = emberAfClusterCount(endpoint, true); + for (uint16_t i = 0; i < clusterCountOnEndpoint; i++) + { + if (clusters[i + clusterIndex[endpointIndex]] == cluster) + { + return attributeCount[i + clusterIndex[endpointIndex]]; + } + } + return 0; +} + +uint16_t emberAfGetServerAttributeIndexByAttributeId(chip::EndpointId endpoint, chip::ClusterId cluster, + chip::AttributeId attributeId) +{ + uint16_t endpointIndex = emberAfIndexFromEndpoint(endpoint); + uint16_t clusterCountOnEndpoint = emberAfClusterCount(endpoint, true); + for (uint16_t i = 0; i < clusterCountOnEndpoint; i++) + { + if (clusters[i + clusterIndex[endpointIndex]] == cluster) + { + uint16_t clusterAttributeOffset = attributeIndex[i + clusterIndex[endpointIndex]]; + for (uint16_t j = 0; j < emberAfGetServerAttributeCount(endpoint, cluster); j++) + { + if (attributes[clusterAttributeOffset + j] == attributeId) + { + return j; + } + } + break; + } + } + return UINT16_MAX; +} + +chip::EndpointId emberAfEndpointFromIndex(uint16_t index) +{ + VerifyOrDie(index < ArraySize(endpoints)); + return endpoints[index]; +} + +chip::Optional emberAfGetNthClusterId(chip::EndpointId endpoint, uint8_t n, bool server) +{ + if (n >= emberAfClusterCount(endpoint, server)) + { + return chip::Optional::Missing(); + } + return chip::Optional(clusters[clusterIndex[emberAfIndexFromEndpoint(endpoint)] + n]); +} + +chip::Optional emberAfGetServerAttributeIdByIndex(chip::EndpointId endpoint, chip::ClusterId cluster, + uint16_t index) +{ + uint16_t endpointIndex = emberAfIndexFromEndpoint(endpoint); + uint16_t clusterCountOnEndpoint = emberAfClusterCount(endpoint, true); + for (uint16_t i = 0; i < clusterCountOnEndpoint; i++) + { + if (clusters[i + clusterIndex[endpointIndex]] == cluster) + { + uint16_t clusterAttributeOffset = attributeIndex[i + clusterIndex[endpointIndex]]; + if (index < emberAfGetServerAttributeCount(endpoint, cluster)) + { + return Optional(attributes[clusterAttributeOffset + index]); + } + break; + } + } + return Optional::Missing(); +} + +uint8_t emberAfClusterIndex(chip::EndpointId endpoint, chip::ClusterId cluster, EmberAfClusterMask mask) +{ + uint16_t endpointIndex = emberAfIndexFromEndpoint(endpoint); + uint16_t clusterCountOnEndpoint = emberAfClusterCount(endpoint, true); + for (uint8_t i = 0; i < clusterCountOnEndpoint; i++) + { + if (clusters[i + clusterIndex[endpointIndex]] == cluster) + { + return i; + } + } + return UINT8_MAX; +} diff --git a/src/app/zap-templates/common/ClusterTestGeneration.js b/src/app/zap-templates/common/ClusterTestGeneration.js index c9a033e9cbcc30..14bde361a46e8f 100644 --- a/src/app/zap-templates/common/ClusterTestGeneration.js +++ b/src/app/zap-templates/common/ClusterTestGeneration.js @@ -149,10 +149,13 @@ function setDefaultPICS(test) return; } - if (!PICS.has(test[kPICSName])) { - const errorStr = 'PICS database does not contains any defined value for: ' + test[kPICSName]; - throwError(test, errorStr); - } + const items = test[kPICSName].split(/[&|() !]+/g).filter(item => item.length); + items.forEach(key => { + if (!PICS.has(key)) { + const errorStr = 'PICS database does not contains any defined value for: ' + key; + throwError(test, errorStr); + } + }) } function setDefaultArguments(test) @@ -309,9 +312,6 @@ function parse(filename) // Filter disabled tests yaml.tests = yaml.tests.filter(test => !test.disabled); - // Filter tests based on PICS - yaml.tests = yaml.tests.filter(test => test[kPICSName] == '' || PICS.get(test[kPICSName]).value == true); - yaml.tests.forEach((test, index) => { setDefault(test, kIndexName, index); }); diff --git a/src/app/zap-templates/common/attributes/Accessors.js b/src/app/zap-templates/common/attributes/Accessors.js index 84433c7abb5a84..d151c6935a92a0 100644 --- a/src/app/zap-templates/common/attributes/Accessors.js +++ b/src/app/zap-templates/common/attributes/Accessors.js @@ -15,9 +15,11 @@ * limitations under the License. */ +const zapPath = '../../../../../third_party/zap/repo/dist/src-electron/'; const ListHelper = require('../../common/ListHelper.js'); const StringHelper = require('../../common/StringHelper.js'); const StructHelper = require('../../common/StructHelper.js'); +const zclHelper = require(zapPath + 'generator/helper-zcl.js') // Issue #8202 // The specification allow non-standard signed and unsigned integer with a width of 24, 40, 48 or 56, but those types does not have @@ -29,24 +31,52 @@ function isUnsupportedType(type) return unsupportedTypes.includes(type.toUpperCase()); } -function canHaveSimpleAccessors(type) +function canHaveSimpleAccessors(attr) { - if (ListHelper.isList(type)) { + if (attr.isArray || attr.isList) { return false; } - if (StructHelper.isStruct(type)) { + if (ListHelper.isList(attr.type)) { return false; } - if (isUnsupportedType(type)) { + if (StructHelper.isStruct(attr.type)) { + return false; + } + + if (isUnsupportedType(attr.type)) { return false; } return true; } +async function accessorGetterType(attr) +{ + let type; + let mayNeedPointer = false; + if (StringHelper.isCharString(attr.type)) { + type = "chip::MutableCharSpan"; + } else if (StringHelper.isOctetString(attr.type)) { + type = "chip::MutableByteSpan"; + } else { + mayNeedPointer = true; + const options = { 'hash' : {} }; + type = await zclHelper.asUnderlyingZclType.call(this, attr.type, options); + } + + if (attr.isNullable) { + type = `DataModel::Nullable<${type}> &`; + } else if (mayNeedPointer) { + type = `${type} *`; + } + + return type; +} + // // Module exports // exports.canHaveSimpleAccessors = canHaveSimpleAccessors; +exports.accessorGetterType = accessorGetterType; diff --git a/src/app/zap-templates/common/simulated-clusters/TestDelayCommands.js b/src/app/zap-templates/common/simulated-clusters/TestDelayCommands.js index c1825a68857345..24320284991a1b 100644 --- a/src/app/zap-templates/common/simulated-clusters/TestDelayCommands.js +++ b/src/app/zap-templates/common/simulated-clusters/TestDelayCommands.js @@ -30,9 +30,15 @@ const WaitForMs = { response : { arguments : [] } }; +const WaitForCommissioning = { + name : 'WaitForCommissioning', + arguments : [], + response : { arguments : [] } +}; + const DelayCommands = { name : 'DelayCommands', - commands : [ WaitForMs ], + commands : [ WaitForMs, WaitForCommissioning ], }; // diff --git a/src/app/zap-templates/templates/app/att-storage.zapt b/src/app/zap-templates/templates/app/att-storage.zapt index dae7ad9d189509..b01f99a390eefe 100644 --- a/src/app/zap-templates/templates/app/att-storage.zapt +++ b/src/app/zap-templates/templates/app/att-storage.zapt @@ -3,25 +3,6 @@ // Prevent multiple inclusion #pragma once -// Attribute masks modify how attributes are used by the framework -// -// Attribute that has this mask is NOT read-only -#define ATTRIBUTE_MASK_WRITABLE (0x01) -// Attribute that has this mask is saved to a token -#define ATTRIBUTE_MASK_TOKENIZE (0x02) -// Attribute that has this mask has a min/max values -#define ATTRIBUTE_MASK_MIN_MAX (0x04) -// Manufacturer specific attribute -#define ATTRIBUTE_MASK_MANUFACTURER_SPECIFIC (0x08) -// Attribute deferred to external storage -#define ATTRIBUTE_MASK_EXTERNAL_STORAGE (0x10) -// Attribute is singleton -#define ATTRIBUTE_MASK_SINGLETON (0x20) -// Attribute is a client attribute -#define ATTRIBUTE_MASK_CLIENT (0x40) -// Attribute is nullable -#define ATTRIBUTE_MASK_NULLABLE (0x80) - // Cluster masks modify how clusters are used by the framework // // Does this cluster have init function? diff --git a/src/app/zap-templates/templates/app/attributes/Accessors-src.zapt b/src/app/zap-templates/templates/app/attributes/Accessors-src.zapt index 644b35310bc529..b51829b143f0dc 100644 --- a/src/app/zap-templates/templates/app/attributes/Accessors-src.zapt +++ b/src/app/zap-templates/templates/app/attributes/Accessors-src.zapt @@ -11,6 +11,7 @@ #include #include #include +#include namespace chip { namespace app { @@ -25,39 +26,102 @@ namespace Attributes { {{/first}} {{#if clusterRef}} -{{#if (canHaveSimpleAccessors type)}} +{{#if (canHaveSimpleAccessors this)}} namespace {{asUpperCamelCase label}} { {{#*inline "clusterId"}}Clusters::{{asUpperCamelCase parent.label}}::Id{{/inline}} {{#*inline "sizingBytes"}}{{#if (isShortString type)}}1{{else}}2{{/if}}{{/inline}} -EmberAfStatus Get(chip::EndpointId endpoint, {{#if (isCharString type)}}chip::MutableCharSpan{{else if (isOctetString type)}}chip::MutableByteSpan{{else}}{{asUnderlyingZclType type}} *{{/if}} value) +EmberAfStatus Get(chip::EndpointId endpoint, {{accessorGetterType this}} value) { - {{#if (isString type)}} - VerifyOrReturnError(value.size() == {{maxLength}}, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + {{~#if (isString type)}} + {{~#*inline "lengthType"}}uint{{#if (isShortString type)}}8{{else}}16{{/if}}_t{{/inline}} uint8_t zclString[{{maxLength}} + {{>sizingBytes}}]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, {{>clusterId}}, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - memcpy(value.data(), &zclString[{{>sizingBytes}}], {{maxLength}}); - value.reduce_size(emberAf{{#if (isLongString type)}}Long{{/if}}StringLength(zclString)); + size_t length = emberAf{{#if (isLongString type)}}Long{{/if}}StringLength(zclString); + if (length == NumericAttributeTraits<{{>lengthType}}>::kNullValue) + { + {{#if isNullable}} + value.SetNull(); + return EMBER_ZCL_STATUS_SUCCESS; + {{else}} + return EMBER_ZCL_STATUS_INVALID_VALUE; + {{/if}} + } + {{#if isNullable}} + auto & span = value.SetNonNull(); + {{/if}} + {{~#*inline "value"}}{{#if isNullable}}span{{else}}value{{/if}}{{/inline}} + VerifyOrReturnError({{>value}}.size() == {{maxLength}}, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + memcpy({{>value}}.data(), &zclString[{{>sizingBytes}}], {{maxLength}}); + {{>value}}.reduce_size(length); return status; {{else}} - return emberAfReadServerAttribute(endpoint, {{>clusterId}}, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits<{{asUnderlyingZclType type}}>::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, {{>clusterId}}, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + {{#if isNullable}} + if (NumericAttributeTraits<{{asUnderlyingZclType type}}>::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = temp; + } + {{else}} + if (!NumericAttributeTraits<{{asUnderlyingZclType type}}>::CanRepresentValue(/* isNullable = */ {{isNullable}}, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + {{/if}} + return status; {{/if}} } EmberAfStatus Set(chip::EndpointId endpoint, {{asUnderlyingZclType type}} value) { - {{#if (isString type)}} + {{~#if (isString type)}} + {{~#*inline "lengthType"}}uint{{#if (isShortString type)}}8{{else}}16{{/if}}_t{{/inline}} + static_assert({{maxLength}} < NumericAttributeTraits<{{>lengthType}}>::kNullValue, + "value.size() might be too big"); VerifyOrReturnError(value.size() <= {{maxLength}}, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[{{maxLength}} + {{>sizingBytes}}]; - emberAfCopyInt{{#if (isShortString type)}}8{{else}}16{{/if}}u(zclString, 0, static_cast(value.size())); + emberAfCopyInt{{#if (isShortString type)}}8{{else}}16{{/if}}u(zclString, 0, static_cast<{{>lengthType}}>(value.size())); memcpy(&zclString[{{>sizingBytes}}], value.data(), value.size()); return emberAfWriteServerAttribute(endpoint, {{>clusterId}}, Id, zclString, ZCL_{{asDelimitedMacro type}}_ATTRIBUTE_TYPE); {{else}} + if (!NumericAttributeTraits<{{asUnderlyingZclType type}}>::CanRepresentValue(/* isNullable = */ {{isNullable}}, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, {{>clusterId}}, Id, (uint8_t *) &value, ZCL_{{asDelimitedMacro type}}_ATTRIBUTE_TYPE); {{/if}} } +{{#if isNullable}} +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + {{#if (isString type)}} + uint8_t zclString[{{>sizingBytes}}] = { {{#if (isShortString type)}}0xFF{{else}}0xFF, 0xFF{{/if}} }; + return emberAfWriteServerAttribute(endpoint, {{>clusterId}}, Id, zclString, ZCL_{{asDelimitedMacro type}}_ATTRIBUTE_TYPE); + {{else}} + auto value = NumericAttributeTraits<{{asUnderlyingZclType type}}>::kNullValue; + return emberAfWriteServerAttribute(endpoint, {{>clusterId}}, Id, reinterpret_cast(&value), ZCL_{{asDelimitedMacro type}}_ATTRIBUTE_TYPE); + {{/if}} +} + +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable<{{asUnderlyingZclType type}}> & value) +{ + if (value.IsNull()) { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} +{{/if}} + } // namespace {{asUpperCamelCase label}} {{/if}} diff --git a/src/app/zap-templates/templates/app/attributes/Accessors.zapt b/src/app/zap-templates/templates/app/attributes/Accessors.zapt index 232f77fad1c884..f8c7147620e642 100644 --- a/src/app/zap-templates/templates/app/attributes/Accessors.zapt +++ b/src/app/zap-templates/templates/app/attributes/Accessors.zapt @@ -7,6 +7,7 @@ #pragma once +#include #include #include @@ -23,10 +24,14 @@ namespace Attributes { {{/first}} {{#if clusterRef}} -{{#if (canHaveSimpleAccessors type)}} +{{#if (canHaveSimpleAccessors this)}} namespace {{asUpperCamelCase label}} { -EmberAfStatus Get(chip::EndpointId endpoint, {{#if (isCharString type)}}chip::MutableCharSpan{{else if (isOctetString type)}}chip::MutableByteSpan{{else}}{{asUnderlyingZclType type}} *{{/if}} value); // {{type}} {{isArray}} +EmberAfStatus Get(chip::EndpointId endpoint, {{accessorGetterType this}} value); // {{type}} {{isArray}} EmberAfStatus Set(chip::EndpointId endpoint, {{asUnderlyingZclType type}} value); +{{#if isNullable}} +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable<{{asUnderlyingZclType type}}> & value); +{{/if}} } // namespace {{asUpperCamelCase label}} {{/if}} diff --git a/src/app/zap-templates/zcl/data-model/chip/basic-information-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/basic-information-cluster.xml index 08aecbc9f33f1a..0505e831946f89 100644 --- a/src/app/zap-templates/zcl/data-model/chip/basic-information-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/basic-information-cluster.xml @@ -37,7 +37,7 @@ limitations under the License. SoftwareVersionString ManufacturingDate PartNumber - ProductURL + ProductURL ProductLabel SerialNumber LocalConfigDisabled diff --git a/src/app/zap-templates/zcl/data-model/chip/bridged-actions-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/bridged-actions-cluster.xml index e1f13d4bc8a8ad..5158b7777b98f6 100644 --- a/src/app/zap-templates/zcl/data-model/chip/bridged-actions-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/bridged-actions-cluster.xml @@ -93,7 +93,7 @@ limitations under the License. action list endpoint list - setup url + setup url This command triggers an action (state change) on the involved endpoints. diff --git a/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml index f9967fd5f1c3da..64b229ef1f5799 100644 --- a/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml @@ -141,6 +141,34 @@ limitations under the License. attribute types in ZAP --> + nullable_boolean + nullable_bitmap8 + nullable_bitmap16 + nullable_bitmap32 + nullable_bitmap64 + nullable_int8u + nullable_int16u + + nullable_int32u + + + + nullable_int64u + nullable_int8s + nullable_int16s + + nullable_int32s + + + + nullable_int64s + nullable_enum8 + nullable_enum16 + + + nullable_octet_string + nullable_char_string + unsupported diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index 2e80a0a66a7176..efa19d5dd09978 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -908,6 +908,9 @@ CHIP_ERROR DeviceCommissioner::PairDevice(NodeId remoteDeviceId, RendezvousParam err = mIDAllocator.Allocate(keyID); SuccessOrExit(err); + // TODO - Remove use of SetActive/IsActive from CommissioneeDeviceProxy + device->SetActive(true); + err = device->GetPairing().Pair(params.GetPeerAddress(), params.GetSetupPINCode(), keyID, exchangeCtxt, this); // Immediately persist the updted mNextKeyID value // TODO maybe remove FreeRendezvousSession() since mNextKeyID is always persisted immediately @@ -960,6 +963,15 @@ void DeviceCommissioner::RendezvousCleanup(CHIP_ERROR status) { FreeRendezvousSession(); + if (mDeviceBeingCommissioned != nullptr) + { + // Release the commissionee device. For BLE, this is stored, + // for IP commissioning, we have taken a reference to the + // operational node to send the completion command. + ReleaseCommissioneeDevice(mDeviceBeingCommissioned); + mDeviceBeingCommissioned = nullptr; + } + if (mPairingDelegate != nullptr) { mPairingDelegate->OnPairingComplete(status); @@ -1007,11 +1019,7 @@ void DeviceCommissioner::OnSessionEstablished() // TODO: Add code to receive OpCSR from the device, and process the signing request // For IP rendezvous, this is sent as part of the state machine. -#if CONFIG_USE_CLUSTERS_FOR_IP_COMMISSIONING bool usingLegacyFlowWithImmediateStart = !mIsIPRendezvous; -#else - bool usingLegacyFlowWithImmediateStart = true; -#endif if (usingLegacyFlowWithImmediateStart) { @@ -1495,23 +1503,21 @@ CHIP_ERROR DeviceCommissioner::OnOperationalCredentialsProvisioningCompletion(Co ChipLogProgress(Controller, "Operational credentials provisioned on device %p", device); VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); -#if CONFIG_USE_CLUSTERS_FOR_IP_COMMISSIONING + mSystemState->SystemLayer()->CancelTimer(OnSessionEstablishmentTimeoutCallback, this); + + mPairedDevices.Insert(device->GetDeviceId()); + mPairedDevicesUpdated = true; + + if (mPairingDelegate != nullptr) + { + mPairingDelegate->OnStatusUpdate(DevicePairingDelegate::SecurePairingSuccess); + } if (mIsIPRendezvous) { AdvanceCommissioningStage(CHIP_NO_ERROR); } else -#endif { - mSystemState->SystemLayer()->CancelTimer(OnSessionEstablishmentTimeoutCallback, this); - - mPairedDevices.Insert(device->GetDeviceId()); - mPairedDevicesUpdated = true; - - if (mPairingDelegate != nullptr) - { - mPairingDelegate->OnStatusUpdate(DevicePairingDelegate::SecurePairingSuccess); - } RendezvousCleanup(CHIP_NO_ERROR); } @@ -1659,19 +1665,20 @@ void DeviceCommissioner::OnDeviceConnectedFn(void * context, DeviceProxy * devic DeviceCommissioner * commissioner = static_cast(context); VerifyOrReturn(commissioner != nullptr, ChipLogProgress(Controller, "Device connected callback with null context. Ignoring")); - if (commissioner->mDeviceBeingCommissioned != nullptr) + if (commissioner->mIsIPRendezvous) { - CommissioneeDeviceProxy * deviceBeingPaired = commissioner->mDeviceBeingCommissioned; - if (device->GetDeviceId() == deviceBeingPaired->GetDeviceId() && commissioner->mIsIPRendezvous) + if (commissioner->mCommissioningStage == CommissioningStage::kFindOperational) { - if (commissioner->mCommissioningStage == CommissioningStage::kFindOperational) - { - commissioner->AdvanceCommissioningStage(CHIP_NO_ERROR); - } - // For IP rendezvous, we don't want to call commissioning complete below because IP commissioning - // has more steps currently. - return; + commissioner->mDeviceOperational = device; + commissioner->AdvanceCommissioningStage(CHIP_NO_ERROR); + } + else + { + commissioner->mPairingDelegate->OnPairingComplete(CHIP_NO_ERROR); } + // For IP rendezvous, we don't want to call commissioning complete below because IP commissioning + // has more steps currently. + return; } VerifyOrReturn(commissioner->mPairingDelegate != nullptr, @@ -1744,13 +1751,22 @@ void DeviceCommissioner::AdvanceCommissioningStage(CHIP_ERROR err) { return; } - CommissioneeDeviceProxy * device = nullptr; - if (mDeviceBeingCommissioned == nullptr) + if (nextStage == CommissioningStage::kSendComplete || nextStage == CommissioningStage::kCleanup) { - return; + if (mDeviceOperational == nullptr) + { + ChipLogError(Controller, "Invalid operational device for commissioning"); + return; + } + } + else + { + if (mDeviceBeingCommissioned == nullptr) + { + ChipLogError(Controller, "Invalid commissionee device for commissioning"); + return; + } } - - device = mDeviceBeingCommissioned; // TODO(cecille): We probably want something better than this for breadcrumbs. uint64_t breadcrumb = static_cast(nextStage); @@ -1767,7 +1783,7 @@ void DeviceCommissioner::AdvanceCommissioningStage(CHIP_ERROR err) // TODO(cecille): Find a way to enumerate the clusters here. GeneralCommissioningCluster genCom; // TODO: should get the endpoint information from the descriptor cluster. - genCom.Associate(device, 0); + genCom.Associate(mDeviceBeingCommissioned, 0); // TODO(cecille): Make this a parameter uint16_t commissioningExpirySeconds = 60; genCom.ArmFailSafe(mSuccess.Cancel(), mFailure.Cancel(), commissioningExpirySeconds, breadcrumb, kCommandTimeoutMs); @@ -1810,14 +1826,14 @@ void DeviceCommissioner::AdvanceCommissioningStage(CHIP_ERROR err) chip::CharSpan countryCode(countryCodeStr, actualCountryCodeSize); GeneralCommissioningCluster genCom; - genCom.Associate(device, 0); + genCom.Associate(mDeviceBeingCommissioned, 0); genCom.SetRegulatoryConfig(mSuccess.Cancel(), mFailure.Cancel(), static_cast(regulatoryLocation), countryCode, breadcrumb, kCommandTimeoutMs); } break; case CommissioningStage::kDeviceAttestation: { ChipLogProgress(Controller, "Exchanging vendor certificates"); - CHIP_ERROR status = SendCertificateChainRequestCommand(device, CertificateType::kPAI); + CHIP_ERROR status = SendCertificateChainRequestCommand(mDeviceBeingCommissioned, CertificateType::kPAI); if (status != CHIP_NO_ERROR) { ChipLogError(Controller, "Failed in sending 'Certificate Chain Request' command to the device: err %s", ErrorStr(err)); @@ -1830,7 +1846,7 @@ void DeviceCommissioner::AdvanceCommissioningStage(CHIP_ERROR err) ChipLogProgress(Controller, "Exchanging certificates"); // TODO(cecille): Once this is implemented through the clusters, it should be moved to the proper stage and the callback // should advance the commissioning stage - CHIP_ERROR status = SendOperationalCertificateSigningRequestCommand(device); + CHIP_ERROR status = SendOperationalCertificateSigningRequestCommand(mDeviceBeingCommissioned); if (status != CHIP_NO_ERROR) { ChipLogError(Controller, "Failed in sending 'CSR Request' command to the device: err %s", ErrorStr(err)); @@ -1854,38 +1870,28 @@ void DeviceCommissioner::AdvanceCommissioningStage(CHIP_ERROR err) } break; case CommissioningStage::kFindOperational: { + PeerId peerId = PeerId().SetCompressedFabricId(GetCompressedFabricId()).SetNodeId(mDeviceBeingCommissioned->GetDeviceId()); + RendezvousCleanup(CHIP_NO_ERROR); #if CHIP_DEVICE_CONFIG_ENABLE_DNSSD ChipLogProgress(Controller, "Finding node on operational network"); - Dnssd::Resolver::Instance().ResolveNodeId( - PeerId().SetCompressedFabricId(GetCompressedFabricId()).SetNodeId(device->GetDeviceId()), Inet::IPAddressType::kAny); + Dnssd::Resolver::Instance().ResolveNodeId(peerId, Inet::IPAddressType::kAny); #endif } break; case CommissioningStage::kSendComplete: { - // TODO this is actualy not correct - we must reconnect over CASE to send this command. ChipLogProgress(Controller, "Calling commissioning complete"); GeneralCommissioningCluster genCom; - genCom.Associate(device, 0); + genCom.Associate(mDeviceOperational, 0); genCom.CommissioningComplete(mSuccess.Cancel(), mFailure.Cancel()); } break; case CommissioningStage::kCleanup: ChipLogProgress(Controller, "Rendezvous cleanup"); - mSystemState->SystemLayer()->CancelTimer(OnSessionEstablishmentTimeoutCallback, this); - - mPairedDevices.Insert(device->GetDeviceId()); - mPairedDevicesUpdated = true; - if (mPairingDelegate != nullptr) { - mPairingDelegate->OnStatusUpdate(DevicePairingDelegate::SecurePairingSuccess); - } - RendezvousCleanup(CHIP_NO_ERROR); - if (mDeviceBeingCommissioned != nullptr) - { - ReleaseCommissioneeDevice(mDeviceBeingCommissioned); - mDeviceBeingCommissioned = nullptr; + mPairingDelegate->OnCommissioningComplete(mDeviceOperational->GetDeviceId(), CHIP_NO_ERROR); } + mDeviceOperational = nullptr; break; case CommissioningStage::kSecurePairing: case CommissioningStage::kError: diff --git a/src/controller/CHIPDeviceController.h b/src/controller/CHIPDeviceController.h index 6f684e7b76cebc..2e854f9e3a57d9 100644 --- a/src/controller/CHIPDeviceController.h +++ b/src/controller/CHIPDeviceController.h @@ -615,6 +615,7 @@ class DLL_EXPORT DeviceCommissioner : public DeviceController, DevicePairingDelegate * mPairingDelegate; CommissioneeDeviceProxy * mDeviceBeingCommissioned = nullptr; + DeviceProxy * mDeviceOperational = nullptr; Credentials::CertificateType mCertificateTypeBeingRequested = Credentials::CertificateType::kUnknown; diff --git a/src/controller/CommissioneeDeviceProxy.cpp b/src/controller/CommissioneeDeviceProxy.cpp index f91d17e8ab3e3c..9ce7c425895751 100644 --- a/src/controller/CommissioneeDeviceProxy.cpp +++ b/src/controller/CommissioneeDeviceProxy.cpp @@ -90,19 +90,6 @@ void CommissioneeDeviceProxy::OnNewConnection(SessionHandle session) { mState = ConnectionState::SecureConnected; mSecureSession.SetValue(session); - - // Reset the message counters here because this is the first time we get a handle to the secure session. - // Since CHIPDevices can be serialized/deserialized in the middle of what is conceptually a single PASE session - // we need to restore the session counters along with the session information. - Transport::SecureSession * secureSession = mSessionManager->GetSecureSession(mSecureSession.Value()); - VerifyOrReturn(secureSession != nullptr); - MessageCounter & localCounter = secureSession->GetSessionMessageCounter().GetLocalMessageCounter(); - if (localCounter.SetCounter(mLocalMessageCounter) != CHIP_NO_ERROR) - { - ChipLogError(Controller, "Unable to restore local counter to %" PRIu32, mLocalMessageCounter); - } - Transport::PeerMessageCounter & peerCounter = secureSession->GetSessionMessageCounter().GetPeerMessageCounter(); - peerCounter.SetCounter(mPeerMessageCounter); } void CommissioneeDeviceProxy::OnConnectionExpired(SessionHandle session) diff --git a/src/controller/CommissioneeDeviceProxy.h b/src/controller/CommissioneeDeviceProxy.h index 81b59820c1f223..6eabfb91866f2a 100644 --- a/src/controller/CommissioneeDeviceProxy.h +++ b/src/controller/CommissioneeDeviceProxy.h @@ -347,9 +347,6 @@ class CommissioneeDeviceProxy : public DeviceProxy, Messaging::ExchangeDelegate uint8_t mSequenceNumber = 0; - uint32_t mLocalMessageCounter = 0; - uint32_t mPeerMessageCounter = 0; - /** * @brief * This function loads the secure session object from the serialized operational diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 735732b7f995e9..36fc0afee3594f 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -3148,6 +3148,21 @@ "enabled": 0, "commands": [], "attributes": [ + { + "name": "ThreadMetrics", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "CurrentHeapFree", "code": 1, @@ -11880,6 +11895,261 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "nullable_boolean", + "code": 32768, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_bitmap8", + "code": 32769, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_bitmap16", + "code": 32770, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_bitmap32", + "code": 32771, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_bitmap64", + "code": 32772, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_int8u", + "code": 32773, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_int16u", + "code": 32774, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_int32u", + "code": 32776, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_int64u", + "code": 32780, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_int8s", + "code": 32781, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_int16s", + "code": 32782, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_int32s", + "code": 32784, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_int64s", + "code": 32788, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_enum8", + "code": 32789, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_enum16", + "code": 32790, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_octet_string", + "code": 32793, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_char_string", + "code": 32798, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, diff --git a/src/controller/java/BUILD.gn b/src/controller/java/BUILD.gn index 31fafee2743e64..6a1efd413ca8ea 100644 --- a/src/controller/java/BUILD.gn +++ b/src/controller/java/BUILD.gn @@ -69,10 +69,10 @@ android_library("java") { sources = [ "src/chip/clusterinfo/ClusterCommandCallback.java", "src/chip/clusterinfo/ClusterInfo.java", - "src/chip/clusterinfo/CommandInfo.java", "src/chip/clusterinfo/CommandParameterInfo.java", "src/chip/clusterinfo/CommandResponseInfo.java", "src/chip/clusterinfo/DelegatedClusterCallback.java", + "src/chip/clusterinfo/InteractionInfo.java", "src/chip/devicecontroller/ChipClusterException.java", "src/chip/devicecontroller/ChipCommandType.java", "src/chip/devicecontroller/ChipDeviceController.java", diff --git a/src/controller/java/CHIPDefaultCallbacks.cpp b/src/controller/java/CHIPDefaultCallbacks.cpp index 7d8c0fd86e9736..b324503e14dc75 100644 --- a/src/controller/java/CHIPDefaultCallbacks.cpp +++ b/src/controller/java/CHIPDefaultCallbacks.cpp @@ -27,7 +27,7 @@ chip::CHIPDefaultSuccessCallback::~CHIPDefaultSuccessCallback() JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) { - ChipLogError(Zcl, "Could not create global reference for Java callback"); + ChipLogError(Zcl, "Could not delete global reference for Java callback"); return; } env->DeleteGlobalRef(javaCallbackRef); diff --git a/src/controller/java/src/chip/clusterinfo/ClusterInfo.java b/src/controller/java/src/chip/clusterinfo/ClusterInfo.java index cb4dee857cceb8..efd37f150dae5f 100644 --- a/src/controller/java/src/chip/clusterinfo/ClusterInfo.java +++ b/src/controller/java/src/chip/clusterinfo/ClusterInfo.java @@ -6,9 +6,10 @@ /** ClusterInfo maps commands and provides a constructor function for a cluster. */ public class ClusterInfo { private final ClusterConstructor createClusterFunction; - private final Map commands; + private final Map commands; - public ClusterInfo(ClusterConstructor createClusterFunction, Map commands) { + public ClusterInfo( + ClusterConstructor createClusterFunction, Map commands) { this.createClusterFunction = createClusterFunction; this.commands = commands; } @@ -17,11 +18,11 @@ public ClusterConstructor getCreateClusterFunction() { return createClusterFunction; } - public Map getCommands() { + public Map getCommands() { return commands; } - public void combineCommands(Map newCommands) { + public void combineCommands(Map newCommands) { this.commands.putAll(newCommands); } diff --git a/src/controller/java/src/chip/clusterinfo/CommandInfo.java b/src/controller/java/src/chip/clusterinfo/InteractionInfo.java similarity index 83% rename from src/controller/java/src/chip/clusterinfo/CommandInfo.java rename to src/controller/java/src/chip/clusterinfo/InteractionInfo.java index 7bc59c1571ff88..c389cbb33c9812 100644 --- a/src/controller/java/src/chip/clusterinfo/CommandInfo.java +++ b/src/controller/java/src/chip/clusterinfo/InteractionInfo.java @@ -5,16 +5,16 @@ import java.util.function.Supplier; /** - * CommandInfo has a functional interface to invoke arbitrary commands based on cluster, callback - * and a map of arguments, a Supplier that provides {@link DelegatedClusterCallback}, and maps the - * parameter and commandParametersInfo. + * InteractionInfo has a functional interface to invoke arbitrary interaction based on cluster, + * callback and a map of arguments, a Supplier that provides {@link DelegatedClusterCallback}, and + * maps the parameter and commandParametersInfo. */ -public class CommandInfo { +public class InteractionInfo { public ClusterCommandFunction commandFunction; private Supplier commandCallbackSupplier; private Map commandParameters; - public CommandInfo( + public InteractionInfo( ClusterCommandFunction commandFunction, Supplier commandCallbackSupplier, Map commandParameters) { diff --git a/src/controller/java/templates/CHIPClusters-JNI.zapt b/src/controller/java/templates/CHIPClusters-JNI.zapt index 2359c43aaa8cbc..e733901e40a79b 100644 --- a/src/controller/java/templates/CHIPClusters-JNI.zapt +++ b/src/controller/java/templates/CHIPClusters-JNI.zapt @@ -76,7 +76,7 @@ class CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callba javaCallbackRef = cppCallback->javaCallbackRef; VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "({{#chip_cluster_response_arguments}}{{#if isArray}}{{else if (isOctetString type)}}[B{{else if (isShortString type)}}Ljava/lang/String;{{else}}{{asJniSignature type}}{{/if}}{{/chip_cluster_response_arguments}})V", &javaMethod); + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "({{#chip_cluster_response_arguments}}{{#if isArray}}{{else if (isOctetString type)}}[B{{else if (isShortString type)}}Ljava/lang/String;{{else}}{{asJniSignature type false}}{{/if}}{{/chip_cluster_response_arguments}})V", &javaMethod); SuccessOrExit(err); {{#chip_cluster_response_arguments}} @@ -146,7 +146,7 @@ JNI_METHOD(jlong, {{asUpperCamelCase name}}Cluster, initWithDevice)(JNIEnv * env } {{#chip_cluster_commands}} -JNI_METHOD(void, {{asUpperCamelCase ../name}}Cluster, {{asLowerCamelCase name}})(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback{{#chip_cluster_command_arguments_with_structs_expanded}}, {{asJniBasicType type}} {{asLowerCamelCase label}}{{/chip_cluster_command_arguments_with_structs_expanded}}) +JNI_METHOD(void, {{asUpperCamelCase ../name}}Cluster, {{asLowerCamelCase name}})(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback{{#chip_cluster_command_arguments_with_structs_expanded}}, {{asJniBasicType type false}} {{asLowerCamelCase label}}{{/chip_cluster_command_arguments_with_structs_expanded}}) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -173,7 +173,8 @@ JNI_METHOD(void, {{asUpperCamelCase ../name}}Cluster, {{asLowerCamelCase name}}) cppCluster = reinterpret_cast<{{asUpperCamelCase ../name}}Cluster *>(clusterPtr); VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - err = cppCluster->{{asCamelCased name false}}(onSuccess->Cancel(), onFailure->Cancel(){{#chip_cluster_command_arguments_with_structs_expanded}}, {{#if_chip_enum type}}static_cast<{{chipType}}>({{asLowerCamelCase label}}){{else if (isOctetString type)}}{{asUnderlyingZclType type}}((const uint8_t*) {{asLowerCamelCase label}}Arr.data(), {{asLowerCamelCase label}}Arr.size()){{else if (isCharString type)}}chip::CharSpan({{asLowerCamelCase label}}Str.c_str(), strlen({{asLowerCamelCase label}}Str.c_str())){{else}}{{asLowerCamelCase label}}{{/if_chip_enum}}{{/chip_cluster_command_arguments_with_structs_expanded}}); + err = cppCluster->{{asCamelCased name false}}(onSuccess->Cancel(), onFailure->Cancel() + {{#chip_cluster_command_arguments_with_structs_expanded}}, {{#if_chip_enum type}}static_cast<{{chipType}}>({{asLowerCamelCase label}}){{else if (isOctetString type)}}{{asUnderlyingZclType type}}((const uint8_t*) {{asLowerCamelCase label}}Arr.data(), {{asLowerCamelCase label}}Arr.size()){{else if (isCharString type)}}chip::CharSpan({{asLowerCamelCase label}}Str.c_str(), strlen({{asLowerCamelCase label}}Str.c_str())){{else}}{{asLowerCamelCase label}}{{/if_chip_enum}}{{/chip_cluster_command_arguments_with_structs_expanded}}); SuccessOrExit(err); exit: @@ -202,7 +203,7 @@ exit: {{#chip_server_cluster_attributes}} {{#if isWritableAttribute}} -JNI_METHOD(void, {{asUpperCamelCase ../name}}Cluster, write{{asUpperCamelCase name}}Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, {{asJniBasicType type}} value) +JNI_METHOD(void, {{asUpperCamelCase ../name}}Cluster, write{{asUpperCamelCase name}}Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, {{asJniBasicType type false}} value) { chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); diff --git a/src/controller/java/templates/CHIPReadCallbacks-src.zapt b/src/controller/java/templates/CHIPReadCallbacks-src.zapt index f6be392903e91e..4c1931dba0c3fa 100644 --- a/src/controller/java/templates/CHIPReadCallbacks-src.zapt +++ b/src/controller/java/templates/CHIPReadCallbacks-src.zapt @@ -26,6 +26,16 @@ CHIP{{chipCallback.name}}AttributeCallback::CHIP{{chipCallback.name}}AttributeCa } } +CHIP{{chipCallback.name}}AttributeCallback::~CHIP{{chipCallback.name}}AttributeCallback() { + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIP{{chipCallback.name}}AttributeCallback::CallbackFn(void * context, {{chipCallback.type}} value) { chip::DeviceLayer::StackUnlock unlock; @@ -43,7 +53,7 @@ void CHIP{{chipCallback.name}}AttributeCallback::CallbackFn(void * context, {{ch jmethodID javaMethod; {{#unless (isStrEqual chipCallback.name "OctetString")}} {{#unless (isStrEqual chipCallback.name "CharString")}} - err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "({{convertCTypeToJniSignature chipCallback.type}})V", &javaMethod); + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "({{convertCTypeToJniSignature chipCallback.type false}})V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess method")); env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast<{{convertBasicCTypeToJniType chipCallback.type}}>(value)); {{/unless}} @@ -89,6 +99,16 @@ CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCallback:: } } +CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCallback::~CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCallback() { + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCallback::CallbackFn(void * context, {{zapTypeToDecodableClusterObjectType type ns=parent.name isArgument=true}} list) { chip::DeviceLayer::StackUnlock unlock; @@ -124,7 +144,7 @@ void CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCallb VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find class chip/devicecontroller/ChipClusters${{asUpperCamelCase parent.name}}Cluster${{asUpperCamelCase name}}Attribute")); chip::JniClass attributeJniClass(attributeClass); jmethodID attributeCtor = env->GetMethodID(attributeClass, "" - , "({{#chip_attribute_list_entryTypes}}{{#if isOptional}}{{! TODO: Add support for optional types here }}{{else if isNullable}}{{! TODO: Add support for nullable types here }}{{else if isArray}}{{! TODO: Add support for lists here }}{{else if isStruct}}{{! TODO: Add support for structs here }}{{else if (isString type)}}{{#if (isOctetString type)}}[B{{else}}Ljava/lang/String;{{/if}}{{else}}{{asJniSignature type}}{{/if}}{{/chip_attribute_list_entryTypes}})V"); + , "({{#chip_attribute_list_entryTypes}}{{#if isArray}}{{! TODO: Add support for lists here }}{{else if isStruct}}{{! TODO: Add support for structs here }}{{else if isOptional}}Ljava/util/Optional;{{else if (isString type)}}{{#if (isOctetString type)}}[B{{else}}Ljava/lang/String;{{/if}}{{else}}{{asJniSignature type true}}{{/if}}{{/chip_attribute_list_entryTypes}})V"); VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find {{asUpperCamelCase name}}Attribute constructor")); {{/if}} @@ -135,35 +155,93 @@ void CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCallb {{#if isStruct}} (void)entry; {{! In case all our struct members are not supported yet }} {{#chip_attribute_list_entryTypes}} + {{#unless isArray}} + {{#unless isStruct}} + bool {{asLowerCamelCase name}}Null = false; + bool {{asLowerCamelCase name}}HasValue = true; + {{#if isNullable}} + {{#unless isOptional}} + {{chipType}} {{asLowerCamelCase name}}Value; + {{asLowerCamelCase name}}Null = entry.{{asLowerCamelCase name}}.IsNull(); + if (!{{asLowerCamelCase name}}Null) { + {{asLowerCamelCase name}}Value = entry.{{asLowerCamelCase name}}.Value(); + } + {{/unless}} + {{/if}} + {{#if isOptional}} - {{! TODO: Add support for optional types here }} - {{else if isNullable}} - {{! TODO: Add support for nullable types here }} - {{else if isArray}} + {{chipType}} {{asLowerCamelCase name}}Value; + {{#if isNullable}} + {{asLowerCamelCase name}}HasValue = entry.{{asLowerCamelCase name}}.HasValue(); + if ({{asLowerCamelCase name}}HasValue) { + auto {{asLowerCamelCase name}}ValueFromOptional = entry.{{asLowerCamelCase name}}.Value(); + {{asLowerCamelCase name}}Null = {{asLowerCamelCase name}}ValueFromOptional.IsNull(); + if (!{{asLowerCamelCase name}}Null) { + {{asLowerCamelCase name}}Value = {{asLowerCamelCase name}}ValueFromOptional.Value(); + } + } + {{else}} + {{asLowerCamelCase name}}HasValue = entry.{{asLowerCamelCase name}}.HasValue(); + if ({{asLowerCamelCase name}}HasValue) { + {{asLowerCamelCase name}}Value = entry.{{asLowerCamelCase name}}.Value(); + } + {{/if}} + {{/if}} + + {{#unless isOptional}} + {{#unless isNullable}} + {{chipType}} {{asLowerCamelCase name}}Value = entry.{{asLowerCamelCase name}}; + {{/unless}} + {{/unless}} + + {{/unless}} + {{/unless}} + + {{#if isArray}} {{! TODO: Add support for lists here }} {{else if isStruct}} {{! TODO: Add support for structs here }} {{else if (isOctetString type)}} - jbyteArray {{asLowerCamelCase name}} = env->NewByteArray(entry.{{asLowerCamelCase name}}.size()); - env->SetByteArrayRegion({{asLowerCamelCase name}}, 0, entry.{{asLowerCamelCase name}}.size(), reinterpret_cast(entry.{{asLowerCamelCase name}}.data())); + jbyteArray {{asLowerCamelCase name}} = nullptr; + if (!{{asLowerCamelCase name}}Null && {{asLowerCamelCase name}}HasValue) { + {{asLowerCamelCase name}} = env->NewByteArray({{asLowerCamelCase name}}Value.size()); + env->SetByteArrayRegion({{asLowerCamelCase name}}, 0, {{asLowerCamelCase name}}Value.size(), reinterpret_cast({{asLowerCamelCase name}}Value.data())); + } {{else if (isCharString type)}} - chip::UtfString {{asLowerCamelCase name}}Str(env, entry.{{asLowerCamelCase name}}); - jstring {{asLowerCamelCase name}}({{asLowerCamelCase name}}Str.jniValue()); + jstring {{asLowerCamelCase name}} = nullptr; + chip::UtfString {{asLowerCamelCase name}}Str(env, {{asLowerCamelCase name}}Value); + if (!{{asLowerCamelCase name}}Null && {{asLowerCamelCase name}}HasValue) { + {{asLowerCamelCase name}} = jstring({{asLowerCamelCase name}}Str.jniValue()); + } {{else}} - {{asJniBasicType type}} {{asLowerCamelCase name}} = entry.{{asLowerCamelCase name}}; + jobject {{asLowerCamelCase name}} = nullptr; + if (!{{asLowerCamelCase name}}Null && {{asLowerCamelCase name}}HasValue) { + jclass {{asLowerCamelCase name}}EntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/{{asJavaBasicTypeForZclType type true}}", {{asLowerCamelCase name}}EntryCls); + chip::JniClass {{asLowerCamelCase name}}JniClass({{asLowerCamelCase name}}EntryCls); + jmethodID {{asLowerCamelCase name}}EntryTypeCtor = env->GetMethodID({{asLowerCamelCase name}}EntryCls, "", "({{asJniSignature type false}})V"); + {{asLowerCamelCase name}} = env->NewObject({{asLowerCamelCase name}}EntryCls, {{asLowerCamelCase name}}EntryTypeCtor, {{asLowerCamelCase name}}Value); + } + {{/if}} + + {{#if isOptional}} + {{#unless isArray}} + {{#unless isStruct}} + jobject {{asLowerCamelCase name}}Optional = nullptr; + chip::JniReferences::GetInstance().CreateOptional({{asLowerCamelCase name}}, {{asLowerCamelCase name}}Optional); + {{/unless}} + {{/unless}} {{/if}} {{/chip_attribute_list_entryTypes}} jobject attributeObj = env->NewObject(attributeClass, attributeCtor {{#chip_attribute_list_entryTypes}} - {{#if isOptional}} - {{! TODO: Add support for optional types here }} - {{else if isNullable}} - {{! TODO: Add support for nullable types here }} - {{else if isArray}} + {{#if isArray}} {{! TODO: Add support for lists here }} {{else if isStruct}} {{! TODO: Add support for structs here }} + {{else isOptional}} + , {{asLowerCamelCase name}}Optional {{else}} , {{asLowerCamelCase name}} {{/if}} @@ -173,19 +251,53 @@ void CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCallb env->CallBooleanMethod(arrayListObj, arrayListAddMethod, attributeObj); {{else}} - {{#if (isOctetString type)}} - jbyteArray {{asLowerCamelCase name}} = env->NewByteArray(entry.size()); - env->SetByteArrayRegion({{asLowerCamelCase name}}, 0, entry.size(), reinterpret_cast(entry.data())); + bool entryNull = false; + {{#unless isArray}} + {{#unless isStruct}} + {{#if isNullable}} + {{chipType}} entryValue; + entryNull = entry.IsNull(); + if (!entryNull) { + entryValue = entry.Value(); + } + {{else}} + {{chipType}} entryValue = entry; + {{/if}} + {{/unless}} + {{/unless}} + + {{#if isStruct}} + {{! TODO: Add support for structs here }} + {{else if (isOctetString type)}} + jbyteArray entryObject = nullptr; + if (!entryNull) { + entryObject = env->NewByteArray(entryValue.size()); + env->SetByteArrayRegion(entryObject, 0, entryValue.size(), reinterpret_cast(entryValue.data())); + } {{else if (isCharString type)}} - chip::UtfString {{asLowerCamelCase name}}Str(env, entry); - jstring {{asLowerCamelCase name}}({{asLowerCamelCase name}}Str.jniValue()); + jstring entryObject = nullptr; + chip::UtfString entryStr(env, entryValue); + if (!entryNull) { + entryObject = jstring(entryStr.jniValue()); + } + {{else}} + jobject entryObject = nullptr; + if (!entryNull) { + jclass entryTypeCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/{{asJavaBasicTypeForZclType type true}}", entryTypeCls); + chip::JniClass jniClass(entryTypeCls); + jmethodID entryTypeCtor = env->GetMethodID(entryTypeCls, "", "({{asJniSignature type false}})V"); + entryObject = env->NewObject(entryTypeCls, entryTypeCtor, entryValue); + } + {{/if}} + + {{#if isOptional}} + jobject entryOptional = nullptr; + chip::JniReferences::GetInstance().CreateOptional(entryObject, entryOptional); + env->CallBooleanMethod(arrayListObj, arrayListAddMethod, entryOptional); {{else}} - jclass entryTypeCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/{{asJavaBasicTypeForZclType type true}}", entryTypeCls); - jmethodID entryTypeCtor = env->GetMethodID(entryTypeCls, "", "({{asJniSignature type}})V"); - jobject {{asLowerCamelCase name}} = env->NewObject(entryTypeCls, entryTypeCtor, entry); + env->CallBooleanMethod(arrayListObj, arrayListAddMethod, entryObject); {{/if}} - env->CallBooleanMethod(arrayListObj, arrayListAddMethod, {{asLowerCamelCase name}}); {{/if}} } VerifyOrReturn(iter.GetStatus() == CHIP_NO_ERROR, ChipLogError(Zcl, "Error decoding {{asUpperCamelCase name}}Attribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); diff --git a/src/controller/java/templates/CHIPReadCallbacks.zapt b/src/controller/java/templates/CHIPReadCallbacks.zapt index c936fffb00bcbe..fe4d5d3d0dacfc 100644 --- a/src/controller/java/templates/CHIPReadCallbacks.zapt +++ b/src/controller/java/templates/CHIPReadCallbacks.zapt @@ -9,6 +9,8 @@ class CHIP{{chipCallback.name}}AttributeCallback : public chip::Callback::Callba public: CHIP{{chipCallback.name}}AttributeCallback(jobject javaCallback, bool keepAlive = false); + ~CHIP{{chipCallback.name}}AttributeCallback(); + static void maybeDestroy(CHIP{{chipCallback.name}}AttributeCallback * callback) { if (!callback->keepAlive) { callback->Cancel(); @@ -33,6 +35,8 @@ class CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCall public: CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCallback(jobject javaCallback); + ~CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCallback(); + static void CallbackFn(void * context, {{zapTypeToDecodableClusterObjectType type ns=parent.name isArgument=true}} list); private: diff --git a/src/controller/java/templates/ChipClusters-java.zapt b/src/controller/java/templates/ChipClusters-java.zapt index ac79f513f4a74b..6949da07b66c68 100644 --- a/src/controller/java/templates/ChipClusters-java.zapt +++ b/src/controller/java/templates/ChipClusters-java.zapt @@ -3,7 +3,10 @@ package chip.devicecontroller; +import androidx.annotation.Nullable; import java.util.List; +import java.util.Arrays; +import java.util.Optional; public class ChipClusters { @@ -110,48 +113,51 @@ public class ChipClusters { {{#if isStruct}} public static class {{asUpperCamelCase name}}Attribute { {{#chip_attribute_list_entryTypes}} - {{#if isOptional}} - {{! TODO: Add support for optional types here }} - {{else if isNullable}} - {{! TODO: Add support for nullable types here }} - {{else if isArray}} + {{#if isNullable}} + {{! 'unless' blocks are temporary until optional array / struct implemented }} + {{#unless isArray}} + {{#unless isStruct}} + @Nullable + {{/unless}} + {{/unless}} + {{/if}} + {{#if isArray}} {{! TODO: Add support for lists here }} {{else if isStruct}} {{! TODO: Add support for structs here }} {{else if (isOctetString type)}} - public byte[] {{asLowerCamelCase name}}; + public {{#if isOptional}}Optional<{{/if}}byte[]{{#if isOptional}}>{{/if}} {{asLowerCamelCase name}}; {{else if (isCharString type)}} - public String {{asLowerCamelCase name}}; + public {{#if isOptional}}Optional<{{/if}}String{{#if isOptional}}>{{/if}} {{asLowerCamelCase name}}; {{else}} - public {{asJavaBasicType label type}} {{asLowerCamelCase name}}; + public {{#if isOptional}}Optional<{{/if}}{{asJavaBoxedType label type}}{{#if isOptional}}>{{/if}} {{asLowerCamelCase name}}; {{/if}} {{/chip_attribute_list_entryTypes}} public {{asUpperCamelCase name}}Attribute( {{#chip_attribute_list_entryTypes}} - {{#if isOptional}} - {{! TODO: Add support for optional types here }} - {{else if isNullable}} - {{! TODO: Add support for nullable types here }} - {{else if isArray}} + {{#if isNullable}} + {{#unless isArray}} + {{#unless isStruct}} + @Nullable + {{/unless}} + {{/unless}} + {{/if}} + {{#if isArray}} {{! TODO: Add support for lists here }} {{else if isStruct}} {{! TODO: Add support for structs here }} {{else if (isOctetString type)}} - byte[] {{asLowerCamelCase name}}{{#not_last}},{{/not_last}} + {{#if isOptional}}Optional<{{/if}}byte[]{{#if isOptional}}>{{/if}} {{asLowerCamelCase name}} {{#notLastSupportedEntryTypes ..}},{{/notLastSupportedEntryTypes}} {{else if (isCharString type)}} - String {{asLowerCamelCase name}}{{#not_last}},{{/not_last}} + {{#if isOptional}}Optional<{{/if}}String{{#if isOptional}}>{{/if}} {{asLowerCamelCase name}} {{#notLastSupportedEntryTypes ..}},{{/notLastSupportedEntryTypes}} {{else}} - {{asJavaBasicType label type}} {{asLowerCamelCase name}}{{#not_last}},{{/not_last}} + {{#if isOptional}}Optional<{{/if}}{{asJavaBoxedType label type}}{{#if isOptional}}>{{/if}} {{asLowerCamelCase name}} {{#notLastSupportedEntryTypes ..}},{{/notLastSupportedEntryTypes}} {{/if}} {{/chip_attribute_list_entryTypes}} ) { {{#chip_attribute_list_entryTypes}} - {{#if isOptional}} - {{! TODO: Add support for optional types here }} - {{else if isNullable}} - {{! TODO: Add support for nullable types here }} - {{else if isArray}} + {{#if isArray}} {{! TODO: Add support for lists here }} {{else if isStruct}} {{! TODO: Add support for structs here }} @@ -174,18 +180,9 @@ public class ChipClusters { {{else if isStruct}} {{! TODO: Add support for structs here }} {{else if (isOctetString type)}} - output.append("byte[] {{asLowerCamelCase name}}: ["); - for (int i = 0; i < {{asLowerCamelCase name}}.length; i++) { - if (i != {{asLowerCamelCase name}}.length - 1) { - output.append({{asLowerCamelCase name}}[i]); - output.append(", "); - } - else { - output.append({{asLowerCamelCase name}}[i]); - output.append("]"); - output.append("\n"); - } - } + output.append("byte[] "); + output.append(Arrays.toString({{asLowerCamelCase name}})); + output.append("\n"); {{else if (isCharString type)}} output.append("String {{asLowerCamelCase name}}: "); output.append(this.{{asLowerCamelCase name}}); @@ -207,6 +204,20 @@ public class ChipClusters { {{#if isStruct}} {{asUpperCamelCase name}}Attribute {{else}} + {{#if isNullable}} + {{#unless isArray}} + {{#unless isStruct}} + @Nullable + {{/unless}} + {{/unless}} + {{/if}} + {{#if isOptional}} + {{#unless isArray}} + {{#unless isStruct}} + Optional< + {{/unless}} + {{/unless}} + {{/if}} {{#if (isOctetString type)}} byte[] {{else if (isCharString type)}} @@ -214,6 +225,13 @@ public class ChipClusters { {{else}} {{asJavaBasicTypeForZclType type true}} {{/if}} + {{#if isOptional}} + {{#unless isArray}} + {{#unless isStruct}} + > + {{/unless}} + {{/unless}} + {{/if}} {{/if}} > valueList); void onError(Exception ex); diff --git a/src/controller/java/templates/ClusterInfo-java.zapt b/src/controller/java/templates/ClusterInfo-java.zapt index 0270c88a27217f..252fc7528cd765 100644 --- a/src/controller/java/templates/ClusterInfo-java.zapt +++ b/src/controller/java/templates/ClusterInfo-java.zapt @@ -9,7 +9,7 @@ import java.util.Map; import java.util.List; import java.util.HashMap; import chip.clusterinfo.ClusterInfo; -import chip.clusterinfo.CommandInfo; +import chip.clusterinfo.InteractionInfo; import chip.clusterinfo.CommandParameterInfo; import chip.clusterinfo.DelegatedClusterCallback; import chip.clusterinfo.ClusterCommandCallback; @@ -248,15 +248,34 @@ public class ClusterInfoMapping { {{/chip_client_clusters}} public Map getClusterMap() { + Map clusterMap = initializeClusterMap(); + Map> commandMap = getCommandMap(); + combineCommand(clusterMap, commandMap); + Map> readAttributeMap = getReadAttributeMap(); + combineCommand(clusterMap, readAttributeMap); + return clusterMap; + } + + public Map initializeClusterMap() { Map clusterMap = new HashMap<>(); - getCommandMap(clusterMap); - getReadAttributeMap(clusterMap); + {{#chip_client_clusters}} + ClusterInfo {{asLowerCamelCase name}}ClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.{{asUpperCamelCase name}}Cluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("{{asLowerCamelCase name}}", {{asLowerCamelCase name}}ClusterInfo); + {{/chip_client_clusters}} return clusterMap; } - public Map getCommandMap(Map clusterMap) { + public void combineCommand(Map destination, Map> source) { + {{#chip_client_clusters}} + destination.get("{{asLowerCamelCase name}}").combineCommands(source.get("{{asLowerCamelCase name}}")); + {{/chip_client_clusters}} + } + + public Map> getCommandMap() { + Map> commandMap = new HashMap<>(); {{#chip_client_clusters}} - Map {{asLowerCamelCase name}}ClusterCommandInfoMap = new LinkedHashMap<>(); + Map {{asLowerCamelCase name}}ClusterInteractionInfoMap = new LinkedHashMap<>(); {{#chip_cluster_commands}} Map {{asLowerCamelCase ../name}}{{asLowerCamelCase name}}CommandParams = new LinkedHashMap(); {{! TODO: fill out parameter types }} @@ -270,7 +289,7 @@ public class ClusterInfoMapping { {{/if}} // Populate commands {{#if hasSpecificResponse}} - CommandInfo {{asLowerCamelCase ../name}}{{asLowerCamelCase name}}CommandInfo = new CommandInfo( + InteractionInfo {{asLowerCamelCase ../name}}{{asLowerCamelCase name}}InteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.{{asUpperCamelCase ../name}}Cluster) cluster) .{{asLowerCamelCase name}}((ChipClusters.{{asUpperCamelCase ../name}}Cluster.{{asUpperCamelCase responseName}}Callback) callback @@ -284,7 +303,7 @@ public class ClusterInfoMapping { {{asLowerCamelCase ../name}}{{asLowerCamelCase name}}CommandParams ); {{else}} - CommandInfo {{asLowerCamelCase ../name}}{{asLowerCamelCase name}}CommandInfo = new CommandInfo( + InteractionInfo {{asLowerCamelCase ../name}}{{asLowerCamelCase name}}InteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.{{asUpperCamelCase ../name}}Cluster) cluster) .{{asLowerCamelCase name}}((DefaultClusterCallback) callback @@ -298,23 +317,21 @@ public class ClusterInfoMapping { {{asLowerCamelCase ../name}}{{asLowerCamelCase name}}CommandParams ); {{/if}} - {{asLowerCamelCase ../name}}ClusterCommandInfoMap.put("{{asLowerCamelCase name}}", {{asLowerCamelCase ../name}}{{asLowerCamelCase name}}CommandInfo); + {{asLowerCamelCase ../name}}ClusterInteractionInfoMap.put("{{asLowerCamelCase name}}", {{asLowerCamelCase ../name}}{{asLowerCamelCase name}}InteractionInfo); {{/chip_cluster_commands}} - // Populate cluster - ClusterInfo {{asLowerCamelCase name}}ClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.{{asUpperCamelCase name}}Cluster(ptr, endpointId), {{asLowerCamelCase name}}ClusterCommandInfoMap); - clusterMap.put("{{asLowerCamelCase name}}", {{asLowerCamelCase name}}ClusterInfo); + commandMap.put("{{asLowerCamelCase name}}", {{asLowerCamelCase name}}ClusterInteractionInfoMap); {{/chip_client_clusters}} - return clusterMap; + return commandMap; } - public Map getReadAttributeMap(Map clusterMap) { + public Map> getReadAttributeMap() { + Map> readAttributeMap = new HashMap<>(); {{#chip_client_clusters}} - Map read{{asUpperCamelCase name}}CommandInfo = new LinkedHashMap<>(); + Map read{{asUpperCamelCase name}}InteractionInfo = new LinkedHashMap<>(); // read attribute {{#chip_server_cluster_attributes}} Map read{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}CommandParams = new LinkedHashMap(); - CommandInfo read{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}AttributeCommandInfo = new CommandInfo( + InteractionInfo read{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}AttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.{{asUpperCamelCase ../name}}Cluster) cluster).read{{asUpperCamelCase name}}Attribute( {{#if isList}} @@ -331,12 +348,11 @@ public class ClusterInfoMapping { {{/if}} read{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}CommandParams ); - read{{asUpperCamelCase ../name}}CommandInfo.put("read{{asUpperCamelCase name}}Attribute", read{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}AttributeCommandInfo); + read{{asUpperCamelCase ../name}}InteractionInfo.put("read{{asUpperCamelCase name}}Attribute", read{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}AttributeInteractionInfo); {{/chip_server_cluster_attributes}} - // combine the read Attribute into the original commands - clusterMap.get("{{asLowerCamelCase name}}").combineCommands(read{{asUpperCamelCase name}}CommandInfo); + readAttributeMap.put("{{asLowerCamelCase name}}", read{{asUpperCamelCase name}}InteractionInfo); {{/chip_client_clusters}} - return clusterMap; + return readAttributeMap; } } diff --git a/src/controller/java/templates/helper.js b/src/controller/java/templates/helper.js index f42ad49c834f48..e8bb5d7434f689 100644 --- a/src/controller/java/templates/helper.js +++ b/src/controller/java/templates/helper.js @@ -99,13 +99,16 @@ function asJavaBoxedType(type) } } -function asJniBasicType(type) +function asJniBasicType(type, useBoxedTypes) { if (StringHelper.isOctetString(type)) { return 'jbyteArray'; } else if (StringHelper.isCharString(type)) { return 'jstring'; } else { + if (useBoxedTypes) { + return 'jobject'; + } return convertBasicCTypeToJniType(ChipTypesHelper.asBasicType(this.chipType)); } } @@ -145,13 +148,13 @@ function asJniBasicTypeForZclType(type) return templateUtil.templatePromise(this.global, promise) } -function asJniSignature(type) +function asJniSignature(type, useBoxedTypes) { function fn(pkgId) { const options = { 'hash' : {} }; return zclHelper.asUnderlyingZclType.call(this, type, options).then(zclType => { - return convertCTypeToJniSignature(ChipTypesHelper.asBasicType(zclType)); + return convertCTypeToJniSignature(ChipTypesHelper.asBasicType(zclType), useBoxedTypes); }) } @@ -162,9 +165,15 @@ function asJniSignature(type) return templateUtil.templatePromise(this.global, promise) } -function convertCTypeToJniSignature(cType) +function convertCTypeToJniSignature(cType, useBoxedTypes) { - const javaType = convertBasicCTypeToJavaType(cType); + let javaType; + if (useBoxedTypes) { + javaType = convertBasicCTypeToJavaBoxedType(cType); + } else { + javaType = convertBasicCTypeToJavaType(cType); + } + switch (javaType) { case 'int': return 'I'; @@ -172,6 +181,12 @@ function convertCTypeToJniSignature(cType) return 'J'; case 'boolean': return 'Z'; + case 'Boolean': + return 'Ljava/lang/Boolean;'; + case 'Integer': + return 'Ljava/lang/Integer;'; + case 'Long': + return 'Ljava/lang/Long;'; default: error = 'Unhandled Java type ' + javaType + ' for C type ' + cType; throw error; @@ -190,6 +205,22 @@ function convertAttributeCallbackTypeToJavaName(cType) } } +function notLastSupportedEntryTypes(context, options) +{ + if (context.items.length == 0) { + return + } + + let lastIndex = context.items.length - 1; + while (context.items[lastIndex].isStruct || context.items[lastIndex].isArray) { + lastIndex--; + } + + if (this.index != lastIndex) { + return options.fn(this); + } +} + function omitCommaForFirstNonStatusCommand(id, index) { let promise = templateUtil.ensureZclPackageId(this) @@ -228,3 +259,4 @@ exports.convertCTypeToJniSignature = convertCTypeToJniSignature; exports.convertBasicCTypeToJavaBoxedType = convertBasicCTypeToJavaBoxedType; exports.convertAttributeCallbackTypeToJavaName = convertAttributeCallbackTypeToJavaName; exports.omitCommaForFirstNonStatusCommand = omitCommaForFirstNonStatusCommand; +exports.notLastSupportedEntryTypes = notLastSupportedEntryTypes; diff --git a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp index 6e0e2defc8b83b..d864242bd2721e 100644 --- a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp @@ -16925,6 +16925,537 @@ JNI_METHOD(void, TestClusterCluster, writeUnsupportedAttribute) onSuccess.release(); onFailure.release(); } + +JNI_METHOD(void, TestClusterCluster, writeNullableBooleanAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jboolean value) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->WriteAttributeNullableBoolean(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableBitmap8Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->WriteAttributeNullableBitmap8(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableBitmap16Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->WriteAttributeNullableBitmap16(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableBitmap32Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong value) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->WriteAttributeNullableBitmap32(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableBitmap64Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong value) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->WriteAttributeNullableBitmap64(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableInt8uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->WriteAttributeNullableInt8u(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableInt16uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->WriteAttributeNullableInt16u(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableInt32uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong value) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->WriteAttributeNullableInt32u(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableInt64uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong value) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->WriteAttributeNullableInt64u(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableInt8sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->WriteAttributeNullableInt8s(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableInt16sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->WriteAttributeNullableInt16s(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableInt32sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong value) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->WriteAttributeNullableInt32s(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableInt64sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong value) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->WriteAttributeNullableInt64s(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableEnum8Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->WriteAttributeNullableEnum8(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableEnum16Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->WriteAttributeNullableEnum16(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableOctetStringAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray value) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + JniByteArray jniArr(env, value); + err = cppCluster->WriteAttributeNullableOctetString(onSuccess->Cancel(), onFailure->Cancel(), + chip::ByteSpan((const uint8_t *) jniArr.data(), jniArr.size())); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, writeNullableCharStringAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + JniUtfString valueStr(env, value); + err = cppCluster->WriteAttributeNullableCharString(onSuccess->Cancel(), onFailure->Cancel(), + chip::CharSpan(valueStr.c_str(), strlen(valueStr.c_str()))); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} JNI_METHOD(jlong, ThermostatCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; diff --git a/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp b/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp index cb8d29868fa139..27361b718f8ee7 100644 --- a/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp @@ -9222,6 +9222,40 @@ JNI_METHOD(void, ScenesCluster, readClusterRevisionAttribute)(JNIEnv * env, jobj onFailure.release(); } +JNI_METHOD(void, SoftwareDiagnosticsCluster, readThreadMetricsAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr + onSuccess(chip::Platform::New(callback), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::SoftwareDiagnosticsCluster * cppCluster = + reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeThreadMetrics(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + JNI_METHOD(void, SoftwareDiagnosticsCluster, readCurrentHeapFreeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -10671,6 +10705,520 @@ JNI_METHOD(void, TestClusterCluster, readUnsupportedAttribute)(JNIEnv * env, job onFailure.release(); } +JNI_METHOD(void, TestClusterCluster, readNullableBooleanAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeNullableBoolean(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, readNullableBitmap8Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeNullableBitmap8(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, readNullableBitmap16Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeNullableBitmap16(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, readNullableBitmap32Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeNullableBitmap32(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, readNullableBitmap64Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeNullableBitmap64(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, readNullableInt8uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeNullableInt8u(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, readNullableInt16uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeNullableInt16u(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, readNullableInt32uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeNullableInt32u(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, readNullableInt64uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeNullableInt64u(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, readNullableInt8sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeNullableInt8s(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, readNullableInt16sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeNullableInt16s(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, readNullableInt32sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeNullableInt32s(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, readNullableInt64sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeNullableInt64s(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, readNullableEnum8Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeNullableEnum8(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, readNullableEnum16Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeNullableEnum16(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, readNullableOctetStringAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + chip::Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeNullableOctetString(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TestClusterCluster, readNullableCharStringAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + chip::Platform::New(callback, false), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeNullableCharString(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + JNI_METHOD(void, TestClusterCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 9f4d7ee9def6df..b2bebd86182f9b 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -42,6 +42,17 @@ CHIPBooleanAttributeCallback::CHIPBooleanAttributeCallback(jobject javaCallback, } } +CHIPBooleanAttributeCallback::~CHIPBooleanAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPBooleanAttributeCallback::CallbackFn(void * context, bool value) { chip::DeviceLayer::StackUnlock unlock; @@ -80,6 +91,17 @@ CHIPCharStringAttributeCallback::CHIPCharStringAttributeCallback(jobject javaCal } } +CHIPCharStringAttributeCallback::~CHIPCharStringAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPCharStringAttributeCallback::CallbackFn(void * context, const chip::CharSpan value) { chip::DeviceLayer::StackUnlock unlock; @@ -121,6 +143,17 @@ CHIPInt8sAttributeCallback::CHIPInt8sAttributeCallback(jobject javaCallback, boo } } +CHIPInt8sAttributeCallback::~CHIPInt8sAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPInt8sAttributeCallback::CallbackFn(void * context, int8_t value) { chip::DeviceLayer::StackUnlock unlock; @@ -159,6 +192,17 @@ CHIPInt8uAttributeCallback::CHIPInt8uAttributeCallback(jobject javaCallback, boo } } +CHIPInt8uAttributeCallback::~CHIPInt8uAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPInt8uAttributeCallback::CallbackFn(void * context, uint8_t value) { chip::DeviceLayer::StackUnlock unlock; @@ -197,6 +241,17 @@ CHIPInt16sAttributeCallback::CHIPInt16sAttributeCallback(jobject javaCallback, b } } +CHIPInt16sAttributeCallback::~CHIPInt16sAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPInt16sAttributeCallback::CallbackFn(void * context, int16_t value) { chip::DeviceLayer::StackUnlock unlock; @@ -235,6 +290,17 @@ CHIPInt16uAttributeCallback::CHIPInt16uAttributeCallback(jobject javaCallback, b } } +CHIPInt16uAttributeCallback::~CHIPInt16uAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPInt16uAttributeCallback::CallbackFn(void * context, uint16_t value) { chip::DeviceLayer::StackUnlock unlock; @@ -273,6 +339,17 @@ CHIPInt32sAttributeCallback::CHIPInt32sAttributeCallback(jobject javaCallback, b } } +CHIPInt32sAttributeCallback::~CHIPInt32sAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPInt32sAttributeCallback::CallbackFn(void * context, int32_t value) { chip::DeviceLayer::StackUnlock unlock; @@ -311,6 +388,17 @@ CHIPInt32uAttributeCallback::CHIPInt32uAttributeCallback(jobject javaCallback, b } } +CHIPInt32uAttributeCallback::~CHIPInt32uAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPInt32uAttributeCallback::CallbackFn(void * context, uint32_t value) { chip::DeviceLayer::StackUnlock unlock; @@ -349,6 +437,17 @@ CHIPInt64sAttributeCallback::CHIPInt64sAttributeCallback(jobject javaCallback, b } } +CHIPInt64sAttributeCallback::~CHIPInt64sAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPInt64sAttributeCallback::CallbackFn(void * context, int64_t value) { chip::DeviceLayer::StackUnlock unlock; @@ -387,6 +486,17 @@ CHIPInt64uAttributeCallback::CHIPInt64uAttributeCallback(jobject javaCallback, b } } +CHIPInt64uAttributeCallback::~CHIPInt64uAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPInt64uAttributeCallback::CallbackFn(void * context, uint64_t value) { chip::DeviceLayer::StackUnlock unlock; @@ -425,6 +535,17 @@ CHIPOctetStringAttributeCallback::CHIPOctetStringAttributeCallback(jobject javaC } } +CHIPOctetStringAttributeCallback::~CHIPOctetStringAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPOctetStringAttributeCallback::CallbackFn(void * context, const chip::ByteSpan value) { chip::DeviceLayer::StackUnlock unlock; @@ -471,6 +592,17 @@ CHIPApplicationLauncherApplicationLauncherListAttributeCallback::CHIPApplication } } +CHIPApplicationLauncherApplicationLauncherListAttributeCallback::~CHIPApplicationLauncherApplicationLauncherListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPApplicationLauncherApplicationLauncherListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { @@ -507,12 +639,21 @@ void CHIPApplicationLauncherApplicationLauncherListAttributeCallback::CallbackFn auto iter = list.begin(); while (iter.Next()) { - auto & entry = iter.GetValue(); - jclass entryTypeCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", entryTypeCls); - jmethodID entryTypeCtor = env->GetMethodID(entryTypeCls, "", "(I)V"); - jobject applicationLauncherList = env->NewObject(entryTypeCls, entryTypeCtor, entry); - env->CallBooleanMethod(arrayListObj, arrayListAddMethod, applicationLauncherList); + auto & entry = iter.GetValue(); + bool entryNull = false; + uint16_t entryValue = entry; + + jobject entryObject = nullptr; + if (!entryNull) + { + jclass entryTypeCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", entryTypeCls); + chip::JniClass jniClass(entryTypeCls); + jmethodID entryTypeCtor = env->GetMethodID(entryTypeCls, "", "(I)V"); + entryObject = env->NewObject(entryTypeCls, entryTypeCtor, entryValue); + } + + env->CallBooleanMethod(arrayListObj, arrayListAddMethod, entryObject); } VerifyOrReturn( iter.GetStatus() == CHIP_NO_ERROR, @@ -539,6 +680,17 @@ CHIPAudioOutputAudioOutputListAttributeCallback::CHIPAudioOutputAudioOutputListA } } +CHIPAudioOutputAudioOutputListAttributeCallback::~CHIPAudioOutputAudioOutputListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPAudioOutputAudioOutputListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) @@ -580,7 +732,8 @@ void CHIPAudioOutputAudioOutputListAttributeCallback::CallbackFn( err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find class chip/devicecontroller/ChipClusters$AudioOutputCluster$AudioOutputListAttribute")); chip::JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(IILjava/lang/String;)V"); + jmethodID attributeCtor = + env->GetMethodID(attributeClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;)V"); VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find AudioOutputListAttribute constructor")); auto iter = list.begin(); @@ -588,10 +741,47 @@ void CHIPAudioOutputAudioOutputListAttributeCallback::CallbackFn( { auto & entry = iter.GetValue(); (void) entry; - jint index = entry.index; - jint outputType = entry.outputType; - chip::UtfString nameStr(env, entry.name); - jstring name(nameStr.jniValue()); + bool indexNull = false; + bool indexHasValue = true; + + uint8_t indexValue = entry.index; + + jobject index = nullptr; + if (!indexNull && indexHasValue) + { + jclass indexEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", indexEntryCls); + chip::JniClass indexJniClass(indexEntryCls); + jmethodID indexEntryTypeCtor = env->GetMethodID(indexEntryCls, "", "(I)V"); + index = env->NewObject(indexEntryCls, indexEntryTypeCtor, indexValue); + } + + bool outputTypeNull = false; + bool outputTypeHasValue = true; + + uint8_t outputTypeValue = entry.outputType; + + jobject outputType = nullptr; + if (!outputTypeNull && outputTypeHasValue) + { + jclass outputTypeEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", outputTypeEntryCls); + chip::JniClass outputTypeJniClass(outputTypeEntryCls); + jmethodID outputTypeEntryTypeCtor = env->GetMethodID(outputTypeEntryCls, "", "(I)V"); + outputType = env->NewObject(outputTypeEntryCls, outputTypeEntryTypeCtor, outputTypeValue); + } + + bool nameNull = false; + bool nameHasValue = true; + + chip::CharSpan nameValue = entry.name; + + jstring name = nullptr; + chip::UtfString nameStr(env, nameValue); + if (!nameNull && nameHasValue) + { + name = jstring(nameStr.jniValue()); + } jobject attributeObj = env->NewObject(attributeClass, attributeCtor, index, outputType, name); VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create AudioOutputListAttribute object")); @@ -623,6 +813,17 @@ CHIPBridgedActionsActionListAttributeCallback::CHIPBridgedActionsActionListAttri } } +CHIPBridgedActionsActionListAttributeCallback::~CHIPBridgedActionsActionListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPBridgedActionsActionListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) @@ -664,7 +865,9 @@ void CHIPBridgedActionsActionListAttributeCallback::CallbackFn( err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find class chip/devicecontroller/ChipClusters$BridgedActionsCluster$ActionListAttribute")); chip::JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(ILjava/lang/String;IIII)V"); + jmethodID attributeCtor = env->GetMethodID( + attributeClass, "", + "(Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V"); VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find ActionListAttribute constructor")); auto iter = list.begin(); @@ -672,13 +875,92 @@ void CHIPBridgedActionsActionListAttributeCallback::CallbackFn( { auto & entry = iter.GetValue(); (void) entry; - jint actionID = entry.actionID; - chip::UtfString nameStr(env, entry.name); - jstring name(nameStr.jniValue()); - jint type = entry.type; - jint endpointListID = entry.endpointListID; - jint supportedCommands = entry.supportedCommands; - jint status = entry.status; + bool actionIDNull = false; + bool actionIDHasValue = true; + + uint16_t actionIDValue = entry.actionID; + + jobject actionID = nullptr; + if (!actionIDNull && actionIDHasValue) + { + jclass actionIDEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", actionIDEntryCls); + chip::JniClass actionIDJniClass(actionIDEntryCls); + jmethodID actionIDEntryTypeCtor = env->GetMethodID(actionIDEntryCls, "", "(I)V"); + actionID = env->NewObject(actionIDEntryCls, actionIDEntryTypeCtor, actionIDValue); + } + + bool nameNull = false; + bool nameHasValue = true; + + chip::CharSpan nameValue = entry.name; + + jstring name = nullptr; + chip::UtfString nameStr(env, nameValue); + if (!nameNull && nameHasValue) + { + name = jstring(nameStr.jniValue()); + } + + bool typeNull = false; + bool typeHasValue = true; + + uint8_t typeValue = entry.type; + + jobject type = nullptr; + if (!typeNull && typeHasValue) + { + jclass typeEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", typeEntryCls); + chip::JniClass typeJniClass(typeEntryCls); + jmethodID typeEntryTypeCtor = env->GetMethodID(typeEntryCls, "", "(I)V"); + type = env->NewObject(typeEntryCls, typeEntryTypeCtor, typeValue); + } + + bool endpointListIDNull = false; + bool endpointListIDHasValue = true; + + uint16_t endpointListIDValue = entry.endpointListID; + + jobject endpointListID = nullptr; + if (!endpointListIDNull && endpointListIDHasValue) + { + jclass endpointListIDEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", endpointListIDEntryCls); + chip::JniClass endpointListIDJniClass(endpointListIDEntryCls); + jmethodID endpointListIDEntryTypeCtor = env->GetMethodID(endpointListIDEntryCls, "", "(I)V"); + endpointListID = env->NewObject(endpointListIDEntryCls, endpointListIDEntryTypeCtor, endpointListIDValue); + } + + bool supportedCommandsNull = false; + bool supportedCommandsHasValue = true; + + uint16_t supportedCommandsValue = entry.supportedCommands; + + jobject supportedCommands = nullptr; + if (!supportedCommandsNull && supportedCommandsHasValue) + { + jclass supportedCommandsEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", supportedCommandsEntryCls); + chip::JniClass supportedCommandsJniClass(supportedCommandsEntryCls); + jmethodID supportedCommandsEntryTypeCtor = env->GetMethodID(supportedCommandsEntryCls, "", "(I)V"); + supportedCommands = env->NewObject(supportedCommandsEntryCls, supportedCommandsEntryTypeCtor, supportedCommandsValue); + } + + bool statusNull = false; + bool statusHasValue = true; + + uint8_t statusValue = entry.status; + + jobject status = nullptr; + if (!statusNull && statusHasValue) + { + jclass statusEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", statusEntryCls); + chip::JniClass statusJniClass(statusEntryCls); + jmethodID statusEntryTypeCtor = env->GetMethodID(statusEntryCls, "", "(I)V"); + status = env->NewObject(statusEntryCls, statusEntryTypeCtor, statusValue); + } jobject attributeObj = env->NewObject(attributeClass, attributeCtor, actionID, name, type, endpointListID, supportedCommands, status); @@ -710,6 +992,17 @@ CHIPBridgedActionsEndpointListAttributeCallback::CHIPBridgedActionsEndpointListA } } +CHIPBridgedActionsEndpointListAttributeCallback::~CHIPBridgedActionsEndpointListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPBridgedActionsEndpointListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & @@ -752,7 +1045,8 @@ void CHIPBridgedActionsEndpointListAttributeCallback::CallbackFn( err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find class chip/devicecontroller/ChipClusters$BridgedActionsCluster$EndpointListAttribute")); chip::JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(ILjava/lang/String;I[B)V"); + jmethodID attributeCtor = + env->GetMethodID(attributeClass, "", "(Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Integer;[B)V"); VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find EndpointListAttribute constructor")); auto iter = list.begin(); @@ -760,12 +1054,59 @@ void CHIPBridgedActionsEndpointListAttributeCallback::CallbackFn( { auto & entry = iter.GetValue(); (void) entry; - jint endpointListID = entry.endpointListID; - chip::UtfString nameStr(env, entry.name); - jstring name(nameStr.jniValue()); - jint type = entry.type; - jbyteArray endpoints = env->NewByteArray(entry.endpoints.size()); - env->SetByteArrayRegion(endpoints, 0, entry.endpoints.size(), reinterpret_cast(entry.endpoints.data())); + bool endpointListIDNull = false; + bool endpointListIDHasValue = true; + + uint16_t endpointListIDValue = entry.endpointListID; + + jobject endpointListID = nullptr; + if (!endpointListIDNull && endpointListIDHasValue) + { + jclass endpointListIDEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", endpointListIDEntryCls); + chip::JniClass endpointListIDJniClass(endpointListIDEntryCls); + jmethodID endpointListIDEntryTypeCtor = env->GetMethodID(endpointListIDEntryCls, "", "(I)V"); + endpointListID = env->NewObject(endpointListIDEntryCls, endpointListIDEntryTypeCtor, endpointListIDValue); + } + + bool nameNull = false; + bool nameHasValue = true; + + chip::CharSpan nameValue = entry.name; + + jstring name = nullptr; + chip::UtfString nameStr(env, nameValue); + if (!nameNull && nameHasValue) + { + name = jstring(nameStr.jniValue()); + } + + bool typeNull = false; + bool typeHasValue = true; + + uint8_t typeValue = entry.type; + + jobject type = nullptr; + if (!typeNull && typeHasValue) + { + jclass typeEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", typeEntryCls); + chip::JniClass typeJniClass(typeEntryCls); + jmethodID typeEntryTypeCtor = env->GetMethodID(typeEntryCls, "", "(I)V"); + type = env->NewObject(typeEntryCls, typeEntryTypeCtor, typeValue); + } + + bool endpointsNull = false; + bool endpointsHasValue = true; + + chip::ByteSpan endpointsValue = entry.endpoints; + + jbyteArray endpoints = nullptr; + if (!endpointsNull && endpointsHasValue) + { + endpoints = env->NewByteArray(endpointsValue.size()); + env->SetByteArrayRegion(endpoints, 0, endpointsValue.size(), reinterpret_cast(endpointsValue.data())); + } jobject attributeObj = env->NewObject(attributeClass, attributeCtor, endpointListID, name, type, endpoints); VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create EndpointListAttribute object")); @@ -796,6 +1137,17 @@ CHIPContentLauncherAcceptsHeaderListAttributeCallback::CHIPContentLauncherAccept } } +CHIPContentLauncherAcceptsHeaderListAttributeCallback::~CHIPContentLauncherAcceptsHeaderListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPContentLauncherAcceptsHeaderListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { @@ -832,10 +1184,18 @@ void CHIPContentLauncherAcceptsHeaderListAttributeCallback::CallbackFn( auto iter = list.begin(); while (iter.Next()) { - auto & entry = iter.GetValue(); - jbyteArray acceptsHeaderList = env->NewByteArray(entry.size()); - env->SetByteArrayRegion(acceptsHeaderList, 0, entry.size(), reinterpret_cast(entry.data())); - env->CallBooleanMethod(arrayListObj, arrayListAddMethod, acceptsHeaderList); + auto & entry = iter.GetValue(); + bool entryNull = false; + chip::ByteSpan entryValue = entry; + + jbyteArray entryObject = nullptr; + if (!entryNull) + { + entryObject = env->NewByteArray(entryValue.size()); + env->SetByteArrayRegion(entryObject, 0, entryValue.size(), reinterpret_cast(entryValue.data())); + } + + env->CallBooleanMethod(arrayListObj, arrayListAddMethod, entryObject); } VerifyOrReturn( iter.GetStatus() == CHIP_NO_ERROR, @@ -863,6 +1223,17 @@ CHIPContentLauncherSupportedStreamingTypesAttributeCallback::CHIPContentLauncher } } +CHIPContentLauncherSupportedStreamingTypesAttributeCallback::~CHIPContentLauncherSupportedStreamingTypesAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPContentLauncherSupportedStreamingTypesAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) @@ -900,12 +1271,21 @@ void CHIPContentLauncherSupportedStreamingTypesAttributeCallback::CallbackFn( auto iter = list.begin(); while (iter.Next()) { - auto & entry = iter.GetValue(); - jclass entryTypeCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", entryTypeCls); - jmethodID entryTypeCtor = env->GetMethodID(entryTypeCls, "", "(I)V"); - jobject supportedStreamingTypes = env->NewObject(entryTypeCls, entryTypeCtor, entry); - env->CallBooleanMethod(arrayListObj, arrayListAddMethod, supportedStreamingTypes); + auto & entry = iter.GetValue(); + bool entryNull = false; + uint8_t entryValue = entry; + + jobject entryObject = nullptr; + if (!entryNull) + { + jclass entryTypeCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", entryTypeCls); + chip::JniClass jniClass(entryTypeCls); + jmethodID entryTypeCtor = env->GetMethodID(entryTypeCls, "", "(I)V"); + entryObject = env->NewObject(entryTypeCls, entryTypeCtor, entryValue); + } + + env->CallBooleanMethod(arrayListObj, arrayListAddMethod, entryObject); } VerifyOrReturn( iter.GetStatus() == CHIP_NO_ERROR, @@ -932,6 +1312,17 @@ CHIPDescriptorDeviceListAttributeCallback::CHIPDescriptorDeviceListAttributeCall } } +CHIPDescriptorDeviceListAttributeCallback::~CHIPDescriptorDeviceListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPDescriptorDeviceListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) @@ -973,7 +1364,7 @@ void CHIPDescriptorDeviceListAttributeCallback::CallbackFn( err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find class chip/devicecontroller/ChipClusters$DescriptorCluster$DeviceListAttribute")); chip::JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(JI)V"); + jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(Ljava/lang/Long;Ljava/lang/Integer;)V"); VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find DeviceListAttribute constructor")); auto iter = list.begin(); @@ -981,8 +1372,35 @@ void CHIPDescriptorDeviceListAttributeCallback::CallbackFn( { auto & entry = iter.GetValue(); (void) entry; - jlong type = entry.type; - jint revision = entry.revision; + bool typeNull = false; + bool typeHasValue = true; + + chip::DeviceTypeId typeValue = entry.type; + + jobject type = nullptr; + if (!typeNull && typeHasValue) + { + jclass typeEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", typeEntryCls); + chip::JniClass typeJniClass(typeEntryCls); + jmethodID typeEntryTypeCtor = env->GetMethodID(typeEntryCls, "", "(J)V"); + type = env->NewObject(typeEntryCls, typeEntryTypeCtor, typeValue); + } + + bool revisionNull = false; + bool revisionHasValue = true; + + uint16_t revisionValue = entry.revision; + + jobject revision = nullptr; + if (!revisionNull && revisionHasValue) + { + jclass revisionEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", revisionEntryCls); + chip::JniClass revisionJniClass(revisionEntryCls); + jmethodID revisionEntryTypeCtor = env->GetMethodID(revisionEntryCls, "", "(I)V"); + revision = env->NewObject(revisionEntryCls, revisionEntryTypeCtor, revisionValue); + } jobject attributeObj = env->NewObject(attributeClass, attributeCtor, type, revision); VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create DeviceListAttribute object")); @@ -1013,6 +1431,17 @@ CHIPDescriptorServerListAttributeCallback::CHIPDescriptorServerListAttributeCall } } +CHIPDescriptorServerListAttributeCallback::~CHIPDescriptorServerListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPDescriptorServerListAttributeCallback::CallbackFn(void * context, const chip::app::DataModel::DecodableList & list) { @@ -1049,12 +1478,21 @@ void CHIPDescriptorServerListAttributeCallback::CallbackFn(void * context, auto iter = list.begin(); while (iter.Next()) { - auto & entry = iter.GetValue(); - jclass entryTypeCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", entryTypeCls); - jmethodID entryTypeCtor = env->GetMethodID(entryTypeCls, "", "(J)V"); - jobject serverList = env->NewObject(entryTypeCls, entryTypeCtor, entry); - env->CallBooleanMethod(arrayListObj, arrayListAddMethod, serverList); + auto & entry = iter.GetValue(); + bool entryNull = false; + chip::ClusterId entryValue = entry; + + jobject entryObject = nullptr; + if (!entryNull) + { + jclass entryTypeCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", entryTypeCls); + chip::JniClass jniClass(entryTypeCls); + jmethodID entryTypeCtor = env->GetMethodID(entryTypeCls, "", "(J)V"); + entryObject = env->NewObject(entryTypeCls, entryTypeCtor, entryValue); + } + + env->CallBooleanMethod(arrayListObj, arrayListAddMethod, entryObject); } VerifyOrReturn(iter.GetStatus() == CHIP_NO_ERROR, ChipLogError(Zcl, "Error decoding ServerListAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); @@ -1080,6 +1518,17 @@ CHIPDescriptorClientListAttributeCallback::CHIPDescriptorClientListAttributeCall } } +CHIPDescriptorClientListAttributeCallback::~CHIPDescriptorClientListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPDescriptorClientListAttributeCallback::CallbackFn(void * context, const chip::app::DataModel::DecodableList & list) { @@ -1116,12 +1565,21 @@ void CHIPDescriptorClientListAttributeCallback::CallbackFn(void * context, auto iter = list.begin(); while (iter.Next()) { - auto & entry = iter.GetValue(); - jclass entryTypeCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", entryTypeCls); - jmethodID entryTypeCtor = env->GetMethodID(entryTypeCls, "", "(J)V"); - jobject clientList = env->NewObject(entryTypeCls, entryTypeCtor, entry); - env->CallBooleanMethod(arrayListObj, arrayListAddMethod, clientList); + auto & entry = iter.GetValue(); + bool entryNull = false; + chip::ClusterId entryValue = entry; + + jobject entryObject = nullptr; + if (!entryNull) + { + jclass entryTypeCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", entryTypeCls); + chip::JniClass jniClass(entryTypeCls); + jmethodID entryTypeCtor = env->GetMethodID(entryTypeCls, "", "(J)V"); + entryObject = env->NewObject(entryTypeCls, entryTypeCtor, entryValue); + } + + env->CallBooleanMethod(arrayListObj, arrayListAddMethod, entryObject); } VerifyOrReturn(iter.GetStatus() == CHIP_NO_ERROR, ChipLogError(Zcl, "Error decoding ClientListAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); @@ -1147,6 +1605,17 @@ CHIPDescriptorPartsListAttributeCallback::CHIPDescriptorPartsListAttributeCallba } } +CHIPDescriptorPartsListAttributeCallback::~CHIPDescriptorPartsListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPDescriptorPartsListAttributeCallback::CallbackFn(void * context, const chip::app::DataModel::DecodableList & list) { @@ -1183,12 +1652,21 @@ void CHIPDescriptorPartsListAttributeCallback::CallbackFn(void * context, auto iter = list.begin(); while (iter.Next()) { - auto & entry = iter.GetValue(); - jclass entryTypeCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", entryTypeCls); - jmethodID entryTypeCtor = env->GetMethodID(entryTypeCls, "", "(I)V"); - jobject partsList = env->NewObject(entryTypeCls, entryTypeCtor, entry); - env->CallBooleanMethod(arrayListObj, arrayListAddMethod, partsList); + auto & entry = iter.GetValue(); + bool entryNull = false; + chip::EndpointId entryValue = entry; + + jobject entryObject = nullptr; + if (!entryNull) + { + jclass entryTypeCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", entryTypeCls); + chip::JniClass jniClass(entryTypeCls); + jmethodID entryTypeCtor = env->GetMethodID(entryTypeCls, "", "(I)V"); + entryObject = env->NewObject(entryTypeCls, entryTypeCtor, entryValue); + } + + env->CallBooleanMethod(arrayListObj, arrayListAddMethod, entryObject); } VerifyOrReturn(iter.GetStatus() == CHIP_NO_ERROR, ChipLogError(Zcl, "Error decoding PartsListAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); @@ -1214,6 +1692,17 @@ CHIPFixedLabelLabelListAttributeCallback::CHIPFixedLabelLabelListAttributeCallba } } +CHIPFixedLabelLabelListAttributeCallback::~CHIPFixedLabelLabelListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPFixedLabelLabelListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) @@ -1263,10 +1752,29 @@ void CHIPFixedLabelLabelListAttributeCallback::CallbackFn( { auto & entry = iter.GetValue(); (void) entry; - chip::UtfString labelStr(env, entry.label); - jstring label(labelStr.jniValue()); - chip::UtfString valueStr(env, entry.value); - jstring value(valueStr.jniValue()); + bool labelNull = false; + bool labelHasValue = true; + + chip::CharSpan labelValue = entry.label; + + jstring label = nullptr; + chip::UtfString labelStr(env, labelValue); + if (!labelNull && labelHasValue) + { + label = jstring(labelStr.jniValue()); + } + + bool valueNull = false; + bool valueHasValue = true; + + chip::CharSpan valueValue = entry.value; + + jstring value = nullptr; + chip::UtfString valueStr(env, valueValue); + if (!valueNull && valueHasValue) + { + value = jstring(valueStr.jniValue()); + } jobject attributeObj = env->NewObject(attributeClass, attributeCtor, label, value); VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create LabelListAttribute object")); @@ -1298,6 +1806,18 @@ CHIPGeneralCommissioningBasicCommissioningInfoListAttributeCallback:: } } +CHIPGeneralCommissioningBasicCommissioningInfoListAttributeCallback:: + ~CHIPGeneralCommissioningBasicCommissioningInfoListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPGeneralCommissioningBasicCommissioningInfoListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList< @@ -1342,7 +1862,7 @@ void CHIPGeneralCommissioningBasicCommissioningInfoListAttributeCallback::Callba "Could not find class " "chip/devicecontroller/ChipClusters$GeneralCommissioningCluster$BasicCommissioningInfoListAttribute")); chip::JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(J)V"); + jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(Ljava/lang/Long;)V"); VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find BasicCommissioningInfoListAttribute constructor")); auto iter = list.begin(); @@ -1350,7 +1870,21 @@ void CHIPGeneralCommissioningBasicCommissioningInfoListAttributeCallback::Callba { auto & entry = iter.GetValue(); (void) entry; - jlong failSafeExpiryLengthMs = entry.failSafeExpiryLengthMs; + bool failSafeExpiryLengthMsNull = false; + bool failSafeExpiryLengthMsHasValue = true; + + uint32_t failSafeExpiryLengthMsValue = entry.failSafeExpiryLengthMs; + + jobject failSafeExpiryLengthMs = nullptr; + if (!failSafeExpiryLengthMsNull && failSafeExpiryLengthMsHasValue) + { + jclass failSafeExpiryLengthMsEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", failSafeExpiryLengthMsEntryCls); + chip::JniClass failSafeExpiryLengthMsJniClass(failSafeExpiryLengthMsEntryCls); + jmethodID failSafeExpiryLengthMsEntryTypeCtor = env->GetMethodID(failSafeExpiryLengthMsEntryCls, "", "(J)V"); + failSafeExpiryLengthMs = + env->NewObject(failSafeExpiryLengthMsEntryCls, failSafeExpiryLengthMsEntryTypeCtor, failSafeExpiryLengthMsValue); + } jobject attributeObj = env->NewObject(attributeClass, attributeCtor, failSafeExpiryLengthMs); VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create BasicCommissioningInfoListAttribute object")); @@ -1383,6 +1917,17 @@ CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback::CHIPGeneralDiagnostics } } +CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback::~CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList< @@ -1426,7 +1971,9 @@ void CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback::CallbackFn( ChipLogError( Zcl, "Could not find class chip/devicecontroller/ChipClusters$GeneralDiagnosticsCluster$NetworkInterfacesAttribute")); chip::JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(Ljava/lang/String;ZZZ[BI)V"); + jmethodID attributeCtor = + env->GetMethodID(attributeClass, "", + "(Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;[BLjava/lang/Integer;)V"); VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find NetworkInterfacesAttribute constructor")); auto iter = list.begin(); @@ -1434,15 +1981,96 @@ void CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback::CallbackFn( { auto & entry = iter.GetValue(); (void) entry; - chip::UtfString nameStr(env, entry.name); - jstring name(nameStr.jniValue()); - jboolean fabricConnected = entry.fabricConnected; - jboolean offPremiseServicesReachableIPv4 = entry.offPremiseServicesReachableIPv4; - jboolean offPremiseServicesReachableIPv6 = entry.offPremiseServicesReachableIPv6; - jbyteArray hardwareAddress = env->NewByteArray(entry.hardwareAddress.size()); - env->SetByteArrayRegion(hardwareAddress, 0, entry.hardwareAddress.size(), - reinterpret_cast(entry.hardwareAddress.data())); - jint type = entry.type; + bool nameNull = false; + bool nameHasValue = true; + + chip::CharSpan nameValue = entry.name; + + jstring name = nullptr; + chip::UtfString nameStr(env, nameValue); + if (!nameNull && nameHasValue) + { + name = jstring(nameStr.jniValue()); + } + + bool fabricConnectedNull = false; + bool fabricConnectedHasValue = true; + + bool fabricConnectedValue = entry.fabricConnected; + + jobject fabricConnected = nullptr; + if (!fabricConnectedNull && fabricConnectedHasValue) + { + jclass fabricConnectedEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Boolean", fabricConnectedEntryCls); + chip::JniClass fabricConnectedJniClass(fabricConnectedEntryCls); + jmethodID fabricConnectedEntryTypeCtor = env->GetMethodID(fabricConnectedEntryCls, "", "(Z)V"); + fabricConnected = env->NewObject(fabricConnectedEntryCls, fabricConnectedEntryTypeCtor, fabricConnectedValue); + } + + bool offPremiseServicesReachableIPv4Null = false; + bool offPremiseServicesReachableIPv4HasValue = true; + + bool offPremiseServicesReachableIPv4Value = entry.offPremiseServicesReachableIPv4; + + jobject offPremiseServicesReachableIPv4 = nullptr; + if (!offPremiseServicesReachableIPv4Null && offPremiseServicesReachableIPv4HasValue) + { + jclass offPremiseServicesReachableIPv4EntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Boolean", offPremiseServicesReachableIPv4EntryCls); + chip::JniClass offPremiseServicesReachableIPv4JniClass(offPremiseServicesReachableIPv4EntryCls); + jmethodID offPremiseServicesReachableIPv4EntryTypeCtor = + env->GetMethodID(offPremiseServicesReachableIPv4EntryCls, "", "(Z)V"); + offPremiseServicesReachableIPv4 = + env->NewObject(offPremiseServicesReachableIPv4EntryCls, offPremiseServicesReachableIPv4EntryTypeCtor, + offPremiseServicesReachableIPv4Value); + } + + bool offPremiseServicesReachableIPv6Null = false; + bool offPremiseServicesReachableIPv6HasValue = true; + + bool offPremiseServicesReachableIPv6Value = entry.offPremiseServicesReachableIPv6; + + jobject offPremiseServicesReachableIPv6 = nullptr; + if (!offPremiseServicesReachableIPv6Null && offPremiseServicesReachableIPv6HasValue) + { + jclass offPremiseServicesReachableIPv6EntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Boolean", offPremiseServicesReachableIPv6EntryCls); + chip::JniClass offPremiseServicesReachableIPv6JniClass(offPremiseServicesReachableIPv6EntryCls); + jmethodID offPremiseServicesReachableIPv6EntryTypeCtor = + env->GetMethodID(offPremiseServicesReachableIPv6EntryCls, "", "(Z)V"); + offPremiseServicesReachableIPv6 = + env->NewObject(offPremiseServicesReachableIPv6EntryCls, offPremiseServicesReachableIPv6EntryTypeCtor, + offPremiseServicesReachableIPv6Value); + } + + bool hardwareAddressNull = false; + bool hardwareAddressHasValue = true; + + chip::ByteSpan hardwareAddressValue = entry.hardwareAddress; + + jbyteArray hardwareAddress = nullptr; + if (!hardwareAddressNull && hardwareAddressHasValue) + { + hardwareAddress = env->NewByteArray(hardwareAddressValue.size()); + env->SetByteArrayRegion(hardwareAddress, 0, hardwareAddressValue.size(), + reinterpret_cast(hardwareAddressValue.data())); + } + + bool typeNull = false; + bool typeHasValue = true; + + uint8_t typeValue = entry.type; + + jobject type = nullptr; + if (!typeNull && typeHasValue) + { + jclass typeEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", typeEntryCls); + chip::JniClass typeJniClass(typeEntryCls); + jmethodID typeEntryTypeCtor = env->GetMethodID(typeEntryCls, "", "(I)V"); + type = env->NewObject(typeEntryCls, typeEntryTypeCtor, typeValue); + } jobject attributeObj = env->NewObject(attributeClass, attributeCtor, name, fabricConnected, offPremiseServicesReachableIPv4, offPremiseServicesReachableIPv6, hardwareAddress, type); @@ -1475,6 +2103,17 @@ CHIPGroupKeyManagementGroupsAttributeCallback::CHIPGroupKeyManagementGroupsAttri } } +CHIPGroupKeyManagementGroupsAttributeCallback::~CHIPGroupKeyManagementGroupsAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPGroupKeyManagementGroupsAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) @@ -1516,7 +2155,8 @@ void CHIPGroupKeyManagementGroupsAttributeCallback::CallbackFn( err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find class chip/devicecontroller/ChipClusters$GroupKeyManagementCluster$GroupsAttribute")); chip::JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(III)V"); + jmethodID attributeCtor = + env->GetMethodID(attributeClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V"); VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find GroupsAttribute constructor")); auto iter = list.begin(); @@ -1524,9 +2164,50 @@ void CHIPGroupKeyManagementGroupsAttributeCallback::CallbackFn( { auto & entry = iter.GetValue(); (void) entry; - jint vendorId = entry.vendorId; - jint vendorGroupId = entry.vendorGroupId; - jint groupKeySetIndex = entry.groupKeySetIndex; + bool vendorIdNull = false; + bool vendorIdHasValue = true; + + uint16_t vendorIdValue = entry.vendorId; + + jobject vendorId = nullptr; + if (!vendorIdNull && vendorIdHasValue) + { + jclass vendorIdEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", vendorIdEntryCls); + chip::JniClass vendorIdJniClass(vendorIdEntryCls); + jmethodID vendorIdEntryTypeCtor = env->GetMethodID(vendorIdEntryCls, "", "(I)V"); + vendorId = env->NewObject(vendorIdEntryCls, vendorIdEntryTypeCtor, vendorIdValue); + } + + bool vendorGroupIdNull = false; + bool vendorGroupIdHasValue = true; + + uint16_t vendorGroupIdValue = entry.vendorGroupId; + + jobject vendorGroupId = nullptr; + if (!vendorGroupIdNull && vendorGroupIdHasValue) + { + jclass vendorGroupIdEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", vendorGroupIdEntryCls); + chip::JniClass vendorGroupIdJniClass(vendorGroupIdEntryCls); + jmethodID vendorGroupIdEntryTypeCtor = env->GetMethodID(vendorGroupIdEntryCls, "", "(I)V"); + vendorGroupId = env->NewObject(vendorGroupIdEntryCls, vendorGroupIdEntryTypeCtor, vendorGroupIdValue); + } + + bool groupKeySetIndexNull = false; + bool groupKeySetIndexHasValue = true; + + uint16_t groupKeySetIndexValue = entry.groupKeySetIndex; + + jobject groupKeySetIndex = nullptr; + if (!groupKeySetIndexNull && groupKeySetIndexHasValue) + { + jclass groupKeySetIndexEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", groupKeySetIndexEntryCls); + chip::JniClass groupKeySetIndexJniClass(groupKeySetIndexEntryCls); + jmethodID groupKeySetIndexEntryTypeCtor = env->GetMethodID(groupKeySetIndexEntryCls, "", "(I)V"); + groupKeySetIndex = env->NewObject(groupKeySetIndexEntryCls, groupKeySetIndexEntryTypeCtor, groupKeySetIndexValue); + } jobject attributeObj = env->NewObject(attributeClass, attributeCtor, vendorId, vendorGroupId, groupKeySetIndex); VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create GroupsAttribute object")); @@ -1557,6 +2238,17 @@ CHIPGroupKeyManagementGroupKeysAttributeCallback::CHIPGroupKeyManagementGroupKey } } +CHIPGroupKeyManagementGroupKeysAttributeCallback::~CHIPGroupKeyManagementGroupKeysAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPGroupKeyManagementGroupKeysAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) @@ -1598,7 +2290,8 @@ void CHIPGroupKeyManagementGroupKeysAttributeCallback::CallbackFn( err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find class chip/devicecontroller/ChipClusters$GroupKeyManagementCluster$GroupKeysAttribute")); chip::JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(II[BJI)V"); + jmethodID attributeCtor = env->GetMethodID(attributeClass, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;[BLjava/lang/Long;Ljava/lang/Integer;)V"); VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find GroupKeysAttribute constructor")); auto iter = list.begin(); @@ -1606,13 +2299,80 @@ void CHIPGroupKeyManagementGroupKeysAttributeCallback::CallbackFn( { auto & entry = iter.GetValue(); (void) entry; - jint vendorId = entry.vendorId; - jint groupKeyIndex = entry.groupKeyIndex; - jbyteArray groupKeyRoot = env->NewByteArray(entry.groupKeyRoot.size()); - env->SetByteArrayRegion(groupKeyRoot, 0, entry.groupKeyRoot.size(), - reinterpret_cast(entry.groupKeyRoot.data())); - jlong groupKeyEpochStartTime = entry.groupKeyEpochStartTime; - jint groupKeySecurityPolicy = entry.groupKeySecurityPolicy; + bool vendorIdNull = false; + bool vendorIdHasValue = true; + + uint16_t vendorIdValue = entry.vendorId; + + jobject vendorId = nullptr; + if (!vendorIdNull && vendorIdHasValue) + { + jclass vendorIdEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", vendorIdEntryCls); + chip::JniClass vendorIdJniClass(vendorIdEntryCls); + jmethodID vendorIdEntryTypeCtor = env->GetMethodID(vendorIdEntryCls, "", "(I)V"); + vendorId = env->NewObject(vendorIdEntryCls, vendorIdEntryTypeCtor, vendorIdValue); + } + + bool groupKeyIndexNull = false; + bool groupKeyIndexHasValue = true; + + uint16_t groupKeyIndexValue = entry.groupKeyIndex; + + jobject groupKeyIndex = nullptr; + if (!groupKeyIndexNull && groupKeyIndexHasValue) + { + jclass groupKeyIndexEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", groupKeyIndexEntryCls); + chip::JniClass groupKeyIndexJniClass(groupKeyIndexEntryCls); + jmethodID groupKeyIndexEntryTypeCtor = env->GetMethodID(groupKeyIndexEntryCls, "", "(I)V"); + groupKeyIndex = env->NewObject(groupKeyIndexEntryCls, groupKeyIndexEntryTypeCtor, groupKeyIndexValue); + } + + bool groupKeyRootNull = false; + bool groupKeyRootHasValue = true; + + chip::ByteSpan groupKeyRootValue = entry.groupKeyRoot; + + jbyteArray groupKeyRoot = nullptr; + if (!groupKeyRootNull && groupKeyRootHasValue) + { + groupKeyRoot = env->NewByteArray(groupKeyRootValue.size()); + env->SetByteArrayRegion(groupKeyRoot, 0, groupKeyRootValue.size(), + reinterpret_cast(groupKeyRootValue.data())); + } + + bool groupKeyEpochStartTimeNull = false; + bool groupKeyEpochStartTimeHasValue = true; + + uint64_t groupKeyEpochStartTimeValue = entry.groupKeyEpochStartTime; + + jobject groupKeyEpochStartTime = nullptr; + if (!groupKeyEpochStartTimeNull && groupKeyEpochStartTimeHasValue) + { + jclass groupKeyEpochStartTimeEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", groupKeyEpochStartTimeEntryCls); + chip::JniClass groupKeyEpochStartTimeJniClass(groupKeyEpochStartTimeEntryCls); + jmethodID groupKeyEpochStartTimeEntryTypeCtor = env->GetMethodID(groupKeyEpochStartTimeEntryCls, "", "(J)V"); + groupKeyEpochStartTime = + env->NewObject(groupKeyEpochStartTimeEntryCls, groupKeyEpochStartTimeEntryTypeCtor, groupKeyEpochStartTimeValue); + } + + bool groupKeySecurityPolicyNull = false; + bool groupKeySecurityPolicyHasValue = true; + + uint8_t groupKeySecurityPolicyValue = entry.groupKeySecurityPolicy; + + jobject groupKeySecurityPolicy = nullptr; + if (!groupKeySecurityPolicyNull && groupKeySecurityPolicyHasValue) + { + jclass groupKeySecurityPolicyEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", groupKeySecurityPolicyEntryCls); + chip::JniClass groupKeySecurityPolicyJniClass(groupKeySecurityPolicyEntryCls); + jmethodID groupKeySecurityPolicyEntryTypeCtor = env->GetMethodID(groupKeySecurityPolicyEntryCls, "", "(I)V"); + groupKeySecurityPolicy = + env->NewObject(groupKeySecurityPolicyEntryCls, groupKeySecurityPolicyEntryTypeCtor, groupKeySecurityPolicyValue); + } jobject attributeObj = env->NewObject(attributeClass, attributeCtor, vendorId, groupKeyIndex, groupKeyRoot, groupKeyEpochStartTime, groupKeySecurityPolicy); @@ -1644,6 +2404,17 @@ CHIPMediaInputMediaInputListAttributeCallback::CHIPMediaInputMediaInputListAttri } } +CHIPMediaInputMediaInputListAttributeCallback::~CHIPMediaInputMediaInputListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPMediaInputMediaInputListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) @@ -1685,7 +2456,8 @@ void CHIPMediaInputMediaInputListAttributeCallback::CallbackFn( err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find class chip/devicecontroller/ChipClusters$MediaInputCluster$MediaInputListAttribute")); chip::JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(IILjava/lang/String;Ljava/lang/String;)V"); + jmethodID attributeCtor = + env->GetMethodID(attributeClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;)V"); VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find MediaInputListAttribute constructor")); auto iter = list.begin(); @@ -1693,12 +2465,59 @@ void CHIPMediaInputMediaInputListAttributeCallback::CallbackFn( { auto & entry = iter.GetValue(); (void) entry; - jint index = entry.index; - jint inputType = entry.inputType; - chip::UtfString nameStr(env, entry.name); - jstring name(nameStr.jniValue()); - chip::UtfString descriptionStr(env, entry.description); - jstring description(descriptionStr.jniValue()); + bool indexNull = false; + bool indexHasValue = true; + + uint8_t indexValue = entry.index; + + jobject index = nullptr; + if (!indexNull && indexHasValue) + { + jclass indexEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", indexEntryCls); + chip::JniClass indexJniClass(indexEntryCls); + jmethodID indexEntryTypeCtor = env->GetMethodID(indexEntryCls, "", "(I)V"); + index = env->NewObject(indexEntryCls, indexEntryTypeCtor, indexValue); + } + + bool inputTypeNull = false; + bool inputTypeHasValue = true; + + uint8_t inputTypeValue = entry.inputType; + + jobject inputType = nullptr; + if (!inputTypeNull && inputTypeHasValue) + { + jclass inputTypeEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", inputTypeEntryCls); + chip::JniClass inputTypeJniClass(inputTypeEntryCls); + jmethodID inputTypeEntryTypeCtor = env->GetMethodID(inputTypeEntryCls, "", "(I)V"); + inputType = env->NewObject(inputTypeEntryCls, inputTypeEntryTypeCtor, inputTypeValue); + } + + bool nameNull = false; + bool nameHasValue = true; + + chip::CharSpan nameValue = entry.name; + + jstring name = nullptr; + chip::UtfString nameStr(env, nameValue); + if (!nameNull && nameHasValue) + { + name = jstring(nameStr.jniValue()); + } + + bool descriptionNull = false; + bool descriptionHasValue = true; + + chip::CharSpan descriptionValue = entry.description; + + jstring description = nullptr; + chip::UtfString descriptionStr(env, descriptionValue); + if (!descriptionNull && descriptionHasValue) + { + description = jstring(descriptionStr.jniValue()); + } jobject attributeObj = env->NewObject(attributeClass, attributeCtor, index, inputType, name, description); VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create MediaInputListAttribute object")); @@ -1730,6 +2549,17 @@ CHIPModeSelectSupportedModesAttributeCallback::CHIPModeSelectSupportedModesAttri } } +CHIPModeSelectSupportedModesAttributeCallback::~CHIPModeSelectSupportedModesAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPModeSelectSupportedModesAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) @@ -1771,7 +2601,8 @@ void CHIPModeSelectSupportedModesAttributeCallback::CallbackFn( err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find class chip/devicecontroller/ChipClusters$ModeSelectCluster$SupportedModesAttribute")); chip::JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(Ljava/lang/String;IJ)V"); + jmethodID attributeCtor = + env->GetMethodID(attributeClass, "", "(Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Long;)V"); VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find SupportedModesAttribute constructor")); auto iter = list.begin(); @@ -1779,10 +2610,47 @@ void CHIPModeSelectSupportedModesAttributeCallback::CallbackFn( { auto & entry = iter.GetValue(); (void) entry; - chip::UtfString labelStr(env, entry.label); - jstring label(labelStr.jniValue()); - jint mode = entry.mode; - jlong semanticTag = entry.semanticTag; + bool labelNull = false; + bool labelHasValue = true; + + chip::CharSpan labelValue = entry.label; + + jstring label = nullptr; + chip::UtfString labelStr(env, labelValue); + if (!labelNull && labelHasValue) + { + label = jstring(labelStr.jniValue()); + } + + bool modeNull = false; + bool modeHasValue = true; + + uint8_t modeValue = entry.mode; + + jobject mode = nullptr; + if (!modeNull && modeHasValue) + { + jclass modeEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", modeEntryCls); + chip::JniClass modeJniClass(modeEntryCls); + jmethodID modeEntryTypeCtor = env->GetMethodID(modeEntryCls, "", "(I)V"); + mode = env->NewObject(modeEntryCls, modeEntryTypeCtor, modeValue); + } + + bool semanticTagNull = false; + bool semanticTagHasValue = true; + + uint32_t semanticTagValue = entry.semanticTag; + + jobject semanticTag = nullptr; + if (!semanticTagNull && semanticTagHasValue) + { + jclass semanticTagEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", semanticTagEntryCls); + chip::JniClass semanticTagJniClass(semanticTagEntryCls); + jmethodID semanticTagEntryTypeCtor = env->GetMethodID(semanticTagEntryCls, "", "(J)V"); + semanticTag = env->NewObject(semanticTagEntryCls, semanticTagEntryTypeCtor, semanticTagValue); + } jobject attributeObj = env->NewObject(attributeClass, attributeCtor, label, mode, semanticTag); VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create SupportedModesAttribute object")); @@ -1815,6 +2683,17 @@ CHIPOperationalCredentialsFabricsListAttributeCallback::CHIPOperationalCredentia } } +CHIPOperationalCredentialsFabricsListAttributeCallback::~CHIPOperationalCredentialsFabricsListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPOperationalCredentialsFabricsListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList< @@ -1858,7 +2737,8 @@ void CHIPOperationalCredentialsFabricsListAttributeCallback::CallbackFn( ChipLogError(Zcl, "Could not find class chip/devicecontroller/ChipClusters$OperationalCredentialsCluster$FabricsListAttribute")); chip::JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(I[BIJJLjava/lang/String;)V"); + jmethodID attributeCtor = env->GetMethodID( + attributeClass, "", "(Ljava/lang/Integer;[BLjava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/String;)V"); VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find FabricsListAttribute constructor")); auto iter = list.begin(); @@ -1866,15 +2746,90 @@ void CHIPOperationalCredentialsFabricsListAttributeCallback::CallbackFn( { auto & entry = iter.GetValue(); (void) entry; - jint fabricIndex = entry.fabricIndex; - jbyteArray rootPublicKey = env->NewByteArray(entry.rootPublicKey.size()); - env->SetByteArrayRegion(rootPublicKey, 0, entry.rootPublicKey.size(), - reinterpret_cast(entry.rootPublicKey.data())); - jint vendorId = entry.vendorId; - jlong fabricId = entry.fabricId; - jlong nodeId = entry.nodeId; - chip::UtfString labelStr(env, entry.label); - jstring label(labelStr.jniValue()); + bool fabricIndexNull = false; + bool fabricIndexHasValue = true; + + uint8_t fabricIndexValue = entry.fabricIndex; + + jobject fabricIndex = nullptr; + if (!fabricIndexNull && fabricIndexHasValue) + { + jclass fabricIndexEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", fabricIndexEntryCls); + chip::JniClass fabricIndexJniClass(fabricIndexEntryCls); + jmethodID fabricIndexEntryTypeCtor = env->GetMethodID(fabricIndexEntryCls, "", "(I)V"); + fabricIndex = env->NewObject(fabricIndexEntryCls, fabricIndexEntryTypeCtor, fabricIndexValue); + } + + bool rootPublicKeyNull = false; + bool rootPublicKeyHasValue = true; + + chip::ByteSpan rootPublicKeyValue = entry.rootPublicKey; + + jbyteArray rootPublicKey = nullptr; + if (!rootPublicKeyNull && rootPublicKeyHasValue) + { + rootPublicKey = env->NewByteArray(rootPublicKeyValue.size()); + env->SetByteArrayRegion(rootPublicKey, 0, rootPublicKeyValue.size(), + reinterpret_cast(rootPublicKeyValue.data())); + } + + bool vendorIdNull = false; + bool vendorIdHasValue = true; + + uint16_t vendorIdValue = entry.vendorId; + + jobject vendorId = nullptr; + if (!vendorIdNull && vendorIdHasValue) + { + jclass vendorIdEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", vendorIdEntryCls); + chip::JniClass vendorIdJniClass(vendorIdEntryCls); + jmethodID vendorIdEntryTypeCtor = env->GetMethodID(vendorIdEntryCls, "", "(I)V"); + vendorId = env->NewObject(vendorIdEntryCls, vendorIdEntryTypeCtor, vendorIdValue); + } + + bool fabricIdNull = false; + bool fabricIdHasValue = true; + + chip::FabricId fabricIdValue = entry.fabricId; + + jobject fabricId = nullptr; + if (!fabricIdNull && fabricIdHasValue) + { + jclass fabricIdEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", fabricIdEntryCls); + chip::JniClass fabricIdJniClass(fabricIdEntryCls); + jmethodID fabricIdEntryTypeCtor = env->GetMethodID(fabricIdEntryCls, "", "(J)V"); + fabricId = env->NewObject(fabricIdEntryCls, fabricIdEntryTypeCtor, fabricIdValue); + } + + bool nodeIdNull = false; + bool nodeIdHasValue = true; + + chip::NodeId nodeIdValue = entry.nodeId; + + jobject nodeId = nullptr; + if (!nodeIdNull && nodeIdHasValue) + { + jclass nodeIdEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", nodeIdEntryCls); + chip::JniClass nodeIdJniClass(nodeIdEntryCls); + jmethodID nodeIdEntryTypeCtor = env->GetMethodID(nodeIdEntryCls, "", "(J)V"); + nodeId = env->NewObject(nodeIdEntryCls, nodeIdEntryTypeCtor, nodeIdValue); + } + + bool labelNull = false; + bool labelHasValue = true; + + chip::CharSpan labelValue = entry.label; + + jstring label = nullptr; + chip::UtfString labelStr(env, labelValue); + if (!labelNull && labelHasValue) + { + label = jstring(labelStr.jniValue()); + } jobject attributeObj = env->NewObject(attributeClass, attributeCtor, fabricIndex, rootPublicKey, vendorId, fabricId, nodeId, label); @@ -1907,6 +2862,18 @@ CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback:: } } +CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback:: + ~CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { @@ -1943,10 +2910,18 @@ void CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback::Callbac auto iter = list.begin(); while (iter.Next()) { - auto & entry = iter.GetValue(); - jbyteArray trustedRootCertificates = env->NewByteArray(entry.size()); - env->SetByteArrayRegion(trustedRootCertificates, 0, entry.size(), reinterpret_cast(entry.data())); - env->CallBooleanMethod(arrayListObj, arrayListAddMethod, trustedRootCertificates); + auto & entry = iter.GetValue(); + bool entryNull = false; + chip::ByteSpan entryValue = entry; + + jbyteArray entryObject = nullptr; + if (!entryNull) + { + entryObject = env->NewByteArray(entryValue.size()); + env->SetByteArrayRegion(entryObject, 0, entryValue.size(), reinterpret_cast(entryValue.data())); + } + + env->CallBooleanMethod(arrayListObj, arrayListAddMethod, entryObject); } VerifyOrReturn( iter.GetStatus() == CHIP_NO_ERROR, @@ -1973,6 +2948,17 @@ CHIPPowerSourceActiveBatteryFaultsAttributeCallback::CHIPPowerSourceActiveBatter } } +CHIPPowerSourceActiveBatteryFaultsAttributeCallback::~CHIPPowerSourceActiveBatteryFaultsAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPPowerSourceActiveBatteryFaultsAttributeCallback::CallbackFn(void * context, const chip::app::DataModel::DecodableList & list) { @@ -2009,12 +2995,21 @@ void CHIPPowerSourceActiveBatteryFaultsAttributeCallback::CallbackFn(void * cont auto iter = list.begin(); while (iter.Next()) { - auto & entry = iter.GetValue(); - jclass entryTypeCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", entryTypeCls); - jmethodID entryTypeCtor = env->GetMethodID(entryTypeCls, "", "(I)V"); - jobject activeBatteryFaults = env->NewObject(entryTypeCls, entryTypeCtor, entry); - env->CallBooleanMethod(arrayListObj, arrayListAddMethod, activeBatteryFaults); + auto & entry = iter.GetValue(); + bool entryNull = false; + uint8_t entryValue = entry; + + jobject entryObject = nullptr; + if (!entryNull) + { + jclass entryTypeCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", entryTypeCls); + chip::JniClass jniClass(entryTypeCls); + jmethodID entryTypeCtor = env->GetMethodID(entryTypeCls, "", "(I)V"); + entryObject = env->NewObject(entryTypeCls, entryTypeCtor, entryValue); + } + + env->CallBooleanMethod(arrayListObj, arrayListAddMethod, entryObject); } VerifyOrReturn( iter.GetStatus() == CHIP_NO_ERROR, @@ -2024,6 +3019,172 @@ void CHIPPowerSourceActiveBatteryFaultsAttributeCallback::CallbackFn(void * cont env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback::CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback(jobject javaCallback) : + chip::Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback::~CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & + list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context)); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jclass arrayListClass; + err = chip::JniReferences::GetInstance().GetClassRef(env, "java/util/ArrayList", arrayListClass); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error using Java ArrayList")); + chip::JniClass arrayListJniClass(arrayListClass); + jmethodID arrayListCtor = env->GetMethodID(arrayListClass, "", "()V"); + jmethodID arrayListAddMethod = env->GetMethodID(arrayListClass, "add", "(Ljava/lang/Object;)Z"); + VerifyOrReturn(arrayListCtor != nullptr && arrayListAddMethod != nullptr, + ChipLogError(Zcl, "Error finding Java ArrayList methods")); + jobject arrayListObj = env->NewObject(arrayListClass, arrayListCtor); + VerifyOrReturn(arrayListObj != nullptr, ChipLogError(Zcl, "Error creating Java ArrayList")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jclass attributeClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipClusters$SoftwareDiagnosticsCluster$ThreadMetricsAttribute", attributeClass); + VerifyOrReturn( + err == CHIP_NO_ERROR, + ChipLogError(Zcl, + "Could not find class chip/devicecontroller/ChipClusters$SoftwareDiagnosticsCluster$ThreadMetricsAttribute")); + chip::JniClass attributeJniClass(attributeClass); + jmethodID attributeCtor = env->GetMethodID( + attributeClass, "", "(Ljava/lang/Long;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;)V"); + VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find ThreadMetricsAttribute constructor")); + + auto iter = list.begin(); + while (iter.Next()) + { + auto & entry = iter.GetValue(); + (void) entry; + bool idNull = false; + bool idHasValue = true; + + uint64_t idValue = entry.id; + + jobject id = nullptr; + if (!idNull && idHasValue) + { + jclass idEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", idEntryCls); + chip::JniClass idJniClass(idEntryCls); + jmethodID idEntryTypeCtor = env->GetMethodID(idEntryCls, "", "(J)V"); + id = env->NewObject(idEntryCls, idEntryTypeCtor, idValue); + } + + bool nameNull = false; + bool nameHasValue = true; + + chip::CharSpan nameValue = entry.name; + + jstring name = nullptr; + chip::UtfString nameStr(env, nameValue); + if (!nameNull && nameHasValue) + { + name = jstring(nameStr.jniValue()); + } + + bool stackFreeCurrentNull = false; + bool stackFreeCurrentHasValue = true; + + uint32_t stackFreeCurrentValue = entry.stackFreeCurrent; + + jobject stackFreeCurrent = nullptr; + if (!stackFreeCurrentNull && stackFreeCurrentHasValue) + { + jclass stackFreeCurrentEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", stackFreeCurrentEntryCls); + chip::JniClass stackFreeCurrentJniClass(stackFreeCurrentEntryCls); + jmethodID stackFreeCurrentEntryTypeCtor = env->GetMethodID(stackFreeCurrentEntryCls, "", "(J)V"); + stackFreeCurrent = env->NewObject(stackFreeCurrentEntryCls, stackFreeCurrentEntryTypeCtor, stackFreeCurrentValue); + } + + bool stackFreeMinimumNull = false; + bool stackFreeMinimumHasValue = true; + + uint32_t stackFreeMinimumValue = entry.stackFreeMinimum; + + jobject stackFreeMinimum = nullptr; + if (!stackFreeMinimumNull && stackFreeMinimumHasValue) + { + jclass stackFreeMinimumEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", stackFreeMinimumEntryCls); + chip::JniClass stackFreeMinimumJniClass(stackFreeMinimumEntryCls); + jmethodID stackFreeMinimumEntryTypeCtor = env->GetMethodID(stackFreeMinimumEntryCls, "", "(J)V"); + stackFreeMinimum = env->NewObject(stackFreeMinimumEntryCls, stackFreeMinimumEntryTypeCtor, stackFreeMinimumValue); + } + + bool stackSizeNull = false; + bool stackSizeHasValue = true; + + uint32_t stackSizeValue = entry.stackSize; + + jobject stackSize = nullptr; + if (!stackSizeNull && stackSizeHasValue) + { + jclass stackSizeEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", stackSizeEntryCls); + chip::JniClass stackSizeJniClass(stackSizeEntryCls); + jmethodID stackSizeEntryTypeCtor = env->GetMethodID(stackSizeEntryCls, "", "(J)V"); + stackSize = env->NewObject(stackSizeEntryCls, stackSizeEntryTypeCtor, stackSizeValue); + } + + jobject attributeObj = + env->NewObject(attributeClass, attributeCtor, id, name, stackFreeCurrent, stackFreeMinimum, stackSize); + VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create ThreadMetricsAttribute object")); + + env->CallBooleanMethod(arrayListObj, arrayListAddMethod, attributeObj); + } + VerifyOrReturn( + iter.GetStatus() == CHIP_NO_ERROR, + ChipLogError(Zcl, "Error decoding ThreadMetricsAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + CHIPTvChannelTvChannelListAttributeCallback::CHIPTvChannelTvChannelListAttributeCallback(jobject javaCallback) : chip::Callback::Callback(CallbackFn, this) { @@ -2041,6 +3202,17 @@ CHIPTvChannelTvChannelListAttributeCallback::CHIPTvChannelTvChannelListAttribute } } +CHIPTvChannelTvChannelListAttributeCallback::~CHIPTvChannelTvChannelListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPTvChannelTvChannelListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) @@ -2083,7 +3255,8 @@ void CHIPTvChannelTvChannelListAttributeCallback::CallbackFn( ChipLogError(Zcl, "Could not find class chip/devicecontroller/ChipClusters$TvChannelCluster$TvChannelListAttribute")); chip::JniClass attributeJniClass(attributeClass); jmethodID attributeCtor = - env->GetMethodID(attributeClass, "", "(IILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); + env->GetMethodID(attributeClass, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find TvChannelListAttribute constructor")); auto iter = list.begin(); @@ -2091,14 +3264,71 @@ void CHIPTvChannelTvChannelListAttributeCallback::CallbackFn( { auto & entry = iter.GetValue(); (void) entry; - jint majorNumber = entry.majorNumber; - jint minorNumber = entry.minorNumber; - chip::UtfString nameStr(env, entry.name); - jstring name(nameStr.jniValue()); - chip::UtfString callSignStr(env, entry.callSign); - jstring callSign(callSignStr.jniValue()); - chip::UtfString affiliateCallSignStr(env, entry.affiliateCallSign); - jstring affiliateCallSign(affiliateCallSignStr.jniValue()); + bool majorNumberNull = false; + bool majorNumberHasValue = true; + + uint16_t majorNumberValue = entry.majorNumber; + + jobject majorNumber = nullptr; + if (!majorNumberNull && majorNumberHasValue) + { + jclass majorNumberEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", majorNumberEntryCls); + chip::JniClass majorNumberJniClass(majorNumberEntryCls); + jmethodID majorNumberEntryTypeCtor = env->GetMethodID(majorNumberEntryCls, "", "(I)V"); + majorNumber = env->NewObject(majorNumberEntryCls, majorNumberEntryTypeCtor, majorNumberValue); + } + + bool minorNumberNull = false; + bool minorNumberHasValue = true; + + uint16_t minorNumberValue = entry.minorNumber; + + jobject minorNumber = nullptr; + if (!minorNumberNull && minorNumberHasValue) + { + jclass minorNumberEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", minorNumberEntryCls); + chip::JniClass minorNumberJniClass(minorNumberEntryCls); + jmethodID minorNumberEntryTypeCtor = env->GetMethodID(minorNumberEntryCls, "", "(I)V"); + minorNumber = env->NewObject(minorNumberEntryCls, minorNumberEntryTypeCtor, minorNumberValue); + } + + bool nameNull = false; + bool nameHasValue = true; + + chip::CharSpan nameValue = entry.name; + + jstring name = nullptr; + chip::UtfString nameStr(env, nameValue); + if (!nameNull && nameHasValue) + { + name = jstring(nameStr.jniValue()); + } + + bool callSignNull = false; + bool callSignHasValue = true; + + chip::CharSpan callSignValue = entry.callSign; + + jstring callSign = nullptr; + chip::UtfString callSignStr(env, callSignValue); + if (!callSignNull && callSignHasValue) + { + callSign = jstring(callSignStr.jniValue()); + } + + bool affiliateCallSignNull = false; + bool affiliateCallSignHasValue = true; + + chip::CharSpan affiliateCallSignValue = entry.affiliateCallSign; + + jstring affiliateCallSign = nullptr; + chip::UtfString affiliateCallSignStr(env, affiliateCallSignValue); + if (!affiliateCallSignNull && affiliateCallSignHasValue) + { + affiliateCallSign = jstring(affiliateCallSignStr.jniValue()); + } jobject attributeObj = env->NewObject(attributeClass, attributeCtor, majorNumber, minorNumber, name, callSign, affiliateCallSign); @@ -2132,6 +3362,17 @@ CHIPTargetNavigatorTargetNavigatorListAttributeCallback::CHIPTargetNavigatorTarg } } +CHIPTargetNavigatorTargetNavigatorListAttributeCallback::~CHIPTargetNavigatorTargetNavigatorListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPTargetNavigatorTargetNavigatorListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList< @@ -2175,7 +3416,7 @@ void CHIPTargetNavigatorTargetNavigatorListAttributeCallback::CallbackFn( ChipLogError( Zcl, "Could not find class chip/devicecontroller/ChipClusters$TargetNavigatorCluster$TargetNavigatorListAttribute")); chip::JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(ILjava/lang/String;)V"); + jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find TargetNavigatorListAttribute constructor")); auto iter = list.begin(); @@ -2183,9 +3424,32 @@ void CHIPTargetNavigatorTargetNavigatorListAttributeCallback::CallbackFn( { auto & entry = iter.GetValue(); (void) entry; - jint identifier = entry.identifier; - chip::UtfString nameStr(env, entry.name); - jstring name(nameStr.jniValue()); + bool identifierNull = false; + bool identifierHasValue = true; + + uint8_t identifierValue = entry.identifier; + + jobject identifier = nullptr; + if (!identifierNull && identifierHasValue) + { + jclass identifierEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", identifierEntryCls); + chip::JniClass identifierJniClass(identifierEntryCls); + jmethodID identifierEntryTypeCtor = env->GetMethodID(identifierEntryCls, "", "(I)V"); + identifier = env->NewObject(identifierEntryCls, identifierEntryTypeCtor, identifierValue); + } + + bool nameNull = false; + bool nameHasValue = true; + + chip::CharSpan nameValue = entry.name; + + jstring name = nullptr; + chip::UtfString nameStr(env, nameValue); + if (!nameNull && nameHasValue) + { + name = jstring(nameStr.jniValue()); + } jobject attributeObj = env->NewObject(attributeClass, attributeCtor, identifier, name); VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create TargetNavigatorListAttribute object")); @@ -2217,6 +3481,17 @@ CHIPTestClusterListInt8uAttributeCallback::CHIPTestClusterListInt8uAttributeCall } } +CHIPTestClusterListInt8uAttributeCallback::~CHIPTestClusterListInt8uAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPTestClusterListInt8uAttributeCallback::CallbackFn(void * context, const chip::app::DataModel::DecodableList & list) { @@ -2253,12 +3528,21 @@ void CHIPTestClusterListInt8uAttributeCallback::CallbackFn(void * context, auto iter = list.begin(); while (iter.Next()) { - auto & entry = iter.GetValue(); - jclass entryTypeCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", entryTypeCls); - jmethodID entryTypeCtor = env->GetMethodID(entryTypeCls, "", "(I)V"); - jobject listInt8u = env->NewObject(entryTypeCls, entryTypeCtor, entry); - env->CallBooleanMethod(arrayListObj, arrayListAddMethod, listInt8u); + auto & entry = iter.GetValue(); + bool entryNull = false; + uint8_t entryValue = entry; + + jobject entryObject = nullptr; + if (!entryNull) + { + jclass entryTypeCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", entryTypeCls); + chip::JniClass jniClass(entryTypeCls); + jmethodID entryTypeCtor = env->GetMethodID(entryTypeCls, "", "(I)V"); + entryObject = env->NewObject(entryTypeCls, entryTypeCtor, entryValue); + } + + env->CallBooleanMethod(arrayListObj, arrayListAddMethod, entryObject); } VerifyOrReturn(iter.GetStatus() == CHIP_NO_ERROR, ChipLogError(Zcl, "Error decoding ListInt8uAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); @@ -2284,6 +3568,17 @@ CHIPTestClusterListOctetStringAttributeCallback::CHIPTestClusterListOctetStringA } } +CHIPTestClusterListOctetStringAttributeCallback::~CHIPTestClusterListOctetStringAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPTestClusterListOctetStringAttributeCallback::CallbackFn(void * context, const chip::app::DataModel::DecodableList & list) { @@ -2320,10 +3615,18 @@ void CHIPTestClusterListOctetStringAttributeCallback::CallbackFn(void * context, auto iter = list.begin(); while (iter.Next()) { - auto & entry = iter.GetValue(); - jbyteArray listOctetString = env->NewByteArray(entry.size()); - env->SetByteArrayRegion(listOctetString, 0, entry.size(), reinterpret_cast(entry.data())); - env->CallBooleanMethod(arrayListObj, arrayListAddMethod, listOctetString); + auto & entry = iter.GetValue(); + bool entryNull = false; + chip::ByteSpan entryValue = entry; + + jbyteArray entryObject = nullptr; + if (!entryNull) + { + entryObject = env->NewByteArray(entryValue.size()); + env->SetByteArrayRegion(entryObject, 0, entryValue.size(), reinterpret_cast(entryValue.data())); + } + + env->CallBooleanMethod(arrayListObj, arrayListAddMethod, entryObject); } VerifyOrReturn( iter.GetStatus() == CHIP_NO_ERROR, @@ -2350,6 +3653,17 @@ CHIPTestClusterListStructOctetStringAttributeCallback::CHIPTestClusterListStruct } } +CHIPTestClusterListStructOctetStringAttributeCallback::~CHIPTestClusterListStructOctetStringAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPTestClusterListStructOctetStringAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) @@ -2392,7 +3706,7 @@ void CHIPTestClusterListStructOctetStringAttributeCallback::CallbackFn( ChipLogError(Zcl, "Could not find class chip/devicecontroller/ChipClusters$TestClusterCluster$ListStructOctetStringAttribute")); chip::JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(J[B)V"); + jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(Ljava/lang/Long;[B)V"); VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find ListStructOctetStringAttribute constructor")); auto iter = list.begin(); @@ -2400,10 +3714,33 @@ void CHIPTestClusterListStructOctetStringAttributeCallback::CallbackFn( { auto & entry = iter.GetValue(); (void) entry; - jlong fabricIndex = entry.fabricIndex; - jbyteArray operationalCert = env->NewByteArray(entry.operationalCert.size()); - env->SetByteArrayRegion(operationalCert, 0, entry.operationalCert.size(), - reinterpret_cast(entry.operationalCert.data())); + bool fabricIndexNull = false; + bool fabricIndexHasValue = true; + + uint64_t fabricIndexValue = entry.fabricIndex; + + jobject fabricIndex = nullptr; + if (!fabricIndexNull && fabricIndexHasValue) + { + jclass fabricIndexEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", fabricIndexEntryCls); + chip::JniClass fabricIndexJniClass(fabricIndexEntryCls); + jmethodID fabricIndexEntryTypeCtor = env->GetMethodID(fabricIndexEntryCls, "", "(J)V"); + fabricIndex = env->NewObject(fabricIndexEntryCls, fabricIndexEntryTypeCtor, fabricIndexValue); + } + + bool operationalCertNull = false; + bool operationalCertHasValue = true; + + chip::ByteSpan operationalCertValue = entry.operationalCert; + + jbyteArray operationalCert = nullptr; + if (!operationalCertNull && operationalCertHasValue) + { + operationalCert = env->NewByteArray(operationalCertValue.size()); + env->SetByteArrayRegion(operationalCert, 0, operationalCertValue.size(), + reinterpret_cast(operationalCertValue.data())); + } jobject attributeObj = env->NewObject(attributeClass, attributeCtor, fabricIndex, operationalCert); VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create ListStructOctetStringAttribute object")); @@ -2436,6 +3773,17 @@ CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback::CHIPTestCluster } } +CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback::~CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList< @@ -2480,7 +3828,9 @@ void CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback::CallbackFn Zcl, "Could not find class chip/devicecontroller/ChipClusters$TestClusterCluster$ListNullablesAndOptionalsStructAttribute")); chip::JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "()V"); + jmethodID attributeCtor = env->GetMethodID( + attributeClass, "", + "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/String;Ljava/util/Optional;Ljava/util/Optional;)V"); VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find ListNullablesAndOptionalsStructAttribute constructor")); @@ -2489,8 +3839,138 @@ void CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback::CallbackFn { auto & entry = iter.GetValue(); (void) entry; + bool nullableIntNull = false; + bool nullableIntHasValue = true; + uint16_t nullableIntValue; + nullableIntNull = entry.nullableInt.IsNull(); + if (!nullableIntNull) + { + nullableIntValue = entry.nullableInt.Value(); + } + + jobject nullableInt = nullptr; + if (!nullableIntNull && nullableIntHasValue) + { + jclass nullableIntEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", nullableIntEntryCls); + chip::JniClass nullableIntJniClass(nullableIntEntryCls); + jmethodID nullableIntEntryTypeCtor = env->GetMethodID(nullableIntEntryCls, "", "(I)V"); + nullableInt = env->NewObject(nullableIntEntryCls, nullableIntEntryTypeCtor, nullableIntValue); + } + + bool optionalIntNull = false; + bool optionalIntHasValue = true; + + uint16_t optionalIntValue; + optionalIntHasValue = entry.optionalInt.HasValue(); + if (optionalIntHasValue) + { + optionalIntValue = entry.optionalInt.Value(); + } + + jobject optionalInt = nullptr; + if (!optionalIntNull && optionalIntHasValue) + { + jclass optionalIntEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", optionalIntEntryCls); + chip::JniClass optionalIntJniClass(optionalIntEntryCls); + jmethodID optionalIntEntryTypeCtor = env->GetMethodID(optionalIntEntryCls, "", "(I)V"); + optionalInt = env->NewObject(optionalIntEntryCls, optionalIntEntryTypeCtor, optionalIntValue); + } + + jobject optionalIntOptional = nullptr; + chip::JniReferences::GetInstance().CreateOptional(optionalInt, optionalIntOptional); + bool nullableOptionalIntNull = false; + bool nullableOptionalIntHasValue = true; + + uint16_t nullableOptionalIntValue; + nullableOptionalIntHasValue = entry.nullableOptionalInt.HasValue(); + if (nullableOptionalIntHasValue) + { + auto nullableOptionalIntValueFromOptional = entry.nullableOptionalInt.Value(); + nullableOptionalIntNull = nullableOptionalIntValueFromOptional.IsNull(); + if (!nullableOptionalIntNull) + { + nullableOptionalIntValue = nullableOptionalIntValueFromOptional.Value(); + } + } + + jobject nullableOptionalInt = nullptr; + if (!nullableOptionalIntNull && nullableOptionalIntHasValue) + { + jclass nullableOptionalIntEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", nullableOptionalIntEntryCls); + chip::JniClass nullableOptionalIntJniClass(nullableOptionalIntEntryCls); + jmethodID nullableOptionalIntEntryTypeCtor = env->GetMethodID(nullableOptionalIntEntryCls, "", "(I)V"); + nullableOptionalInt = + env->NewObject(nullableOptionalIntEntryCls, nullableOptionalIntEntryTypeCtor, nullableOptionalIntValue); + } + + jobject nullableOptionalIntOptional = nullptr; + chip::JniReferences::GetInstance().CreateOptional(nullableOptionalInt, nullableOptionalIntOptional); + bool nullableStringNull = false; + bool nullableStringHasValue = true; + chip::CharSpan nullableStringValue; + nullableStringNull = entry.nullableString.IsNull(); + if (!nullableStringNull) + { + nullableStringValue = entry.nullableString.Value(); + } + + jstring nullableString = nullptr; + chip::UtfString nullableStringStr(env, nullableStringValue); + if (!nullableStringNull && nullableStringHasValue) + { + nullableString = jstring(nullableStringStr.jniValue()); + } + + bool optionalStringNull = false; + bool optionalStringHasValue = true; + + chip::CharSpan optionalStringValue; + optionalStringHasValue = entry.optionalString.HasValue(); + if (optionalStringHasValue) + { + optionalStringValue = entry.optionalString.Value(); + } + + jstring optionalString = nullptr; + chip::UtfString optionalStringStr(env, optionalStringValue); + if (!optionalStringNull && optionalStringHasValue) + { + optionalString = jstring(optionalStringStr.jniValue()); + } + + jobject optionalStringOptional = nullptr; + chip::JniReferences::GetInstance().CreateOptional(optionalString, optionalStringOptional); + bool nullableOptionalStringNull = false; + bool nullableOptionalStringHasValue = true; + + chip::CharSpan nullableOptionalStringValue; + nullableOptionalStringHasValue = entry.nullableOptionalString.HasValue(); + if (nullableOptionalStringHasValue) + { + auto nullableOptionalStringValueFromOptional = entry.nullableOptionalString.Value(); + nullableOptionalStringNull = nullableOptionalStringValueFromOptional.IsNull(); + if (!nullableOptionalStringNull) + { + nullableOptionalStringValue = nullableOptionalStringValueFromOptional.Value(); + } + } + + jstring nullableOptionalString = nullptr; + chip::UtfString nullableOptionalStringStr(env, nullableOptionalStringValue); + if (!nullableOptionalStringNull && nullableOptionalStringHasValue) + { + nullableOptionalString = jstring(nullableOptionalStringStr.jniValue()); + } + + jobject nullableOptionalStringOptional = nullptr; + chip::JniReferences::GetInstance().CreateOptional(nullableOptionalString, nullableOptionalStringOptional); - jobject attributeObj = env->NewObject(attributeClass, attributeCtor); + jobject attributeObj = + env->NewObject(attributeClass, attributeCtor, nullableInt, optionalIntOptional, nullableOptionalIntOptional, + nullableString, optionalStringOptional, nullableOptionalStringOptional); VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create ListNullablesAndOptionalsStructAttribute object")); @@ -2522,6 +4002,17 @@ CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback::CHIPThreadNetwor } } +CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback::~CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList< @@ -2566,7 +4057,11 @@ void CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback::CallbackFn( Zcl, "Could not find class chip/devicecontroller/ChipClusters$ThreadNetworkDiagnosticsCluster$NeighborTableListAttribute")); chip::JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(JJIJJIIIIIZZZZ)V"); + jmethodID attributeCtor = + env->GetMethodID(attributeClass, "", + "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/" + "Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/" + "Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;)V"); VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find NeighborTableListAttribute constructor")); auto iter = list.begin(); @@ -2574,20 +4069,215 @@ void CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback::CallbackFn( { auto & entry = iter.GetValue(); (void) entry; - jlong extAddress = entry.extAddress; - jlong age = entry.age; - jint rloc16 = entry.rloc16; - jlong linkFrameCounter = entry.linkFrameCounter; - jlong mleFrameCounter = entry.mleFrameCounter; - jint lqi = entry.lqi; - jint averageRssi = entry.averageRssi; - jint lastRssi = entry.lastRssi; - jint frameErrorRate = entry.frameErrorRate; - jint messageErrorRate = entry.messageErrorRate; - jboolean rxOnWhenIdle = entry.rxOnWhenIdle; - jboolean fullThreadDevice = entry.fullThreadDevice; - jboolean fullNetworkData = entry.fullNetworkData; - jboolean isChild = entry.isChild; + bool extAddressNull = false; + bool extAddressHasValue = true; + + uint64_t extAddressValue = entry.extAddress; + + jobject extAddress = nullptr; + if (!extAddressNull && extAddressHasValue) + { + jclass extAddressEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", extAddressEntryCls); + chip::JniClass extAddressJniClass(extAddressEntryCls); + jmethodID extAddressEntryTypeCtor = env->GetMethodID(extAddressEntryCls, "", "(J)V"); + extAddress = env->NewObject(extAddressEntryCls, extAddressEntryTypeCtor, extAddressValue); + } + + bool ageNull = false; + bool ageHasValue = true; + + uint32_t ageValue = entry.age; + + jobject age = nullptr; + if (!ageNull && ageHasValue) + { + jclass ageEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", ageEntryCls); + chip::JniClass ageJniClass(ageEntryCls); + jmethodID ageEntryTypeCtor = env->GetMethodID(ageEntryCls, "", "(J)V"); + age = env->NewObject(ageEntryCls, ageEntryTypeCtor, ageValue); + } + + bool rloc16Null = false; + bool rloc16HasValue = true; + + uint16_t rloc16Value = entry.rloc16; + + jobject rloc16 = nullptr; + if (!rloc16Null && rloc16HasValue) + { + jclass rloc16EntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", rloc16EntryCls); + chip::JniClass rloc16JniClass(rloc16EntryCls); + jmethodID rloc16EntryTypeCtor = env->GetMethodID(rloc16EntryCls, "", "(I)V"); + rloc16 = env->NewObject(rloc16EntryCls, rloc16EntryTypeCtor, rloc16Value); + } + + bool linkFrameCounterNull = false; + bool linkFrameCounterHasValue = true; + + uint32_t linkFrameCounterValue = entry.linkFrameCounter; + + jobject linkFrameCounter = nullptr; + if (!linkFrameCounterNull && linkFrameCounterHasValue) + { + jclass linkFrameCounterEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", linkFrameCounterEntryCls); + chip::JniClass linkFrameCounterJniClass(linkFrameCounterEntryCls); + jmethodID linkFrameCounterEntryTypeCtor = env->GetMethodID(linkFrameCounterEntryCls, "", "(J)V"); + linkFrameCounter = env->NewObject(linkFrameCounterEntryCls, linkFrameCounterEntryTypeCtor, linkFrameCounterValue); + } + + bool mleFrameCounterNull = false; + bool mleFrameCounterHasValue = true; + + uint32_t mleFrameCounterValue = entry.mleFrameCounter; + + jobject mleFrameCounter = nullptr; + if (!mleFrameCounterNull && mleFrameCounterHasValue) + { + jclass mleFrameCounterEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", mleFrameCounterEntryCls); + chip::JniClass mleFrameCounterJniClass(mleFrameCounterEntryCls); + jmethodID mleFrameCounterEntryTypeCtor = env->GetMethodID(mleFrameCounterEntryCls, "", "(J)V"); + mleFrameCounter = env->NewObject(mleFrameCounterEntryCls, mleFrameCounterEntryTypeCtor, mleFrameCounterValue); + } + + bool lqiNull = false; + bool lqiHasValue = true; + + uint8_t lqiValue = entry.lqi; + + jobject lqi = nullptr; + if (!lqiNull && lqiHasValue) + { + jclass lqiEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", lqiEntryCls); + chip::JniClass lqiJniClass(lqiEntryCls); + jmethodID lqiEntryTypeCtor = env->GetMethodID(lqiEntryCls, "", "(I)V"); + lqi = env->NewObject(lqiEntryCls, lqiEntryTypeCtor, lqiValue); + } + + bool averageRssiNull = false; + bool averageRssiHasValue = true; + + int8_t averageRssiValue = entry.averageRssi; + + jobject averageRssi = nullptr; + if (!averageRssiNull && averageRssiHasValue) + { + jclass averageRssiEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", averageRssiEntryCls); + chip::JniClass averageRssiJniClass(averageRssiEntryCls); + jmethodID averageRssiEntryTypeCtor = env->GetMethodID(averageRssiEntryCls, "", "(I)V"); + averageRssi = env->NewObject(averageRssiEntryCls, averageRssiEntryTypeCtor, averageRssiValue); + } + + bool lastRssiNull = false; + bool lastRssiHasValue = true; + + int8_t lastRssiValue = entry.lastRssi; + + jobject lastRssi = nullptr; + if (!lastRssiNull && lastRssiHasValue) + { + jclass lastRssiEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", lastRssiEntryCls); + chip::JniClass lastRssiJniClass(lastRssiEntryCls); + jmethodID lastRssiEntryTypeCtor = env->GetMethodID(lastRssiEntryCls, "", "(I)V"); + lastRssi = env->NewObject(lastRssiEntryCls, lastRssiEntryTypeCtor, lastRssiValue); + } + + bool frameErrorRateNull = false; + bool frameErrorRateHasValue = true; + + uint8_t frameErrorRateValue = entry.frameErrorRate; + + jobject frameErrorRate = nullptr; + if (!frameErrorRateNull && frameErrorRateHasValue) + { + jclass frameErrorRateEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", frameErrorRateEntryCls); + chip::JniClass frameErrorRateJniClass(frameErrorRateEntryCls); + jmethodID frameErrorRateEntryTypeCtor = env->GetMethodID(frameErrorRateEntryCls, "", "(I)V"); + frameErrorRate = env->NewObject(frameErrorRateEntryCls, frameErrorRateEntryTypeCtor, frameErrorRateValue); + } + + bool messageErrorRateNull = false; + bool messageErrorRateHasValue = true; + + uint8_t messageErrorRateValue = entry.messageErrorRate; + + jobject messageErrorRate = nullptr; + if (!messageErrorRateNull && messageErrorRateHasValue) + { + jclass messageErrorRateEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", messageErrorRateEntryCls); + chip::JniClass messageErrorRateJniClass(messageErrorRateEntryCls); + jmethodID messageErrorRateEntryTypeCtor = env->GetMethodID(messageErrorRateEntryCls, "", "(I)V"); + messageErrorRate = env->NewObject(messageErrorRateEntryCls, messageErrorRateEntryTypeCtor, messageErrorRateValue); + } + + bool rxOnWhenIdleNull = false; + bool rxOnWhenIdleHasValue = true; + + bool rxOnWhenIdleValue = entry.rxOnWhenIdle; + + jobject rxOnWhenIdle = nullptr; + if (!rxOnWhenIdleNull && rxOnWhenIdleHasValue) + { + jclass rxOnWhenIdleEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Boolean", rxOnWhenIdleEntryCls); + chip::JniClass rxOnWhenIdleJniClass(rxOnWhenIdleEntryCls); + jmethodID rxOnWhenIdleEntryTypeCtor = env->GetMethodID(rxOnWhenIdleEntryCls, "", "(Z)V"); + rxOnWhenIdle = env->NewObject(rxOnWhenIdleEntryCls, rxOnWhenIdleEntryTypeCtor, rxOnWhenIdleValue); + } + + bool fullThreadDeviceNull = false; + bool fullThreadDeviceHasValue = true; + + bool fullThreadDeviceValue = entry.fullThreadDevice; + + jobject fullThreadDevice = nullptr; + if (!fullThreadDeviceNull && fullThreadDeviceHasValue) + { + jclass fullThreadDeviceEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Boolean", fullThreadDeviceEntryCls); + chip::JniClass fullThreadDeviceJniClass(fullThreadDeviceEntryCls); + jmethodID fullThreadDeviceEntryTypeCtor = env->GetMethodID(fullThreadDeviceEntryCls, "", "(Z)V"); + fullThreadDevice = env->NewObject(fullThreadDeviceEntryCls, fullThreadDeviceEntryTypeCtor, fullThreadDeviceValue); + } + + bool fullNetworkDataNull = false; + bool fullNetworkDataHasValue = true; + + bool fullNetworkDataValue = entry.fullNetworkData; + + jobject fullNetworkData = nullptr; + if (!fullNetworkDataNull && fullNetworkDataHasValue) + { + jclass fullNetworkDataEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Boolean", fullNetworkDataEntryCls); + chip::JniClass fullNetworkDataJniClass(fullNetworkDataEntryCls); + jmethodID fullNetworkDataEntryTypeCtor = env->GetMethodID(fullNetworkDataEntryCls, "", "(Z)V"); + fullNetworkData = env->NewObject(fullNetworkDataEntryCls, fullNetworkDataEntryTypeCtor, fullNetworkDataValue); + } + + bool isChildNull = false; + bool isChildHasValue = true; + + bool isChildValue = entry.isChild; + + jobject isChild = nullptr; + if (!isChildNull && isChildHasValue) + { + jclass isChildEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Boolean", isChildEntryCls); + chip::JniClass isChildJniClass(isChildEntryCls); + jmethodID isChildEntryTypeCtor = env->GetMethodID(isChildEntryCls, "", "(Z)V"); + isChild = env->NewObject(isChildEntryCls, isChildEntryTypeCtor, isChildValue); + } jobject attributeObj = env->NewObject(attributeClass, attributeCtor, extAddress, age, rloc16, linkFrameCounter, mleFrameCounter, lqi, averageRssi, lastRssi, frameErrorRate, messageErrorRate, @@ -2622,6 +4312,17 @@ CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback::CHIPThreadNetworkDi } } +CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback::~CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & @@ -2666,7 +4367,10 @@ void CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback::CallbackFn( Zcl, "Could not find class chip/devicecontroller/ChipClusters$ThreadNetworkDiagnosticsCluster$RouteTableListAttribute")); chip::JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(JIIIIIIIZZ)V"); + jmethodID attributeCtor = + env->GetMethodID(attributeClass, "", + "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/" + "Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Boolean;)V"); VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find RouteTableListAttribute constructor")); auto iter = list.begin(); @@ -2674,16 +4378,155 @@ void CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback::CallbackFn( { auto & entry = iter.GetValue(); (void) entry; - jlong extAddress = entry.extAddress; - jint rloc16 = entry.rloc16; - jint routerId = entry.routerId; - jint nextHop = entry.nextHop; - jint pathCost = entry.pathCost; - jint LQIIn = entry.LQIIn; - jint LQIOut = entry.LQIOut; - jint age = entry.age; - jboolean allocated = entry.allocated; - jboolean linkEstablished = entry.linkEstablished; + bool extAddressNull = false; + bool extAddressHasValue = true; + + uint64_t extAddressValue = entry.extAddress; + + jobject extAddress = nullptr; + if (!extAddressNull && extAddressHasValue) + { + jclass extAddressEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", extAddressEntryCls); + chip::JniClass extAddressJniClass(extAddressEntryCls); + jmethodID extAddressEntryTypeCtor = env->GetMethodID(extAddressEntryCls, "", "(J)V"); + extAddress = env->NewObject(extAddressEntryCls, extAddressEntryTypeCtor, extAddressValue); + } + + bool rloc16Null = false; + bool rloc16HasValue = true; + + uint16_t rloc16Value = entry.rloc16; + + jobject rloc16 = nullptr; + if (!rloc16Null && rloc16HasValue) + { + jclass rloc16EntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", rloc16EntryCls); + chip::JniClass rloc16JniClass(rloc16EntryCls); + jmethodID rloc16EntryTypeCtor = env->GetMethodID(rloc16EntryCls, "", "(I)V"); + rloc16 = env->NewObject(rloc16EntryCls, rloc16EntryTypeCtor, rloc16Value); + } + + bool routerIdNull = false; + bool routerIdHasValue = true; + + uint8_t routerIdValue = entry.routerId; + + jobject routerId = nullptr; + if (!routerIdNull && routerIdHasValue) + { + jclass routerIdEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", routerIdEntryCls); + chip::JniClass routerIdJniClass(routerIdEntryCls); + jmethodID routerIdEntryTypeCtor = env->GetMethodID(routerIdEntryCls, "", "(I)V"); + routerId = env->NewObject(routerIdEntryCls, routerIdEntryTypeCtor, routerIdValue); + } + + bool nextHopNull = false; + bool nextHopHasValue = true; + + uint8_t nextHopValue = entry.nextHop; + + jobject nextHop = nullptr; + if (!nextHopNull && nextHopHasValue) + { + jclass nextHopEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", nextHopEntryCls); + chip::JniClass nextHopJniClass(nextHopEntryCls); + jmethodID nextHopEntryTypeCtor = env->GetMethodID(nextHopEntryCls, "", "(I)V"); + nextHop = env->NewObject(nextHopEntryCls, nextHopEntryTypeCtor, nextHopValue); + } + + bool pathCostNull = false; + bool pathCostHasValue = true; + + uint8_t pathCostValue = entry.pathCost; + + jobject pathCost = nullptr; + if (!pathCostNull && pathCostHasValue) + { + jclass pathCostEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", pathCostEntryCls); + chip::JniClass pathCostJniClass(pathCostEntryCls); + jmethodID pathCostEntryTypeCtor = env->GetMethodID(pathCostEntryCls, "", "(I)V"); + pathCost = env->NewObject(pathCostEntryCls, pathCostEntryTypeCtor, pathCostValue); + } + + bool LQIInNull = false; + bool LQIInHasValue = true; + + uint8_t LQIInValue = entry.LQIIn; + + jobject LQIIn = nullptr; + if (!LQIInNull && LQIInHasValue) + { + jclass LQIInEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", LQIInEntryCls); + chip::JniClass LQIInJniClass(LQIInEntryCls); + jmethodID LQIInEntryTypeCtor = env->GetMethodID(LQIInEntryCls, "", "(I)V"); + LQIIn = env->NewObject(LQIInEntryCls, LQIInEntryTypeCtor, LQIInValue); + } + + bool LQIOutNull = false; + bool LQIOutHasValue = true; + + uint8_t LQIOutValue = entry.LQIOut; + + jobject LQIOut = nullptr; + if (!LQIOutNull && LQIOutHasValue) + { + jclass LQIOutEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", LQIOutEntryCls); + chip::JniClass LQIOutJniClass(LQIOutEntryCls); + jmethodID LQIOutEntryTypeCtor = env->GetMethodID(LQIOutEntryCls, "", "(I)V"); + LQIOut = env->NewObject(LQIOutEntryCls, LQIOutEntryTypeCtor, LQIOutValue); + } + + bool ageNull = false; + bool ageHasValue = true; + + uint8_t ageValue = entry.age; + + jobject age = nullptr; + if (!ageNull && ageHasValue) + { + jclass ageEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", ageEntryCls); + chip::JniClass ageJniClass(ageEntryCls); + jmethodID ageEntryTypeCtor = env->GetMethodID(ageEntryCls, "", "(I)V"); + age = env->NewObject(ageEntryCls, ageEntryTypeCtor, ageValue); + } + + bool allocatedNull = false; + bool allocatedHasValue = true; + + bool allocatedValue = entry.allocated; + + jobject allocated = nullptr; + if (!allocatedNull && allocatedHasValue) + { + jclass allocatedEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Boolean", allocatedEntryCls); + chip::JniClass allocatedJniClass(allocatedEntryCls); + jmethodID allocatedEntryTypeCtor = env->GetMethodID(allocatedEntryCls, "", "(Z)V"); + allocated = env->NewObject(allocatedEntryCls, allocatedEntryTypeCtor, allocatedValue); + } + + bool linkEstablishedNull = false; + bool linkEstablishedHasValue = true; + + bool linkEstablishedValue = entry.linkEstablished; + + jobject linkEstablished = nullptr; + if (!linkEstablishedNull && linkEstablishedHasValue) + { + jclass linkEstablishedEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Boolean", linkEstablishedEntryCls); + chip::JniClass linkEstablishedJniClass(linkEstablishedEntryCls); + jmethodID linkEstablishedEntryTypeCtor = env->GetMethodID(linkEstablishedEntryCls, "", "(Z)V"); + linkEstablished = env->NewObject(linkEstablishedEntryCls, linkEstablishedEntryTypeCtor, linkEstablishedValue); + } jobject attributeObj = env->NewObject(attributeClass, attributeCtor, extAddress, rloc16, routerId, nextHop, pathCost, LQIIn, LQIOut, age, allocated, linkEstablished); @@ -2717,6 +4560,17 @@ CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback::CHIPThreadNetworkDi } } +CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback::~CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList< @@ -2761,7 +4615,7 @@ void CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback::CallbackFn( Zcl, "Could not find class chip/devicecontroller/ChipClusters$ThreadNetworkDiagnosticsCluster$SecurityPolicyAttribute")); chip::JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(II)V"); + jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;)V"); VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find SecurityPolicyAttribute constructor")); auto iter = list.begin(); @@ -2769,8 +4623,35 @@ void CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback::CallbackFn( { auto & entry = iter.GetValue(); (void) entry; - jint rotationTime = entry.rotationTime; - jint flags = entry.flags; + bool rotationTimeNull = false; + bool rotationTimeHasValue = true; + + uint16_t rotationTimeValue = entry.rotationTime; + + jobject rotationTime = nullptr; + if (!rotationTimeNull && rotationTimeHasValue) + { + jclass rotationTimeEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", rotationTimeEntryCls); + chip::JniClass rotationTimeJniClass(rotationTimeEntryCls); + jmethodID rotationTimeEntryTypeCtor = env->GetMethodID(rotationTimeEntryCls, "", "(I)V"); + rotationTime = env->NewObject(rotationTimeEntryCls, rotationTimeEntryTypeCtor, rotationTimeValue); + } + + bool flagsNull = false; + bool flagsHasValue = true; + + uint16_t flagsValue = entry.flags; + + jobject flags = nullptr; + if (!flagsNull && flagsHasValue) + { + jclass flagsEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", flagsEntryCls); + chip::JniClass flagsJniClass(flagsEntryCls); + jmethodID flagsEntryTypeCtor = env->GetMethodID(flagsEntryCls, "", "(I)V"); + flags = env->NewObject(flagsEntryCls, flagsEntryTypeCtor, flagsValue); + } jobject attributeObj = env->NewObject(attributeClass, attributeCtor, rotationTime, flags); VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create SecurityPolicyAttribute object")); @@ -2803,6 +4684,18 @@ CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback:: } } +CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback:: + ~CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList< @@ -2848,7 +4741,10 @@ void CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback:: "Could not find class " "chip/devicecontroller/ChipClusters$ThreadNetworkDiagnosticsCluster$OperationalDatasetComponentsAttribute")); chip::JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(ZZZZZZZZZZZZ)V"); + jmethodID attributeCtor = env->GetMethodID( + attributeClass, "", + "(Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/" + "lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;)V"); VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find OperationalDatasetComponentsAttribute constructor")); auto iter = list.begin(); @@ -2856,18 +4752,192 @@ void CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback:: { auto & entry = iter.GetValue(); (void) entry; - jboolean activeTimestampPresent = entry.activeTimestampPresent; - jboolean pendingTimestampPresent = entry.pendingTimestampPresent; - jboolean masterKeyPresent = entry.masterKeyPresent; - jboolean networkNamePresent = entry.networkNamePresent; - jboolean extendedPanIdPresent = entry.extendedPanIdPresent; - jboolean meshLocalPrefixPresent = entry.meshLocalPrefixPresent; - jboolean delayPresent = entry.delayPresent; - jboolean panIdPresent = entry.panIdPresent; - jboolean channelPresent = entry.channelPresent; - jboolean pskcPresent = entry.pskcPresent; - jboolean securityPolicyPresent = entry.securityPolicyPresent; - jboolean channelMaskPresent = entry.channelMaskPresent; + bool activeTimestampPresentNull = false; + bool activeTimestampPresentHasValue = true; + + bool activeTimestampPresentValue = entry.activeTimestampPresent; + + jobject activeTimestampPresent = nullptr; + if (!activeTimestampPresentNull && activeTimestampPresentHasValue) + { + jclass activeTimestampPresentEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Boolean", activeTimestampPresentEntryCls); + chip::JniClass activeTimestampPresentJniClass(activeTimestampPresentEntryCls); + jmethodID activeTimestampPresentEntryTypeCtor = env->GetMethodID(activeTimestampPresentEntryCls, "", "(Z)V"); + activeTimestampPresent = + env->NewObject(activeTimestampPresentEntryCls, activeTimestampPresentEntryTypeCtor, activeTimestampPresentValue); + } + + bool pendingTimestampPresentNull = false; + bool pendingTimestampPresentHasValue = true; + + bool pendingTimestampPresentValue = entry.pendingTimestampPresent; + + jobject pendingTimestampPresent = nullptr; + if (!pendingTimestampPresentNull && pendingTimestampPresentHasValue) + { + jclass pendingTimestampPresentEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Boolean", pendingTimestampPresentEntryCls); + chip::JniClass pendingTimestampPresentJniClass(pendingTimestampPresentEntryCls); + jmethodID pendingTimestampPresentEntryTypeCtor = env->GetMethodID(pendingTimestampPresentEntryCls, "", "(Z)V"); + pendingTimestampPresent = + env->NewObject(pendingTimestampPresentEntryCls, pendingTimestampPresentEntryTypeCtor, pendingTimestampPresentValue); + } + + bool masterKeyPresentNull = false; + bool masterKeyPresentHasValue = true; + + bool masterKeyPresentValue = entry.masterKeyPresent; + + jobject masterKeyPresent = nullptr; + if (!masterKeyPresentNull && masterKeyPresentHasValue) + { + jclass masterKeyPresentEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Boolean", masterKeyPresentEntryCls); + chip::JniClass masterKeyPresentJniClass(masterKeyPresentEntryCls); + jmethodID masterKeyPresentEntryTypeCtor = env->GetMethodID(masterKeyPresentEntryCls, "", "(Z)V"); + masterKeyPresent = env->NewObject(masterKeyPresentEntryCls, masterKeyPresentEntryTypeCtor, masterKeyPresentValue); + } + + bool networkNamePresentNull = false; + bool networkNamePresentHasValue = true; + + bool networkNamePresentValue = entry.networkNamePresent; + + jobject networkNamePresent = nullptr; + if (!networkNamePresentNull && networkNamePresentHasValue) + { + jclass networkNamePresentEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Boolean", networkNamePresentEntryCls); + chip::JniClass networkNamePresentJniClass(networkNamePresentEntryCls); + jmethodID networkNamePresentEntryTypeCtor = env->GetMethodID(networkNamePresentEntryCls, "", "(Z)V"); + networkNamePresent = + env->NewObject(networkNamePresentEntryCls, networkNamePresentEntryTypeCtor, networkNamePresentValue); + } + + bool extendedPanIdPresentNull = false; + bool extendedPanIdPresentHasValue = true; + + bool extendedPanIdPresentValue = entry.extendedPanIdPresent; + + jobject extendedPanIdPresent = nullptr; + if (!extendedPanIdPresentNull && extendedPanIdPresentHasValue) + { + jclass extendedPanIdPresentEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Boolean", extendedPanIdPresentEntryCls); + chip::JniClass extendedPanIdPresentJniClass(extendedPanIdPresentEntryCls); + jmethodID extendedPanIdPresentEntryTypeCtor = env->GetMethodID(extendedPanIdPresentEntryCls, "", "(Z)V"); + extendedPanIdPresent = + env->NewObject(extendedPanIdPresentEntryCls, extendedPanIdPresentEntryTypeCtor, extendedPanIdPresentValue); + } + + bool meshLocalPrefixPresentNull = false; + bool meshLocalPrefixPresentHasValue = true; + + bool meshLocalPrefixPresentValue = entry.meshLocalPrefixPresent; + + jobject meshLocalPrefixPresent = nullptr; + if (!meshLocalPrefixPresentNull && meshLocalPrefixPresentHasValue) + { + jclass meshLocalPrefixPresentEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Boolean", meshLocalPrefixPresentEntryCls); + chip::JniClass meshLocalPrefixPresentJniClass(meshLocalPrefixPresentEntryCls); + jmethodID meshLocalPrefixPresentEntryTypeCtor = env->GetMethodID(meshLocalPrefixPresentEntryCls, "", "(Z)V"); + meshLocalPrefixPresent = + env->NewObject(meshLocalPrefixPresentEntryCls, meshLocalPrefixPresentEntryTypeCtor, meshLocalPrefixPresentValue); + } + + bool delayPresentNull = false; + bool delayPresentHasValue = true; + + bool delayPresentValue = entry.delayPresent; + + jobject delayPresent = nullptr; + if (!delayPresentNull && delayPresentHasValue) + { + jclass delayPresentEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Boolean", delayPresentEntryCls); + chip::JniClass delayPresentJniClass(delayPresentEntryCls); + jmethodID delayPresentEntryTypeCtor = env->GetMethodID(delayPresentEntryCls, "", "(Z)V"); + delayPresent = env->NewObject(delayPresentEntryCls, delayPresentEntryTypeCtor, delayPresentValue); + } + + bool panIdPresentNull = false; + bool panIdPresentHasValue = true; + + bool panIdPresentValue = entry.panIdPresent; + + jobject panIdPresent = nullptr; + if (!panIdPresentNull && panIdPresentHasValue) + { + jclass panIdPresentEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Boolean", panIdPresentEntryCls); + chip::JniClass panIdPresentJniClass(panIdPresentEntryCls); + jmethodID panIdPresentEntryTypeCtor = env->GetMethodID(panIdPresentEntryCls, "", "(Z)V"); + panIdPresent = env->NewObject(panIdPresentEntryCls, panIdPresentEntryTypeCtor, panIdPresentValue); + } + + bool channelPresentNull = false; + bool channelPresentHasValue = true; + + bool channelPresentValue = entry.channelPresent; + + jobject channelPresent = nullptr; + if (!channelPresentNull && channelPresentHasValue) + { + jclass channelPresentEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Boolean", channelPresentEntryCls); + chip::JniClass channelPresentJniClass(channelPresentEntryCls); + jmethodID channelPresentEntryTypeCtor = env->GetMethodID(channelPresentEntryCls, "", "(Z)V"); + channelPresent = env->NewObject(channelPresentEntryCls, channelPresentEntryTypeCtor, channelPresentValue); + } + + bool pskcPresentNull = false; + bool pskcPresentHasValue = true; + + bool pskcPresentValue = entry.pskcPresent; + + jobject pskcPresent = nullptr; + if (!pskcPresentNull && pskcPresentHasValue) + { + jclass pskcPresentEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Boolean", pskcPresentEntryCls); + chip::JniClass pskcPresentJniClass(pskcPresentEntryCls); + jmethodID pskcPresentEntryTypeCtor = env->GetMethodID(pskcPresentEntryCls, "", "(Z)V"); + pskcPresent = env->NewObject(pskcPresentEntryCls, pskcPresentEntryTypeCtor, pskcPresentValue); + } + + bool securityPolicyPresentNull = false; + bool securityPolicyPresentHasValue = true; + + bool securityPolicyPresentValue = entry.securityPolicyPresent; + + jobject securityPolicyPresent = nullptr; + if (!securityPolicyPresentNull && securityPolicyPresentHasValue) + { + jclass securityPolicyPresentEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Boolean", securityPolicyPresentEntryCls); + chip::JniClass securityPolicyPresentJniClass(securityPolicyPresentEntryCls); + jmethodID securityPolicyPresentEntryTypeCtor = env->GetMethodID(securityPolicyPresentEntryCls, "", "(Z)V"); + securityPolicyPresent = + env->NewObject(securityPolicyPresentEntryCls, securityPolicyPresentEntryTypeCtor, securityPolicyPresentValue); + } + + bool channelMaskPresentNull = false; + bool channelMaskPresentHasValue = true; + + bool channelMaskPresentValue = entry.channelMaskPresent; + + jobject channelMaskPresent = nullptr; + if (!channelMaskPresentNull && channelMaskPresentHasValue) + { + jclass channelMaskPresentEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Boolean", channelMaskPresentEntryCls); + chip::JniClass channelMaskPresentJniClass(channelMaskPresentEntryCls); + jmethodID channelMaskPresentEntryTypeCtor = env->GetMethodID(channelMaskPresentEntryCls, "", "(Z)V"); + channelMaskPresent = + env->NewObject(channelMaskPresentEntryCls, channelMaskPresentEntryTypeCtor, channelMaskPresentValue); + } jobject attributeObj = env->NewObject(attributeClass, attributeCtor, activeTimestampPresent, pendingTimestampPresent, masterKeyPresent, @@ -2903,6 +4973,18 @@ CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback:: } } +CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback:: + ~CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + void CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { @@ -2939,12 +5021,21 @@ void CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback::Callb auto iter = list.begin(); while (iter.Next()) { - auto & entry = iter.GetValue(); - jclass entryTypeCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", entryTypeCls); - jmethodID entryTypeCtor = env->GetMethodID(entryTypeCls, "", "(I)V"); - jobject activeNetworkFaultsList = env->NewObject(entryTypeCls, entryTypeCtor, entry); - env->CallBooleanMethod(arrayListObj, arrayListAddMethod, activeNetworkFaultsList); + auto & entry = iter.GetValue(); + bool entryNull = false; + uint8_t entryValue = entry; + + jobject entryObject = nullptr; + if (!entryNull) + { + jclass entryTypeCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", entryTypeCls); + chip::JniClass jniClass(entryTypeCls); + jmethodID entryTypeCtor = env->GetMethodID(entryTypeCls, "", "(I)V"); + entryObject = env->NewObject(entryTypeCls, entryTypeCtor, entryValue); + } + + env->CallBooleanMethod(arrayListObj, arrayListAddMethod, entryObject); } VerifyOrReturn( iter.GetStatus() == CHIP_NO_ERROR, diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.h b/src/controller/java/zap-generated/CHIPReadCallbacks.h index 87cdceabb97ebf..259c3495f03caa 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.h +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.h @@ -25,6 +25,8 @@ class CHIPBooleanAttributeCallback : public chip::Callback::CallbackkeepAlive) @@ -46,6 +48,8 @@ class CHIPCharStringAttributeCallback : public chip::Callback::CallbackkeepAlive) @@ -67,6 +71,8 @@ class CHIPInt8sAttributeCallback : public chip::Callback::CallbackkeepAlive) @@ -88,6 +94,8 @@ class CHIPInt8uAttributeCallback : public chip::Callback::CallbackkeepAlive) @@ -109,6 +117,8 @@ class CHIPInt16sAttributeCallback : public chip::Callback::CallbackkeepAlive) @@ -130,6 +140,8 @@ class CHIPInt16uAttributeCallback : public chip::Callback::CallbackkeepAlive) @@ -151,6 +163,8 @@ class CHIPInt32sAttributeCallback : public chip::Callback::CallbackkeepAlive) @@ -172,6 +186,8 @@ class CHIPInt32uAttributeCallback : public chip::Callback::CallbackkeepAlive) @@ -193,6 +209,8 @@ class CHIPInt64sAttributeCallback : public chip::Callback::CallbackkeepAlive) @@ -214,6 +232,8 @@ class CHIPInt64uAttributeCallback : public chip::Callback::CallbackkeepAlive) @@ -235,6 +255,8 @@ class CHIPOctetStringAttributeCallback : public chip::Callback::CallbackkeepAlive) @@ -257,6 +279,8 @@ class CHIPApplicationLauncherApplicationLauncherListAttributeCallback public: CHIPApplicationLauncherApplicationLauncherListAttributeCallback(jobject javaCallback); + ~CHIPApplicationLauncherApplicationLauncherListAttributeCallback(); + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); private: @@ -269,6 +293,8 @@ class CHIPAudioOutputAudioOutputListAttributeCallback public: CHIPAudioOutputAudioOutputListAttributeCallback(jobject javaCallback); + ~CHIPAudioOutputAudioOutputListAttributeCallback(); + static void CallbackFn( void * context, const chip::app::DataModel::DecodableList & @@ -283,6 +309,8 @@ class CHIPBridgedActionsActionListAttributeCallback : public chip::Callback::Cal public: CHIPBridgedActionsActionListAttributeCallback(jobject javaCallback); + ~CHIPBridgedActionsActionListAttributeCallback(); + static void CallbackFn( void * context, const chip::app::DataModel::DecodableList & @@ -298,6 +326,8 @@ class CHIPBridgedActionsEndpointListAttributeCallback public: CHIPBridgedActionsEndpointListAttributeCallback(jobject javaCallback); + ~CHIPBridgedActionsEndpointListAttributeCallback(); + static void CallbackFn( void * context, const chip::app::DataModel::DecodableList & @@ -313,6 +343,8 @@ class CHIPContentLauncherAcceptsHeaderListAttributeCallback public: CHIPContentLauncherAcceptsHeaderListAttributeCallback(jobject javaCallback); + ~CHIPContentLauncherAcceptsHeaderListAttributeCallback(); + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); private: @@ -325,6 +357,8 @@ class CHIPContentLauncherSupportedStreamingTypesAttributeCallback public: CHIPContentLauncherSupportedStreamingTypesAttributeCallback(jobject javaCallback); + ~CHIPContentLauncherSupportedStreamingTypesAttributeCallback(); + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); @@ -338,6 +372,8 @@ class CHIPDescriptorDeviceListAttributeCallback : public chip::Callback::Callbac public: CHIPDescriptorDeviceListAttributeCallback(jobject javaCallback); + ~CHIPDescriptorDeviceListAttributeCallback(); + static void CallbackFn( void * context, const chip::app::DataModel::DecodableList & list); @@ -351,6 +387,8 @@ class CHIPDescriptorServerListAttributeCallback : public chip::Callback::Callbac public: CHIPDescriptorServerListAttributeCallback(jobject javaCallback); + ~CHIPDescriptorServerListAttributeCallback(); + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); private: @@ -362,6 +400,8 @@ class CHIPDescriptorClientListAttributeCallback : public chip::Callback::Callbac public: CHIPDescriptorClientListAttributeCallback(jobject javaCallback); + ~CHIPDescriptorClientListAttributeCallback(); + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); private: @@ -373,6 +413,8 @@ class CHIPDescriptorPartsListAttributeCallback : public chip::Callback::Callback public: CHIPDescriptorPartsListAttributeCallback(jobject javaCallback); + ~CHIPDescriptorPartsListAttributeCallback(); + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); private: @@ -384,6 +426,8 @@ class CHIPFixedLabelLabelListAttributeCallback : public chip::Callback::Callback public: CHIPFixedLabelLabelListAttributeCallback(jobject javaCallback); + ~CHIPFixedLabelLabelListAttributeCallback(); + static void CallbackFn( void * context, const chip::app::DataModel::DecodableList & list); @@ -398,6 +442,8 @@ class CHIPGeneralCommissioningBasicCommissioningInfoListAttributeCallback public: CHIPGeneralCommissioningBasicCommissioningInfoListAttributeCallback(jobject javaCallback); + ~CHIPGeneralCommissioningBasicCommissioningInfoListAttributeCallback(); + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList< @@ -413,6 +459,8 @@ class CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback public: CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback(jobject javaCallback); + ~CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback(); + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::GeneralDiagnostics::Structs::NetworkInterfaceType::DecodableType> & list); @@ -426,6 +474,8 @@ class CHIPGroupKeyManagementGroupsAttributeCallback : public chip::Callback::Cal public: CHIPGroupKeyManagementGroupsAttributeCallback(jobject javaCallback); + ~CHIPGroupKeyManagementGroupsAttributeCallback(); + static void CallbackFn( void * context, const chip::app::DataModel::DecodableList & @@ -441,6 +491,8 @@ class CHIPGroupKeyManagementGroupKeysAttributeCallback public: CHIPGroupKeyManagementGroupKeysAttributeCallback(jobject javaCallback); + ~CHIPGroupKeyManagementGroupKeysAttributeCallback(); + static void CallbackFn( void * context, const chip::app::DataModel::DecodableList & @@ -455,6 +507,8 @@ class CHIPMediaInputMediaInputListAttributeCallback : public chip::Callback::Cal public: CHIPMediaInputMediaInputListAttributeCallback(jobject javaCallback); + ~CHIPMediaInputMediaInputListAttributeCallback(); + static void CallbackFn( void * context, const chip::app::DataModel::DecodableList & list); @@ -468,6 +522,8 @@ class CHIPModeSelectSupportedModesAttributeCallback : public chip::Callback::Cal public: CHIPModeSelectSupportedModesAttributeCallback(jobject javaCallback); + ~CHIPModeSelectSupportedModesAttributeCallback(); + static void CallbackFn( void * context, const chip::app::DataModel::DecodableList & @@ -483,6 +539,8 @@ class CHIPOperationalCredentialsFabricsListAttributeCallback public: CHIPOperationalCredentialsFabricsListAttributeCallback(jobject javaCallback); + ~CHIPOperationalCredentialsFabricsListAttributeCallback(); + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & list); @@ -497,6 +555,8 @@ class CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback public: CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback(jobject javaCallback); + ~CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback(); + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); private: @@ -509,17 +569,38 @@ class CHIPPowerSourceActiveBatteryFaultsAttributeCallback public: CHIPPowerSourceActiveBatteryFaultsAttributeCallback(jobject javaCallback); + ~CHIPPowerSourceActiveBatteryFaultsAttributeCallback(); + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); private: jobject javaCallbackRef; }; +class CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback(jobject javaCallback); + + ~CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback(); + + static void CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & + list); + +private: + jobject javaCallbackRef; +}; + class CHIPTvChannelTvChannelListAttributeCallback : public chip::Callback::Callback { public: CHIPTvChannelTvChannelListAttributeCallback(jobject javaCallback); + ~CHIPTvChannelTvChannelListAttributeCallback(); + static void CallbackFn( void * context, const chip::app::DataModel::DecodableList & list); @@ -534,6 +615,8 @@ class CHIPTargetNavigatorTargetNavigatorListAttributeCallback public: CHIPTargetNavigatorTargetNavigatorListAttributeCallback(jobject javaCallback); + ~CHIPTargetNavigatorTargetNavigatorListAttributeCallback(); + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::TargetNavigator::Structs::NavigateTargetTargetInfo::DecodableType> & list); @@ -547,6 +630,8 @@ class CHIPTestClusterListInt8uAttributeCallback : public chip::Callback::Callbac public: CHIPTestClusterListInt8uAttributeCallback(jobject javaCallback); + ~CHIPTestClusterListInt8uAttributeCallback(); + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); private: @@ -559,6 +644,8 @@ class CHIPTestClusterListOctetStringAttributeCallback public: CHIPTestClusterListOctetStringAttributeCallback(jobject javaCallback); + ~CHIPTestClusterListOctetStringAttributeCallback(); + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); private: @@ -571,6 +658,8 @@ class CHIPTestClusterListStructOctetStringAttributeCallback public: CHIPTestClusterListStructOctetStringAttributeCallback(jobject javaCallback); + ~CHIPTestClusterListStructOctetStringAttributeCallback(); + static void CallbackFn( void * context, const chip::app::DataModel::DecodableList & @@ -586,6 +675,8 @@ class CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback public: CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback(jobject javaCallback); + ~CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback(); + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::TestCluster::Structs::NullablesAndOptionalsStruct::DecodableType> & list); @@ -600,6 +691,8 @@ class CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback public: CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback(jobject javaCallback); + ~CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback(); + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::ThreadNetworkDiagnostics::Structs::NeighborTable::DecodableType> & list); @@ -614,6 +707,8 @@ class CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback public: CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback(jobject javaCallback); + ~CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback(); + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::ThreadNetworkDiagnostics::Structs::RouteTable::DecodableType> & list); @@ -628,6 +723,8 @@ class CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback public: CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback(jobject javaCallback); + ~CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback(); + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::ThreadNetworkDiagnostics::Structs::SecurityPolicy::DecodableType> & list); @@ -642,6 +739,8 @@ class CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback public: CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback(jobject javaCallback); + ~CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback(); + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList< @@ -657,6 +756,8 @@ class CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback public: CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback(jobject javaCallback); + ~CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback(); + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index 188eab50f8b1c2..1d4f42aed4fd38 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -19,7 +19,10 @@ package chip.devicecontroller; +import androidx.annotation.Nullable; +import java.util.Arrays; import java.util.List; +import java.util.Optional; public class ChipClusters { @@ -362,11 +365,11 @@ private native void selectOutput( long chipClusterPtr, DefaultClusterCallback callback, int index); public static class AudioOutputListAttribute { - public int index; - public int outputType; + public Integer index; + public Integer outputType; public String name; - public AudioOutputListAttribute(int index, int outputType, String name) { + public AudioOutputListAttribute(Integer index, Integer outputType, String name) { this.index = index; this.outputType = outputType; this.name = name; @@ -948,20 +951,20 @@ private native void stopAction( long chipClusterPtr, DefaultClusterCallback callback, int actionID, long invokeID); public static class ActionListAttribute { - public int actionID; + public Integer actionID; public String name; - public int type; - public int endpointListID; - public int supportedCommands; - public int status; + public Integer type; + public Integer endpointListID; + public Integer supportedCommands; + public Integer status; public ActionListAttribute( - int actionID, + Integer actionID, String name, - int type, - int endpointListID, - int supportedCommands, - int status) { + Integer type, + Integer endpointListID, + Integer supportedCommands, + Integer status) { this.actionID = actionID; this.name = name; this.type = type; @@ -1008,12 +1011,13 @@ public interface ActionListAttributeCallback { } public static class EndpointListAttribute { - public int endpointListID; + public Integer endpointListID; public String name; - public int type; + public Integer type; public byte[] endpoints; - public EndpointListAttribute(int endpointListID, String name, int type, byte[] endpoints) { + public EndpointListAttribute( + Integer endpointListID, String name, Integer type, byte[] endpoints) { this.endpointListID = endpointListID; this.name = name; this.type = type; @@ -1035,17 +1039,9 @@ public String toString() { output.append(this.type); output.append("\n"); - output.append("byte[] endpoints: ["); - for (int i = 0; i < endpoints.length; i++) { - if (i != endpoints.length - 1) { - output.append(endpoints[i]); - output.append(", "); - } else { - output.append(endpoints[i]); - output.append("]"); - output.append("\n"); - } - } + output.append("byte[] "); + output.append(Arrays.toString(endpoints)); + output.append("\n"); return output.toString(); } @@ -2268,10 +2264,10 @@ public static long clusterId() { public native long initWithDevice(long devicePtr, int endpointId); public static class DeviceListAttribute { - public long type; - public int revision; + public Long type; + public Integer revision; - public DeviceListAttribute(long type, int revision) { + public DeviceListAttribute(Long type, Integer revision) { this.type = type; this.revision = revision; } @@ -3204,9 +3200,9 @@ public interface SetRegulatoryConfigResponseCallback { } public static class BasicCommissioningInfoListAttribute { - public long failSafeExpiryLengthMs; + public Long failSafeExpiryLengthMs; - public BasicCommissioningInfoListAttribute(long failSafeExpiryLengthMs) { + public BasicCommissioningInfoListAttribute(Long failSafeExpiryLengthMs) { this.failSafeExpiryLengthMs = failSafeExpiryLengthMs; } @@ -3271,19 +3267,19 @@ public static long clusterId() { public static class NetworkInterfacesAttribute { public String name; - public boolean fabricConnected; - public boolean offPremiseServicesReachableIPv4; - public boolean offPremiseServicesReachableIPv6; + public Boolean fabricConnected; + public Boolean offPremiseServicesReachableIPv4; + public Boolean offPremiseServicesReachableIPv6; public byte[] hardwareAddress; - public int type; + public Integer type; public NetworkInterfacesAttribute( String name, - boolean fabricConnected, - boolean offPremiseServicesReachableIPv4, - boolean offPremiseServicesReachableIPv6, + Boolean fabricConnected, + Boolean offPremiseServicesReachableIPv4, + Boolean offPremiseServicesReachableIPv6, byte[] hardwareAddress, - int type) { + Integer type) { this.name = name; this.fabricConnected = fabricConnected; this.offPremiseServicesReachableIPv4 = offPremiseServicesReachableIPv4; @@ -3311,17 +3307,9 @@ public String toString() { output.append(this.offPremiseServicesReachableIPv6); output.append("\n"); - output.append("byte[] hardwareAddress: ["); - for (int i = 0; i < hardwareAddress.length; i++) { - if (i != hardwareAddress.length - 1) { - output.append(hardwareAddress[i]); - output.append(", "); - } else { - output.append(hardwareAddress[i]); - output.append("]"); - output.append("\n"); - } - } + output.append("byte[] "); + output.append(Arrays.toString(hardwareAddress)); + output.append("\n"); output.append("int type: "); output.append(this.type); @@ -3392,11 +3380,11 @@ public static long clusterId() { public native long initWithDevice(long devicePtr, int endpointId); public static class GroupsAttribute { - public int vendorId; - public int vendorGroupId; - public int groupKeySetIndex; + public Integer vendorId; + public Integer vendorGroupId; + public Integer groupKeySetIndex; - public GroupsAttribute(int vendorId, int vendorGroupId, int groupKeySetIndex) { + public GroupsAttribute(Integer vendorId, Integer vendorGroupId, Integer groupKeySetIndex) { this.vendorId = vendorId; this.vendorGroupId = vendorGroupId; this.groupKeySetIndex = groupKeySetIndex; @@ -3428,18 +3416,18 @@ public interface GroupsAttributeCallback { } public static class GroupKeysAttribute { - public int vendorId; - public int groupKeyIndex; + public Integer vendorId; + public Integer groupKeyIndex; public byte[] groupKeyRoot; - public long groupKeyEpochStartTime; - public int groupKeySecurityPolicy; + public Long groupKeyEpochStartTime; + public Integer groupKeySecurityPolicy; public GroupKeysAttribute( - int vendorId, - int groupKeyIndex, + Integer vendorId, + Integer groupKeyIndex, byte[] groupKeyRoot, - long groupKeyEpochStartTime, - int groupKeySecurityPolicy) { + Long groupKeyEpochStartTime, + Integer groupKeySecurityPolicy) { this.vendorId = vendorId; this.groupKeyIndex = groupKeyIndex; this.groupKeyRoot = groupKeyRoot; @@ -3458,17 +3446,9 @@ public String toString() { output.append(this.groupKeyIndex); output.append("\n"); - output.append("byte[] groupKeyRoot: ["); - for (int i = 0; i < groupKeyRoot.length; i++) { - if (i != groupKeyRoot.length - 1) { - output.append(groupKeyRoot[i]); - output.append(", "); - } else { - output.append(groupKeyRoot[i]); - output.append("]"); - output.append("\n"); - } - } + output.append("byte[] "); + output.append(Arrays.toString(groupKeyRoot)); + output.append("\n"); output.append("long groupKeyEpochStartTime: "); output.append(this.groupKeyEpochStartTime); @@ -4123,12 +4103,13 @@ private native void selectInput( private native void showInputStatus(long chipClusterPtr, DefaultClusterCallback callback); public static class MediaInputListAttribute { - public int index; - public int inputType; + public Integer index; + public Integer inputType; public String name; public String description; - public MediaInputListAttribute(int index, int inputType, String name, String description) { + public MediaInputListAttribute( + Integer index, Integer inputType, String name, String description) { this.index = index; this.inputType = inputType; this.name = name; @@ -4423,10 +4404,10 @@ private native void changeToMode( public static class SupportedModesAttribute { public String label; - public int mode; - public long semanticTag; + public Integer mode; + public Long semanticTag; - public SupportedModesAttribute(String label, int mode, long semanticTag) { + public SupportedModesAttribute(String label, Integer mode, Long semanticTag) { this.label = label; this.mode = mode; this.semanticTag = semanticTag; @@ -5228,19 +5209,19 @@ public interface OpCSRResponseCallback { } public static class FabricsListAttribute { - public int fabricIndex; + public Integer fabricIndex; public byte[] rootPublicKey; - public int vendorId; - public long fabricId; - public long nodeId; + public Integer vendorId; + public Long fabricId; + public Long nodeId; public String label; public FabricsListAttribute( - int fabricIndex, + Integer fabricIndex, byte[] rootPublicKey, - int vendorId, - long fabricId, - long nodeId, + Integer vendorId, + Long fabricId, + Long nodeId, String label) { this.fabricIndex = fabricIndex; this.rootPublicKey = rootPublicKey; @@ -5257,17 +5238,9 @@ public String toString() { output.append(this.fabricIndex); output.append("\n"); - output.append("byte[] rootPublicKey: ["); - for (int i = 0; i < rootPublicKey.length; i++) { - if (i != rootPublicKey.length - 1) { - output.append(rootPublicKey[i]); - output.append(", "); - } else { - output.append(rootPublicKey[i]); - output.append("]"); - output.append("\n"); - } - } + output.append("byte[] "); + output.append(Arrays.toString(rootPublicKey)); + output.append("\n"); output.append("int vendorId: "); output.append(this.vendorId); @@ -5991,6 +5964,59 @@ public void resetWatermarks(DefaultClusterCallback callback) { private native void resetWatermarks(long chipClusterPtr, DefaultClusterCallback callback); + public static class ThreadMetricsAttribute { + public Long id; + public String name; + public Long stackFreeCurrent; + public Long stackFreeMinimum; + public Long stackSize; + + public ThreadMetricsAttribute( + Long id, String name, Long stackFreeCurrent, Long stackFreeMinimum, Long stackSize) { + this.id = id; + this.name = name; + this.stackFreeCurrent = stackFreeCurrent; + this.stackFreeMinimum = stackFreeMinimum; + this.stackSize = stackSize; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(""); + output.append("long id: "); + output.append(this.id); + output.append("\n"); + + output.append("String name: "); + output.append(this.name); + output.append("\n"); + + output.append("long stackFreeCurrent: "); + output.append(this.stackFreeCurrent); + output.append("\n"); + + output.append("long stackFreeMinimum: "); + output.append(this.stackFreeMinimum); + output.append("\n"); + + output.append("long stackSize: "); + output.append(this.stackSize); + output.append("\n"); + + return output.toString(); + } + } + + public interface ThreadMetricsAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + } + + public void readThreadMetricsAttribute(ThreadMetricsAttributeCallback callback) { + readThreadMetricsAttribute(chipClusterPtr, callback); + } + public void readCurrentHeapFreeAttribute(LongAttributeCallback callback) { readCurrentHeapFreeAttribute(chipClusterPtr, callback); } @@ -6007,6 +6033,9 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { readClusterRevisionAttribute(chipClusterPtr, callback); } + private native void readThreadMetricsAttribute( + long chipClusterPtr, ThreadMetricsAttributeCallback callback); + private native void readCurrentHeapFreeAttribute( long chipClusterPtr, LongAttributeCallback callback); @@ -6127,15 +6156,15 @@ void onSuccess( } public static class TvChannelListAttribute { - public int majorNumber; - public int minorNumber; + public Integer majorNumber; + public Integer minorNumber; public String name; public String callSign; public String affiliateCallSign; public TvChannelListAttribute( - int majorNumber, - int minorNumber, + Integer majorNumber, + Integer minorNumber, String name, String callSign, String affiliateCallSign) { @@ -6234,10 +6263,10 @@ public interface NavigateTargetResponseCallback { } public static class TargetNavigatorListAttribute { - public int identifier; + public Integer identifier; public String name; - public TargetNavigatorListAttribute(int identifier, String name) { + public TargetNavigatorListAttribute(Integer identifier, String name) { this.identifier = identifier; this.name = name; } @@ -6511,10 +6540,10 @@ public interface ListOctetStringAttributeCallback { } public static class ListStructOctetStringAttribute { - public long fabricIndex; + public Long fabricIndex; public byte[] operationalCert; - public ListStructOctetStringAttribute(long fabricIndex, byte[] operationalCert) { + public ListStructOctetStringAttribute(Long fabricIndex, byte[] operationalCert) { this.fabricIndex = fabricIndex; this.operationalCert = operationalCert; } @@ -6526,17 +6555,9 @@ public String toString() { output.append(this.fabricIndex); output.append("\n"); - output.append("byte[] operationalCert: ["); - for (int i = 0; i < operationalCert.length; i++) { - if (i != operationalCert.length - 1) { - output.append(operationalCert[i]); - output.append(", "); - } else { - output.append(operationalCert[i]); - output.append("]"); - output.append("\n"); - } - } + output.append("byte[] "); + output.append(Arrays.toString(operationalCert)); + output.append("\n"); return output.toString(); } @@ -6549,8 +6570,27 @@ public interface ListStructOctetStringAttributeCallback { } public static class ListNullablesAndOptionalsStructAttribute { - - public ListNullablesAndOptionalsStructAttribute() {} + @Nullable public Integer nullableInt; + public Optional optionalInt; + @Nullable public Optional nullableOptionalInt; + @Nullable public String nullableString; + public Optional optionalString; + @Nullable public Optional nullableOptionalString; + + public ListNullablesAndOptionalsStructAttribute( + @Nullable Integer nullableInt, + Optional optionalInt, + @Nullable Optional nullableOptionalInt, + @Nullable String nullableString, + Optional optionalString, + @Nullable Optional nullableOptionalString) { + this.nullableInt = nullableInt; + this.optionalInt = optionalInt; + this.nullableOptionalInt = nullableOptionalInt; + this.nullableString = nullableString; + this.optionalString = optionalString; + this.nullableOptionalString = nullableOptionalString; + } @Override public String toString() { @@ -6768,6 +6808,142 @@ public void writeUnsupportedAttribute(DefaultClusterCallback callback, boolean v writeUnsupportedAttribute(chipClusterPtr, callback, value); } + public void readNullableBooleanAttribute(BooleanAttributeCallback callback) { + readNullableBooleanAttribute(chipClusterPtr, callback); + } + + public void writeNullableBooleanAttribute(DefaultClusterCallback callback, boolean value) { + writeNullableBooleanAttribute(chipClusterPtr, callback, value); + } + + public void readNullableBitmap8Attribute(IntegerAttributeCallback callback) { + readNullableBitmap8Attribute(chipClusterPtr, callback); + } + + public void writeNullableBitmap8Attribute(DefaultClusterCallback callback, int value) { + writeNullableBitmap8Attribute(chipClusterPtr, callback, value); + } + + public void readNullableBitmap16Attribute(IntegerAttributeCallback callback) { + readNullableBitmap16Attribute(chipClusterPtr, callback); + } + + public void writeNullableBitmap16Attribute(DefaultClusterCallback callback, int value) { + writeNullableBitmap16Attribute(chipClusterPtr, callback, value); + } + + public void readNullableBitmap32Attribute(LongAttributeCallback callback) { + readNullableBitmap32Attribute(chipClusterPtr, callback); + } + + public void writeNullableBitmap32Attribute(DefaultClusterCallback callback, long value) { + writeNullableBitmap32Attribute(chipClusterPtr, callback, value); + } + + public void readNullableBitmap64Attribute(LongAttributeCallback callback) { + readNullableBitmap64Attribute(chipClusterPtr, callback); + } + + public void writeNullableBitmap64Attribute(DefaultClusterCallback callback, long value) { + writeNullableBitmap64Attribute(chipClusterPtr, callback, value); + } + + public void readNullableInt8uAttribute(IntegerAttributeCallback callback) { + readNullableInt8uAttribute(chipClusterPtr, callback); + } + + public void writeNullableInt8uAttribute(DefaultClusterCallback callback, int value) { + writeNullableInt8uAttribute(chipClusterPtr, callback, value); + } + + public void readNullableInt16uAttribute(IntegerAttributeCallback callback) { + readNullableInt16uAttribute(chipClusterPtr, callback); + } + + public void writeNullableInt16uAttribute(DefaultClusterCallback callback, int value) { + writeNullableInt16uAttribute(chipClusterPtr, callback, value); + } + + public void readNullableInt32uAttribute(LongAttributeCallback callback) { + readNullableInt32uAttribute(chipClusterPtr, callback); + } + + public void writeNullableInt32uAttribute(DefaultClusterCallback callback, long value) { + writeNullableInt32uAttribute(chipClusterPtr, callback, value); + } + + public void readNullableInt64uAttribute(LongAttributeCallback callback) { + readNullableInt64uAttribute(chipClusterPtr, callback); + } + + public void writeNullableInt64uAttribute(DefaultClusterCallback callback, long value) { + writeNullableInt64uAttribute(chipClusterPtr, callback, value); + } + + public void readNullableInt8sAttribute(IntegerAttributeCallback callback) { + readNullableInt8sAttribute(chipClusterPtr, callback); + } + + public void writeNullableInt8sAttribute(DefaultClusterCallback callback, int value) { + writeNullableInt8sAttribute(chipClusterPtr, callback, value); + } + + public void readNullableInt16sAttribute(IntegerAttributeCallback callback) { + readNullableInt16sAttribute(chipClusterPtr, callback); + } + + public void writeNullableInt16sAttribute(DefaultClusterCallback callback, int value) { + writeNullableInt16sAttribute(chipClusterPtr, callback, value); + } + + public void readNullableInt32sAttribute(LongAttributeCallback callback) { + readNullableInt32sAttribute(chipClusterPtr, callback); + } + + public void writeNullableInt32sAttribute(DefaultClusterCallback callback, long value) { + writeNullableInt32sAttribute(chipClusterPtr, callback, value); + } + + public void readNullableInt64sAttribute(LongAttributeCallback callback) { + readNullableInt64sAttribute(chipClusterPtr, callback); + } + + public void writeNullableInt64sAttribute(DefaultClusterCallback callback, long value) { + writeNullableInt64sAttribute(chipClusterPtr, callback, value); + } + + public void readNullableEnum8Attribute(IntegerAttributeCallback callback) { + readNullableEnum8Attribute(chipClusterPtr, callback); + } + + public void writeNullableEnum8Attribute(DefaultClusterCallback callback, int value) { + writeNullableEnum8Attribute(chipClusterPtr, callback, value); + } + + public void readNullableEnum16Attribute(IntegerAttributeCallback callback) { + readNullableEnum16Attribute(chipClusterPtr, callback); + } + + public void writeNullableEnum16Attribute(DefaultClusterCallback callback, int value) { + writeNullableEnum16Attribute(chipClusterPtr, callback, value); + } + + public void readNullableOctetStringAttribute(OctetStringAttributeCallback callback) { + readNullableOctetStringAttribute(chipClusterPtr, callback); + } + + public void writeNullableOctetStringAttribute(DefaultClusterCallback callback, byte[] value) { + writeNullableOctetStringAttribute(chipClusterPtr, callback, value); + } + + public void readNullableCharStringAttribute(CharStringAttributeCallback callback) { + readNullableCharStringAttribute(chipClusterPtr, callback); + } + + public void writeNullableCharStringAttribute(DefaultClusterCallback callback, String value) { + writeNullableCharStringAttribute(chipClusterPtr, callback, value); + } + public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { readClusterRevisionAttribute(chipClusterPtr, callback); } @@ -6908,6 +7084,108 @@ private native void readUnsupportedAttribute( private native void writeUnsupportedAttribute( long chipClusterPtr, DefaultClusterCallback callback, boolean value); + private native void readNullableBooleanAttribute( + long chipClusterPtr, BooleanAttributeCallback callback); + + private native void writeNullableBooleanAttribute( + long chipClusterPtr, DefaultClusterCallback callback, boolean value); + + private native void readNullableBitmap8Attribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeNullableBitmap8Attribute( + long chipClusterPtr, DefaultClusterCallback callback, int value); + + private native void readNullableBitmap16Attribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeNullableBitmap16Attribute( + long chipClusterPtr, DefaultClusterCallback callback, int value); + + private native void readNullableBitmap32Attribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void writeNullableBitmap32Attribute( + long chipClusterPtr, DefaultClusterCallback callback, long value); + + private native void readNullableBitmap64Attribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void writeNullableBitmap64Attribute( + long chipClusterPtr, DefaultClusterCallback callback, long value); + + private native void readNullableInt8uAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeNullableInt8uAttribute( + long chipClusterPtr, DefaultClusterCallback callback, int value); + + private native void readNullableInt16uAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeNullableInt16uAttribute( + long chipClusterPtr, DefaultClusterCallback callback, int value); + + private native void readNullableInt32uAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void writeNullableInt32uAttribute( + long chipClusterPtr, DefaultClusterCallback callback, long value); + + private native void readNullableInt64uAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void writeNullableInt64uAttribute( + long chipClusterPtr, DefaultClusterCallback callback, long value); + + private native void readNullableInt8sAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeNullableInt8sAttribute( + long chipClusterPtr, DefaultClusterCallback callback, int value); + + private native void readNullableInt16sAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeNullableInt16sAttribute( + long chipClusterPtr, DefaultClusterCallback callback, int value); + + private native void readNullableInt32sAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void writeNullableInt32sAttribute( + long chipClusterPtr, DefaultClusterCallback callback, long value); + + private native void readNullableInt64sAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void writeNullableInt64sAttribute( + long chipClusterPtr, DefaultClusterCallback callback, long value); + + private native void readNullableEnum8Attribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeNullableEnum8Attribute( + long chipClusterPtr, DefaultClusterCallback callback, int value); + + private native void readNullableEnum16Attribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeNullableEnum16Attribute( + long chipClusterPtr, DefaultClusterCallback callback, int value); + + private native void readNullableOctetStringAttribute( + long chipClusterPtr, OctetStringAttributeCallback callback); + + private native void writeNullableOctetStringAttribute( + long chipClusterPtr, DefaultClusterCallback callback, byte[] value); + + private native void readNullableCharStringAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void writeNullableCharStringAttribute( + long chipClusterPtr, DefaultClusterCallback callback, String value); + private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); } @@ -7269,36 +7547,36 @@ public void resetCounts(DefaultClusterCallback callback) { private native void resetCounts(long chipClusterPtr, DefaultClusterCallback callback); public static class NeighborTableListAttribute { - public long extAddress; - public long age; - public int rloc16; - public long linkFrameCounter; - public long mleFrameCounter; - public int lqi; - public int averageRssi; - public int lastRssi; - public int frameErrorRate; - public int messageErrorRate; - public boolean rxOnWhenIdle; - public boolean fullThreadDevice; - public boolean fullNetworkData; - public boolean isChild; + public Long extAddress; + public Long age; + public Integer rloc16; + public Long linkFrameCounter; + public Long mleFrameCounter; + public Integer lqi; + public Integer averageRssi; + public Integer lastRssi; + public Integer frameErrorRate; + public Integer messageErrorRate; + public Boolean rxOnWhenIdle; + public Boolean fullThreadDevice; + public Boolean fullNetworkData; + public Boolean isChild; public NeighborTableListAttribute( - long extAddress, - long age, - int rloc16, - long linkFrameCounter, - long mleFrameCounter, - int lqi, - int averageRssi, - int lastRssi, - int frameErrorRate, - int messageErrorRate, - boolean rxOnWhenIdle, - boolean fullThreadDevice, - boolean fullNetworkData, - boolean isChild) { + Long extAddress, + Long age, + Integer rloc16, + Long linkFrameCounter, + Long mleFrameCounter, + Integer lqi, + Integer averageRssi, + Integer lastRssi, + Integer frameErrorRate, + Integer messageErrorRate, + Boolean rxOnWhenIdle, + Boolean fullThreadDevice, + Boolean fullNetworkData, + Boolean isChild) { this.extAddress = extAddress; this.age = age; this.rloc16 = rloc16; @@ -7385,28 +7663,28 @@ public interface NeighborTableListAttributeCallback { } public static class RouteTableListAttribute { - public long extAddress; - public int rloc16; - public int routerId; - public int nextHop; - public int pathCost; - public int LQIIn; - public int LQIOut; - public int age; - public boolean allocated; - public boolean linkEstablished; + public Long extAddress; + public Integer rloc16; + public Integer routerId; + public Integer nextHop; + public Integer pathCost; + public Integer LQIIn; + public Integer LQIOut; + public Integer age; + public Boolean allocated; + public Boolean linkEstablished; public RouteTableListAttribute( - long extAddress, - int rloc16, - int routerId, - int nextHop, - int pathCost, - int LQIIn, - int LQIOut, - int age, - boolean allocated, - boolean linkEstablished) { + Long extAddress, + Integer rloc16, + Integer routerId, + Integer nextHop, + Integer pathCost, + Integer LQIIn, + Integer LQIOut, + Integer age, + Boolean allocated, + Boolean linkEstablished) { this.extAddress = extAddress; this.rloc16 = rloc16; this.routerId = routerId; @@ -7473,10 +7751,10 @@ public interface RouteTableListAttributeCallback { } public static class SecurityPolicyAttribute { - public int rotationTime; - public int flags; + public Integer rotationTime; + public Integer flags; - public SecurityPolicyAttribute(int rotationTime, int flags) { + public SecurityPolicyAttribute(Integer rotationTime, Integer flags) { this.rotationTime = rotationTime; this.flags = flags; } @@ -7503,32 +7781,32 @@ public interface SecurityPolicyAttributeCallback { } public static class OperationalDatasetComponentsAttribute { - public boolean activeTimestampPresent; - public boolean pendingTimestampPresent; - public boolean masterKeyPresent; - public boolean networkNamePresent; - public boolean extendedPanIdPresent; - public boolean meshLocalPrefixPresent; - public boolean delayPresent; - public boolean panIdPresent; - public boolean channelPresent; - public boolean pskcPresent; - public boolean securityPolicyPresent; - public boolean channelMaskPresent; + public Boolean activeTimestampPresent; + public Boolean pendingTimestampPresent; + public Boolean masterKeyPresent; + public Boolean networkNamePresent; + public Boolean extendedPanIdPresent; + public Boolean meshLocalPrefixPresent; + public Boolean delayPresent; + public Boolean panIdPresent; + public Boolean channelPresent; + public Boolean pskcPresent; + public Boolean securityPolicyPresent; + public Boolean channelMaskPresent; public OperationalDatasetComponentsAttribute( - boolean activeTimestampPresent, - boolean pendingTimestampPresent, - boolean masterKeyPresent, - boolean networkNamePresent, - boolean extendedPanIdPresent, - boolean meshLocalPrefixPresent, - boolean delayPresent, - boolean panIdPresent, - boolean channelPresent, - boolean pskcPresent, - boolean securityPolicyPresent, - boolean channelMaskPresent) { + Boolean activeTimestampPresent, + Boolean pendingTimestampPresent, + Boolean masterKeyPresent, + Boolean networkNamePresent, + Boolean extendedPanIdPresent, + Boolean meshLocalPrefixPresent, + Boolean delayPresent, + Boolean panIdPresent, + Boolean channelPresent, + Boolean pskcPresent, + Boolean securityPolicyPresent, + Boolean channelMaskPresent) { this.activeTimestampPresent = activeTimestampPresent; this.pendingTimestampPresent = pendingTimestampPresent; this.masterKeyPresent = masterKeyPresent; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index e545384a82e601..758a98b4219747 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -21,10 +21,10 @@ import chip.clusterinfo.ClusterCommandCallback; import chip.clusterinfo.ClusterInfo; -import chip.clusterinfo.CommandInfo; import chip.clusterinfo.CommandParameterInfo; import chip.clusterinfo.CommandResponseInfo; import chip.clusterinfo.DelegatedClusterCallback; +import chip.clusterinfo.InteractionInfo; import chip.devicecontroller.ChipClusters.DefaultClusterCallback; import java.util.HashMap; import java.util.LinkedHashMap; @@ -2567,6 +2567,34 @@ public void onError(Exception error) { } } + public class DelegatedThreadMetricsAttributeCallback + implements ChipClusters.SoftwareDiagnosticsCluster.ThreadMetricsAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess( + List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = + new CommandResponseInfo( + "valueList", "List"); + + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public class DelegatedChangeChannelResponseCallback implements ChipClusters.TvChannelCluster.ChangeChannelResponseCallback, DelegatedClusterCallback { @@ -3089,14 +3117,387 @@ public void onError(Exception ex) { } public Map getClusterMap() { + Map clusterMap = initializeClusterMap(); + Map> commandMap = getCommandMap(); + combineCommand(clusterMap, commandMap); + Map> readAttributeMap = getReadAttributeMap(); + combineCommand(clusterMap, readAttributeMap); + return clusterMap; + } + + public Map initializeClusterMap() { Map clusterMap = new HashMap<>(); - getCommandMap(clusterMap); - getReadAttributeMap(clusterMap); + ClusterInfo accountLoginClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.AccountLoginCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("accountLogin", accountLoginClusterInfo); + ClusterInfo administratorCommissioningClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> + new ChipClusters.AdministratorCommissioningCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("administratorCommissioning", administratorCommissioningClusterInfo); + ClusterInfo applicationBasicClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.ApplicationBasicCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("applicationBasic", applicationBasicClusterInfo); + ClusterInfo applicationLauncherClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.ApplicationLauncherCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("applicationLauncher", applicationLauncherClusterInfo); + ClusterInfo audioOutputClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.AudioOutputCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("audioOutput", audioOutputClusterInfo); + ClusterInfo barrierControlClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.BarrierControlCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("barrierControl", barrierControlClusterInfo); + ClusterInfo basicClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.BasicCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("basic", basicClusterInfo); + ClusterInfo binaryInputBasicClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.BinaryInputBasicCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("binaryInputBasic", binaryInputBasicClusterInfo); + ClusterInfo bindingClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.BindingCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("binding", bindingClusterInfo); + ClusterInfo booleanStateClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.BooleanStateCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("booleanState", booleanStateClusterInfo); + ClusterInfo bridgedActionsClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.BridgedActionsCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("bridgedActions", bridgedActionsClusterInfo); + ClusterInfo bridgedDeviceBasicClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.BridgedDeviceBasicCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("bridgedDeviceBasic", bridgedDeviceBasicClusterInfo); + ClusterInfo colorControlClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.ColorControlCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("colorControl", colorControlClusterInfo); + ClusterInfo contentLauncherClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.ContentLauncherCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("contentLauncher", contentLauncherClusterInfo); + ClusterInfo descriptorClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.DescriptorCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("descriptor", descriptorClusterInfo); + ClusterInfo diagnosticLogsClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.DiagnosticLogsCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("diagnosticLogs", diagnosticLogsClusterInfo); + ClusterInfo doorLockClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.DoorLockCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("doorLock", doorLockClusterInfo); + ClusterInfo electricalMeasurementClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.ElectricalMeasurementCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("electricalMeasurement", electricalMeasurementClusterInfo); + ClusterInfo ethernetNetworkDiagnosticsClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> + new ChipClusters.EthernetNetworkDiagnosticsCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("ethernetNetworkDiagnostics", ethernetNetworkDiagnosticsClusterInfo); + ClusterInfo fixedLabelClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.FixedLabelCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("fixedLabel", fixedLabelClusterInfo); + ClusterInfo flowMeasurementClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.FlowMeasurementCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("flowMeasurement", flowMeasurementClusterInfo); + ClusterInfo generalCommissioningClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.GeneralCommissioningCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("generalCommissioning", generalCommissioningClusterInfo); + ClusterInfo generalDiagnosticsClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.GeneralDiagnosticsCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("generalDiagnostics", generalDiagnosticsClusterInfo); + ClusterInfo groupKeyManagementClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.GroupKeyManagementCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("groupKeyManagement", groupKeyManagementClusterInfo); + ClusterInfo groupsClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.GroupsCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("groups", groupsClusterInfo); + ClusterInfo identifyClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.IdentifyCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("identify", identifyClusterInfo); + ClusterInfo illuminanceMeasurementClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.IlluminanceMeasurementCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("illuminanceMeasurement", illuminanceMeasurementClusterInfo); + ClusterInfo keypadInputClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.KeypadInputCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("keypadInput", keypadInputClusterInfo); + ClusterInfo levelControlClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.LevelControlCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("levelControl", levelControlClusterInfo); + ClusterInfo lowPowerClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.LowPowerCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("lowPower", lowPowerClusterInfo); + ClusterInfo mediaInputClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.MediaInputCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("mediaInput", mediaInputClusterInfo); + ClusterInfo mediaPlaybackClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.MediaPlaybackCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("mediaPlayback", mediaPlaybackClusterInfo); + ClusterInfo modeSelectClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.ModeSelectCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("modeSelect", modeSelectClusterInfo); + ClusterInfo networkCommissioningClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.NetworkCommissioningCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("networkCommissioning", networkCommissioningClusterInfo); + ClusterInfo otaSoftwareUpdateProviderClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.OtaSoftwareUpdateProviderCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("otaSoftwareUpdateProvider", otaSoftwareUpdateProviderClusterInfo); + ClusterInfo otaSoftwareUpdateRequestorClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> + new ChipClusters.OtaSoftwareUpdateRequestorCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("otaSoftwareUpdateRequestor", otaSoftwareUpdateRequestorClusterInfo); + ClusterInfo occupancySensingClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.OccupancySensingCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("occupancySensing", occupancySensingClusterInfo); + ClusterInfo onOffClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.OnOffCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("onOff", onOffClusterInfo); + ClusterInfo onOffSwitchConfigurationClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.OnOffSwitchConfigurationCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("onOffSwitchConfiguration", onOffSwitchConfigurationClusterInfo); + ClusterInfo operationalCredentialsClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.OperationalCredentialsCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("operationalCredentials", operationalCredentialsClusterInfo); + ClusterInfo powerSourceClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.PowerSourceCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("powerSource", powerSourceClusterInfo); + ClusterInfo pressureMeasurementClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.PressureMeasurementCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("pressureMeasurement", pressureMeasurementClusterInfo); + ClusterInfo pumpConfigurationAndControlClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> + new ChipClusters.PumpConfigurationAndControlCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("pumpConfigurationAndControl", pumpConfigurationAndControlClusterInfo); + ClusterInfo relativeHumidityMeasurementClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> + new ChipClusters.RelativeHumidityMeasurementCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("relativeHumidityMeasurement", relativeHumidityMeasurementClusterInfo); + ClusterInfo scenesClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.ScenesCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("scenes", scenesClusterInfo); + ClusterInfo softwareDiagnosticsClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.SoftwareDiagnosticsCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("softwareDiagnostics", softwareDiagnosticsClusterInfo); + ClusterInfo switchClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.SwitchCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("switch", switchClusterInfo); + ClusterInfo tvChannelClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.TvChannelCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("tvChannel", tvChannelClusterInfo); + ClusterInfo targetNavigatorClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.TargetNavigatorCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("targetNavigator", targetNavigatorClusterInfo); + ClusterInfo temperatureMeasurementClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.TemperatureMeasurementCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("temperatureMeasurement", temperatureMeasurementClusterInfo); + ClusterInfo testClusterClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.TestClusterCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("testCluster", testClusterClusterInfo); + ClusterInfo thermostatClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.ThermostatCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("thermostat", thermostatClusterInfo); + ClusterInfo thermostatUserInterfaceConfigurationClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> + new ChipClusters.ThermostatUserInterfaceConfigurationCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put( + "thermostatUserInterfaceConfiguration", thermostatUserInterfaceConfigurationClusterInfo); + ClusterInfo threadNetworkDiagnosticsClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.ThreadNetworkDiagnosticsCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("threadNetworkDiagnostics", threadNetworkDiagnosticsClusterInfo); + ClusterInfo wakeOnLanClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.WakeOnLanCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("wakeOnLan", wakeOnLanClusterInfo); + ClusterInfo wiFiNetworkDiagnosticsClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.WiFiNetworkDiagnosticsCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("wiFiNetworkDiagnostics", wiFiNetworkDiagnosticsClusterInfo); + ClusterInfo windowCoveringClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.WindowCoveringCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("windowCovering", windowCoveringClusterInfo); return clusterMap; } - public Map getCommandMap(Map clusterMap) { - Map accountLoginClusterCommandInfoMap = new LinkedHashMap<>(); + public void combineCommand( + Map destination, Map> source) { + destination.get("accountLogin").combineCommands(source.get("accountLogin")); + destination + .get("administratorCommissioning") + .combineCommands(source.get("administratorCommissioning")); + destination.get("applicationBasic").combineCommands(source.get("applicationBasic")); + destination.get("applicationLauncher").combineCommands(source.get("applicationLauncher")); + destination.get("audioOutput").combineCommands(source.get("audioOutput")); + destination.get("barrierControl").combineCommands(source.get("barrierControl")); + destination.get("basic").combineCommands(source.get("basic")); + destination.get("binaryInputBasic").combineCommands(source.get("binaryInputBasic")); + destination.get("binding").combineCommands(source.get("binding")); + destination.get("booleanState").combineCommands(source.get("booleanState")); + destination.get("bridgedActions").combineCommands(source.get("bridgedActions")); + destination.get("bridgedDeviceBasic").combineCommands(source.get("bridgedDeviceBasic")); + destination.get("colorControl").combineCommands(source.get("colorControl")); + destination.get("contentLauncher").combineCommands(source.get("contentLauncher")); + destination.get("descriptor").combineCommands(source.get("descriptor")); + destination.get("diagnosticLogs").combineCommands(source.get("diagnosticLogs")); + destination.get("doorLock").combineCommands(source.get("doorLock")); + destination.get("electricalMeasurement").combineCommands(source.get("electricalMeasurement")); + destination + .get("ethernetNetworkDiagnostics") + .combineCommands(source.get("ethernetNetworkDiagnostics")); + destination.get("fixedLabel").combineCommands(source.get("fixedLabel")); + destination.get("flowMeasurement").combineCommands(source.get("flowMeasurement")); + destination.get("generalCommissioning").combineCommands(source.get("generalCommissioning")); + destination.get("generalDiagnostics").combineCommands(source.get("generalDiagnostics")); + destination.get("groupKeyManagement").combineCommands(source.get("groupKeyManagement")); + destination.get("groups").combineCommands(source.get("groups")); + destination.get("identify").combineCommands(source.get("identify")); + destination.get("illuminanceMeasurement").combineCommands(source.get("illuminanceMeasurement")); + destination.get("keypadInput").combineCommands(source.get("keypadInput")); + destination.get("levelControl").combineCommands(source.get("levelControl")); + destination.get("lowPower").combineCommands(source.get("lowPower")); + destination.get("mediaInput").combineCommands(source.get("mediaInput")); + destination.get("mediaPlayback").combineCommands(source.get("mediaPlayback")); + destination.get("modeSelect").combineCommands(source.get("modeSelect")); + destination.get("networkCommissioning").combineCommands(source.get("networkCommissioning")); + destination + .get("otaSoftwareUpdateProvider") + .combineCommands(source.get("otaSoftwareUpdateProvider")); + destination + .get("otaSoftwareUpdateRequestor") + .combineCommands(source.get("otaSoftwareUpdateRequestor")); + destination.get("occupancySensing").combineCommands(source.get("occupancySensing")); + destination.get("onOff").combineCommands(source.get("onOff")); + destination + .get("onOffSwitchConfiguration") + .combineCommands(source.get("onOffSwitchConfiguration")); + destination.get("operationalCredentials").combineCommands(source.get("operationalCredentials")); + destination.get("powerSource").combineCommands(source.get("powerSource")); + destination.get("pressureMeasurement").combineCommands(source.get("pressureMeasurement")); + destination + .get("pumpConfigurationAndControl") + .combineCommands(source.get("pumpConfigurationAndControl")); + destination + .get("relativeHumidityMeasurement") + .combineCommands(source.get("relativeHumidityMeasurement")); + destination.get("scenes").combineCommands(source.get("scenes")); + destination.get("softwareDiagnostics").combineCommands(source.get("softwareDiagnostics")); + destination.get("switch").combineCommands(source.get("switch")); + destination.get("tvChannel").combineCommands(source.get("tvChannel")); + destination.get("targetNavigator").combineCommands(source.get("targetNavigator")); + destination.get("temperatureMeasurement").combineCommands(source.get("temperatureMeasurement")); + destination.get("testCluster").combineCommands(source.get("testCluster")); + destination.get("thermostat").combineCommands(source.get("thermostat")); + destination + .get("thermostatUserInterfaceConfiguration") + .combineCommands(source.get("thermostatUserInterfaceConfiguration")); + destination + .get("threadNetworkDiagnostics") + .combineCommands(source.get("threadNetworkDiagnostics")); + destination.get("wakeOnLan").combineCommands(source.get("wakeOnLan")); + destination.get("wiFiNetworkDiagnostics").combineCommands(source.get("wiFiNetworkDiagnostics")); + destination.get("windowCovering").combineCommands(source.get("windowCovering")); + } + + public Map> getCommandMap() { + Map> commandMap = new HashMap<>(); + Map accountLoginClusterInteractionInfoMap = new LinkedHashMap<>(); Map accountLogingetSetupPINCommandParams = new LinkedHashMap(); CommandParameterInfo accountLogingetSetupPINtempAccountIdentifierCommandParameterInfo = @@ -3105,8 +3506,8 @@ public Map getCommandMap(Map clusterMa "tempAccountIdentifier", accountLogingetSetupPINtempAccountIdentifierCommandParameterInfo); // Populate commands - CommandInfo accountLogingetSetupPINCommandInfo = - new CommandInfo( + InteractionInfo accountLogingetSetupPINInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.AccountLoginCluster) cluster) .getSetupPIN( @@ -3115,7 +3516,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedGetSetupPINResponseCallback(), accountLogingetSetupPINCommandParams); - accountLoginClusterCommandInfoMap.put("getSetupPIN", accountLogingetSetupPINCommandInfo); + accountLoginClusterInteractionInfoMap.put( + "getSetupPIN", accountLogingetSetupPINInteractionInfo); Map accountLoginloginCommandParams = new LinkedHashMap(); CommandParameterInfo accountLoginlogintempAccountIdentifierCommandParameterInfo = @@ -3128,8 +3530,8 @@ public Map getCommandMap(Map clusterMa accountLoginloginCommandParams.put("setupPIN", accountLoginloginsetupPINCommandParameterInfo); // Populate commands - CommandInfo accountLoginloginCommandInfo = - new CommandInfo( + InteractionInfo accountLoginloginInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.AccountLoginCluster) cluster) .login( @@ -3139,14 +3541,9 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), accountLoginloginCommandParams); - accountLoginClusterCommandInfoMap.put("login", accountLoginloginCommandInfo); - // Populate cluster - ClusterInfo accountLoginClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.AccountLoginCluster(ptr, endpointId), - accountLoginClusterCommandInfoMap); - clusterMap.put("accountLogin", accountLoginClusterInfo); - Map administratorCommissioningClusterCommandInfoMap = + accountLoginClusterInteractionInfoMap.put("login", accountLoginloginInteractionInfo); + commandMap.put("accountLogin", accountLoginClusterInteractionInfoMap); + Map administratorCommissioningClusterInteractionInfoMap = new LinkedHashMap<>(); Map administratorCommissioningopenBasicCommissioningWindowCommandParams = @@ -3159,8 +3556,8 @@ public Map getCommandMap(Map clusterMa administratorCommissioningopenBasicCommissioningWindowcommissioningTimeoutCommandParameterInfo); // Populate commands - CommandInfo administratorCommissioningopenBasicCommissioningWindowCommandInfo = - new CommandInfo( + InteractionInfo administratorCommissioningopenBasicCommissioningWindowInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.AdministratorCommissioningCluster) cluster) .openBasicCommissioningWindow( @@ -3169,9 +3566,9 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), administratorCommissioningopenBasicCommissioningWindowCommandParams); - administratorCommissioningClusterCommandInfoMap.put( + administratorCommissioningClusterInteractionInfoMap.put( "openBasicCommissioningWindow", - administratorCommissioningopenBasicCommissioningWindowCommandInfo); + administratorCommissioningopenBasicCommissioningWindowInteractionInfo); Map administratorCommissioningopenCommissioningWindowCommandParams = new LinkedHashMap(); @@ -3216,8 +3613,8 @@ public Map getCommandMap(Map clusterMa administratorCommissioningopenCommissioningWindowpasscodeIDCommandParameterInfo); // Populate commands - CommandInfo administratorCommissioningopenCommissioningWindowCommandInfo = - new CommandInfo( + InteractionInfo administratorCommissioningopenCommissioningWindowInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.AdministratorCommissioningCluster) cluster) .openCommissioningWindow( @@ -3231,29 +3628,25 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), administratorCommissioningopenCommissioningWindowCommandParams); - administratorCommissioningClusterCommandInfoMap.put( - "openCommissioningWindow", administratorCommissioningopenCommissioningWindowCommandInfo); + administratorCommissioningClusterInteractionInfoMap.put( + "openCommissioningWindow", + administratorCommissioningopenCommissioningWindowInteractionInfo); Map administratorCommissioningrevokeCommissioningCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo administratorCommissioningrevokeCommissioningCommandInfo = - new CommandInfo( + InteractionInfo administratorCommissioningrevokeCommissioningInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.AdministratorCommissioningCluster) cluster) .revokeCommissioning((DefaultClusterCallback) callback); }, () -> new DelegatedDefaultClusterCallback(), administratorCommissioningrevokeCommissioningCommandParams); - administratorCommissioningClusterCommandInfoMap.put( - "revokeCommissioning", administratorCommissioningrevokeCommissioningCommandInfo); - // Populate cluster - ClusterInfo administratorCommissioningClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> - new ChipClusters.AdministratorCommissioningCluster(ptr, endpointId), - administratorCommissioningClusterCommandInfoMap); - clusterMap.put("administratorCommissioning", administratorCommissioningClusterInfo); - Map applicationBasicClusterCommandInfoMap = new LinkedHashMap<>(); + administratorCommissioningClusterInteractionInfoMap.put( + "revokeCommissioning", administratorCommissioningrevokeCommissioningInteractionInfo); + commandMap.put( + "administratorCommissioning", administratorCommissioningClusterInteractionInfoMap); + Map applicationBasicClusterInteractionInfoMap = new LinkedHashMap<>(); Map applicationBasicchangeStatusCommandParams = new LinkedHashMap(); CommandParameterInfo applicationBasicchangeStatusstatusCommandParameterInfo = @@ -3262,8 +3655,8 @@ public Map getCommandMap(Map clusterMa "status", applicationBasicchangeStatusstatusCommandParameterInfo); // Populate commands - CommandInfo applicationBasicchangeStatusCommandInfo = - new CommandInfo( + InteractionInfo applicationBasicchangeStatusInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ApplicationBasicCluster) cluster) .changeStatus( @@ -3271,15 +3664,11 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), applicationBasicchangeStatusCommandParams); - applicationBasicClusterCommandInfoMap.put( - "changeStatus", applicationBasicchangeStatusCommandInfo); - // Populate cluster - ClusterInfo applicationBasicClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.ApplicationBasicCluster(ptr, endpointId), - applicationBasicClusterCommandInfoMap); - clusterMap.put("applicationBasic", applicationBasicClusterInfo); - Map applicationLauncherClusterCommandInfoMap = new LinkedHashMap<>(); + applicationBasicClusterInteractionInfoMap.put( + "changeStatus", applicationBasicchangeStatusInteractionInfo); + commandMap.put("applicationBasic", applicationBasicClusterInteractionInfoMap); + Map applicationLauncherClusterInteractionInfoMap = + new LinkedHashMap<>(); Map applicationLauncherlaunchAppCommandParams = new LinkedHashMap(); CommandParameterInfo applicationLauncherlaunchAppdataCommandParameterInfo = @@ -3298,8 +3687,8 @@ public Map getCommandMap(Map clusterMa "applicationId", applicationLauncherlaunchAppapplicationIdCommandParameterInfo); // Populate commands - CommandInfo applicationLauncherlaunchAppCommandInfo = - new CommandInfo( + InteractionInfo applicationLauncherlaunchAppInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ApplicationLauncherCluster) cluster) .launchApp( @@ -3310,15 +3699,10 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedLaunchAppResponseCallback(), applicationLauncherlaunchAppCommandParams); - applicationLauncherClusterCommandInfoMap.put( - "launchApp", applicationLauncherlaunchAppCommandInfo); - // Populate cluster - ClusterInfo applicationLauncherClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.ApplicationLauncherCluster(ptr, endpointId), - applicationLauncherClusterCommandInfoMap); - clusterMap.put("applicationLauncher", applicationLauncherClusterInfo); - Map audioOutputClusterCommandInfoMap = new LinkedHashMap<>(); + applicationLauncherClusterInteractionInfoMap.put( + "launchApp", applicationLauncherlaunchAppInteractionInfo); + commandMap.put("applicationLauncher", applicationLauncherClusterInteractionInfoMap); + Map audioOutputClusterInteractionInfoMap = new LinkedHashMap<>(); Map audioOutputrenameOutputCommandParams = new LinkedHashMap(); CommandParameterInfo audioOutputrenameOutputindexCommandParameterInfo = @@ -3332,8 +3716,8 @@ public Map getCommandMap(Map clusterMa "name", audioOutputrenameOutputnameCommandParameterInfo); // Populate commands - CommandInfo audioOutputrenameOutputCommandInfo = - new CommandInfo( + InteractionInfo audioOutputrenameOutputInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.AudioOutputCluster) cluster) .renameOutput( @@ -3343,7 +3727,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), audioOutputrenameOutputCommandParams); - audioOutputClusterCommandInfoMap.put("renameOutput", audioOutputrenameOutputCommandInfo); + audioOutputClusterInteractionInfoMap.put( + "renameOutput", audioOutputrenameOutputInteractionInfo); Map audioOutputselectOutputCommandParams = new LinkedHashMap(); CommandParameterInfo audioOutputselectOutputindexCommandParameterInfo = @@ -3352,8 +3737,8 @@ public Map getCommandMap(Map clusterMa "index", audioOutputselectOutputindexCommandParameterInfo); // Populate commands - CommandInfo audioOutputselectOutputCommandInfo = - new CommandInfo( + InteractionInfo audioOutputselectOutputInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.AudioOutputCluster) cluster) .selectOutput( @@ -3361,14 +3746,10 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), audioOutputselectOutputCommandParams); - audioOutputClusterCommandInfoMap.put("selectOutput", audioOutputselectOutputCommandInfo); - // Populate cluster - ClusterInfo audioOutputClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.AudioOutputCluster(ptr, endpointId), - audioOutputClusterCommandInfoMap); - clusterMap.put("audioOutput", audioOutputClusterInfo); - Map barrierControlClusterCommandInfoMap = new LinkedHashMap<>(); + audioOutputClusterInteractionInfoMap.put( + "selectOutput", audioOutputselectOutputInteractionInfo); + commandMap.put("audioOutput", audioOutputClusterInteractionInfoMap); + Map barrierControlClusterInteractionInfoMap = new LinkedHashMap<>(); Map barrierControlbarrierControlGoToPercentCommandParams = new LinkedHashMap(); CommandParameterInfo barrierControlbarrierControlGoToPercentpercentOpenCommandParameterInfo = @@ -3377,8 +3758,8 @@ public Map getCommandMap(Map clusterMa "percentOpen", barrierControlbarrierControlGoToPercentpercentOpenCommandParameterInfo); // Populate commands - CommandInfo barrierControlbarrierControlGoToPercentCommandInfo = - new CommandInfo( + InteractionInfo barrierControlbarrierControlGoToPercentInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BarrierControlCluster) cluster) .barrierControlGoToPercent( @@ -3387,54 +3768,39 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), barrierControlbarrierControlGoToPercentCommandParams); - barrierControlClusterCommandInfoMap.put( - "barrierControlGoToPercent", barrierControlbarrierControlGoToPercentCommandInfo); + barrierControlClusterInteractionInfoMap.put( + "barrierControlGoToPercent", barrierControlbarrierControlGoToPercentInteractionInfo); Map barrierControlbarrierControlStopCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo barrierControlbarrierControlStopCommandInfo = - new CommandInfo( + InteractionInfo barrierControlbarrierControlStopInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BarrierControlCluster) cluster) .barrierControlStop((DefaultClusterCallback) callback); }, () -> new DelegatedDefaultClusterCallback(), barrierControlbarrierControlStopCommandParams); - barrierControlClusterCommandInfoMap.put( - "barrierControlStop", barrierControlbarrierControlStopCommandInfo); - // Populate cluster - ClusterInfo barrierControlClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.BarrierControlCluster(ptr, endpointId), - barrierControlClusterCommandInfoMap); - clusterMap.put("barrierControl", barrierControlClusterInfo); - Map basicClusterCommandInfoMap = new LinkedHashMap<>(); + barrierControlClusterInteractionInfoMap.put( + "barrierControlStop", barrierControlbarrierControlStopInteractionInfo); + commandMap.put("barrierControl", barrierControlClusterInteractionInfoMap); + Map basicClusterInteractionInfoMap = new LinkedHashMap<>(); Map basicmfgSpecificPingCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo basicmfgSpecificPingCommandInfo = - new CommandInfo( + InteractionInfo basicmfgSpecificPingInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BasicCluster) cluster) .mfgSpecificPing((DefaultClusterCallback) callback); }, () -> new DelegatedDefaultClusterCallback(), basicmfgSpecificPingCommandParams); - basicClusterCommandInfoMap.put("mfgSpecificPing", basicmfgSpecificPingCommandInfo); - // Populate cluster - ClusterInfo basicClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.BasicCluster(ptr, endpointId), - basicClusterCommandInfoMap); - clusterMap.put("basic", basicClusterInfo); - Map binaryInputBasicClusterCommandInfoMap = new LinkedHashMap<>(); - // Populate cluster - ClusterInfo binaryInputBasicClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.BinaryInputBasicCluster(ptr, endpointId), - binaryInputBasicClusterCommandInfoMap); - clusterMap.put("binaryInputBasic", binaryInputBasicClusterInfo); - Map bindingClusterCommandInfoMap = new LinkedHashMap<>(); + basicClusterInteractionInfoMap.put("mfgSpecificPing", basicmfgSpecificPingInteractionInfo); + commandMap.put("basic", basicClusterInteractionInfoMap); + Map binaryInputBasicClusterInteractionInfoMap = new LinkedHashMap<>(); + commandMap.put("binaryInputBasic", binaryInputBasicClusterInteractionInfoMap); + Map bindingClusterInteractionInfoMap = new LinkedHashMap<>(); Map bindingbindCommandParams = new LinkedHashMap(); CommandParameterInfo bindingbindnodeIdCommandParameterInfo = @@ -3454,8 +3820,8 @@ public Map getCommandMap(Map clusterMa bindingbindCommandParams.put("clusterId", bindingbindclusterIdCommandParameterInfo); // Populate commands - CommandInfo bindingbindCommandInfo = - new CommandInfo( + InteractionInfo bindingbindInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BindingCluster) cluster) .bind( @@ -3467,7 +3833,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), bindingbindCommandParams); - bindingClusterCommandInfoMap.put("bind", bindingbindCommandInfo); + bindingClusterInteractionInfoMap.put("bind", bindingbindInteractionInfo); Map bindingunbindCommandParams = new LinkedHashMap(); CommandParameterInfo bindingunbindnodeIdCommandParameterInfo = @@ -3487,8 +3853,8 @@ public Map getCommandMap(Map clusterMa bindingunbindCommandParams.put("clusterId", bindingunbindclusterIdCommandParameterInfo); // Populate commands - CommandInfo bindingunbindCommandInfo = - new CommandInfo( + InteractionInfo bindingunbindInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BindingCluster) cluster) .unbind( @@ -3500,21 +3866,11 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), bindingunbindCommandParams); - bindingClusterCommandInfoMap.put("unbind", bindingunbindCommandInfo); - // Populate cluster - ClusterInfo bindingClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.BindingCluster(ptr, endpointId), - bindingClusterCommandInfoMap); - clusterMap.put("binding", bindingClusterInfo); - Map booleanStateClusterCommandInfoMap = new LinkedHashMap<>(); - // Populate cluster - ClusterInfo booleanStateClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.BooleanStateCluster(ptr, endpointId), - booleanStateClusterCommandInfoMap); - clusterMap.put("booleanState", booleanStateClusterInfo); - Map bridgedActionsClusterCommandInfoMap = new LinkedHashMap<>(); + bindingClusterInteractionInfoMap.put("unbind", bindingunbindInteractionInfo); + commandMap.put("binding", bindingClusterInteractionInfoMap); + Map booleanStateClusterInteractionInfoMap = new LinkedHashMap<>(); + commandMap.put("booleanState", booleanStateClusterInteractionInfoMap); + Map bridgedActionsClusterInteractionInfoMap = new LinkedHashMap<>(); Map bridgedActionsdisableActionCommandParams = new LinkedHashMap(); CommandParameterInfo bridgedActionsdisableActionactionIDCommandParameterInfo = @@ -3528,8 +3884,8 @@ public Map getCommandMap(Map clusterMa "invokeID", bridgedActionsdisableActioninvokeIDCommandParameterInfo); // Populate commands - CommandInfo bridgedActionsdisableActionCommandInfo = - new CommandInfo( + InteractionInfo bridgedActionsdisableActionInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedActionsCluster) cluster) .disableAction( @@ -3539,8 +3895,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), bridgedActionsdisableActionCommandParams); - bridgedActionsClusterCommandInfoMap.put( - "disableAction", bridgedActionsdisableActionCommandInfo); + bridgedActionsClusterInteractionInfoMap.put( + "disableAction", bridgedActionsdisableActionInteractionInfo); Map bridgedActionsdisableActionWithDurationCommandParams = new LinkedHashMap(); CommandParameterInfo bridgedActionsdisableActionWithDurationactionIDCommandParameterInfo = @@ -3559,8 +3915,8 @@ public Map getCommandMap(Map clusterMa "duration", bridgedActionsdisableActionWithDurationdurationCommandParameterInfo); // Populate commands - CommandInfo bridgedActionsdisableActionWithDurationCommandInfo = - new CommandInfo( + InteractionInfo bridgedActionsdisableActionWithDurationInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedActionsCluster) cluster) .disableActionWithDuration( @@ -3571,8 +3927,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), bridgedActionsdisableActionWithDurationCommandParams); - bridgedActionsClusterCommandInfoMap.put( - "disableActionWithDuration", bridgedActionsdisableActionWithDurationCommandInfo); + bridgedActionsClusterInteractionInfoMap.put( + "disableActionWithDuration", bridgedActionsdisableActionWithDurationInteractionInfo); Map bridgedActionsenableActionCommandParams = new LinkedHashMap(); CommandParameterInfo bridgedActionsenableActionactionIDCommandParameterInfo = @@ -3586,8 +3942,8 @@ public Map getCommandMap(Map clusterMa "invokeID", bridgedActionsenableActioninvokeIDCommandParameterInfo); // Populate commands - CommandInfo bridgedActionsenableActionCommandInfo = - new CommandInfo( + InteractionInfo bridgedActionsenableActionInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedActionsCluster) cluster) .enableAction( @@ -3597,7 +3953,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), bridgedActionsenableActionCommandParams); - bridgedActionsClusterCommandInfoMap.put("enableAction", bridgedActionsenableActionCommandInfo); + bridgedActionsClusterInteractionInfoMap.put( + "enableAction", bridgedActionsenableActionInteractionInfo); Map bridgedActionsenableActionWithDurationCommandParams = new LinkedHashMap(); CommandParameterInfo bridgedActionsenableActionWithDurationactionIDCommandParameterInfo = @@ -3616,8 +3973,8 @@ public Map getCommandMap(Map clusterMa "duration", bridgedActionsenableActionWithDurationdurationCommandParameterInfo); // Populate commands - CommandInfo bridgedActionsenableActionWithDurationCommandInfo = - new CommandInfo( + InteractionInfo bridgedActionsenableActionWithDurationInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedActionsCluster) cluster) .enableActionWithDuration( @@ -3628,8 +3985,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), bridgedActionsenableActionWithDurationCommandParams); - bridgedActionsClusterCommandInfoMap.put( - "enableActionWithDuration", bridgedActionsenableActionWithDurationCommandInfo); + bridgedActionsClusterInteractionInfoMap.put( + "enableActionWithDuration", bridgedActionsenableActionWithDurationInteractionInfo); Map bridgedActionsinstantActionCommandParams = new LinkedHashMap(); CommandParameterInfo bridgedActionsinstantActionactionIDCommandParameterInfo = @@ -3643,8 +4000,8 @@ public Map getCommandMap(Map clusterMa "invokeID", bridgedActionsinstantActioninvokeIDCommandParameterInfo); // Populate commands - CommandInfo bridgedActionsinstantActionCommandInfo = - new CommandInfo( + InteractionInfo bridgedActionsinstantActionInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedActionsCluster) cluster) .instantAction( @@ -3654,8 +4011,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), bridgedActionsinstantActionCommandParams); - bridgedActionsClusterCommandInfoMap.put( - "instantAction", bridgedActionsinstantActionCommandInfo); + bridgedActionsClusterInteractionInfoMap.put( + "instantAction", bridgedActionsinstantActionInteractionInfo); Map bridgedActionsinstantActionWithTransitionCommandParams = new LinkedHashMap(); CommandParameterInfo bridgedActionsinstantActionWithTransitionactionIDCommandParameterInfo = @@ -3676,8 +4033,8 @@ public Map getCommandMap(Map clusterMa bridgedActionsinstantActionWithTransitiontransitionTimeCommandParameterInfo); // Populate commands - CommandInfo bridgedActionsinstantActionWithTransitionCommandInfo = - new CommandInfo( + InteractionInfo bridgedActionsinstantActionWithTransitionInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedActionsCluster) cluster) .instantActionWithTransition( @@ -3688,8 +4045,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), bridgedActionsinstantActionWithTransitionCommandParams); - bridgedActionsClusterCommandInfoMap.put( - "instantActionWithTransition", bridgedActionsinstantActionWithTransitionCommandInfo); + bridgedActionsClusterInteractionInfoMap.put( + "instantActionWithTransition", bridgedActionsinstantActionWithTransitionInteractionInfo); Map bridgedActionspauseActionCommandParams = new LinkedHashMap(); CommandParameterInfo bridgedActionspauseActionactionIDCommandParameterInfo = @@ -3703,8 +4060,8 @@ public Map getCommandMap(Map clusterMa "invokeID", bridgedActionspauseActioninvokeIDCommandParameterInfo); // Populate commands - CommandInfo bridgedActionspauseActionCommandInfo = - new CommandInfo( + InteractionInfo bridgedActionspauseActionInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedActionsCluster) cluster) .pauseAction( @@ -3714,7 +4071,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), bridgedActionspauseActionCommandParams); - bridgedActionsClusterCommandInfoMap.put("pauseAction", bridgedActionspauseActionCommandInfo); + bridgedActionsClusterInteractionInfoMap.put( + "pauseAction", bridgedActionspauseActionInteractionInfo); Map bridgedActionspauseActionWithDurationCommandParams = new LinkedHashMap(); CommandParameterInfo bridgedActionspauseActionWithDurationactionIDCommandParameterInfo = @@ -3733,8 +4091,8 @@ public Map getCommandMap(Map clusterMa "duration", bridgedActionspauseActionWithDurationdurationCommandParameterInfo); // Populate commands - CommandInfo bridgedActionspauseActionWithDurationCommandInfo = - new CommandInfo( + InteractionInfo bridgedActionspauseActionWithDurationInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedActionsCluster) cluster) .pauseActionWithDuration( @@ -3745,8 +4103,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), bridgedActionspauseActionWithDurationCommandParams); - bridgedActionsClusterCommandInfoMap.put( - "pauseActionWithDuration", bridgedActionspauseActionWithDurationCommandInfo); + bridgedActionsClusterInteractionInfoMap.put( + "pauseActionWithDuration", bridgedActionspauseActionWithDurationInteractionInfo); Map bridgedActionsresumeActionCommandParams = new LinkedHashMap(); CommandParameterInfo bridgedActionsresumeActionactionIDCommandParameterInfo = @@ -3760,8 +4118,8 @@ public Map getCommandMap(Map clusterMa "invokeID", bridgedActionsresumeActioninvokeIDCommandParameterInfo); // Populate commands - CommandInfo bridgedActionsresumeActionCommandInfo = - new CommandInfo( + InteractionInfo bridgedActionsresumeActionInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedActionsCluster) cluster) .resumeAction( @@ -3771,7 +4129,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), bridgedActionsresumeActionCommandParams); - bridgedActionsClusterCommandInfoMap.put("resumeAction", bridgedActionsresumeActionCommandInfo); + bridgedActionsClusterInteractionInfoMap.put( + "resumeAction", bridgedActionsresumeActionInteractionInfo); Map bridgedActionsstartActionCommandParams = new LinkedHashMap(); CommandParameterInfo bridgedActionsstartActionactionIDCommandParameterInfo = @@ -3785,8 +4144,8 @@ public Map getCommandMap(Map clusterMa "invokeID", bridgedActionsstartActioninvokeIDCommandParameterInfo); // Populate commands - CommandInfo bridgedActionsstartActionCommandInfo = - new CommandInfo( + InteractionInfo bridgedActionsstartActionInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedActionsCluster) cluster) .startAction( @@ -3796,7 +4155,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), bridgedActionsstartActionCommandParams); - bridgedActionsClusterCommandInfoMap.put("startAction", bridgedActionsstartActionCommandInfo); + bridgedActionsClusterInteractionInfoMap.put( + "startAction", bridgedActionsstartActionInteractionInfo); Map bridgedActionsstartActionWithDurationCommandParams = new LinkedHashMap(); CommandParameterInfo bridgedActionsstartActionWithDurationactionIDCommandParameterInfo = @@ -3815,8 +4175,8 @@ public Map getCommandMap(Map clusterMa "duration", bridgedActionsstartActionWithDurationdurationCommandParameterInfo); // Populate commands - CommandInfo bridgedActionsstartActionWithDurationCommandInfo = - new CommandInfo( + InteractionInfo bridgedActionsstartActionWithDurationInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedActionsCluster) cluster) .startActionWithDuration( @@ -3827,8 +4187,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), bridgedActionsstartActionWithDurationCommandParams); - bridgedActionsClusterCommandInfoMap.put( - "startActionWithDuration", bridgedActionsstartActionWithDurationCommandInfo); + bridgedActionsClusterInteractionInfoMap.put( + "startActionWithDuration", bridgedActionsstartActionWithDurationInteractionInfo); Map bridgedActionsstopActionCommandParams = new LinkedHashMap(); CommandParameterInfo bridgedActionsstopActionactionIDCommandParameterInfo = @@ -3842,8 +4202,8 @@ public Map getCommandMap(Map clusterMa "invokeID", bridgedActionsstopActioninvokeIDCommandParameterInfo); // Populate commands - CommandInfo bridgedActionsstopActionCommandInfo = - new CommandInfo( + InteractionInfo bridgedActionsstopActionInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedActionsCluster) cluster) .stopAction( @@ -3853,21 +4213,13 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), bridgedActionsstopActionCommandParams); - bridgedActionsClusterCommandInfoMap.put("stopAction", bridgedActionsstopActionCommandInfo); - // Populate cluster - ClusterInfo bridgedActionsClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.BridgedActionsCluster(ptr, endpointId), - bridgedActionsClusterCommandInfoMap); - clusterMap.put("bridgedActions", bridgedActionsClusterInfo); - Map bridgedDeviceBasicClusterCommandInfoMap = new LinkedHashMap<>(); - // Populate cluster - ClusterInfo bridgedDeviceBasicClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.BridgedDeviceBasicCluster(ptr, endpointId), - bridgedDeviceBasicClusterCommandInfoMap); - clusterMap.put("bridgedDeviceBasic", bridgedDeviceBasicClusterInfo); - Map colorControlClusterCommandInfoMap = new LinkedHashMap<>(); + bridgedActionsClusterInteractionInfoMap.put( + "stopAction", bridgedActionsstopActionInteractionInfo); + commandMap.put("bridgedActions", bridgedActionsClusterInteractionInfoMap); + Map bridgedDeviceBasicClusterInteractionInfoMap = + new LinkedHashMap<>(); + commandMap.put("bridgedDeviceBasic", bridgedDeviceBasicClusterInteractionInfoMap); + Map colorControlClusterInteractionInfoMap = new LinkedHashMap<>(); Map colorControlcolorLoopSetCommandParams = new LinkedHashMap(); CommandParameterInfo colorControlcolorLoopSetupdateFlagsCommandParameterInfo = @@ -3906,8 +4258,8 @@ public Map getCommandMap(Map clusterMa "optionsOverride", colorControlcolorLoopSetoptionsOverrideCommandParameterInfo); // Populate commands - CommandInfo colorControlcolorLoopSetCommandInfo = - new CommandInfo( + InteractionInfo colorControlcolorLoopSetInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .colorLoopSet( @@ -3922,7 +4274,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), colorControlcolorLoopSetCommandParams); - colorControlClusterCommandInfoMap.put("colorLoopSet", colorControlcolorLoopSetCommandInfo); + colorControlClusterInteractionInfoMap.put( + "colorLoopSet", colorControlcolorLoopSetInteractionInfo); Map colorControlenhancedMoveHueCommandParams = new LinkedHashMap(); CommandParameterInfo colorControlenhancedMoveHuemoveModeCommandParameterInfo = @@ -3946,8 +4299,8 @@ public Map getCommandMap(Map clusterMa "optionsOverride", colorControlenhancedMoveHueoptionsOverrideCommandParameterInfo); // Populate commands - CommandInfo colorControlenhancedMoveHueCommandInfo = - new CommandInfo( + InteractionInfo colorControlenhancedMoveHueInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .enhancedMoveHue( @@ -3959,8 +4312,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), colorControlenhancedMoveHueCommandParams); - colorControlClusterCommandInfoMap.put( - "enhancedMoveHue", colorControlenhancedMoveHueCommandInfo); + colorControlClusterInteractionInfoMap.put( + "enhancedMoveHue", colorControlenhancedMoveHueInteractionInfo); Map colorControlenhancedMoveToHueCommandParams = new LinkedHashMap(); CommandParameterInfo colorControlenhancedMoveToHueenhancedHueCommandParameterInfo = @@ -3989,8 +4342,8 @@ public Map getCommandMap(Map clusterMa "optionsOverride", colorControlenhancedMoveToHueoptionsOverrideCommandParameterInfo); // Populate commands - CommandInfo colorControlenhancedMoveToHueCommandInfo = - new CommandInfo( + InteractionInfo colorControlenhancedMoveToHueInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .enhancedMoveToHue( @@ -4003,8 +4356,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), colorControlenhancedMoveToHueCommandParams); - colorControlClusterCommandInfoMap.put( - "enhancedMoveToHue", colorControlenhancedMoveToHueCommandInfo); + colorControlClusterInteractionInfoMap.put( + "enhancedMoveToHue", colorControlenhancedMoveToHueInteractionInfo); Map colorControlenhancedMoveToHueAndSaturationCommandParams = new LinkedHashMap(); CommandParameterInfo colorControlenhancedMoveToHueAndSaturationenhancedHueCommandParameterInfo = @@ -4037,8 +4390,8 @@ public Map getCommandMap(Map clusterMa colorControlenhancedMoveToHueAndSaturationoptionsOverrideCommandParameterInfo); // Populate commands - CommandInfo colorControlenhancedMoveToHueAndSaturationCommandInfo = - new CommandInfo( + InteractionInfo colorControlenhancedMoveToHueAndSaturationInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .enhancedMoveToHueAndSaturation( @@ -4051,8 +4404,9 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), colorControlenhancedMoveToHueAndSaturationCommandParams); - colorControlClusterCommandInfoMap.put( - "enhancedMoveToHueAndSaturation", colorControlenhancedMoveToHueAndSaturationCommandInfo); + colorControlClusterInteractionInfoMap.put( + "enhancedMoveToHueAndSaturation", + colorControlenhancedMoveToHueAndSaturationInteractionInfo); Map colorControlenhancedStepHueCommandParams = new LinkedHashMap(); CommandParameterInfo colorControlenhancedStepHuestepModeCommandParameterInfo = @@ -4081,8 +4435,8 @@ public Map getCommandMap(Map clusterMa "optionsOverride", colorControlenhancedStepHueoptionsOverrideCommandParameterInfo); // Populate commands - CommandInfo colorControlenhancedStepHueCommandInfo = - new CommandInfo( + InteractionInfo colorControlenhancedStepHueInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .enhancedStepHue( @@ -4095,8 +4449,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), colorControlenhancedStepHueCommandParams); - colorControlClusterCommandInfoMap.put( - "enhancedStepHue", colorControlenhancedStepHueCommandInfo); + colorControlClusterInteractionInfoMap.put( + "enhancedStepHue", colorControlenhancedStepHueInteractionInfo); Map colorControlmoveColorCommandParams = new LinkedHashMap(); CommandParameterInfo colorControlmoveColorrateXCommandParameterInfo = @@ -4118,8 +4472,8 @@ public Map getCommandMap(Map clusterMa "optionsOverride", colorControlmoveColoroptionsOverrideCommandParameterInfo); // Populate commands - CommandInfo colorControlmoveColorCommandInfo = - new CommandInfo( + InteractionInfo colorControlmoveColorInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .moveColor( @@ -4131,7 +4485,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), colorControlmoveColorCommandParams); - colorControlClusterCommandInfoMap.put("moveColor", colorControlmoveColorCommandInfo); + colorControlClusterInteractionInfoMap.put("moveColor", colorControlmoveColorInteractionInfo); Map colorControlmoveColorTemperatureCommandParams = new LinkedHashMap(); CommandParameterInfo colorControlmoveColorTemperaturemoveModeCommandParameterInfo = @@ -4169,8 +4523,8 @@ public Map getCommandMap(Map clusterMa "optionsOverride", colorControlmoveColorTemperatureoptionsOverrideCommandParameterInfo); // Populate commands - CommandInfo colorControlmoveColorTemperatureCommandInfo = - new CommandInfo( + InteractionInfo colorControlmoveColorTemperatureInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .moveColorTemperature( @@ -4184,8 +4538,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), colorControlmoveColorTemperatureCommandParams); - colorControlClusterCommandInfoMap.put( - "moveColorTemperature", colorControlmoveColorTemperatureCommandInfo); + colorControlClusterInteractionInfoMap.put( + "moveColorTemperature", colorControlmoveColorTemperatureInteractionInfo); Map colorControlmoveHueCommandParams = new LinkedHashMap(); CommandParameterInfo colorControlmoveHuemoveModeCommandParameterInfo = @@ -4208,8 +4562,8 @@ public Map getCommandMap(Map clusterMa "optionsOverride", colorControlmoveHueoptionsOverrideCommandParameterInfo); // Populate commands - CommandInfo colorControlmoveHueCommandInfo = - new CommandInfo( + InteractionInfo colorControlmoveHueInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .moveHue( @@ -4221,7 +4575,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), colorControlmoveHueCommandParams); - colorControlClusterCommandInfoMap.put("moveHue", colorControlmoveHueCommandInfo); + colorControlClusterInteractionInfoMap.put("moveHue", colorControlmoveHueInteractionInfo); Map colorControlmoveSaturationCommandParams = new LinkedHashMap(); CommandParameterInfo colorControlmoveSaturationmoveModeCommandParameterInfo = @@ -4245,8 +4599,8 @@ public Map getCommandMap(Map clusterMa "optionsOverride", colorControlmoveSaturationoptionsOverrideCommandParameterInfo); // Populate commands - CommandInfo colorControlmoveSaturationCommandInfo = - new CommandInfo( + InteractionInfo colorControlmoveSaturationInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .moveSaturation( @@ -4258,7 +4612,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), colorControlmoveSaturationCommandParams); - colorControlClusterCommandInfoMap.put("moveSaturation", colorControlmoveSaturationCommandInfo); + colorControlClusterInteractionInfoMap.put( + "moveSaturation", colorControlmoveSaturationInteractionInfo); Map colorControlmoveToColorCommandParams = new LinkedHashMap(); CommandParameterInfo colorControlmoveToColorcolorXCommandParameterInfo = @@ -4287,8 +4642,8 @@ public Map getCommandMap(Map clusterMa "optionsOverride", colorControlmoveToColoroptionsOverrideCommandParameterInfo); // Populate commands - CommandInfo colorControlmoveToColorCommandInfo = - new CommandInfo( + InteractionInfo colorControlmoveToColorInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .moveToColor( @@ -4301,7 +4656,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), colorControlmoveToColorCommandParams); - colorControlClusterCommandInfoMap.put("moveToColor", colorControlmoveToColorCommandInfo); + colorControlClusterInteractionInfoMap.put( + "moveToColor", colorControlmoveToColorInteractionInfo); Map colorControlmoveToColorTemperatureCommandParams = new LinkedHashMap(); CommandParameterInfo colorControlmoveToColorTemperaturecolorTemperatureCommandParameterInfo = @@ -4325,8 +4681,8 @@ public Map getCommandMap(Map clusterMa "optionsOverride", colorControlmoveToColorTemperatureoptionsOverrideCommandParameterInfo); // Populate commands - CommandInfo colorControlmoveToColorTemperatureCommandInfo = - new CommandInfo( + InteractionInfo colorControlmoveToColorTemperatureInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .moveToColorTemperature( @@ -4338,8 +4694,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), colorControlmoveToColorTemperatureCommandParams); - colorControlClusterCommandInfoMap.put( - "moveToColorTemperature", colorControlmoveToColorTemperatureCommandInfo); + colorControlClusterInteractionInfoMap.put( + "moveToColorTemperature", colorControlmoveToColorTemperatureInteractionInfo); Map colorControlmoveToHueCommandParams = new LinkedHashMap(); CommandParameterInfo colorControlmoveToHuehueCommandParameterInfo = @@ -4367,8 +4723,8 @@ public Map getCommandMap(Map clusterMa "optionsOverride", colorControlmoveToHueoptionsOverrideCommandParameterInfo); // Populate commands - CommandInfo colorControlmoveToHueCommandInfo = - new CommandInfo( + InteractionInfo colorControlmoveToHueInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .moveToHue( @@ -4381,7 +4737,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), colorControlmoveToHueCommandParams); - colorControlClusterCommandInfoMap.put("moveToHue", colorControlmoveToHueCommandInfo); + colorControlClusterInteractionInfoMap.put("moveToHue", colorControlmoveToHueInteractionInfo); Map colorControlmoveToHueAndSaturationCommandParams = new LinkedHashMap(); CommandParameterInfo colorControlmoveToHueAndSaturationhueCommandParameterInfo = @@ -4410,8 +4766,8 @@ public Map getCommandMap(Map clusterMa "optionsOverride", colorControlmoveToHueAndSaturationoptionsOverrideCommandParameterInfo); // Populate commands - CommandInfo colorControlmoveToHueAndSaturationCommandInfo = - new CommandInfo( + InteractionInfo colorControlmoveToHueAndSaturationInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .moveToHueAndSaturation( @@ -4424,8 +4780,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), colorControlmoveToHueAndSaturationCommandParams); - colorControlClusterCommandInfoMap.put( - "moveToHueAndSaturation", colorControlmoveToHueAndSaturationCommandInfo); + colorControlClusterInteractionInfoMap.put( + "moveToHueAndSaturation", colorControlmoveToHueAndSaturationInteractionInfo); Map colorControlmoveToSaturationCommandParams = new LinkedHashMap(); CommandParameterInfo colorControlmoveToSaturationsaturationCommandParameterInfo = @@ -4449,8 +4805,8 @@ public Map getCommandMap(Map clusterMa "optionsOverride", colorControlmoveToSaturationoptionsOverrideCommandParameterInfo); // Populate commands - CommandInfo colorControlmoveToSaturationCommandInfo = - new CommandInfo( + InteractionInfo colorControlmoveToSaturationInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .moveToSaturation( @@ -4462,8 +4818,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), colorControlmoveToSaturationCommandParams); - colorControlClusterCommandInfoMap.put( - "moveToSaturation", colorControlmoveToSaturationCommandInfo); + colorControlClusterInteractionInfoMap.put( + "moveToSaturation", colorControlmoveToSaturationInteractionInfo); Map colorControlstepColorCommandParams = new LinkedHashMap(); CommandParameterInfo colorControlstepColorstepXCommandParameterInfo = @@ -4490,8 +4846,8 @@ public Map getCommandMap(Map clusterMa "optionsOverride", colorControlstepColoroptionsOverrideCommandParameterInfo); // Populate commands - CommandInfo colorControlstepColorCommandInfo = - new CommandInfo( + InteractionInfo colorControlstepColorInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .stepColor( @@ -4504,7 +4860,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), colorControlstepColorCommandParams); - colorControlClusterCommandInfoMap.put("stepColor", colorControlstepColorCommandInfo); + colorControlClusterInteractionInfoMap.put("stepColor", colorControlstepColorInteractionInfo); Map colorControlstepColorTemperatureCommandParams = new LinkedHashMap(); CommandParameterInfo colorControlstepColorTemperaturestepModeCommandParameterInfo = @@ -4547,8 +4903,8 @@ public Map getCommandMap(Map clusterMa "optionsOverride", colorControlstepColorTemperatureoptionsOverrideCommandParameterInfo); // Populate commands - CommandInfo colorControlstepColorTemperatureCommandInfo = - new CommandInfo( + InteractionInfo colorControlstepColorTemperatureInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .stepColorTemperature( @@ -4563,8 +4919,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), colorControlstepColorTemperatureCommandParams); - colorControlClusterCommandInfoMap.put( - "stepColorTemperature", colorControlstepColorTemperatureCommandInfo); + colorControlClusterInteractionInfoMap.put( + "stepColorTemperature", colorControlstepColorTemperatureInteractionInfo); Map colorControlstepHueCommandParams = new LinkedHashMap(); CommandParameterInfo colorControlstepHuestepModeCommandParameterInfo = @@ -4593,8 +4949,8 @@ public Map getCommandMap(Map clusterMa "optionsOverride", colorControlstepHueoptionsOverrideCommandParameterInfo); // Populate commands - CommandInfo colorControlstepHueCommandInfo = - new CommandInfo( + InteractionInfo colorControlstepHueInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .stepHue( @@ -4607,7 +4963,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), colorControlstepHueCommandParams); - colorControlClusterCommandInfoMap.put("stepHue", colorControlstepHueCommandInfo); + colorControlClusterInteractionInfoMap.put("stepHue", colorControlstepHueInteractionInfo); Map colorControlstepSaturationCommandParams = new LinkedHashMap(); CommandParameterInfo colorControlstepSaturationstepModeCommandParameterInfo = @@ -4636,8 +4992,8 @@ public Map getCommandMap(Map clusterMa "optionsOverride", colorControlstepSaturationoptionsOverrideCommandParameterInfo); // Populate commands - CommandInfo colorControlstepSaturationCommandInfo = - new CommandInfo( + InteractionInfo colorControlstepSaturationInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .stepSaturation( @@ -4650,7 +5006,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), colorControlstepSaturationCommandParams); - colorControlClusterCommandInfoMap.put("stepSaturation", colorControlstepSaturationCommandInfo); + colorControlClusterInteractionInfoMap.put( + "stepSaturation", colorControlstepSaturationInteractionInfo); Map colorControlstopMoveStepCommandParams = new LinkedHashMap(); CommandParameterInfo colorControlstopMoveStepoptionsMaskCommandParameterInfo = @@ -4664,8 +5021,8 @@ public Map getCommandMap(Map clusterMa "optionsOverride", colorControlstopMoveStepoptionsOverrideCommandParameterInfo); // Populate commands - CommandInfo colorControlstopMoveStepCommandInfo = - new CommandInfo( + InteractionInfo colorControlstopMoveStepInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .stopMoveStep( @@ -4675,14 +5032,10 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), colorControlstopMoveStepCommandParams); - colorControlClusterCommandInfoMap.put("stopMoveStep", colorControlstopMoveStepCommandInfo); - // Populate cluster - ClusterInfo colorControlClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.ColorControlCluster(ptr, endpointId), - colorControlClusterCommandInfoMap); - clusterMap.put("colorControl", colorControlClusterInfo); - Map contentLauncherClusterCommandInfoMap = new LinkedHashMap<>(); + colorControlClusterInteractionInfoMap.put( + "stopMoveStep", colorControlstopMoveStepInteractionInfo); + commandMap.put("colorControl", colorControlClusterInteractionInfoMap); + Map contentLauncherClusterInteractionInfoMap = new LinkedHashMap<>(); Map contentLauncherlaunchContentCommandParams = new LinkedHashMap(); CommandParameterInfo contentLauncherlaunchContentautoPlayCommandParameterInfo = @@ -4696,8 +5049,8 @@ public Map getCommandMap(Map clusterMa "data", contentLauncherlaunchContentdataCommandParameterInfo); // Populate commands - CommandInfo contentLauncherlaunchContentCommandInfo = - new CommandInfo( + InteractionInfo contentLauncherlaunchContentInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ContentLauncherCluster) cluster) .launchContent( @@ -4707,8 +5060,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedLaunchContentResponseCallback(), contentLauncherlaunchContentCommandParams); - contentLauncherClusterCommandInfoMap.put( - "launchContent", contentLauncherlaunchContentCommandInfo); + contentLauncherClusterInteractionInfoMap.put( + "launchContent", contentLauncherlaunchContentInteractionInfo); Map contentLauncherlaunchURLCommandParams = new LinkedHashMap(); CommandParameterInfo contentLauncherlaunchURLcontentURLCommandParameterInfo = @@ -4722,8 +5075,8 @@ public Map getCommandMap(Map clusterMa "displayString", contentLauncherlaunchURLdisplayStringCommandParameterInfo); // Populate commands - CommandInfo contentLauncherlaunchURLCommandInfo = - new CommandInfo( + InteractionInfo contentLauncherlaunchURLInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ContentLauncherCluster) cluster) .launchURL( @@ -4733,21 +5086,12 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedLaunchURLResponseCallback(), contentLauncherlaunchURLCommandParams); - contentLauncherClusterCommandInfoMap.put("launchURL", contentLauncherlaunchURLCommandInfo); - // Populate cluster - ClusterInfo contentLauncherClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.ContentLauncherCluster(ptr, endpointId), - contentLauncherClusterCommandInfoMap); - clusterMap.put("contentLauncher", contentLauncherClusterInfo); - Map descriptorClusterCommandInfoMap = new LinkedHashMap<>(); - // Populate cluster - ClusterInfo descriptorClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.DescriptorCluster(ptr, endpointId), - descriptorClusterCommandInfoMap); - clusterMap.put("descriptor", descriptorClusterInfo); - Map diagnosticLogsClusterCommandInfoMap = new LinkedHashMap<>(); + contentLauncherClusterInteractionInfoMap.put( + "launchURL", contentLauncherlaunchURLInteractionInfo); + commandMap.put("contentLauncher", contentLauncherClusterInteractionInfoMap); + Map descriptorClusterInteractionInfoMap = new LinkedHashMap<>(); + commandMap.put("descriptor", descriptorClusterInteractionInfoMap); + Map diagnosticLogsClusterInteractionInfoMap = new LinkedHashMap<>(); Map diagnosticLogsretrieveLogsRequestCommandParams = new LinkedHashMap(); CommandParameterInfo diagnosticLogsretrieveLogsRequestintentCommandParameterInfo = @@ -4769,8 +5113,8 @@ public Map getCommandMap(Map clusterMa diagnosticLogsretrieveLogsRequesttransferFileDesignatorCommandParameterInfo); // Populate commands - CommandInfo diagnosticLogsretrieveLogsRequestCommandInfo = - new CommandInfo( + InteractionInfo diagnosticLogsretrieveLogsRequestInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DiagnosticLogsCluster) cluster) .retrieveLogsRequest( @@ -4781,20 +5125,15 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedRetrieveLogsResponseCallback(), diagnosticLogsretrieveLogsRequestCommandParams); - diagnosticLogsClusterCommandInfoMap.put( - "retrieveLogsRequest", diagnosticLogsretrieveLogsRequestCommandInfo); - // Populate cluster - ClusterInfo diagnosticLogsClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.DiagnosticLogsCluster(ptr, endpointId), - diagnosticLogsClusterCommandInfoMap); - clusterMap.put("diagnosticLogs", diagnosticLogsClusterInfo); - Map doorLockClusterCommandInfoMap = new LinkedHashMap<>(); + diagnosticLogsClusterInteractionInfoMap.put( + "retrieveLogsRequest", diagnosticLogsretrieveLogsRequestInteractionInfo); + commandMap.put("diagnosticLogs", diagnosticLogsClusterInteractionInfoMap); + Map doorLockClusterInteractionInfoMap = new LinkedHashMap<>(); Map doorLockclearAllPinsCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo doorLockclearAllPinsCommandInfo = - new CommandInfo( + InteractionInfo doorLockclearAllPinsInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DoorLockCluster) cluster) .clearAllPins( @@ -4802,12 +5141,12 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedClearAllPinsResponseCallback(), doorLockclearAllPinsCommandParams); - doorLockClusterCommandInfoMap.put("clearAllPins", doorLockclearAllPinsCommandInfo); + doorLockClusterInteractionInfoMap.put("clearAllPins", doorLockclearAllPinsInteractionInfo); Map doorLockclearAllRfidsCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo doorLockclearAllRfidsCommandInfo = - new CommandInfo( + InteractionInfo doorLockclearAllRfidsInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DoorLockCluster) cluster) .clearAllRfids( @@ -4815,7 +5154,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedClearAllRfidsResponseCallback(), doorLockclearAllRfidsCommandParams); - doorLockClusterCommandInfoMap.put("clearAllRfids", doorLockclearAllRfidsCommandInfo); + doorLockClusterInteractionInfoMap.put("clearAllRfids", doorLockclearAllRfidsInteractionInfo); Map doorLockclearHolidayScheduleCommandParams = new LinkedHashMap(); CommandParameterInfo doorLockclearHolidaySchedulescheduleIdCommandParameterInfo = @@ -4824,8 +5163,8 @@ public Map getCommandMap(Map clusterMa "scheduleId", doorLockclearHolidaySchedulescheduleIdCommandParameterInfo); // Populate commands - CommandInfo doorLockclearHolidayScheduleCommandInfo = - new CommandInfo( + InteractionInfo doorLockclearHolidayScheduleInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DoorLockCluster) cluster) .clearHolidaySchedule( @@ -4834,8 +5173,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedClearHolidayScheduleResponseCallback(), doorLockclearHolidayScheduleCommandParams); - doorLockClusterCommandInfoMap.put( - "clearHolidaySchedule", doorLockclearHolidayScheduleCommandInfo); + doorLockClusterInteractionInfoMap.put( + "clearHolidaySchedule", doorLockclearHolidayScheduleInteractionInfo); Map doorLockclearPinCommandParams = new LinkedHashMap(); CommandParameterInfo doorLockclearPinuserIdCommandParameterInfo = @@ -4843,8 +5182,8 @@ public Map getCommandMap(Map clusterMa doorLockclearPinCommandParams.put("userId", doorLockclearPinuserIdCommandParameterInfo); // Populate commands - CommandInfo doorLockclearPinCommandInfo = - new CommandInfo( + InteractionInfo doorLockclearPinInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DoorLockCluster) cluster) .clearPin( @@ -4853,7 +5192,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedClearPinResponseCallback(), doorLockclearPinCommandParams); - doorLockClusterCommandInfoMap.put("clearPin", doorLockclearPinCommandInfo); + doorLockClusterInteractionInfoMap.put("clearPin", doorLockclearPinInteractionInfo); Map doorLockclearRfidCommandParams = new LinkedHashMap(); CommandParameterInfo doorLockclearRfiduserIdCommandParameterInfo = @@ -4861,8 +5200,8 @@ public Map getCommandMap(Map clusterMa doorLockclearRfidCommandParams.put("userId", doorLockclearRfiduserIdCommandParameterInfo); // Populate commands - CommandInfo doorLockclearRfidCommandInfo = - new CommandInfo( + InteractionInfo doorLockclearRfidInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DoorLockCluster) cluster) .clearRfid( @@ -4871,7 +5210,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedClearRfidResponseCallback(), doorLockclearRfidCommandParams); - doorLockClusterCommandInfoMap.put("clearRfid", doorLockclearRfidCommandInfo); + doorLockClusterInteractionInfoMap.put("clearRfid", doorLockclearRfidInteractionInfo); Map doorLockclearWeekdayScheduleCommandParams = new LinkedHashMap(); CommandParameterInfo doorLockclearWeekdaySchedulescheduleIdCommandParameterInfo = @@ -4885,8 +5224,8 @@ public Map getCommandMap(Map clusterMa "userId", doorLockclearWeekdayScheduleuserIdCommandParameterInfo); // Populate commands - CommandInfo doorLockclearWeekdayScheduleCommandInfo = - new CommandInfo( + InteractionInfo doorLockclearWeekdayScheduleInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DoorLockCluster) cluster) .clearWeekdaySchedule( @@ -4896,8 +5235,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedClearWeekdayScheduleResponseCallback(), doorLockclearWeekdayScheduleCommandParams); - doorLockClusterCommandInfoMap.put( - "clearWeekdaySchedule", doorLockclearWeekdayScheduleCommandInfo); + doorLockClusterInteractionInfoMap.put( + "clearWeekdaySchedule", doorLockclearWeekdayScheduleInteractionInfo); Map doorLockclearYeardayScheduleCommandParams = new LinkedHashMap(); CommandParameterInfo doorLockclearYeardaySchedulescheduleIdCommandParameterInfo = @@ -4911,8 +5250,8 @@ public Map getCommandMap(Map clusterMa "userId", doorLockclearYeardayScheduleuserIdCommandParameterInfo); // Populate commands - CommandInfo doorLockclearYeardayScheduleCommandInfo = - new CommandInfo( + InteractionInfo doorLockclearYeardayScheduleInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DoorLockCluster) cluster) .clearYeardaySchedule( @@ -4922,8 +5261,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedClearYeardayScheduleResponseCallback(), doorLockclearYeardayScheduleCommandParams); - doorLockClusterCommandInfoMap.put( - "clearYeardaySchedule", doorLockclearYeardayScheduleCommandInfo); + doorLockClusterInteractionInfoMap.put( + "clearYeardaySchedule", doorLockclearYeardayScheduleInteractionInfo); Map doorLockgetHolidayScheduleCommandParams = new LinkedHashMap(); CommandParameterInfo doorLockgetHolidaySchedulescheduleIdCommandParameterInfo = @@ -4932,8 +5271,8 @@ public Map getCommandMap(Map clusterMa "scheduleId", doorLockgetHolidaySchedulescheduleIdCommandParameterInfo); // Populate commands - CommandInfo doorLockgetHolidayScheduleCommandInfo = - new CommandInfo( + InteractionInfo doorLockgetHolidayScheduleInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DoorLockCluster) cluster) .getHolidaySchedule( @@ -4942,7 +5281,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedGetHolidayScheduleResponseCallback(), doorLockgetHolidayScheduleCommandParams); - doorLockClusterCommandInfoMap.put("getHolidaySchedule", doorLockgetHolidayScheduleCommandInfo); + doorLockClusterInteractionInfoMap.put( + "getHolidaySchedule", doorLockgetHolidayScheduleInteractionInfo); Map doorLockgetLogRecordCommandParams = new LinkedHashMap(); CommandParameterInfo doorLockgetLogRecordlogIndexCommandParameterInfo = @@ -4951,8 +5291,8 @@ public Map getCommandMap(Map clusterMa "logIndex", doorLockgetLogRecordlogIndexCommandParameterInfo); // Populate commands - CommandInfo doorLockgetLogRecordCommandInfo = - new CommandInfo( + InteractionInfo doorLockgetLogRecordInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DoorLockCluster) cluster) .getLogRecord( @@ -4961,7 +5301,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedGetLogRecordResponseCallback(), doorLockgetLogRecordCommandParams); - doorLockClusterCommandInfoMap.put("getLogRecord", doorLockgetLogRecordCommandInfo); + doorLockClusterInteractionInfoMap.put("getLogRecord", doorLockgetLogRecordInteractionInfo); Map doorLockgetPinCommandParams = new LinkedHashMap(); CommandParameterInfo doorLockgetPinuserIdCommandParameterInfo = @@ -4969,8 +5309,8 @@ public Map getCommandMap(Map clusterMa doorLockgetPinCommandParams.put("userId", doorLockgetPinuserIdCommandParameterInfo); // Populate commands - CommandInfo doorLockgetPinCommandInfo = - new CommandInfo( + InteractionInfo doorLockgetPinInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DoorLockCluster) cluster) .getPin( @@ -4979,7 +5319,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedGetPinResponseCallback(), doorLockgetPinCommandParams); - doorLockClusterCommandInfoMap.put("getPin", doorLockgetPinCommandInfo); + doorLockClusterInteractionInfoMap.put("getPin", doorLockgetPinInteractionInfo); Map doorLockgetRfidCommandParams = new LinkedHashMap(); CommandParameterInfo doorLockgetRfiduserIdCommandParameterInfo = @@ -4987,8 +5327,8 @@ public Map getCommandMap(Map clusterMa doorLockgetRfidCommandParams.put("userId", doorLockgetRfiduserIdCommandParameterInfo); // Populate commands - CommandInfo doorLockgetRfidCommandInfo = - new CommandInfo( + InteractionInfo doorLockgetRfidInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DoorLockCluster) cluster) .getRfid( @@ -4997,7 +5337,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedGetRfidResponseCallback(), doorLockgetRfidCommandParams); - doorLockClusterCommandInfoMap.put("getRfid", doorLockgetRfidCommandInfo); + doorLockClusterInteractionInfoMap.put("getRfid", doorLockgetRfidInteractionInfo); Map doorLockgetUserTypeCommandParams = new LinkedHashMap(); CommandParameterInfo doorLockgetUserTypeuserIdCommandParameterInfo = @@ -5005,8 +5345,8 @@ public Map getCommandMap(Map clusterMa doorLockgetUserTypeCommandParams.put("userId", doorLockgetUserTypeuserIdCommandParameterInfo); // Populate commands - CommandInfo doorLockgetUserTypeCommandInfo = - new CommandInfo( + InteractionInfo doorLockgetUserTypeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DoorLockCluster) cluster) .getUserType( @@ -5015,7 +5355,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedGetUserTypeResponseCallback(), doorLockgetUserTypeCommandParams); - doorLockClusterCommandInfoMap.put("getUserType", doorLockgetUserTypeCommandInfo); + doorLockClusterInteractionInfoMap.put("getUserType", doorLockgetUserTypeInteractionInfo); Map doorLockgetWeekdayScheduleCommandParams = new LinkedHashMap(); CommandParameterInfo doorLockgetWeekdaySchedulescheduleIdCommandParameterInfo = @@ -5029,8 +5369,8 @@ public Map getCommandMap(Map clusterMa "userId", doorLockgetWeekdayScheduleuserIdCommandParameterInfo); // Populate commands - CommandInfo doorLockgetWeekdayScheduleCommandInfo = - new CommandInfo( + InteractionInfo doorLockgetWeekdayScheduleInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DoorLockCluster) cluster) .getWeekdaySchedule( @@ -5040,7 +5380,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedGetWeekdayScheduleResponseCallback(), doorLockgetWeekdayScheduleCommandParams); - doorLockClusterCommandInfoMap.put("getWeekdaySchedule", doorLockgetWeekdayScheduleCommandInfo); + doorLockClusterInteractionInfoMap.put( + "getWeekdaySchedule", doorLockgetWeekdayScheduleInteractionInfo); Map doorLockgetYeardayScheduleCommandParams = new LinkedHashMap(); CommandParameterInfo doorLockgetYeardaySchedulescheduleIdCommandParameterInfo = @@ -5054,8 +5395,8 @@ public Map getCommandMap(Map clusterMa "userId", doorLockgetYeardayScheduleuserIdCommandParameterInfo); // Populate commands - CommandInfo doorLockgetYeardayScheduleCommandInfo = - new CommandInfo( + InteractionInfo doorLockgetYeardayScheduleInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DoorLockCluster) cluster) .getYeardaySchedule( @@ -5065,7 +5406,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedGetYeardayScheduleResponseCallback(), doorLockgetYeardayScheduleCommandParams); - doorLockClusterCommandInfoMap.put("getYeardaySchedule", doorLockgetYeardayScheduleCommandInfo); + doorLockClusterInteractionInfoMap.put( + "getYeardaySchedule", doorLockgetYeardayScheduleInteractionInfo); Map doorLocklockDoorCommandParams = new LinkedHashMap(); CommandParameterInfo doorLocklockDoorpinCommandParameterInfo = @@ -5073,8 +5415,8 @@ public Map getCommandMap(Map clusterMa doorLocklockDoorCommandParams.put("pin", doorLocklockDoorpinCommandParameterInfo); // Populate commands - CommandInfo doorLocklockDoorCommandInfo = - new CommandInfo( + InteractionInfo doorLocklockDoorInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DoorLockCluster) cluster) .lockDoor( @@ -5083,7 +5425,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedLockDoorResponseCallback(), doorLocklockDoorCommandParams); - doorLockClusterCommandInfoMap.put("lockDoor", doorLocklockDoorCommandInfo); + doorLockClusterInteractionInfoMap.put("lockDoor", doorLocklockDoorInteractionInfo); Map doorLocksetHolidayScheduleCommandParams = new LinkedHashMap(); CommandParameterInfo doorLocksetHolidaySchedulescheduleIdCommandParameterInfo = @@ -5108,8 +5450,8 @@ public Map getCommandMap(Map clusterMa doorLocksetHolidayScheduleoperatingModeDuringHolidayCommandParameterInfo); // Populate commands - CommandInfo doorLocksetHolidayScheduleCommandInfo = - new CommandInfo( + InteractionInfo doorLocksetHolidayScheduleInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DoorLockCluster) cluster) .setHolidaySchedule( @@ -5121,7 +5463,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedSetHolidayScheduleResponseCallback(), doorLocksetHolidayScheduleCommandParams); - doorLockClusterCommandInfoMap.put("setHolidaySchedule", doorLocksetHolidayScheduleCommandInfo); + doorLockClusterInteractionInfoMap.put( + "setHolidaySchedule", doorLocksetHolidayScheduleInteractionInfo); Map doorLocksetPinCommandParams = new LinkedHashMap(); CommandParameterInfo doorLocksetPinuserIdCommandParameterInfo = @@ -5141,8 +5484,8 @@ public Map getCommandMap(Map clusterMa doorLocksetPinCommandParams.put("pin", doorLocksetPinpinCommandParameterInfo); // Populate commands - CommandInfo doorLocksetPinCommandInfo = - new CommandInfo( + InteractionInfo doorLocksetPinInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DoorLockCluster) cluster) .setPin( @@ -5154,7 +5497,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedSetPinResponseCallback(), doorLocksetPinCommandParams); - doorLockClusterCommandInfoMap.put("setPin", doorLocksetPinCommandInfo); + doorLockClusterInteractionInfoMap.put("setPin", doorLocksetPinInteractionInfo); Map doorLocksetRfidCommandParams = new LinkedHashMap(); CommandParameterInfo doorLocksetRfiduserIdCommandParameterInfo = @@ -5174,8 +5517,8 @@ public Map getCommandMap(Map clusterMa doorLocksetRfidCommandParams.put("id", doorLocksetRfididCommandParameterInfo); // Populate commands - CommandInfo doorLocksetRfidCommandInfo = - new CommandInfo( + InteractionInfo doorLocksetRfidInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DoorLockCluster) cluster) .setRfid( @@ -5187,7 +5530,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedSetRfidResponseCallback(), doorLocksetRfidCommandParams); - doorLockClusterCommandInfoMap.put("setRfid", doorLocksetRfidCommandInfo); + doorLockClusterInteractionInfoMap.put("setRfid", doorLocksetRfidInteractionInfo); Map doorLocksetUserTypeCommandParams = new LinkedHashMap(); CommandParameterInfo doorLocksetUserTypeuserIdCommandParameterInfo = @@ -5200,8 +5543,8 @@ public Map getCommandMap(Map clusterMa "userType", doorLocksetUserTypeuserTypeCommandParameterInfo); // Populate commands - CommandInfo doorLocksetUserTypeCommandInfo = - new CommandInfo( + InteractionInfo doorLocksetUserTypeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DoorLockCluster) cluster) .setUserType( @@ -5211,7 +5554,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedSetUserTypeResponseCallback(), doorLocksetUserTypeCommandParams); - doorLockClusterCommandInfoMap.put("setUserType", doorLocksetUserTypeCommandInfo); + doorLockClusterInteractionInfoMap.put("setUserType", doorLocksetUserTypeInteractionInfo); Map doorLocksetWeekdayScheduleCommandParams = new LinkedHashMap(); CommandParameterInfo doorLocksetWeekdaySchedulescheduleIdCommandParameterInfo = @@ -5250,8 +5593,8 @@ public Map getCommandMap(Map clusterMa "endMinute", doorLocksetWeekdayScheduleendMinuteCommandParameterInfo); // Populate commands - CommandInfo doorLocksetWeekdayScheduleCommandInfo = - new CommandInfo( + InteractionInfo doorLocksetWeekdayScheduleInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DoorLockCluster) cluster) .setWeekdaySchedule( @@ -5266,7 +5609,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedSetWeekdayScheduleResponseCallback(), doorLocksetWeekdayScheduleCommandParams); - doorLockClusterCommandInfoMap.put("setWeekdaySchedule", doorLocksetWeekdayScheduleCommandInfo); + doorLockClusterInteractionInfoMap.put( + "setWeekdaySchedule", doorLocksetWeekdayScheduleInteractionInfo); Map doorLocksetYeardayScheduleCommandParams = new LinkedHashMap(); CommandParameterInfo doorLocksetYeardaySchedulescheduleIdCommandParameterInfo = @@ -5290,8 +5634,8 @@ public Map getCommandMap(Map clusterMa "localEndTime", doorLocksetYeardaySchedulelocalEndTimeCommandParameterInfo); // Populate commands - CommandInfo doorLocksetYeardayScheduleCommandInfo = - new CommandInfo( + InteractionInfo doorLocksetYeardayScheduleInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DoorLockCluster) cluster) .setYeardaySchedule( @@ -5303,7 +5647,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedSetYeardayScheduleResponseCallback(), doorLocksetYeardayScheduleCommandParams); - doorLockClusterCommandInfoMap.put("setYeardaySchedule", doorLocksetYeardayScheduleCommandInfo); + doorLockClusterInteractionInfoMap.put( + "setYeardaySchedule", doorLocksetYeardayScheduleInteractionInfo); Map doorLockunlockDoorCommandParams = new LinkedHashMap(); CommandParameterInfo doorLockunlockDoorpinCommandParameterInfo = @@ -5311,8 +5656,8 @@ public Map getCommandMap(Map clusterMa doorLockunlockDoorCommandParams.put("pin", doorLockunlockDoorpinCommandParameterInfo); // Populate commands - CommandInfo doorLockunlockDoorCommandInfo = - new CommandInfo( + InteractionInfo doorLockunlockDoorInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DoorLockCluster) cluster) .unlockDoor( @@ -5321,7 +5666,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedUnlockDoorResponseCallback(), doorLockunlockDoorCommandParams); - doorLockClusterCommandInfoMap.put("unlockDoor", doorLockunlockDoorCommandInfo); + doorLockClusterInteractionInfoMap.put("unlockDoor", doorLockunlockDoorInteractionInfo); Map doorLockunlockWithTimeoutCommandParams = new LinkedHashMap(); CommandParameterInfo doorLockunlockWithTimeouttimeoutInSecondsCommandParameterInfo = @@ -5335,8 +5680,8 @@ public Map getCommandMap(Map clusterMa "pin", doorLockunlockWithTimeoutpinCommandParameterInfo); // Populate commands - CommandInfo doorLockunlockWithTimeoutCommandInfo = - new CommandInfo( + InteractionInfo doorLockunlockWithTimeoutInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DoorLockCluster) cluster) .unlockWithTimeout( @@ -5346,57 +5691,35 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedUnlockWithTimeoutResponseCallback(), doorLockunlockWithTimeoutCommandParams); - doorLockClusterCommandInfoMap.put("unlockWithTimeout", doorLockunlockWithTimeoutCommandInfo); - // Populate cluster - ClusterInfo doorLockClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.DoorLockCluster(ptr, endpointId), - doorLockClusterCommandInfoMap); - clusterMap.put("doorLock", doorLockClusterInfo); - Map electricalMeasurementClusterCommandInfoMap = new LinkedHashMap<>(); - // Populate cluster - ClusterInfo electricalMeasurementClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.ElectricalMeasurementCluster(ptr, endpointId), - electricalMeasurementClusterCommandInfoMap); - clusterMap.put("electricalMeasurement", electricalMeasurementClusterInfo); - Map ethernetNetworkDiagnosticsClusterCommandInfoMap = + doorLockClusterInteractionInfoMap.put( + "unlockWithTimeout", doorLockunlockWithTimeoutInteractionInfo); + commandMap.put("doorLock", doorLockClusterInteractionInfoMap); + Map electricalMeasurementClusterInteractionInfoMap = + new LinkedHashMap<>(); + commandMap.put("electricalMeasurement", electricalMeasurementClusterInteractionInfoMap); + Map ethernetNetworkDiagnosticsClusterInteractionInfoMap = new LinkedHashMap<>(); Map ethernetNetworkDiagnosticsresetCountsCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo ethernetNetworkDiagnosticsresetCountsCommandInfo = - new CommandInfo( + InteractionInfo ethernetNetworkDiagnosticsresetCountsInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) .resetCounts((DefaultClusterCallback) callback); }, () -> new DelegatedDefaultClusterCallback(), ethernetNetworkDiagnosticsresetCountsCommandParams); - ethernetNetworkDiagnosticsClusterCommandInfoMap.put( - "resetCounts", ethernetNetworkDiagnosticsresetCountsCommandInfo); - // Populate cluster - ClusterInfo ethernetNetworkDiagnosticsClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> - new ChipClusters.EthernetNetworkDiagnosticsCluster(ptr, endpointId), - ethernetNetworkDiagnosticsClusterCommandInfoMap); - clusterMap.put("ethernetNetworkDiagnostics", ethernetNetworkDiagnosticsClusterInfo); - Map fixedLabelClusterCommandInfoMap = new LinkedHashMap<>(); - // Populate cluster - ClusterInfo fixedLabelClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.FixedLabelCluster(ptr, endpointId), - fixedLabelClusterCommandInfoMap); - clusterMap.put("fixedLabel", fixedLabelClusterInfo); - Map flowMeasurementClusterCommandInfoMap = new LinkedHashMap<>(); - // Populate cluster - ClusterInfo flowMeasurementClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.FlowMeasurementCluster(ptr, endpointId), - flowMeasurementClusterCommandInfoMap); - clusterMap.put("flowMeasurement", flowMeasurementClusterInfo); - Map generalCommissioningClusterCommandInfoMap = new LinkedHashMap<>(); + ethernetNetworkDiagnosticsClusterInteractionInfoMap.put( + "resetCounts", ethernetNetworkDiagnosticsresetCountsInteractionInfo); + commandMap.put( + "ethernetNetworkDiagnostics", ethernetNetworkDiagnosticsClusterInteractionInfoMap); + Map fixedLabelClusterInteractionInfoMap = new LinkedHashMap<>(); + commandMap.put("fixedLabel", fixedLabelClusterInteractionInfoMap); + Map flowMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + commandMap.put("flowMeasurement", flowMeasurementClusterInteractionInfoMap); + Map generalCommissioningClusterInteractionInfoMap = + new LinkedHashMap<>(); Map generalCommissioningarmFailSafeCommandParams = new LinkedHashMap(); CommandParameterInfo generalCommissioningarmFailSafeexpiryLengthSecondsCommandParameterInfo = @@ -5416,8 +5739,8 @@ public Map getCommandMap(Map clusterMa "timeoutMs", generalCommissioningarmFailSafetimeoutMsCommandParameterInfo); // Populate commands - CommandInfo generalCommissioningarmFailSafeCommandInfo = - new CommandInfo( + InteractionInfo generalCommissioningarmFailSafeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.GeneralCommissioningCluster) cluster) .armFailSafe( @@ -5429,13 +5752,13 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedArmFailSafeResponseCallback(), generalCommissioningarmFailSafeCommandParams); - generalCommissioningClusterCommandInfoMap.put( - "armFailSafe", generalCommissioningarmFailSafeCommandInfo); + generalCommissioningClusterInteractionInfoMap.put( + "armFailSafe", generalCommissioningarmFailSafeInteractionInfo); Map generalCommissioningcommissioningCompleteCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo generalCommissioningcommissioningCompleteCommandInfo = - new CommandInfo( + InteractionInfo generalCommissioningcommissioningCompleteInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.GeneralCommissioningCluster) cluster) .commissioningComplete( @@ -5445,8 +5768,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedCommissioningCompleteResponseCallback(), generalCommissioningcommissioningCompleteCommandParams); - generalCommissioningClusterCommandInfoMap.put( - "commissioningComplete", generalCommissioningcommissioningCompleteCommandInfo); + generalCommissioningClusterInteractionInfoMap.put( + "commissioningComplete", generalCommissioningcommissioningCompleteInteractionInfo); Map generalCommissioningsetRegulatoryConfigCommandParams = new LinkedHashMap(); CommandParameterInfo generalCommissioningsetRegulatoryConfiglocationCommandParameterInfo = @@ -5470,8 +5793,8 @@ public Map getCommandMap(Map clusterMa "timeoutMs", generalCommissioningsetRegulatoryConfigtimeoutMsCommandParameterInfo); // Populate commands - CommandInfo generalCommissioningsetRegulatoryConfigCommandInfo = - new CommandInfo( + InteractionInfo generalCommissioningsetRegulatoryConfigInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.GeneralCommissioningCluster) cluster) .setRegulatoryConfig( @@ -5484,29 +5807,16 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedSetRegulatoryConfigResponseCallback(), generalCommissioningsetRegulatoryConfigCommandParams); - generalCommissioningClusterCommandInfoMap.put( - "setRegulatoryConfig", generalCommissioningsetRegulatoryConfigCommandInfo); - // Populate cluster - ClusterInfo generalCommissioningClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.GeneralCommissioningCluster(ptr, endpointId), - generalCommissioningClusterCommandInfoMap); - clusterMap.put("generalCommissioning", generalCommissioningClusterInfo); - Map generalDiagnosticsClusterCommandInfoMap = new LinkedHashMap<>(); - // Populate cluster - ClusterInfo generalDiagnosticsClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.GeneralDiagnosticsCluster(ptr, endpointId), - generalDiagnosticsClusterCommandInfoMap); - clusterMap.put("generalDiagnostics", generalDiagnosticsClusterInfo); - Map groupKeyManagementClusterCommandInfoMap = new LinkedHashMap<>(); - // Populate cluster - ClusterInfo groupKeyManagementClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.GroupKeyManagementCluster(ptr, endpointId), - groupKeyManagementClusterCommandInfoMap); - clusterMap.put("groupKeyManagement", groupKeyManagementClusterInfo); - Map groupsClusterCommandInfoMap = new LinkedHashMap<>(); + generalCommissioningClusterInteractionInfoMap.put( + "setRegulatoryConfig", generalCommissioningsetRegulatoryConfigInteractionInfo); + commandMap.put("generalCommissioning", generalCommissioningClusterInteractionInfoMap); + Map generalDiagnosticsClusterInteractionInfoMap = + new LinkedHashMap<>(); + commandMap.put("generalDiagnostics", generalDiagnosticsClusterInteractionInfoMap); + Map groupKeyManagementClusterInteractionInfoMap = + new LinkedHashMap<>(); + commandMap.put("groupKeyManagement", groupKeyManagementClusterInteractionInfoMap); + Map groupsClusterInteractionInfoMap = new LinkedHashMap<>(); Map groupsaddGroupCommandParams = new LinkedHashMap(); CommandParameterInfo groupsaddGroupgroupIdCommandParameterInfo = @@ -5518,8 +5828,8 @@ public Map getCommandMap(Map clusterMa groupsaddGroupCommandParams.put("groupName", groupsaddGroupgroupNameCommandParameterInfo); // Populate commands - CommandInfo groupsaddGroupCommandInfo = - new CommandInfo( + InteractionInfo groupsaddGroupInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.GroupsCluster) cluster) .addGroup( @@ -5529,7 +5839,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedAddGroupResponseCallback(), groupsaddGroupCommandParams); - groupsClusterCommandInfoMap.put("addGroup", groupsaddGroupCommandInfo); + groupsClusterInteractionInfoMap.put("addGroup", groupsaddGroupInteractionInfo); Map groupsaddGroupIfIdentifyingCommandParams = new LinkedHashMap(); CommandParameterInfo groupsaddGroupIfIdentifyinggroupIdCommandParameterInfo = @@ -5543,8 +5853,8 @@ public Map getCommandMap(Map clusterMa "groupName", groupsaddGroupIfIdentifyinggroupNameCommandParameterInfo); // Populate commands - CommandInfo groupsaddGroupIfIdentifyingCommandInfo = - new CommandInfo( + InteractionInfo groupsaddGroupIfIdentifyingInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.GroupsCluster) cluster) .addGroupIfIdentifying( @@ -5554,8 +5864,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), groupsaddGroupIfIdentifyingCommandParams); - groupsClusterCommandInfoMap.put( - "addGroupIfIdentifying", groupsaddGroupIfIdentifyingCommandInfo); + groupsClusterInteractionInfoMap.put( + "addGroupIfIdentifying", groupsaddGroupIfIdentifyingInteractionInfo); Map groupsgetGroupMembershipCommandParams = new LinkedHashMap(); CommandParameterInfo groupsgetGroupMembershipgroupCountCommandParameterInfo = @@ -5569,8 +5879,8 @@ public Map getCommandMap(Map clusterMa "groupList", groupsgetGroupMembershipgroupListCommandParameterInfo); // Populate commands - CommandInfo groupsgetGroupMembershipCommandInfo = - new CommandInfo( + InteractionInfo groupsgetGroupMembershipInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.GroupsCluster) cluster) .getGroupMembership( @@ -5580,19 +5890,20 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedGetGroupMembershipResponseCallback(), groupsgetGroupMembershipCommandParams); - groupsClusterCommandInfoMap.put("getGroupMembership", groupsgetGroupMembershipCommandInfo); + groupsClusterInteractionInfoMap.put( + "getGroupMembership", groupsgetGroupMembershipInteractionInfo); Map groupsremoveAllGroupsCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo groupsremoveAllGroupsCommandInfo = - new CommandInfo( + InteractionInfo groupsremoveAllGroupsInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.GroupsCluster) cluster) .removeAllGroups((DefaultClusterCallback) callback); }, () -> new DelegatedDefaultClusterCallback(), groupsremoveAllGroupsCommandParams); - groupsClusterCommandInfoMap.put("removeAllGroups", groupsremoveAllGroupsCommandInfo); + groupsClusterInteractionInfoMap.put("removeAllGroups", groupsremoveAllGroupsInteractionInfo); Map groupsremoveGroupCommandParams = new LinkedHashMap(); CommandParameterInfo groupsremoveGroupgroupIdCommandParameterInfo = @@ -5600,8 +5911,8 @@ public Map getCommandMap(Map clusterMa groupsremoveGroupCommandParams.put("groupId", groupsremoveGroupgroupIdCommandParameterInfo); // Populate commands - CommandInfo groupsremoveGroupCommandInfo = - new CommandInfo( + InteractionInfo groupsremoveGroupInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.GroupsCluster) cluster) .removeGroup( @@ -5610,7 +5921,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedRemoveGroupResponseCallback(), groupsremoveGroupCommandParams); - groupsClusterCommandInfoMap.put("removeGroup", groupsremoveGroupCommandInfo); + groupsClusterInteractionInfoMap.put("removeGroup", groupsremoveGroupInteractionInfo); Map groupsviewGroupCommandParams = new LinkedHashMap(); CommandParameterInfo groupsviewGroupgroupIdCommandParameterInfo = @@ -5618,8 +5929,8 @@ public Map getCommandMap(Map clusterMa groupsviewGroupCommandParams.put("groupId", groupsviewGroupgroupIdCommandParameterInfo); // Populate commands - CommandInfo groupsviewGroupCommandInfo = - new CommandInfo( + InteractionInfo groupsviewGroupInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.GroupsCluster) cluster) .viewGroup( @@ -5628,14 +5939,9 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedViewGroupResponseCallback(), groupsviewGroupCommandParams); - groupsClusterCommandInfoMap.put("viewGroup", groupsviewGroupCommandInfo); - // Populate cluster - ClusterInfo groupsClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.GroupsCluster(ptr, endpointId), - groupsClusterCommandInfoMap); - clusterMap.put("groups", groupsClusterInfo); - Map identifyClusterCommandInfoMap = new LinkedHashMap<>(); + groupsClusterInteractionInfoMap.put("viewGroup", groupsviewGroupInteractionInfo); + commandMap.put("groups", groupsClusterInteractionInfoMap); + Map identifyClusterInteractionInfoMap = new LinkedHashMap<>(); Map identifyidentifyCommandParams = new LinkedHashMap(); CommandParameterInfo identifyidentifyidentifyTimeCommandParameterInfo = @@ -5644,8 +5950,8 @@ public Map getCommandMap(Map clusterMa "identifyTime", identifyidentifyidentifyTimeCommandParameterInfo); // Populate commands - CommandInfo identifyidentifyCommandInfo = - new CommandInfo( + InteractionInfo identifyidentifyInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.IdentifyCluster) cluster) .identify( @@ -5654,12 +5960,12 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), identifyidentifyCommandParams); - identifyClusterCommandInfoMap.put("identify", identifyidentifyCommandInfo); + identifyClusterInteractionInfoMap.put("identify", identifyidentifyInteractionInfo); Map identifyidentifyQueryCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo identifyidentifyQueryCommandInfo = - new CommandInfo( + InteractionInfo identifyidentifyQueryInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.IdentifyCluster) cluster) .identifyQuery( @@ -5667,7 +5973,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedIdentifyQueryResponseCallback(), identifyidentifyQueryCommandParams); - identifyClusterCommandInfoMap.put("identifyQuery", identifyidentifyQueryCommandInfo); + identifyClusterInteractionInfoMap.put("identifyQuery", identifyidentifyQueryInteractionInfo); Map identifytriggerEffectCommandParams = new LinkedHashMap(); CommandParameterInfo identifytriggerEffecteffectIdentifierCommandParameterInfo = @@ -5681,8 +5987,8 @@ public Map getCommandMap(Map clusterMa "effectVariant", identifytriggerEffecteffectVariantCommandParameterInfo); // Populate commands - CommandInfo identifytriggerEffectCommandInfo = - new CommandInfo( + InteractionInfo identifytriggerEffectInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.IdentifyCluster) cluster) .triggerEffect( @@ -5692,21 +5998,12 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), identifytriggerEffectCommandParams); - identifyClusterCommandInfoMap.put("triggerEffect", identifytriggerEffectCommandInfo); - // Populate cluster - ClusterInfo identifyClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.IdentifyCluster(ptr, endpointId), - identifyClusterCommandInfoMap); - clusterMap.put("identify", identifyClusterInfo); - Map illuminanceMeasurementClusterCommandInfoMap = new LinkedHashMap<>(); - // Populate cluster - ClusterInfo illuminanceMeasurementClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.IlluminanceMeasurementCluster(ptr, endpointId), - illuminanceMeasurementClusterCommandInfoMap); - clusterMap.put("illuminanceMeasurement", illuminanceMeasurementClusterInfo); - Map keypadInputClusterCommandInfoMap = new LinkedHashMap<>(); + identifyClusterInteractionInfoMap.put("triggerEffect", identifytriggerEffectInteractionInfo); + commandMap.put("identify", identifyClusterInteractionInfoMap); + Map illuminanceMeasurementClusterInteractionInfoMap = + new LinkedHashMap<>(); + commandMap.put("illuminanceMeasurement", illuminanceMeasurementClusterInteractionInfoMap); + Map keypadInputClusterInteractionInfoMap = new LinkedHashMap<>(); Map keypadInputsendKeyCommandParams = new LinkedHashMap(); CommandParameterInfo keypadInputsendKeykeyCodeCommandParameterInfo = @@ -5714,8 +6011,8 @@ public Map getCommandMap(Map clusterMa keypadInputsendKeyCommandParams.put("keyCode", keypadInputsendKeykeyCodeCommandParameterInfo); // Populate commands - CommandInfo keypadInputsendKeyCommandInfo = - new CommandInfo( + InteractionInfo keypadInputsendKeyInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.KeypadInputCluster) cluster) .sendKey( @@ -5724,14 +6021,9 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedSendKeyResponseCallback(), keypadInputsendKeyCommandParams); - keypadInputClusterCommandInfoMap.put("sendKey", keypadInputsendKeyCommandInfo); - // Populate cluster - ClusterInfo keypadInputClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.KeypadInputCluster(ptr, endpointId), - keypadInputClusterCommandInfoMap); - clusterMap.put("keypadInput", keypadInputClusterInfo); - Map levelControlClusterCommandInfoMap = new LinkedHashMap<>(); + keypadInputClusterInteractionInfoMap.put("sendKey", keypadInputsendKeyInteractionInfo); + commandMap.put("keypadInput", keypadInputClusterInteractionInfoMap); + Map levelControlClusterInteractionInfoMap = new LinkedHashMap<>(); Map levelControlmoveCommandParams = new LinkedHashMap(); CommandParameterInfo levelControlmovemoveModeCommandParameterInfo = @@ -5752,8 +6044,8 @@ public Map getCommandMap(Map clusterMa "optionOverride", levelControlmoveoptionOverrideCommandParameterInfo); // Populate commands - CommandInfo levelControlmoveCommandInfo = - new CommandInfo( + InteractionInfo levelControlmoveInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.LevelControlCluster) cluster) .move( @@ -5765,7 +6057,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), levelControlmoveCommandParams); - levelControlClusterCommandInfoMap.put("move", levelControlmoveCommandInfo); + levelControlClusterInteractionInfoMap.put("move", levelControlmoveInteractionInfo); Map levelControlmoveToLevelCommandParams = new LinkedHashMap(); CommandParameterInfo levelControlmoveToLevellevelCommandParameterInfo = @@ -5789,8 +6081,8 @@ public Map getCommandMap(Map clusterMa "optionOverride", levelControlmoveToLeveloptionOverrideCommandParameterInfo); // Populate commands - CommandInfo levelControlmoveToLevelCommandInfo = - new CommandInfo( + InteractionInfo levelControlmoveToLevelInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.LevelControlCluster) cluster) .moveToLevel( @@ -5802,7 +6094,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), levelControlmoveToLevelCommandParams); - levelControlClusterCommandInfoMap.put("moveToLevel", levelControlmoveToLevelCommandInfo); + levelControlClusterInteractionInfoMap.put( + "moveToLevel", levelControlmoveToLevelInteractionInfo); Map levelControlmoveToLevelWithOnOffCommandParams = new LinkedHashMap(); CommandParameterInfo levelControlmoveToLevelWithOnOfflevelCommandParameterInfo = @@ -5816,8 +6109,8 @@ public Map getCommandMap(Map clusterMa "transitionTime", levelControlmoveToLevelWithOnOfftransitionTimeCommandParameterInfo); // Populate commands - CommandInfo levelControlmoveToLevelWithOnOffCommandInfo = - new CommandInfo( + InteractionInfo levelControlmoveToLevelWithOnOffInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.LevelControlCluster) cluster) .moveToLevelWithOnOff( @@ -5827,8 +6120,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), levelControlmoveToLevelWithOnOffCommandParams); - levelControlClusterCommandInfoMap.put( - "moveToLevelWithOnOff", levelControlmoveToLevelWithOnOffCommandInfo); + levelControlClusterInteractionInfoMap.put( + "moveToLevelWithOnOff", levelControlmoveToLevelWithOnOffInteractionInfo); Map levelControlmoveWithOnOffCommandParams = new LinkedHashMap(); CommandParameterInfo levelControlmoveWithOnOffmoveModeCommandParameterInfo = @@ -5842,8 +6135,8 @@ public Map getCommandMap(Map clusterMa "rate", levelControlmoveWithOnOffrateCommandParameterInfo); // Populate commands - CommandInfo levelControlmoveWithOnOffCommandInfo = - new CommandInfo( + InteractionInfo levelControlmoveWithOnOffInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.LevelControlCluster) cluster) .moveWithOnOff( @@ -5853,7 +6146,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), levelControlmoveWithOnOffCommandParams); - levelControlClusterCommandInfoMap.put("moveWithOnOff", levelControlmoveWithOnOffCommandInfo); + levelControlClusterInteractionInfoMap.put( + "moveWithOnOff", levelControlmoveWithOnOffInteractionInfo); Map levelControlstepCommandParams = new LinkedHashMap(); CommandParameterInfo levelControlstepstepModeCommandParameterInfo = @@ -5879,8 +6173,8 @@ public Map getCommandMap(Map clusterMa "optionOverride", levelControlstepoptionOverrideCommandParameterInfo); // Populate commands - CommandInfo levelControlstepCommandInfo = - new CommandInfo( + InteractionInfo levelControlstepInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.LevelControlCluster) cluster) .step( @@ -5893,7 +6187,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), levelControlstepCommandParams); - levelControlClusterCommandInfoMap.put("step", levelControlstepCommandInfo); + levelControlClusterInteractionInfoMap.put("step", levelControlstepInteractionInfo); Map levelControlstepWithOnOffCommandParams = new LinkedHashMap(); CommandParameterInfo levelControlstepWithOnOffstepModeCommandParameterInfo = @@ -5912,8 +6206,8 @@ public Map getCommandMap(Map clusterMa "transitionTime", levelControlstepWithOnOfftransitionTimeCommandParameterInfo); // Populate commands - CommandInfo levelControlstepWithOnOffCommandInfo = - new CommandInfo( + InteractionInfo levelControlstepWithOnOffInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.LevelControlCluster) cluster) .stepWithOnOff( @@ -5924,7 +6218,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), levelControlstepWithOnOffCommandParams); - levelControlClusterCommandInfoMap.put("stepWithOnOff", levelControlstepWithOnOffCommandInfo); + levelControlClusterInteractionInfoMap.put( + "stepWithOnOff", levelControlstepWithOnOffInteractionInfo); Map levelControlstopCommandParams = new LinkedHashMap(); CommandParameterInfo levelControlstopoptionMaskCommandParameterInfo = @@ -5937,8 +6232,8 @@ public Map getCommandMap(Map clusterMa "optionOverride", levelControlstopoptionOverrideCommandParameterInfo); // Populate commands - CommandInfo levelControlstopCommandInfo = - new CommandInfo( + InteractionInfo levelControlstopInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.LevelControlCluster) cluster) .stop( @@ -5948,56 +6243,48 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), levelControlstopCommandParams); - levelControlClusterCommandInfoMap.put("stop", levelControlstopCommandInfo); + levelControlClusterInteractionInfoMap.put("stop", levelControlstopInteractionInfo); Map levelControlstopWithOnOffCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo levelControlstopWithOnOffCommandInfo = - new CommandInfo( + InteractionInfo levelControlstopWithOnOffInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.LevelControlCluster) cluster) .stopWithOnOff((DefaultClusterCallback) callback); }, () -> new DelegatedDefaultClusterCallback(), levelControlstopWithOnOffCommandParams); - levelControlClusterCommandInfoMap.put("stopWithOnOff", levelControlstopWithOnOffCommandInfo); - // Populate cluster - ClusterInfo levelControlClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.LevelControlCluster(ptr, endpointId), - levelControlClusterCommandInfoMap); - clusterMap.put("levelControl", levelControlClusterInfo); - Map lowPowerClusterCommandInfoMap = new LinkedHashMap<>(); + levelControlClusterInteractionInfoMap.put( + "stopWithOnOff", levelControlstopWithOnOffInteractionInfo); + commandMap.put("levelControl", levelControlClusterInteractionInfoMap); + Map lowPowerClusterInteractionInfoMap = new LinkedHashMap<>(); Map lowPowersleepCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo lowPowersleepCommandInfo = - new CommandInfo( + InteractionInfo lowPowersleepInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.LowPowerCluster) cluster).sleep((DefaultClusterCallback) callback); }, () -> new DelegatedDefaultClusterCallback(), lowPowersleepCommandParams); - lowPowerClusterCommandInfoMap.put("sleep", lowPowersleepCommandInfo); - // Populate cluster - ClusterInfo lowPowerClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.LowPowerCluster(ptr, endpointId), - lowPowerClusterCommandInfoMap); - clusterMap.put("lowPower", lowPowerClusterInfo); - Map mediaInputClusterCommandInfoMap = new LinkedHashMap<>(); + lowPowerClusterInteractionInfoMap.put("sleep", lowPowersleepInteractionInfo); + commandMap.put("lowPower", lowPowerClusterInteractionInfoMap); + Map mediaInputClusterInteractionInfoMap = new LinkedHashMap<>(); Map mediaInputhideInputStatusCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo mediaInputhideInputStatusCommandInfo = - new CommandInfo( + InteractionInfo mediaInputhideInputStatusInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaInputCluster) cluster) .hideInputStatus((DefaultClusterCallback) callback); }, () -> new DelegatedDefaultClusterCallback(), mediaInputhideInputStatusCommandParams); - mediaInputClusterCommandInfoMap.put("hideInputStatus", mediaInputhideInputStatusCommandInfo); + mediaInputClusterInteractionInfoMap.put( + "hideInputStatus", mediaInputhideInputStatusInteractionInfo); Map mediaInputrenameInputCommandParams = new LinkedHashMap(); CommandParameterInfo mediaInputrenameInputindexCommandParameterInfo = @@ -6009,8 +6296,8 @@ public Map getCommandMap(Map clusterMa mediaInputrenameInputCommandParams.put("name", mediaInputrenameInputnameCommandParameterInfo); // Populate commands - CommandInfo mediaInputrenameInputCommandInfo = - new CommandInfo( + InteractionInfo mediaInputrenameInputInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaInputCluster) cluster) .renameInput( @@ -6020,7 +6307,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), mediaInputrenameInputCommandParams); - mediaInputClusterCommandInfoMap.put("renameInput", mediaInputrenameInputCommandInfo); + mediaInputClusterInteractionInfoMap.put("renameInput", mediaInputrenameInputInteractionInfo); Map mediaInputselectInputCommandParams = new LinkedHashMap(); CommandParameterInfo mediaInputselectInputindexCommandParameterInfo = @@ -6028,8 +6315,8 @@ public Map getCommandMap(Map clusterMa mediaInputselectInputCommandParams.put("index", mediaInputselectInputindexCommandParameterInfo); // Populate commands - CommandInfo mediaInputselectInputCommandInfo = - new CommandInfo( + InteractionInfo mediaInputselectInputInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaInputCluster) cluster) .selectInput( @@ -6037,31 +6324,27 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), mediaInputselectInputCommandParams); - mediaInputClusterCommandInfoMap.put("selectInput", mediaInputselectInputCommandInfo); + mediaInputClusterInteractionInfoMap.put("selectInput", mediaInputselectInputInteractionInfo); Map mediaInputshowInputStatusCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo mediaInputshowInputStatusCommandInfo = - new CommandInfo( + InteractionInfo mediaInputshowInputStatusInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaInputCluster) cluster) .showInputStatus((DefaultClusterCallback) callback); }, () -> new DelegatedDefaultClusterCallback(), mediaInputshowInputStatusCommandParams); - mediaInputClusterCommandInfoMap.put("showInputStatus", mediaInputshowInputStatusCommandInfo); - // Populate cluster - ClusterInfo mediaInputClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.MediaInputCluster(ptr, endpointId), - mediaInputClusterCommandInfoMap); - clusterMap.put("mediaInput", mediaInputClusterInfo); - Map mediaPlaybackClusterCommandInfoMap = new LinkedHashMap<>(); + mediaInputClusterInteractionInfoMap.put( + "showInputStatus", mediaInputshowInputStatusInteractionInfo); + commandMap.put("mediaInput", mediaInputClusterInteractionInfoMap); + Map mediaPlaybackClusterInteractionInfoMap = new LinkedHashMap<>(); Map mediaPlaybackmediaFastForwardCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo mediaPlaybackmediaFastForwardCommandInfo = - new CommandInfo( + InteractionInfo mediaPlaybackmediaFastForwardInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) .mediaFastForward( @@ -6070,13 +6353,13 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedMediaFastForwardResponseCallback(), mediaPlaybackmediaFastForwardCommandParams); - mediaPlaybackClusterCommandInfoMap.put( - "mediaFastForward", mediaPlaybackmediaFastForwardCommandInfo); + mediaPlaybackClusterInteractionInfoMap.put( + "mediaFastForward", mediaPlaybackmediaFastForwardInteractionInfo); Map mediaPlaybackmediaNextCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo mediaPlaybackmediaNextCommandInfo = - new CommandInfo( + InteractionInfo mediaPlaybackmediaNextInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) .mediaNext( @@ -6084,12 +6367,12 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedMediaNextResponseCallback(), mediaPlaybackmediaNextCommandParams); - mediaPlaybackClusterCommandInfoMap.put("mediaNext", mediaPlaybackmediaNextCommandInfo); + mediaPlaybackClusterInteractionInfoMap.put("mediaNext", mediaPlaybackmediaNextInteractionInfo); Map mediaPlaybackmediaPauseCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo mediaPlaybackmediaPauseCommandInfo = - new CommandInfo( + InteractionInfo mediaPlaybackmediaPauseInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) .mediaPause( @@ -6097,12 +6380,13 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedMediaPauseResponseCallback(), mediaPlaybackmediaPauseCommandParams); - mediaPlaybackClusterCommandInfoMap.put("mediaPause", mediaPlaybackmediaPauseCommandInfo); + mediaPlaybackClusterInteractionInfoMap.put( + "mediaPause", mediaPlaybackmediaPauseInteractionInfo); Map mediaPlaybackmediaPlayCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo mediaPlaybackmediaPlayCommandInfo = - new CommandInfo( + InteractionInfo mediaPlaybackmediaPlayInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) .mediaPlay( @@ -6110,12 +6394,12 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedMediaPlayResponseCallback(), mediaPlaybackmediaPlayCommandParams); - mediaPlaybackClusterCommandInfoMap.put("mediaPlay", mediaPlaybackmediaPlayCommandInfo); + mediaPlaybackClusterInteractionInfoMap.put("mediaPlay", mediaPlaybackmediaPlayInteractionInfo); Map mediaPlaybackmediaPreviousCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo mediaPlaybackmediaPreviousCommandInfo = - new CommandInfo( + InteractionInfo mediaPlaybackmediaPreviousInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) .mediaPrevious( @@ -6123,12 +6407,13 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedMediaPreviousResponseCallback(), mediaPlaybackmediaPreviousCommandParams); - mediaPlaybackClusterCommandInfoMap.put("mediaPrevious", mediaPlaybackmediaPreviousCommandInfo); + mediaPlaybackClusterInteractionInfoMap.put( + "mediaPrevious", mediaPlaybackmediaPreviousInteractionInfo); Map mediaPlaybackmediaRewindCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo mediaPlaybackmediaRewindCommandInfo = - new CommandInfo( + InteractionInfo mediaPlaybackmediaRewindInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) .mediaRewind( @@ -6136,7 +6421,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedMediaRewindResponseCallback(), mediaPlaybackmediaRewindCommandParams); - mediaPlaybackClusterCommandInfoMap.put("mediaRewind", mediaPlaybackmediaRewindCommandInfo); + mediaPlaybackClusterInteractionInfoMap.put( + "mediaRewind", mediaPlaybackmediaRewindInteractionInfo); Map mediaPlaybackmediaSeekCommandParams = new LinkedHashMap(); CommandParameterInfo mediaPlaybackmediaSeekpositionCommandParameterInfo = @@ -6145,8 +6431,8 @@ public Map getCommandMap(Map clusterMa "position", mediaPlaybackmediaSeekpositionCommandParameterInfo); // Populate commands - CommandInfo mediaPlaybackmediaSeekCommandInfo = - new CommandInfo( + InteractionInfo mediaPlaybackmediaSeekInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) .mediaSeek( @@ -6155,7 +6441,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedMediaSeekResponseCallback(), mediaPlaybackmediaSeekCommandParams); - mediaPlaybackClusterCommandInfoMap.put("mediaSeek", mediaPlaybackmediaSeekCommandInfo); + mediaPlaybackClusterInteractionInfoMap.put("mediaSeek", mediaPlaybackmediaSeekInteractionInfo); Map mediaPlaybackmediaSkipBackwardCommandParams = new LinkedHashMap(); CommandParameterInfo @@ -6166,8 +6452,8 @@ public Map getCommandMap(Map clusterMa mediaPlaybackmediaSkipBackwarddeltaPositionMillisecondsCommandParameterInfo); // Populate commands - CommandInfo mediaPlaybackmediaSkipBackwardCommandInfo = - new CommandInfo( + InteractionInfo mediaPlaybackmediaSkipBackwardInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) .mediaSkipBackward( @@ -6177,8 +6463,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedMediaSkipBackwardResponseCallback(), mediaPlaybackmediaSkipBackwardCommandParams); - mediaPlaybackClusterCommandInfoMap.put( - "mediaSkipBackward", mediaPlaybackmediaSkipBackwardCommandInfo); + mediaPlaybackClusterInteractionInfoMap.put( + "mediaSkipBackward", mediaPlaybackmediaSkipBackwardInteractionInfo); Map mediaPlaybackmediaSkipForwardCommandParams = new LinkedHashMap(); CommandParameterInfo @@ -6189,8 +6475,8 @@ public Map getCommandMap(Map clusterMa mediaPlaybackmediaSkipForwarddeltaPositionMillisecondsCommandParameterInfo); // Populate commands - CommandInfo mediaPlaybackmediaSkipForwardCommandInfo = - new CommandInfo( + InteractionInfo mediaPlaybackmediaSkipForwardInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) .mediaSkipForward( @@ -6199,13 +6485,13 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedMediaSkipForwardResponseCallback(), mediaPlaybackmediaSkipForwardCommandParams); - mediaPlaybackClusterCommandInfoMap.put( - "mediaSkipForward", mediaPlaybackmediaSkipForwardCommandInfo); + mediaPlaybackClusterInteractionInfoMap.put( + "mediaSkipForward", mediaPlaybackmediaSkipForwardInteractionInfo); Map mediaPlaybackmediaStartOverCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo mediaPlaybackmediaStartOverCommandInfo = - new CommandInfo( + InteractionInfo mediaPlaybackmediaStartOverInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) .mediaStartOver( @@ -6213,13 +6499,13 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedMediaStartOverResponseCallback(), mediaPlaybackmediaStartOverCommandParams); - mediaPlaybackClusterCommandInfoMap.put( - "mediaStartOver", mediaPlaybackmediaStartOverCommandInfo); + mediaPlaybackClusterInteractionInfoMap.put( + "mediaStartOver", mediaPlaybackmediaStartOverInteractionInfo); Map mediaPlaybackmediaStopCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo mediaPlaybackmediaStopCommandInfo = - new CommandInfo( + InteractionInfo mediaPlaybackmediaStopInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) .mediaStop( @@ -6227,14 +6513,9 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedMediaStopResponseCallback(), mediaPlaybackmediaStopCommandParams); - mediaPlaybackClusterCommandInfoMap.put("mediaStop", mediaPlaybackmediaStopCommandInfo); - // Populate cluster - ClusterInfo mediaPlaybackClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.MediaPlaybackCluster(ptr, endpointId), - mediaPlaybackClusterCommandInfoMap); - clusterMap.put("mediaPlayback", mediaPlaybackClusterInfo); - Map modeSelectClusterCommandInfoMap = new LinkedHashMap<>(); + mediaPlaybackClusterInteractionInfoMap.put("mediaStop", mediaPlaybackmediaStopInteractionInfo); + commandMap.put("mediaPlayback", mediaPlaybackClusterInteractionInfoMap); + Map modeSelectClusterInteractionInfoMap = new LinkedHashMap<>(); Map modeSelectchangeToModeCommandParams = new LinkedHashMap(); CommandParameterInfo modeSelectchangeToModenewModeCommandParameterInfo = @@ -6243,8 +6524,8 @@ public Map getCommandMap(Map clusterMa "newMode", modeSelectchangeToModenewModeCommandParameterInfo); // Populate commands - CommandInfo modeSelectchangeToModeCommandInfo = - new CommandInfo( + InteractionInfo modeSelectchangeToModeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ModeSelectCluster) cluster) .changeToMode( @@ -6252,14 +6533,10 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), modeSelectchangeToModeCommandParams); - modeSelectClusterCommandInfoMap.put("changeToMode", modeSelectchangeToModeCommandInfo); - // Populate cluster - ClusterInfo modeSelectClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.ModeSelectCluster(ptr, endpointId), - modeSelectClusterCommandInfoMap); - clusterMap.put("modeSelect", modeSelectClusterInfo); - Map networkCommissioningClusterCommandInfoMap = new LinkedHashMap<>(); + modeSelectClusterInteractionInfoMap.put("changeToMode", modeSelectchangeToModeInteractionInfo); + commandMap.put("modeSelect", modeSelectClusterInteractionInfoMap); + Map networkCommissioningClusterInteractionInfoMap = + new LinkedHashMap<>(); Map networkCommissioningaddThreadNetworkCommandParams = new LinkedHashMap(); CommandParameterInfo @@ -6280,8 +6557,8 @@ public Map getCommandMap(Map clusterMa "timeoutMs", networkCommissioningaddThreadNetworktimeoutMsCommandParameterInfo); // Populate commands - CommandInfo networkCommissioningaddThreadNetworkCommandInfo = - new CommandInfo( + InteractionInfo networkCommissioningaddThreadNetworkInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.NetworkCommissioningCluster) cluster) .addThreadNetwork( @@ -6293,8 +6570,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedAddThreadNetworkResponseCallback(), networkCommissioningaddThreadNetworkCommandParams); - networkCommissioningClusterCommandInfoMap.put( - "addThreadNetwork", networkCommissioningaddThreadNetworkCommandInfo); + networkCommissioningClusterInteractionInfoMap.put( + "addThreadNetwork", networkCommissioningaddThreadNetworkInteractionInfo); Map networkCommissioningaddWiFiNetworkCommandParams = new LinkedHashMap(); CommandParameterInfo networkCommissioningaddWiFiNetworkssidCommandParameterInfo = @@ -6318,8 +6595,8 @@ public Map getCommandMap(Map clusterMa "timeoutMs", networkCommissioningaddWiFiNetworktimeoutMsCommandParameterInfo); // Populate commands - CommandInfo networkCommissioningaddWiFiNetworkCommandInfo = - new CommandInfo( + InteractionInfo networkCommissioningaddWiFiNetworkInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.NetworkCommissioningCluster) cluster) .addWiFiNetwork( @@ -6332,8 +6609,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedAddWiFiNetworkResponseCallback(), networkCommissioningaddWiFiNetworkCommandParams); - networkCommissioningClusterCommandInfoMap.put( - "addWiFiNetwork", networkCommissioningaddWiFiNetworkCommandInfo); + networkCommissioningClusterInteractionInfoMap.put( + "addWiFiNetwork", networkCommissioningaddWiFiNetworkInteractionInfo); Map networkCommissioningdisableNetworkCommandParams = new LinkedHashMap(); CommandParameterInfo networkCommissioningdisableNetworknetworkIDCommandParameterInfo = @@ -6352,8 +6629,8 @@ public Map getCommandMap(Map clusterMa "timeoutMs", networkCommissioningdisableNetworktimeoutMsCommandParameterInfo); // Populate commands - CommandInfo networkCommissioningdisableNetworkCommandInfo = - new CommandInfo( + InteractionInfo networkCommissioningdisableNetworkInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.NetworkCommissioningCluster) cluster) .disableNetwork( @@ -6365,8 +6642,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDisableNetworkResponseCallback(), networkCommissioningdisableNetworkCommandParams); - networkCommissioningClusterCommandInfoMap.put( - "disableNetwork", networkCommissioningdisableNetworkCommandInfo); + networkCommissioningClusterInteractionInfoMap.put( + "disableNetwork", networkCommissioningdisableNetworkInteractionInfo); Map networkCommissioningenableNetworkCommandParams = new LinkedHashMap(); CommandParameterInfo networkCommissioningenableNetworknetworkIDCommandParameterInfo = @@ -6385,8 +6662,8 @@ public Map getCommandMap(Map clusterMa "timeoutMs", networkCommissioningenableNetworktimeoutMsCommandParameterInfo); // Populate commands - CommandInfo networkCommissioningenableNetworkCommandInfo = - new CommandInfo( + InteractionInfo networkCommissioningenableNetworkInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.NetworkCommissioningCluster) cluster) .enableNetwork( @@ -6398,8 +6675,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedEnableNetworkResponseCallback(), networkCommissioningenableNetworkCommandParams); - networkCommissioningClusterCommandInfoMap.put( - "enableNetwork", networkCommissioningenableNetworkCommandInfo); + networkCommissioningClusterInteractionInfoMap.put( + "enableNetwork", networkCommissioningenableNetworkInteractionInfo); Map networkCommissioningremoveNetworkCommandParams = new LinkedHashMap(); CommandParameterInfo networkCommissioningremoveNetworknetworkIDCommandParameterInfo = @@ -6418,8 +6695,8 @@ public Map getCommandMap(Map clusterMa "timeoutMs", networkCommissioningremoveNetworktimeoutMsCommandParameterInfo); // Populate commands - CommandInfo networkCommissioningremoveNetworkCommandInfo = - new CommandInfo( + InteractionInfo networkCommissioningremoveNetworkInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.NetworkCommissioningCluster) cluster) .removeNetwork( @@ -6431,8 +6708,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedRemoveNetworkResponseCallback(), networkCommissioningremoveNetworkCommandParams); - networkCommissioningClusterCommandInfoMap.put( - "removeNetwork", networkCommissioningremoveNetworkCommandInfo); + networkCommissioningClusterInteractionInfoMap.put( + "removeNetwork", networkCommissioningremoveNetworkInteractionInfo); Map networkCommissioningscanNetworksCommandParams = new LinkedHashMap(); CommandParameterInfo networkCommissioningscanNetworksssidCommandParameterInfo = @@ -6451,8 +6728,8 @@ public Map getCommandMap(Map clusterMa "timeoutMs", networkCommissioningscanNetworkstimeoutMsCommandParameterInfo); // Populate commands - CommandInfo networkCommissioningscanNetworksCommandInfo = - new CommandInfo( + InteractionInfo networkCommissioningscanNetworksInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.NetworkCommissioningCluster) cluster) .scanNetworks( @@ -6464,8 +6741,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedScanNetworksResponseCallback(), networkCommissioningscanNetworksCommandParams); - networkCommissioningClusterCommandInfoMap.put( - "scanNetworks", networkCommissioningscanNetworksCommandInfo); + networkCommissioningClusterInteractionInfoMap.put( + "scanNetworks", networkCommissioningscanNetworksInteractionInfo); Map networkCommissioningupdateThreadNetworkCommandParams = new LinkedHashMap(); CommandParameterInfo @@ -6486,8 +6763,8 @@ public Map getCommandMap(Map clusterMa "timeoutMs", networkCommissioningupdateThreadNetworktimeoutMsCommandParameterInfo); // Populate commands - CommandInfo networkCommissioningupdateThreadNetworkCommandInfo = - new CommandInfo( + InteractionInfo networkCommissioningupdateThreadNetworkInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.NetworkCommissioningCluster) cluster) .updateThreadNetwork( @@ -6499,8 +6776,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedUpdateThreadNetworkResponseCallback(), networkCommissioningupdateThreadNetworkCommandParams); - networkCommissioningClusterCommandInfoMap.put( - "updateThreadNetwork", networkCommissioningupdateThreadNetworkCommandInfo); + networkCommissioningClusterInteractionInfoMap.put( + "updateThreadNetwork", networkCommissioningupdateThreadNetworkInteractionInfo); Map networkCommissioningupdateWiFiNetworkCommandParams = new LinkedHashMap(); CommandParameterInfo networkCommissioningupdateWiFiNetworkssidCommandParameterInfo = @@ -6524,8 +6801,8 @@ public Map getCommandMap(Map clusterMa "timeoutMs", networkCommissioningupdateWiFiNetworktimeoutMsCommandParameterInfo); // Populate commands - CommandInfo networkCommissioningupdateWiFiNetworkCommandInfo = - new CommandInfo( + InteractionInfo networkCommissioningupdateWiFiNetworkInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.NetworkCommissioningCluster) cluster) .updateWiFiNetwork( @@ -6538,15 +6815,11 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedUpdateWiFiNetworkResponseCallback(), networkCommissioningupdateWiFiNetworkCommandParams); - networkCommissioningClusterCommandInfoMap.put( - "updateWiFiNetwork", networkCommissioningupdateWiFiNetworkCommandInfo); - // Populate cluster - ClusterInfo networkCommissioningClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.NetworkCommissioningCluster(ptr, endpointId), - networkCommissioningClusterCommandInfoMap); - clusterMap.put("networkCommissioning", networkCommissioningClusterInfo); - Map otaSoftwareUpdateProviderClusterCommandInfoMap = new LinkedHashMap<>(); + networkCommissioningClusterInteractionInfoMap.put( + "updateWiFiNetwork", networkCommissioningupdateWiFiNetworkInteractionInfo); + commandMap.put("networkCommissioning", networkCommissioningClusterInteractionInfoMap); + Map otaSoftwareUpdateProviderClusterInteractionInfoMap = + new LinkedHashMap<>(); Map otaSoftwareUpdateProviderapplyUpdateRequestCommandParams = new LinkedHashMap(); CommandParameterInfo @@ -6561,8 +6834,8 @@ public Map getCommandMap(Map clusterMa "newVersion", otaSoftwareUpdateProviderapplyUpdateRequestnewVersionCommandParameterInfo); // Populate commands - CommandInfo otaSoftwareUpdateProviderapplyUpdateRequestCommandInfo = - new CommandInfo( + InteractionInfo otaSoftwareUpdateProviderapplyUpdateRequestInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OtaSoftwareUpdateProviderCluster) cluster) .applyUpdateRequest( @@ -6573,8 +6846,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedApplyUpdateResponseCallback(), otaSoftwareUpdateProviderapplyUpdateRequestCommandParams); - otaSoftwareUpdateProviderClusterCommandInfoMap.put( - "applyUpdateRequest", otaSoftwareUpdateProviderapplyUpdateRequestCommandInfo); + otaSoftwareUpdateProviderClusterInteractionInfoMap.put( + "applyUpdateRequest", otaSoftwareUpdateProviderapplyUpdateRequestInteractionInfo); Map otaSoftwareUpdateProvidernotifyUpdateAppliedCommandParams = new LinkedHashMap(); CommandParameterInfo @@ -6591,8 +6864,8 @@ public Map getCommandMap(Map clusterMa otaSoftwareUpdateProvidernotifyUpdateAppliedsoftwareVersionCommandParameterInfo); // Populate commands - CommandInfo otaSoftwareUpdateProvidernotifyUpdateAppliedCommandInfo = - new CommandInfo( + InteractionInfo otaSoftwareUpdateProvidernotifyUpdateAppliedInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OtaSoftwareUpdateProviderCluster) cluster) .notifyUpdateApplied( @@ -6602,8 +6875,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), otaSoftwareUpdateProvidernotifyUpdateAppliedCommandParams); - otaSoftwareUpdateProviderClusterCommandInfoMap.put( - "notifyUpdateApplied", otaSoftwareUpdateProvidernotifyUpdateAppliedCommandInfo); + otaSoftwareUpdateProviderClusterInteractionInfoMap.put( + "notifyUpdateApplied", otaSoftwareUpdateProvidernotifyUpdateAppliedInteractionInfo); Map otaSoftwareUpdateProviderqueryImageCommandParams = new LinkedHashMap(); CommandParameterInfo otaSoftwareUpdateProviderqueryImagevendorIdCommandParameterInfo = @@ -6652,8 +6925,8 @@ public Map getCommandMap(Map clusterMa otaSoftwareUpdateProviderqueryImagemetadataForProviderCommandParameterInfo); // Populate commands - CommandInfo otaSoftwareUpdateProviderqueryImageCommandInfo = - new CommandInfo( + InteractionInfo otaSoftwareUpdateProviderqueryImageInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OtaSoftwareUpdateProviderCluster) cluster) .queryImage( @@ -6670,15 +6943,10 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedQueryImageResponseCallback(), otaSoftwareUpdateProviderqueryImageCommandParams); - otaSoftwareUpdateProviderClusterCommandInfoMap.put( - "queryImage", otaSoftwareUpdateProviderqueryImageCommandInfo); - // Populate cluster - ClusterInfo otaSoftwareUpdateProviderClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.OtaSoftwareUpdateProviderCluster(ptr, endpointId), - otaSoftwareUpdateProviderClusterCommandInfoMap); - clusterMap.put("otaSoftwareUpdateProvider", otaSoftwareUpdateProviderClusterInfo); - Map otaSoftwareUpdateRequestorClusterCommandInfoMap = + otaSoftwareUpdateProviderClusterInteractionInfoMap.put( + "queryImage", otaSoftwareUpdateProviderqueryImageInteractionInfo); + commandMap.put("otaSoftwareUpdateProvider", otaSoftwareUpdateProviderClusterInteractionInfoMap); + Map otaSoftwareUpdateRequestorClusterInteractionInfoMap = new LinkedHashMap<>(); Map otaSoftwareUpdateRequestorannounceOtaProviderCommandParams = new LinkedHashMap(); @@ -6709,8 +6977,8 @@ public Map getCommandMap(Map clusterMa otaSoftwareUpdateRequestorannounceOtaProvidermetadataForNodeCommandParameterInfo); // Populate commands - CommandInfo otaSoftwareUpdateRequestorannounceOtaProviderCommandInfo = - new CommandInfo( + InteractionInfo otaSoftwareUpdateRequestorannounceOtaProviderInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OtaSoftwareUpdateRequestorCluster) cluster) .announceOtaProvider( @@ -6722,34 +6990,24 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), otaSoftwareUpdateRequestorannounceOtaProviderCommandParams); - otaSoftwareUpdateRequestorClusterCommandInfoMap.put( - "announceOtaProvider", otaSoftwareUpdateRequestorannounceOtaProviderCommandInfo); - // Populate cluster - ClusterInfo otaSoftwareUpdateRequestorClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> - new ChipClusters.OtaSoftwareUpdateRequestorCluster(ptr, endpointId), - otaSoftwareUpdateRequestorClusterCommandInfoMap); - clusterMap.put("otaSoftwareUpdateRequestor", otaSoftwareUpdateRequestorClusterInfo); - Map occupancySensingClusterCommandInfoMap = new LinkedHashMap<>(); - // Populate cluster - ClusterInfo occupancySensingClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.OccupancySensingCluster(ptr, endpointId), - occupancySensingClusterCommandInfoMap); - clusterMap.put("occupancySensing", occupancySensingClusterInfo); - Map onOffClusterCommandInfoMap = new LinkedHashMap<>(); + otaSoftwareUpdateRequestorClusterInteractionInfoMap.put( + "announceOtaProvider", otaSoftwareUpdateRequestorannounceOtaProviderInteractionInfo); + commandMap.put( + "otaSoftwareUpdateRequestor", otaSoftwareUpdateRequestorClusterInteractionInfoMap); + Map occupancySensingClusterInteractionInfoMap = new LinkedHashMap<>(); + commandMap.put("occupancySensing", occupancySensingClusterInteractionInfoMap); + Map onOffClusterInteractionInfoMap = new LinkedHashMap<>(); Map onOffoffCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo onOffoffCommandInfo = - new CommandInfo( + InteractionInfo onOffoffInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OnOffCluster) cluster).off((DefaultClusterCallback) callback); }, () -> new DelegatedDefaultClusterCallback(), onOffoffCommandParams); - onOffClusterCommandInfoMap.put("off", onOffoffCommandInfo); + onOffClusterInteractionInfoMap.put("off", onOffoffInteractionInfo); Map onOffoffWithEffectCommandParams = new LinkedHashMap(); CommandParameterInfo onOffoffWithEffecteffectIdCommandParameterInfo = @@ -6762,8 +7020,8 @@ public Map getCommandMap(Map clusterMa "effectVariant", onOffoffWithEffecteffectVariantCommandParameterInfo); // Populate commands - CommandInfo onOffoffWithEffectCommandInfo = - new CommandInfo( + InteractionInfo onOffoffWithEffectInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OnOffCluster) cluster) .offWithEffect( @@ -6773,31 +7031,31 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), onOffoffWithEffectCommandParams); - onOffClusterCommandInfoMap.put("offWithEffect", onOffoffWithEffectCommandInfo); + onOffClusterInteractionInfoMap.put("offWithEffect", onOffoffWithEffectInteractionInfo); Map onOffonCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo onOffonCommandInfo = - new CommandInfo( + InteractionInfo onOffonInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OnOffCluster) cluster).on((DefaultClusterCallback) callback); }, () -> new DelegatedDefaultClusterCallback(), onOffonCommandParams); - onOffClusterCommandInfoMap.put("on", onOffonCommandInfo); + onOffClusterInteractionInfoMap.put("on", onOffonInteractionInfo); Map onOffonWithRecallGlobalSceneCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo onOffonWithRecallGlobalSceneCommandInfo = - new CommandInfo( + InteractionInfo onOffonWithRecallGlobalSceneInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OnOffCluster) cluster) .onWithRecallGlobalScene((DefaultClusterCallback) callback); }, () -> new DelegatedDefaultClusterCallback(), onOffonWithRecallGlobalSceneCommandParams); - onOffClusterCommandInfoMap.put( - "onWithRecallGlobalScene", onOffonWithRecallGlobalSceneCommandInfo); + onOffClusterInteractionInfoMap.put( + "onWithRecallGlobalScene", onOffonWithRecallGlobalSceneInteractionInfo); Map onOffonWithTimedOffCommandParams = new LinkedHashMap(); CommandParameterInfo onOffonWithTimedOffonOffControlCommandParameterInfo = @@ -6815,8 +7073,8 @@ public Map getCommandMap(Map clusterMa "offWaitTime", onOffonWithTimedOffoffWaitTimeCommandParameterInfo); // Populate commands - CommandInfo onOffonWithTimedOffCommandInfo = - new CommandInfo( + InteractionInfo onOffonWithTimedOffInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OnOffCluster) cluster) .onWithTimedOff( @@ -6827,32 +7085,24 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), onOffonWithTimedOffCommandParams); - onOffClusterCommandInfoMap.put("onWithTimedOff", onOffonWithTimedOffCommandInfo); + onOffClusterInteractionInfoMap.put("onWithTimedOff", onOffonWithTimedOffInteractionInfo); Map onOfftoggleCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo onOfftoggleCommandInfo = - new CommandInfo( + InteractionInfo onOfftoggleInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OnOffCluster) cluster).toggle((DefaultClusterCallback) callback); }, () -> new DelegatedDefaultClusterCallback(), onOfftoggleCommandParams); - onOffClusterCommandInfoMap.put("toggle", onOfftoggleCommandInfo); - // Populate cluster - ClusterInfo onOffClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.OnOffCluster(ptr, endpointId), - onOffClusterCommandInfoMap); - clusterMap.put("onOff", onOffClusterInfo); - Map onOffSwitchConfigurationClusterCommandInfoMap = new LinkedHashMap<>(); - // Populate cluster - ClusterInfo onOffSwitchConfigurationClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.OnOffSwitchConfigurationCluster(ptr, endpointId), - onOffSwitchConfigurationClusterCommandInfoMap); - clusterMap.put("onOffSwitchConfiguration", onOffSwitchConfigurationClusterInfo); - Map operationalCredentialsClusterCommandInfoMap = new LinkedHashMap<>(); + onOffClusterInteractionInfoMap.put("toggle", onOfftoggleInteractionInfo); + commandMap.put("onOff", onOffClusterInteractionInfoMap); + Map onOffSwitchConfigurationClusterInteractionInfoMap = + new LinkedHashMap<>(); + commandMap.put("onOffSwitchConfiguration", onOffSwitchConfigurationClusterInteractionInfoMap); + Map operationalCredentialsClusterInteractionInfoMap = + new LinkedHashMap<>(); Map operationalCredentialsaddNOCCommandParams = new LinkedHashMap(); CommandParameterInfo operationalCredentialsaddNOCNOCValueCommandParameterInfo = @@ -6881,8 +7131,8 @@ public Map getCommandMap(Map clusterMa "adminVendorId", operationalCredentialsaddNOCadminVendorIdCommandParameterInfo); // Populate commands - CommandInfo operationalCredentialsaddNOCCommandInfo = - new CommandInfo( + InteractionInfo operationalCredentialsaddNOCInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OperationalCredentialsCluster) cluster) .addNOC( @@ -6895,8 +7145,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedNOCResponseCallback(), operationalCredentialsaddNOCCommandParams); - operationalCredentialsClusterCommandInfoMap.put( - "addNOC", operationalCredentialsaddNOCCommandInfo); + operationalCredentialsClusterInteractionInfoMap.put( + "addNOC", operationalCredentialsaddNOCInteractionInfo); Map operationalCredentialsaddTrustedRootCertificateCommandParams = new LinkedHashMap(); CommandParameterInfo @@ -6907,8 +7157,8 @@ public Map getCommandMap(Map clusterMa operationalCredentialsaddTrustedRootCertificaterootCertificateCommandParameterInfo); // Populate commands - CommandInfo operationalCredentialsaddTrustedRootCertificateCommandInfo = - new CommandInfo( + InteractionInfo operationalCredentialsaddTrustedRootCertificateInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OperationalCredentialsCluster) cluster) .addTrustedRootCertificate( @@ -6917,8 +7167,9 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), operationalCredentialsaddTrustedRootCertificateCommandParams); - operationalCredentialsClusterCommandInfoMap.put( - "addTrustedRootCertificate", operationalCredentialsaddTrustedRootCertificateCommandInfo); + operationalCredentialsClusterInteractionInfoMap.put( + "addTrustedRootCertificate", + operationalCredentialsaddTrustedRootCertificateInteractionInfo); Map operationalCredentialsattestationRequestCommandParams = new LinkedHashMap(); CommandParameterInfo @@ -6929,8 +7180,8 @@ public Map getCommandMap(Map clusterMa operationalCredentialsattestationRequestattestationNonceCommandParameterInfo); // Populate commands - CommandInfo operationalCredentialsattestationRequestCommandInfo = - new CommandInfo( + InteractionInfo operationalCredentialsattestationRequestInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OperationalCredentialsCluster) cluster) .attestationRequest( @@ -6940,8 +7191,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedAttestationResponseCallback(), operationalCredentialsattestationRequestCommandParams); - operationalCredentialsClusterCommandInfoMap.put( - "attestationRequest", operationalCredentialsattestationRequestCommandInfo); + operationalCredentialsClusterInteractionInfoMap.put( + "attestationRequest", operationalCredentialsattestationRequestInteractionInfo); Map operationalCredentialscertificateChainRequestCommandParams = new LinkedHashMap(); CommandParameterInfo @@ -6952,8 +7203,8 @@ public Map getCommandMap(Map clusterMa operationalCredentialscertificateChainRequestcertificateTypeCommandParameterInfo); // Populate commands - CommandInfo operationalCredentialscertificateChainRequestCommandInfo = - new CommandInfo( + InteractionInfo operationalCredentialscertificateChainRequestInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OperationalCredentialsCluster) cluster) .certificateChainRequest( @@ -6963,8 +7214,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedCertificateChainResponseCallback(), operationalCredentialscertificateChainRequestCommandParams); - operationalCredentialsClusterCommandInfoMap.put( - "certificateChainRequest", operationalCredentialscertificateChainRequestCommandInfo); + operationalCredentialsClusterInteractionInfoMap.put( + "certificateChainRequest", operationalCredentialscertificateChainRequestInteractionInfo); Map operationalCredentialsopCSRRequestCommandParams = new LinkedHashMap(); CommandParameterInfo operationalCredentialsopCSRRequestCSRNonceCommandParameterInfo = @@ -6973,8 +7224,8 @@ public Map getCommandMap(Map clusterMa "CSRNonce", operationalCredentialsopCSRRequestCSRNonceCommandParameterInfo); // Populate commands - CommandInfo operationalCredentialsopCSRRequestCommandInfo = - new CommandInfo( + InteractionInfo operationalCredentialsopCSRRequestInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OperationalCredentialsCluster) cluster) .opCSRRequest( @@ -6983,8 +7234,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedOpCSRResponseCallback(), operationalCredentialsopCSRRequestCommandParams); - operationalCredentialsClusterCommandInfoMap.put( - "opCSRRequest", operationalCredentialsopCSRRequestCommandInfo); + operationalCredentialsClusterInteractionInfoMap.put( + "opCSRRequest", operationalCredentialsopCSRRequestInteractionInfo); Map operationalCredentialsremoveFabricCommandParams = new LinkedHashMap(); CommandParameterInfo operationalCredentialsremoveFabricfabricIndexCommandParameterInfo = @@ -6993,8 +7244,8 @@ public Map getCommandMap(Map clusterMa "fabricIndex", operationalCredentialsremoveFabricfabricIndexCommandParameterInfo); // Populate commands - CommandInfo operationalCredentialsremoveFabricCommandInfo = - new CommandInfo( + InteractionInfo operationalCredentialsremoveFabricInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OperationalCredentialsCluster) cluster) .removeFabric( @@ -7003,8 +7254,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedNOCResponseCallback(), operationalCredentialsremoveFabricCommandParams); - operationalCredentialsClusterCommandInfoMap.put( - "removeFabric", operationalCredentialsremoveFabricCommandInfo); + operationalCredentialsClusterInteractionInfoMap.put( + "removeFabric", operationalCredentialsremoveFabricInteractionInfo); Map operationalCredentialsremoveTrustedRootCertificateCommandParams = new LinkedHashMap(); @@ -7016,8 +7267,8 @@ public Map getCommandMap(Map clusterMa operationalCredentialsremoveTrustedRootCertificatetrustedRootIdentifierCommandParameterInfo); // Populate commands - CommandInfo operationalCredentialsremoveTrustedRootCertificateCommandInfo = - new CommandInfo( + InteractionInfo operationalCredentialsremoveTrustedRootCertificateInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OperationalCredentialsCluster) cluster) .removeTrustedRootCertificate( @@ -7026,9 +7277,9 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), operationalCredentialsremoveTrustedRootCertificateCommandParams); - operationalCredentialsClusterCommandInfoMap.put( + operationalCredentialsClusterInteractionInfoMap.put( "removeTrustedRootCertificate", - operationalCredentialsremoveTrustedRootCertificateCommandInfo); + operationalCredentialsremoveTrustedRootCertificateInteractionInfo); Map operationalCredentialsupdateFabricLabelCommandParams = new LinkedHashMap(); CommandParameterInfo operationalCredentialsupdateFabricLabellabelCommandParameterInfo = @@ -7037,8 +7288,8 @@ public Map getCommandMap(Map clusterMa "label", operationalCredentialsupdateFabricLabellabelCommandParameterInfo); // Populate commands - CommandInfo operationalCredentialsupdateFabricLabelCommandInfo = - new CommandInfo( + InteractionInfo operationalCredentialsupdateFabricLabelInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OperationalCredentialsCluster) cluster) .updateFabricLabel( @@ -7047,8 +7298,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedNOCResponseCallback(), operationalCredentialsupdateFabricLabelCommandParams); - operationalCredentialsClusterCommandInfoMap.put( - "updateFabricLabel", operationalCredentialsupdateFabricLabelCommandInfo); + operationalCredentialsClusterInteractionInfoMap.put( + "updateFabricLabel", operationalCredentialsupdateFabricLabelInteractionInfo); Map operationalCredentialsupdateNOCCommandParams = new LinkedHashMap(); CommandParameterInfo operationalCredentialsupdateNOCNOCValueCommandParameterInfo = @@ -7060,60 +7311,36 @@ public Map getCommandMap(Map clusterMa new CommandParameterInfo("ICACValue", byte[].class); operationalCredentialsupdateNOCCommandParams.put( "ICACValue", operationalCredentialsupdateNOCICACValueCommandParameterInfo); - - // Populate commands - CommandInfo operationalCredentialsupdateNOCCommandInfo = - new CommandInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OperationalCredentialsCluster) cluster) - .updateNOC( - (ChipClusters.OperationalCredentialsCluster.NOCResponseCallback) callback, - (byte[]) commandArguments.get("NOCValue"), - (byte[]) commandArguments.get("ICACValue")); - }, - () -> new DelegatedNOCResponseCallback(), - operationalCredentialsupdateNOCCommandParams); - operationalCredentialsClusterCommandInfoMap.put( - "updateNOC", operationalCredentialsupdateNOCCommandInfo); - // Populate cluster - ClusterInfo operationalCredentialsClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.OperationalCredentialsCluster(ptr, endpointId), - operationalCredentialsClusterCommandInfoMap); - clusterMap.put("operationalCredentials", operationalCredentialsClusterInfo); - Map powerSourceClusterCommandInfoMap = new LinkedHashMap<>(); - // Populate cluster - ClusterInfo powerSourceClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.PowerSourceCluster(ptr, endpointId), - powerSourceClusterCommandInfoMap); - clusterMap.put("powerSource", powerSourceClusterInfo); - Map pressureMeasurementClusterCommandInfoMap = new LinkedHashMap<>(); - // Populate cluster - ClusterInfo pressureMeasurementClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.PressureMeasurementCluster(ptr, endpointId), - pressureMeasurementClusterCommandInfoMap); - clusterMap.put("pressureMeasurement", pressureMeasurementClusterInfo); - Map pumpConfigurationAndControlClusterCommandInfoMap = + + // Populate commands + InteractionInfo operationalCredentialsupdateNOCInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OperationalCredentialsCluster) cluster) + .updateNOC( + (ChipClusters.OperationalCredentialsCluster.NOCResponseCallback) callback, + (byte[]) commandArguments.get("NOCValue"), + (byte[]) commandArguments.get("ICACValue")); + }, + () -> new DelegatedNOCResponseCallback(), + operationalCredentialsupdateNOCCommandParams); + operationalCredentialsClusterInteractionInfoMap.put( + "updateNOC", operationalCredentialsupdateNOCInteractionInfo); + commandMap.put("operationalCredentials", operationalCredentialsClusterInteractionInfoMap); + Map powerSourceClusterInteractionInfoMap = new LinkedHashMap<>(); + commandMap.put("powerSource", powerSourceClusterInteractionInfoMap); + Map pressureMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); - // Populate cluster - ClusterInfo pumpConfigurationAndControlClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> - new ChipClusters.PumpConfigurationAndControlCluster(ptr, endpointId), - pumpConfigurationAndControlClusterCommandInfoMap); - clusterMap.put("pumpConfigurationAndControl", pumpConfigurationAndControlClusterInfo); - Map relativeHumidityMeasurementClusterCommandInfoMap = + commandMap.put("pressureMeasurement", pressureMeasurementClusterInteractionInfoMap); + Map pumpConfigurationAndControlClusterInteractionInfoMap = new LinkedHashMap<>(); - // Populate cluster - ClusterInfo relativeHumidityMeasurementClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> - new ChipClusters.RelativeHumidityMeasurementCluster(ptr, endpointId), - relativeHumidityMeasurementClusterCommandInfoMap); - clusterMap.put("relativeHumidityMeasurement", relativeHumidityMeasurementClusterInfo); - Map scenesClusterCommandInfoMap = new LinkedHashMap<>(); + commandMap.put( + "pumpConfigurationAndControl", pumpConfigurationAndControlClusterInteractionInfoMap); + Map relativeHumidityMeasurementClusterInteractionInfoMap = + new LinkedHashMap<>(); + commandMap.put( + "relativeHumidityMeasurement", relativeHumidityMeasurementClusterInteractionInfoMap); + Map scenesClusterInteractionInfoMap = new LinkedHashMap<>(); Map scenesaddSceneCommandParams = new LinkedHashMap(); CommandParameterInfo scenesaddScenegroupIdCommandParameterInfo = @@ -7146,8 +7373,8 @@ public Map getCommandMap(Map clusterMa scenesaddSceneCommandParams.put("value", scenesaddScenevalueCommandParameterInfo); // Populate commands - CommandInfo scenesaddSceneCommandInfo = - new CommandInfo( + InteractionInfo scenesaddSceneInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ScenesCluster) cluster) .addScene( @@ -7162,7 +7389,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedAddSceneResponseCallback(), scenesaddSceneCommandParams); - scenesClusterCommandInfoMap.put("addScene", scenesaddSceneCommandInfo); + scenesClusterInteractionInfoMap.put("addScene", scenesaddSceneInteractionInfo); Map scenesgetSceneMembershipCommandParams = new LinkedHashMap(); CommandParameterInfo scenesgetSceneMembershipgroupIdCommandParameterInfo = @@ -7171,8 +7398,8 @@ public Map getCommandMap(Map clusterMa "groupId", scenesgetSceneMembershipgroupIdCommandParameterInfo); // Populate commands - CommandInfo scenesgetSceneMembershipCommandInfo = - new CommandInfo( + InteractionInfo scenesgetSceneMembershipInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ScenesCluster) cluster) .getSceneMembership( @@ -7181,7 +7408,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedGetSceneMembershipResponseCallback(), scenesgetSceneMembershipCommandParams); - scenesClusterCommandInfoMap.put("getSceneMembership", scenesgetSceneMembershipCommandInfo); + scenesClusterInteractionInfoMap.put( + "getSceneMembership", scenesgetSceneMembershipInteractionInfo); Map scenesrecallSceneCommandParams = new LinkedHashMap(); CommandParameterInfo scenesrecallScenegroupIdCommandParameterInfo = @@ -7198,8 +7426,8 @@ public Map getCommandMap(Map clusterMa "transitionTime", scenesrecallScenetransitionTimeCommandParameterInfo); // Populate commands - CommandInfo scenesrecallSceneCommandInfo = - new CommandInfo( + InteractionInfo scenesrecallSceneInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ScenesCluster) cluster) .recallScene( @@ -7210,7 +7438,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), scenesrecallSceneCommandParams); - scenesClusterCommandInfoMap.put("recallScene", scenesrecallSceneCommandInfo); + scenesClusterInteractionInfoMap.put("recallScene", scenesrecallSceneInteractionInfo); Map scenesremoveAllScenesCommandParams = new LinkedHashMap(); CommandParameterInfo scenesremoveAllScenesgroupIdCommandParameterInfo = @@ -7219,8 +7447,8 @@ public Map getCommandMap(Map clusterMa "groupId", scenesremoveAllScenesgroupIdCommandParameterInfo); // Populate commands - CommandInfo scenesremoveAllScenesCommandInfo = - new CommandInfo( + InteractionInfo scenesremoveAllScenesInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ScenesCluster) cluster) .removeAllScenes( @@ -7229,7 +7457,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedRemoveAllScenesResponseCallback(), scenesremoveAllScenesCommandParams); - scenesClusterCommandInfoMap.put("removeAllScenes", scenesremoveAllScenesCommandInfo); + scenesClusterInteractionInfoMap.put("removeAllScenes", scenesremoveAllScenesInteractionInfo); Map scenesremoveSceneCommandParams = new LinkedHashMap(); CommandParameterInfo scenesremoveScenegroupIdCommandParameterInfo = @@ -7241,8 +7469,8 @@ public Map getCommandMap(Map clusterMa scenesremoveSceneCommandParams.put("sceneId", scenesremoveScenesceneIdCommandParameterInfo); // Populate commands - CommandInfo scenesremoveSceneCommandInfo = - new CommandInfo( + InteractionInfo scenesremoveSceneInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ScenesCluster) cluster) .removeScene( @@ -7252,7 +7480,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedRemoveSceneResponseCallback(), scenesremoveSceneCommandParams); - scenesClusterCommandInfoMap.put("removeScene", scenesremoveSceneCommandInfo); + scenesClusterInteractionInfoMap.put("removeScene", scenesremoveSceneInteractionInfo); Map scenesstoreSceneCommandParams = new LinkedHashMap(); CommandParameterInfo scenesstoreScenegroupIdCommandParameterInfo = @@ -7264,8 +7492,8 @@ public Map getCommandMap(Map clusterMa scenesstoreSceneCommandParams.put("sceneId", scenesstoreScenesceneIdCommandParameterInfo); // Populate commands - CommandInfo scenesstoreSceneCommandInfo = - new CommandInfo( + InteractionInfo scenesstoreSceneInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ScenesCluster) cluster) .storeScene( @@ -7275,7 +7503,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedStoreSceneResponseCallback(), scenesstoreSceneCommandParams); - scenesClusterCommandInfoMap.put("storeScene", scenesstoreSceneCommandInfo); + scenesClusterInteractionInfoMap.put("storeScene", scenesstoreSceneInteractionInfo); Map scenesviewSceneCommandParams = new LinkedHashMap(); CommandParameterInfo scenesviewScenegroupIdCommandParameterInfo = @@ -7287,8 +7515,8 @@ public Map getCommandMap(Map clusterMa scenesviewSceneCommandParams.put("sceneId", scenesviewScenesceneIdCommandParameterInfo); // Populate commands - CommandInfo scenesviewSceneCommandInfo = - new CommandInfo( + InteractionInfo scenesviewSceneInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ScenesCluster) cluster) .viewScene( @@ -7298,41 +7526,27 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedViewSceneResponseCallback(), scenesviewSceneCommandParams); - scenesClusterCommandInfoMap.put("viewScene", scenesviewSceneCommandInfo); - // Populate cluster - ClusterInfo scenesClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.ScenesCluster(ptr, endpointId), - scenesClusterCommandInfoMap); - clusterMap.put("scenes", scenesClusterInfo); - Map softwareDiagnosticsClusterCommandInfoMap = new LinkedHashMap<>(); + scenesClusterInteractionInfoMap.put("viewScene", scenesviewSceneInteractionInfo); + commandMap.put("scenes", scenesClusterInteractionInfoMap); + Map softwareDiagnosticsClusterInteractionInfoMap = + new LinkedHashMap<>(); Map softwareDiagnosticsresetWatermarksCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo softwareDiagnosticsresetWatermarksCommandInfo = - new CommandInfo( + InteractionInfo softwareDiagnosticsresetWatermarksInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.SoftwareDiagnosticsCluster) cluster) .resetWatermarks((DefaultClusterCallback) callback); }, () -> new DelegatedDefaultClusterCallback(), softwareDiagnosticsresetWatermarksCommandParams); - softwareDiagnosticsClusterCommandInfoMap.put( - "resetWatermarks", softwareDiagnosticsresetWatermarksCommandInfo); - // Populate cluster - ClusterInfo softwareDiagnosticsClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.SoftwareDiagnosticsCluster(ptr, endpointId), - softwareDiagnosticsClusterCommandInfoMap); - clusterMap.put("softwareDiagnostics", softwareDiagnosticsClusterInfo); - Map switchClusterCommandInfoMap = new LinkedHashMap<>(); - // Populate cluster - ClusterInfo switchClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.SwitchCluster(ptr, endpointId), - switchClusterCommandInfoMap); - clusterMap.put("switch", switchClusterInfo); - Map tvChannelClusterCommandInfoMap = new LinkedHashMap<>(); + softwareDiagnosticsClusterInteractionInfoMap.put( + "resetWatermarks", softwareDiagnosticsresetWatermarksInteractionInfo); + commandMap.put("softwareDiagnostics", softwareDiagnosticsClusterInteractionInfoMap); + Map switchClusterInteractionInfoMap = new LinkedHashMap<>(); + commandMap.put("switch", switchClusterInteractionInfoMap); + Map tvChannelClusterInteractionInfoMap = new LinkedHashMap<>(); Map tvChannelchangeChannelCommandParams = new LinkedHashMap(); CommandParameterInfo tvChannelchangeChannelmatchCommandParameterInfo = @@ -7341,8 +7555,8 @@ public Map getCommandMap(Map clusterMa "match", tvChannelchangeChannelmatchCommandParameterInfo); // Populate commands - CommandInfo tvChannelchangeChannelCommandInfo = - new CommandInfo( + InteractionInfo tvChannelchangeChannelInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TvChannelCluster) cluster) .changeChannel( @@ -7351,7 +7565,7 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedChangeChannelResponseCallback(), tvChannelchangeChannelCommandParams); - tvChannelClusterCommandInfoMap.put("changeChannel", tvChannelchangeChannelCommandInfo); + tvChannelClusterInteractionInfoMap.put("changeChannel", tvChannelchangeChannelInteractionInfo); Map tvChannelchangeChannelByNumberCommandParams = new LinkedHashMap(); CommandParameterInfo tvChannelchangeChannelByNumbermajorNumberCommandParameterInfo = @@ -7365,8 +7579,8 @@ public Map getCommandMap(Map clusterMa "minorNumber", tvChannelchangeChannelByNumberminorNumberCommandParameterInfo); // Populate commands - CommandInfo tvChannelchangeChannelByNumberCommandInfo = - new CommandInfo( + InteractionInfo tvChannelchangeChannelByNumberInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TvChannelCluster) cluster) .changeChannelByNumber( @@ -7376,8 +7590,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), tvChannelchangeChannelByNumberCommandParams); - tvChannelClusterCommandInfoMap.put( - "changeChannelByNumber", tvChannelchangeChannelByNumberCommandInfo); + tvChannelClusterInteractionInfoMap.put( + "changeChannelByNumber", tvChannelchangeChannelByNumberInteractionInfo); Map tvChannelskipChannelCommandParams = new LinkedHashMap(); CommandParameterInfo tvChannelskipChannelcountCommandParameterInfo = @@ -7385,8 +7599,8 @@ public Map getCommandMap(Map clusterMa tvChannelskipChannelCommandParams.put("count", tvChannelskipChannelcountCommandParameterInfo); // Populate commands - CommandInfo tvChannelskipChannelCommandInfo = - new CommandInfo( + InteractionInfo tvChannelskipChannelInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TvChannelCluster) cluster) .skipChannel( @@ -7394,14 +7608,9 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), tvChannelskipChannelCommandParams); - tvChannelClusterCommandInfoMap.put("skipChannel", tvChannelskipChannelCommandInfo); - // Populate cluster - ClusterInfo tvChannelClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.TvChannelCluster(ptr, endpointId), - tvChannelClusterCommandInfoMap); - clusterMap.put("tvChannel", tvChannelClusterInfo); - Map targetNavigatorClusterCommandInfoMap = new LinkedHashMap<>(); + tvChannelClusterInteractionInfoMap.put("skipChannel", tvChannelskipChannelInteractionInfo); + commandMap.put("tvChannel", tvChannelClusterInteractionInfoMap); + Map targetNavigatorClusterInteractionInfoMap = new LinkedHashMap<>(); Map targetNavigatornavigateTargetCommandParams = new LinkedHashMap(); CommandParameterInfo targetNavigatornavigateTargettargetCommandParameterInfo = @@ -7415,8 +7624,8 @@ public Map getCommandMap(Map clusterMa "data", targetNavigatornavigateTargetdataCommandParameterInfo); // Populate commands - CommandInfo targetNavigatornavigateTargetCommandInfo = - new CommandInfo( + InteractionInfo targetNavigatornavigateTargetInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TargetNavigatorCluster) cluster) .navigateTarget( @@ -7426,33 +7635,24 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedNavigateTargetResponseCallback(), targetNavigatornavigateTargetCommandParams); - targetNavigatorClusterCommandInfoMap.put( - "navigateTarget", targetNavigatornavigateTargetCommandInfo); - // Populate cluster - ClusterInfo targetNavigatorClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.TargetNavigatorCluster(ptr, endpointId), - targetNavigatorClusterCommandInfoMap); - clusterMap.put("targetNavigator", targetNavigatorClusterInfo); - Map temperatureMeasurementClusterCommandInfoMap = new LinkedHashMap<>(); - // Populate cluster - ClusterInfo temperatureMeasurementClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.TemperatureMeasurementCluster(ptr, endpointId), - temperatureMeasurementClusterCommandInfoMap); - clusterMap.put("temperatureMeasurement", temperatureMeasurementClusterInfo); - Map testClusterClusterCommandInfoMap = new LinkedHashMap<>(); + targetNavigatorClusterInteractionInfoMap.put( + "navigateTarget", targetNavigatornavigateTargetInteractionInfo); + commandMap.put("targetNavigator", targetNavigatorClusterInteractionInfoMap); + Map temperatureMeasurementClusterInteractionInfoMap = + new LinkedHashMap<>(); + commandMap.put("temperatureMeasurement", temperatureMeasurementClusterInteractionInfoMap); + Map testClusterClusterInteractionInfoMap = new LinkedHashMap<>(); Map testClustertestCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo testClustertestCommandInfo = - new CommandInfo( + InteractionInfo testClustertestInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster).test((DefaultClusterCallback) callback); }, () -> new DelegatedDefaultClusterCallback(), testClustertestCommandParams); - testClusterClusterCommandInfoMap.put("test", testClustertestCommandInfo); + testClusterClusterInteractionInfoMap.put("test", testClustertestInteractionInfo); Map testClustertestAddArgumentsCommandParams = new LinkedHashMap(); CommandParameterInfo testClustertestAddArgumentsarg1CommandParameterInfo = @@ -7466,8 +7666,8 @@ public Map getCommandMap(Map clusterMa "arg2", testClustertestAddArgumentsarg2CommandParameterInfo); // Populate commands - CommandInfo testClustertestAddArgumentsCommandInfo = - new CommandInfo( + InteractionInfo testClustertestAddArgumentsInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .testAddArguments( @@ -7477,8 +7677,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedTestAddArgumentsResponseCallback(), testClustertestAddArgumentsCommandParams); - testClusterClusterCommandInfoMap.put( - "testAddArguments", testClustertestAddArgumentsCommandInfo); + testClusterClusterInteractionInfoMap.put( + "testAddArguments", testClustertestAddArgumentsInteractionInfo); Map testClustertestEnumsRequestCommandParams = new LinkedHashMap(); CommandParameterInfo testClustertestEnumsRequestarg1CommandParameterInfo = @@ -7492,8 +7692,8 @@ public Map getCommandMap(Map clusterMa "arg2", testClustertestEnumsRequestarg2CommandParameterInfo); // Populate commands - CommandInfo testClustertestEnumsRequestCommandInfo = - new CommandInfo( + InteractionInfo testClustertestEnumsRequestInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .testEnumsRequest( @@ -7503,8 +7703,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedTestEnumsResponseCallback(), testClustertestEnumsRequestCommandParams); - testClusterClusterCommandInfoMap.put( - "testEnumsRequest", testClustertestEnumsRequestCommandInfo); + testClusterClusterInteractionInfoMap.put( + "testEnumsRequest", testClustertestEnumsRequestInteractionInfo); Map testClustertestListInt8UArgumentRequestCommandParams = new LinkedHashMap(); CommandParameterInfo testClustertestListInt8UArgumentRequestarg1CommandParameterInfo = @@ -7513,8 +7713,8 @@ public Map getCommandMap(Map clusterMa "arg1", testClustertestListInt8UArgumentRequestarg1CommandParameterInfo); // Populate commands - CommandInfo testClustertestListInt8UArgumentRequestCommandInfo = - new CommandInfo( + InteractionInfo testClustertestListInt8UArgumentRequestInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .testListInt8UArgumentRequest( @@ -7523,8 +7723,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedBooleanResponseCallback(), testClustertestListInt8UArgumentRequestCommandParams); - testClusterClusterCommandInfoMap.put( - "testListInt8UArgumentRequest", testClustertestListInt8UArgumentRequestCommandInfo); + testClusterClusterInteractionInfoMap.put( + "testListInt8UArgumentRequest", testClustertestListInt8UArgumentRequestInteractionInfo); Map testClustertestListInt8UReverseRequestCommandParams = new LinkedHashMap(); CommandParameterInfo testClustertestListInt8UReverseRequestarg1CommandParameterInfo = @@ -7533,8 +7733,8 @@ public Map getCommandMap(Map clusterMa "arg1", testClustertestListInt8UReverseRequestarg1CommandParameterInfo); // Populate commands - CommandInfo testClustertestListInt8UReverseRequestCommandInfo = - new CommandInfo( + InteractionInfo testClustertestListInt8UReverseRequestInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .testListInt8UReverseRequest( @@ -7544,8 +7744,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedTestListInt8UReverseResponseCallback(), testClustertestListInt8UReverseRequestCommandParams); - testClusterClusterCommandInfoMap.put( - "testListInt8UReverseRequest", testClustertestListInt8UReverseRequestCommandInfo); + testClusterClusterInteractionInfoMap.put( + "testListInt8UReverseRequest", testClustertestListInt8UReverseRequestInteractionInfo); Map testClustertestListStructArgumentRequestCommandParams = new LinkedHashMap(); CommandParameterInfo testClustertestListStructArgumentRequestaCommandParameterInfo = @@ -7579,8 +7779,8 @@ public Map getCommandMap(Map clusterMa "f", testClustertestListStructArgumentRequestfCommandParameterInfo); // Populate commands - CommandInfo testClustertestListStructArgumentRequestCommandInfo = - new CommandInfo( + InteractionInfo testClustertestListStructArgumentRequestInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .testListStructArgumentRequest( @@ -7594,20 +7794,21 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedBooleanResponseCallback(), testClustertestListStructArgumentRequestCommandParams); - testClusterClusterCommandInfoMap.put( - "testListStructArgumentRequest", testClustertestListStructArgumentRequestCommandInfo); + testClusterClusterInteractionInfoMap.put( + "testListStructArgumentRequest", testClustertestListStructArgumentRequestInteractionInfo); Map testClustertestNotHandledCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo testClustertestNotHandledCommandInfo = - new CommandInfo( + InteractionInfo testClustertestNotHandledInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .testNotHandled((DefaultClusterCallback) callback); }, () -> new DelegatedDefaultClusterCallback(), testClustertestNotHandledCommandParams); - testClusterClusterCommandInfoMap.put("testNotHandled", testClustertestNotHandledCommandInfo); + testClusterClusterInteractionInfoMap.put( + "testNotHandled", testClustertestNotHandledInteractionInfo); Map testClustertestNullableOptionalRequestCommandParams = new LinkedHashMap(); CommandParameterInfo testClustertestNullableOptionalRequestarg1CommandParameterInfo = @@ -7616,8 +7817,8 @@ public Map getCommandMap(Map clusterMa "arg1", testClustertestNullableOptionalRequestarg1CommandParameterInfo); // Populate commands - CommandInfo testClustertestNullableOptionalRequestCommandInfo = - new CommandInfo( + InteractionInfo testClustertestNullableOptionalRequestInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .testNullableOptionalRequest( @@ -7627,13 +7828,13 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedTestNullableOptionalResponseCallback(), testClustertestNullableOptionalRequestCommandParams); - testClusterClusterCommandInfoMap.put( - "testNullableOptionalRequest", testClustertestNullableOptionalRequestCommandInfo); + testClusterClusterInteractionInfoMap.put( + "testNullableOptionalRequest", testClustertestNullableOptionalRequestInteractionInfo); Map testClustertestSpecificCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo testClustertestSpecificCommandInfo = - new CommandInfo( + InteractionInfo testClustertestSpecificInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .testSpecific( @@ -7641,7 +7842,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedTestSpecificResponseCallback(), testClustertestSpecificCommandParams); - testClusterClusterCommandInfoMap.put("testSpecific", testClustertestSpecificCommandInfo); + testClusterClusterInteractionInfoMap.put( + "testSpecific", testClustertestSpecificInteractionInfo); Map testClustertestStructArgumentRequestCommandParams = new LinkedHashMap(); CommandParameterInfo testClustertestStructArgumentRequestaCommandParameterInfo = @@ -7675,8 +7877,8 @@ public Map getCommandMap(Map clusterMa "f", testClustertestStructArgumentRequestfCommandParameterInfo); // Populate commands - CommandInfo testClustertestStructArgumentRequestCommandInfo = - new CommandInfo( + InteractionInfo testClustertestStructArgumentRequestInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .testStructArgumentRequest( @@ -7690,54 +7892,49 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedBooleanResponseCallback(), testClustertestStructArgumentRequestCommandParams); - testClusterClusterCommandInfoMap.put( - "testStructArgumentRequest", testClustertestStructArgumentRequestCommandInfo); + testClusterClusterInteractionInfoMap.put( + "testStructArgumentRequest", testClustertestStructArgumentRequestInteractionInfo); Map testClustertestUnknownCommandCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo testClustertestUnknownCommandCommandInfo = - new CommandInfo( + InteractionInfo testClustertestUnknownCommandInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .testUnknownCommand((DefaultClusterCallback) callback); }, () -> new DelegatedDefaultClusterCallback(), testClustertestUnknownCommandCommandParams); - testClusterClusterCommandInfoMap.put( - "testUnknownCommand", testClustertestUnknownCommandCommandInfo); - // Populate cluster - ClusterInfo testClusterClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.TestClusterCluster(ptr, endpointId), - testClusterClusterCommandInfoMap); - clusterMap.put("testCluster", testClusterClusterInfo); - Map thermostatClusterCommandInfoMap = new LinkedHashMap<>(); + testClusterClusterInteractionInfoMap.put( + "testUnknownCommand", testClustertestUnknownCommandInteractionInfo); + commandMap.put("testCluster", testClusterClusterInteractionInfoMap); + Map thermostatClusterInteractionInfoMap = new LinkedHashMap<>(); Map thermostatclearWeeklyScheduleCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo thermostatclearWeeklyScheduleCommandInfo = - new CommandInfo( + InteractionInfo thermostatclearWeeklyScheduleInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThermostatCluster) cluster) .clearWeeklySchedule((DefaultClusterCallback) callback); }, () -> new DelegatedDefaultClusterCallback(), thermostatclearWeeklyScheduleCommandParams); - thermostatClusterCommandInfoMap.put( - "clearWeeklySchedule", thermostatclearWeeklyScheduleCommandInfo); + thermostatClusterInteractionInfoMap.put( + "clearWeeklySchedule", thermostatclearWeeklyScheduleInteractionInfo); Map thermostatgetRelayStatusLogCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo thermostatgetRelayStatusLogCommandInfo = - new CommandInfo( + InteractionInfo thermostatgetRelayStatusLogInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThermostatCluster) cluster) .getRelayStatusLog((DefaultClusterCallback) callback); }, () -> new DelegatedDefaultClusterCallback(), thermostatgetRelayStatusLogCommandParams); - thermostatClusterCommandInfoMap.put( - "getRelayStatusLog", thermostatgetRelayStatusLogCommandInfo); + thermostatClusterInteractionInfoMap.put( + "getRelayStatusLog", thermostatgetRelayStatusLogInteractionInfo); Map thermostatgetWeeklyScheduleCommandParams = new LinkedHashMap(); CommandParameterInfo thermostatgetWeeklyScheduledaysToReturnCommandParameterInfo = @@ -7751,8 +7948,8 @@ public Map getCommandMap(Map clusterMa "modeToReturn", thermostatgetWeeklySchedulemodeToReturnCommandParameterInfo); // Populate commands - CommandInfo thermostatgetWeeklyScheduleCommandInfo = - new CommandInfo( + InteractionInfo thermostatgetWeeklyScheduleInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThermostatCluster) cluster) .getWeeklySchedule( @@ -7762,8 +7959,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), thermostatgetWeeklyScheduleCommandParams); - thermostatClusterCommandInfoMap.put( - "getWeeklySchedule", thermostatgetWeeklyScheduleCommandInfo); + thermostatClusterInteractionInfoMap.put( + "getWeeklySchedule", thermostatgetWeeklyScheduleInteractionInfo); Map thermostatsetWeeklyScheduleCommandParams = new LinkedHashMap(); CommandParameterInfo @@ -7790,8 +7987,8 @@ public Map getCommandMap(Map clusterMa "payload", thermostatsetWeeklySchedulepayloadCommandParameterInfo); // Populate commands - CommandInfo thermostatsetWeeklyScheduleCommandInfo = - new CommandInfo( + InteractionInfo thermostatsetWeeklyScheduleInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThermostatCluster) cluster) .setWeeklySchedule( @@ -7803,8 +8000,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), thermostatsetWeeklyScheduleCommandParams); - thermostatClusterCommandInfoMap.put( - "setWeeklySchedule", thermostatsetWeeklyScheduleCommandInfo); + thermostatClusterInteractionInfoMap.put( + "setWeeklySchedule", thermostatsetWeeklyScheduleInteractionInfo); Map thermostatsetpointRaiseLowerCommandParams = new LinkedHashMap(); CommandParameterInfo thermostatsetpointRaiseLowermodeCommandParameterInfo = @@ -7818,8 +8015,8 @@ public Map getCommandMap(Map clusterMa "amount", thermostatsetpointRaiseLoweramountCommandParameterInfo); // Populate commands - CommandInfo thermostatsetpointRaiseLowerCommandInfo = - new CommandInfo( + InteractionInfo thermostatsetpointRaiseLowerInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThermostatCluster) cluster) .setpointRaiseLower( @@ -7829,84 +8026,62 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), thermostatsetpointRaiseLowerCommandParams); - thermostatClusterCommandInfoMap.put( - "setpointRaiseLower", thermostatsetpointRaiseLowerCommandInfo); - // Populate cluster - ClusterInfo thermostatClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.ThermostatCluster(ptr, endpointId), - thermostatClusterCommandInfoMap); - clusterMap.put("thermostat", thermostatClusterInfo); - Map thermostatUserInterfaceConfigurationClusterCommandInfoMap = + thermostatClusterInteractionInfoMap.put( + "setpointRaiseLower", thermostatsetpointRaiseLowerInteractionInfo); + commandMap.put("thermostat", thermostatClusterInteractionInfoMap); + Map thermostatUserInterfaceConfigurationClusterInteractionInfoMap = + new LinkedHashMap<>(); + commandMap.put( + "thermostatUserInterfaceConfiguration", + thermostatUserInterfaceConfigurationClusterInteractionInfoMap); + Map threadNetworkDiagnosticsClusterInteractionInfoMap = new LinkedHashMap<>(); - // Populate cluster - ClusterInfo thermostatUserInterfaceConfigurationClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> - new ChipClusters.ThermostatUserInterfaceConfigurationCluster(ptr, endpointId), - thermostatUserInterfaceConfigurationClusterCommandInfoMap); - clusterMap.put( - "thermostatUserInterfaceConfiguration", thermostatUserInterfaceConfigurationClusterInfo); - Map threadNetworkDiagnosticsClusterCommandInfoMap = new LinkedHashMap<>(); Map threadNetworkDiagnosticsresetCountsCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo threadNetworkDiagnosticsresetCountsCommandInfo = - new CommandInfo( + InteractionInfo threadNetworkDiagnosticsresetCountsInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .resetCounts((DefaultClusterCallback) callback); }, () -> new DelegatedDefaultClusterCallback(), threadNetworkDiagnosticsresetCountsCommandParams); - threadNetworkDiagnosticsClusterCommandInfoMap.put( - "resetCounts", threadNetworkDiagnosticsresetCountsCommandInfo); - // Populate cluster - ClusterInfo threadNetworkDiagnosticsClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.ThreadNetworkDiagnosticsCluster(ptr, endpointId), - threadNetworkDiagnosticsClusterCommandInfoMap); - clusterMap.put("threadNetworkDiagnostics", threadNetworkDiagnosticsClusterInfo); - Map wakeOnLanClusterCommandInfoMap = new LinkedHashMap<>(); - // Populate cluster - ClusterInfo wakeOnLanClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.WakeOnLanCluster(ptr, endpointId), - wakeOnLanClusterCommandInfoMap); - clusterMap.put("wakeOnLan", wakeOnLanClusterInfo); - Map wiFiNetworkDiagnosticsClusterCommandInfoMap = new LinkedHashMap<>(); + threadNetworkDiagnosticsClusterInteractionInfoMap.put( + "resetCounts", threadNetworkDiagnosticsresetCountsInteractionInfo); + commandMap.put("threadNetworkDiagnostics", threadNetworkDiagnosticsClusterInteractionInfoMap); + Map wakeOnLanClusterInteractionInfoMap = new LinkedHashMap<>(); + commandMap.put("wakeOnLan", wakeOnLanClusterInteractionInfoMap); + Map wiFiNetworkDiagnosticsClusterInteractionInfoMap = + new LinkedHashMap<>(); Map wiFiNetworkDiagnosticsresetCountsCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo wiFiNetworkDiagnosticsresetCountsCommandInfo = - new CommandInfo( + InteractionInfo wiFiNetworkDiagnosticsresetCountsInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) .resetCounts((DefaultClusterCallback) callback); }, () -> new DelegatedDefaultClusterCallback(), wiFiNetworkDiagnosticsresetCountsCommandParams); - wiFiNetworkDiagnosticsClusterCommandInfoMap.put( - "resetCounts", wiFiNetworkDiagnosticsresetCountsCommandInfo); - // Populate cluster - ClusterInfo wiFiNetworkDiagnosticsClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.WiFiNetworkDiagnosticsCluster(ptr, endpointId), - wiFiNetworkDiagnosticsClusterCommandInfoMap); - clusterMap.put("wiFiNetworkDiagnostics", wiFiNetworkDiagnosticsClusterInfo); - Map windowCoveringClusterCommandInfoMap = new LinkedHashMap<>(); + wiFiNetworkDiagnosticsClusterInteractionInfoMap.put( + "resetCounts", wiFiNetworkDiagnosticsresetCountsInteractionInfo); + commandMap.put("wiFiNetworkDiagnostics", wiFiNetworkDiagnosticsClusterInteractionInfoMap); + Map windowCoveringClusterInteractionInfoMap = new LinkedHashMap<>(); Map windowCoveringdownOrCloseCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo windowCoveringdownOrCloseCommandInfo = - new CommandInfo( + InteractionInfo windowCoveringdownOrCloseInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .downOrClose((DefaultClusterCallback) callback); }, () -> new DelegatedDefaultClusterCallback(), windowCoveringdownOrCloseCommandParams); - windowCoveringClusterCommandInfoMap.put("downOrClose", windowCoveringdownOrCloseCommandInfo); + windowCoveringClusterInteractionInfoMap.put( + "downOrClose", windowCoveringdownOrCloseInteractionInfo); Map windowCoveringgoToLiftPercentageCommandParams = new LinkedHashMap(); CommandParameterInfo windowCoveringgoToLiftPercentageliftPercentageValueCommandParameterInfo = @@ -7923,8 +8098,8 @@ public Map getCommandMap(Map clusterMa windowCoveringgoToLiftPercentageliftPercent100thsValueCommandParameterInfo); // Populate commands - CommandInfo windowCoveringgoToLiftPercentageCommandInfo = - new CommandInfo( + InteractionInfo windowCoveringgoToLiftPercentageInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .goToLiftPercentage( @@ -7934,8 +8109,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), windowCoveringgoToLiftPercentageCommandParams); - windowCoveringClusterCommandInfoMap.put( - "goToLiftPercentage", windowCoveringgoToLiftPercentageCommandInfo); + windowCoveringClusterInteractionInfoMap.put( + "goToLiftPercentage", windowCoveringgoToLiftPercentageInteractionInfo); Map windowCoveringgoToLiftValueCommandParams = new LinkedHashMap(); CommandParameterInfo windowCoveringgoToLiftValueliftValueCommandParameterInfo = @@ -7944,8 +8119,8 @@ public Map getCommandMap(Map clusterMa "liftValue", windowCoveringgoToLiftValueliftValueCommandParameterInfo); // Populate commands - CommandInfo windowCoveringgoToLiftValueCommandInfo = - new CommandInfo( + InteractionInfo windowCoveringgoToLiftValueInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .goToLiftValue( @@ -7954,8 +8129,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), windowCoveringgoToLiftValueCommandParams); - windowCoveringClusterCommandInfoMap.put( - "goToLiftValue", windowCoveringgoToLiftValueCommandInfo); + windowCoveringClusterInteractionInfoMap.put( + "goToLiftValue", windowCoveringgoToLiftValueInteractionInfo); Map windowCoveringgoToTiltPercentageCommandParams = new LinkedHashMap(); CommandParameterInfo windowCoveringgoToTiltPercentagetiltPercentageValueCommandParameterInfo = @@ -7972,8 +8147,8 @@ public Map getCommandMap(Map clusterMa windowCoveringgoToTiltPercentagetiltPercent100thsValueCommandParameterInfo); // Populate commands - CommandInfo windowCoveringgoToTiltPercentageCommandInfo = - new CommandInfo( + InteractionInfo windowCoveringgoToTiltPercentageInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .goToTiltPercentage( @@ -7983,8 +8158,8 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), windowCoveringgoToTiltPercentageCommandParams); - windowCoveringClusterCommandInfoMap.put( - "goToTiltPercentage", windowCoveringgoToTiltPercentageCommandInfo); + windowCoveringClusterInteractionInfoMap.put( + "goToTiltPercentage", windowCoveringgoToTiltPercentageInteractionInfo); Map windowCoveringgoToTiltValueCommandParams = new LinkedHashMap(); CommandParameterInfo windowCoveringgoToTiltValuetiltValueCommandParameterInfo = @@ -7993,8 +8168,8 @@ public Map getCommandMap(Map clusterMa "tiltValue", windowCoveringgoToTiltValuetiltValueCommandParameterInfo); // Populate commands - CommandInfo windowCoveringgoToTiltValueCommandInfo = - new CommandInfo( + InteractionInfo windowCoveringgoToTiltValueInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .goToTiltValue( @@ -8003,107 +8178,102 @@ public Map getCommandMap(Map clusterMa }, () -> new DelegatedDefaultClusterCallback(), windowCoveringgoToTiltValueCommandParams); - windowCoveringClusterCommandInfoMap.put( - "goToTiltValue", windowCoveringgoToTiltValueCommandInfo); + windowCoveringClusterInteractionInfoMap.put( + "goToTiltValue", windowCoveringgoToTiltValueInteractionInfo); Map windowCoveringstopMotionCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo windowCoveringstopMotionCommandInfo = - new CommandInfo( + InteractionInfo windowCoveringstopMotionInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .stopMotion((DefaultClusterCallback) callback); }, () -> new DelegatedDefaultClusterCallback(), windowCoveringstopMotionCommandParams); - windowCoveringClusterCommandInfoMap.put("stopMotion", windowCoveringstopMotionCommandInfo); + windowCoveringClusterInteractionInfoMap.put( + "stopMotion", windowCoveringstopMotionInteractionInfo); Map windowCoveringupOrOpenCommandParams = new LinkedHashMap(); // Populate commands - CommandInfo windowCoveringupOrOpenCommandInfo = - new CommandInfo( + InteractionInfo windowCoveringupOrOpenInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .upOrOpen((DefaultClusterCallback) callback); }, () -> new DelegatedDefaultClusterCallback(), windowCoveringupOrOpenCommandParams); - windowCoveringClusterCommandInfoMap.put("upOrOpen", windowCoveringupOrOpenCommandInfo); - // Populate cluster - ClusterInfo windowCoveringClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.WindowCoveringCluster(ptr, endpointId), - windowCoveringClusterCommandInfoMap); - clusterMap.put("windowCovering", windowCoveringClusterInfo); - return clusterMap; + windowCoveringClusterInteractionInfoMap.put("upOrOpen", windowCoveringupOrOpenInteractionInfo); + commandMap.put("windowCovering", windowCoveringClusterInteractionInfoMap); + return commandMap; } - public Map getReadAttributeMap(Map clusterMap) { - Map readAccountLoginCommandInfo = new LinkedHashMap<>(); + public Map> getReadAttributeMap() { + Map> readAttributeMap = new HashMap<>(); + Map readAccountLoginInteractionInfo = new LinkedHashMap<>(); // read attribute Map readAccountLoginClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readAccountLoginClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readAccountLoginClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.AccountLoginCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readAccountLoginClusterRevisionCommandParams); - readAccountLoginCommandInfo.put( - "readClusterRevisionAttribute", readAccountLoginClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("accountLogin").combineCommands(readAccountLoginCommandInfo); - Map readAdministratorCommissioningCommandInfo = new LinkedHashMap<>(); + readAccountLoginInteractionInfo.put( + "readClusterRevisionAttribute", readAccountLoginClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("accountLogin", readAccountLoginInteractionInfo); + Map readAdministratorCommissioningInteractionInfo = + new LinkedHashMap<>(); // read attribute Map readAdministratorCommissioningClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readAdministratorCommissioningClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readAdministratorCommissioningClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.AdministratorCommissioningCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readAdministratorCommissioningClusterRevisionCommandParams); - readAdministratorCommissioningCommandInfo.put( + readAdministratorCommissioningInteractionInfo.put( "readClusterRevisionAttribute", - readAdministratorCommissioningClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap - .get("administratorCommissioning") - .combineCommands(readAdministratorCommissioningCommandInfo); - Map readApplicationBasicCommandInfo = new LinkedHashMap<>(); + readAdministratorCommissioningClusterRevisionAttributeInteractionInfo); + readAttributeMap.put( + "administratorCommissioning", readAdministratorCommissioningInteractionInfo); + Map readApplicationBasicInteractionInfo = new LinkedHashMap<>(); // read attribute Map readApplicationBasicVendorNameCommandParams = new LinkedHashMap(); - CommandInfo readApplicationBasicVendorNameAttributeCommandInfo = - new CommandInfo( + InteractionInfo readApplicationBasicVendorNameAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ApplicationBasicCluster) cluster) .readVendorNameAttribute((ChipClusters.CharStringAttributeCallback) callback); }, () -> new DelegatedCharStringAttributeCallback(), readApplicationBasicVendorNameCommandParams); - readApplicationBasicCommandInfo.put( - "readVendorNameAttribute", readApplicationBasicVendorNameAttributeCommandInfo); + readApplicationBasicInteractionInfo.put( + "readVendorNameAttribute", readApplicationBasicVendorNameAttributeInteractionInfo); Map readApplicationBasicVendorIdCommandParams = new LinkedHashMap(); - CommandInfo readApplicationBasicVendorIdAttributeCommandInfo = - new CommandInfo( + InteractionInfo readApplicationBasicVendorIdAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ApplicationBasicCluster) cluster) .readVendorIdAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readApplicationBasicVendorIdCommandParams); - readApplicationBasicCommandInfo.put( - "readVendorIdAttribute", readApplicationBasicVendorIdAttributeCommandInfo); + readApplicationBasicInteractionInfo.put( + "readVendorIdAttribute", readApplicationBasicVendorIdAttributeInteractionInfo); Map readApplicationBasicApplicationNameCommandParams = new LinkedHashMap(); - CommandInfo readApplicationBasicApplicationNameAttributeCommandInfo = - new CommandInfo( + InteractionInfo readApplicationBasicApplicationNameAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ApplicationBasicCluster) cluster) .readApplicationNameAttribute( @@ -8111,77 +8281,79 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedCharStringAttributeCallback(), readApplicationBasicApplicationNameCommandParams); - readApplicationBasicCommandInfo.put( - "readApplicationNameAttribute", readApplicationBasicApplicationNameAttributeCommandInfo); + readApplicationBasicInteractionInfo.put( + "readApplicationNameAttribute", + readApplicationBasicApplicationNameAttributeInteractionInfo); Map readApplicationBasicProductIdCommandParams = new LinkedHashMap(); - CommandInfo readApplicationBasicProductIdAttributeCommandInfo = - new CommandInfo( + InteractionInfo readApplicationBasicProductIdAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ApplicationBasicCluster) cluster) .readProductIdAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readApplicationBasicProductIdCommandParams); - readApplicationBasicCommandInfo.put( - "readProductIdAttribute", readApplicationBasicProductIdAttributeCommandInfo); + readApplicationBasicInteractionInfo.put( + "readProductIdAttribute", readApplicationBasicProductIdAttributeInteractionInfo); Map readApplicationBasicApplicationIdCommandParams = new LinkedHashMap(); - CommandInfo readApplicationBasicApplicationIdAttributeCommandInfo = - new CommandInfo( + InteractionInfo readApplicationBasicApplicationIdAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ApplicationBasicCluster) cluster) .readApplicationIdAttribute((ChipClusters.CharStringAttributeCallback) callback); }, () -> new DelegatedCharStringAttributeCallback(), readApplicationBasicApplicationIdCommandParams); - readApplicationBasicCommandInfo.put( - "readApplicationIdAttribute", readApplicationBasicApplicationIdAttributeCommandInfo); + readApplicationBasicInteractionInfo.put( + "readApplicationIdAttribute", readApplicationBasicApplicationIdAttributeInteractionInfo); Map readApplicationBasicCatalogVendorIdCommandParams = new LinkedHashMap(); - CommandInfo readApplicationBasicCatalogVendorIdAttributeCommandInfo = - new CommandInfo( + InteractionInfo readApplicationBasicCatalogVendorIdAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ApplicationBasicCluster) cluster) .readCatalogVendorIdAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readApplicationBasicCatalogVendorIdCommandParams); - readApplicationBasicCommandInfo.put( - "readCatalogVendorIdAttribute", readApplicationBasicCatalogVendorIdAttributeCommandInfo); + readApplicationBasicInteractionInfo.put( + "readCatalogVendorIdAttribute", + readApplicationBasicCatalogVendorIdAttributeInteractionInfo); Map readApplicationBasicApplicationStatusCommandParams = new LinkedHashMap(); - CommandInfo readApplicationBasicApplicationStatusAttributeCommandInfo = - new CommandInfo( + InteractionInfo readApplicationBasicApplicationStatusAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ApplicationBasicCluster) cluster) .readApplicationStatusAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readApplicationBasicApplicationStatusCommandParams); - readApplicationBasicCommandInfo.put( + readApplicationBasicInteractionInfo.put( "readApplicationStatusAttribute", - readApplicationBasicApplicationStatusAttributeCommandInfo); + readApplicationBasicApplicationStatusAttributeInteractionInfo); Map readApplicationBasicClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readApplicationBasicClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readApplicationBasicClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ApplicationBasicCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readApplicationBasicClusterRevisionCommandParams); - readApplicationBasicCommandInfo.put( - "readClusterRevisionAttribute", readApplicationBasicClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("applicationBasic").combineCommands(readApplicationBasicCommandInfo); - Map readApplicationLauncherCommandInfo = new LinkedHashMap<>(); + readApplicationBasicInteractionInfo.put( + "readClusterRevisionAttribute", + readApplicationBasicClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("applicationBasic", readApplicationBasicInteractionInfo); + Map readApplicationLauncherInteractionInfo = new LinkedHashMap<>(); // read attribute Map readApplicationLauncherApplicationLauncherListCommandParams = new LinkedHashMap(); - CommandInfo readApplicationLauncherApplicationLauncherListAttributeCommandInfo = - new CommandInfo( + InteractionInfo readApplicationLauncherApplicationLauncherListAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ApplicationLauncherCluster) cluster) .readApplicationLauncherListAttribute( @@ -8191,53 +8363,54 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedApplicationLauncherListAttributeCallback(), readApplicationLauncherApplicationLauncherListCommandParams); - readApplicationLauncherCommandInfo.put( + readApplicationLauncherInteractionInfo.put( "readApplicationLauncherListAttribute", - readApplicationLauncherApplicationLauncherListAttributeCommandInfo); + readApplicationLauncherApplicationLauncherListAttributeInteractionInfo); Map readApplicationLauncherCatalogVendorIdCommandParams = new LinkedHashMap(); - CommandInfo readApplicationLauncherCatalogVendorIdAttributeCommandInfo = - new CommandInfo( + InteractionInfo readApplicationLauncherCatalogVendorIdAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ApplicationLauncherCluster) cluster) .readCatalogVendorIdAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readApplicationLauncherCatalogVendorIdCommandParams); - readApplicationLauncherCommandInfo.put( - "readCatalogVendorIdAttribute", readApplicationLauncherCatalogVendorIdAttributeCommandInfo); + readApplicationLauncherInteractionInfo.put( + "readCatalogVendorIdAttribute", + readApplicationLauncherCatalogVendorIdAttributeInteractionInfo); Map readApplicationLauncherApplicationIdCommandParams = new LinkedHashMap(); - CommandInfo readApplicationLauncherApplicationIdAttributeCommandInfo = - new CommandInfo( + InteractionInfo readApplicationLauncherApplicationIdAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ApplicationLauncherCluster) cluster) .readApplicationIdAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readApplicationLauncherApplicationIdCommandParams); - readApplicationLauncherCommandInfo.put( - "readApplicationIdAttribute", readApplicationLauncherApplicationIdAttributeCommandInfo); + readApplicationLauncherInteractionInfo.put( + "readApplicationIdAttribute", readApplicationLauncherApplicationIdAttributeInteractionInfo); Map readApplicationLauncherClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readApplicationLauncherClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readApplicationLauncherClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ApplicationLauncherCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readApplicationLauncherClusterRevisionCommandParams); - readApplicationLauncherCommandInfo.put( - "readClusterRevisionAttribute", readApplicationLauncherClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("applicationLauncher").combineCommands(readApplicationLauncherCommandInfo); - Map readAudioOutputCommandInfo = new LinkedHashMap<>(); + readApplicationLauncherInteractionInfo.put( + "readClusterRevisionAttribute", + readApplicationLauncherClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("applicationLauncher", readApplicationLauncherInteractionInfo); + Map readAudioOutputInteractionInfo = new LinkedHashMap<>(); // read attribute Map readAudioOutputAudioOutputListCommandParams = new LinkedHashMap(); - CommandInfo readAudioOutputAudioOutputListAttributeCommandInfo = - new CommandInfo( + InteractionInfo readAudioOutputAudioOutputListAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.AudioOutputCluster) cluster) .readAudioOutputListAttribute( @@ -8245,12 +8418,12 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedAudioOutputListAttributeCallback(), readAudioOutputAudioOutputListCommandParams); - readAudioOutputCommandInfo.put( - "readAudioOutputListAttribute", readAudioOutputAudioOutputListAttributeCommandInfo); + readAudioOutputInteractionInfo.put( + "readAudioOutputListAttribute", readAudioOutputAudioOutputListAttributeInteractionInfo); Map readAudioOutputCurrentAudioOutputCommandParams = new LinkedHashMap(); - CommandInfo readAudioOutputCurrentAudioOutputAttributeCommandInfo = - new CommandInfo( + InteractionInfo readAudioOutputCurrentAudioOutputAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.AudioOutputCluster) cluster) .readCurrentAudioOutputAttribute( @@ -8258,28 +8431,28 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readAudioOutputCurrentAudioOutputCommandParams); - readAudioOutputCommandInfo.put( - "readCurrentAudioOutputAttribute", readAudioOutputCurrentAudioOutputAttributeCommandInfo); + readAudioOutputInteractionInfo.put( + "readCurrentAudioOutputAttribute", + readAudioOutputCurrentAudioOutputAttributeInteractionInfo); Map readAudioOutputClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readAudioOutputClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readAudioOutputClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.AudioOutputCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readAudioOutputClusterRevisionCommandParams); - readAudioOutputCommandInfo.put( - "readClusterRevisionAttribute", readAudioOutputClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("audioOutput").combineCommands(readAudioOutputCommandInfo); - Map readBarrierControlCommandInfo = new LinkedHashMap<>(); + readAudioOutputInteractionInfo.put( + "readClusterRevisionAttribute", readAudioOutputClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("audioOutput", readAudioOutputInteractionInfo); + Map readBarrierControlInteractionInfo = new LinkedHashMap<>(); // read attribute Map readBarrierControlBarrierMovingStateCommandParams = new LinkedHashMap(); - CommandInfo readBarrierControlBarrierMovingStateAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBarrierControlBarrierMovingStateAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BarrierControlCluster) cluster) .readBarrierMovingStateAttribute( @@ -8287,13 +8460,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readBarrierControlBarrierMovingStateCommandParams); - readBarrierControlCommandInfo.put( + readBarrierControlInteractionInfo.put( "readBarrierMovingStateAttribute", - readBarrierControlBarrierMovingStateAttributeCommandInfo); + readBarrierControlBarrierMovingStateAttributeInteractionInfo); Map readBarrierControlBarrierSafetyStatusCommandParams = new LinkedHashMap(); - CommandInfo readBarrierControlBarrierSafetyStatusAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBarrierControlBarrierSafetyStatusAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BarrierControlCluster) cluster) .readBarrierSafetyStatusAttribute( @@ -8301,13 +8474,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readBarrierControlBarrierSafetyStatusCommandParams); - readBarrierControlCommandInfo.put( + readBarrierControlInteractionInfo.put( "readBarrierSafetyStatusAttribute", - readBarrierControlBarrierSafetyStatusAttributeCommandInfo); + readBarrierControlBarrierSafetyStatusAttributeInteractionInfo); Map readBarrierControlBarrierCapabilitiesCommandParams = new LinkedHashMap(); - CommandInfo readBarrierControlBarrierCapabilitiesAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBarrierControlBarrierCapabilitiesAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BarrierControlCluster) cluster) .readBarrierCapabilitiesAttribute( @@ -8315,41 +8488,40 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readBarrierControlBarrierCapabilitiesCommandParams); - readBarrierControlCommandInfo.put( + readBarrierControlInteractionInfo.put( "readBarrierCapabilitiesAttribute", - readBarrierControlBarrierCapabilitiesAttributeCommandInfo); + readBarrierControlBarrierCapabilitiesAttributeInteractionInfo); Map readBarrierControlBarrierPositionCommandParams = new LinkedHashMap(); - CommandInfo readBarrierControlBarrierPositionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBarrierControlBarrierPositionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BarrierControlCluster) cluster) .readBarrierPositionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readBarrierControlBarrierPositionCommandParams); - readBarrierControlCommandInfo.put( - "readBarrierPositionAttribute", readBarrierControlBarrierPositionAttributeCommandInfo); + readBarrierControlInteractionInfo.put( + "readBarrierPositionAttribute", readBarrierControlBarrierPositionAttributeInteractionInfo); Map readBarrierControlClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readBarrierControlClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBarrierControlClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BarrierControlCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readBarrierControlClusterRevisionCommandParams); - readBarrierControlCommandInfo.put( - "readClusterRevisionAttribute", readBarrierControlClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("barrierControl").combineCommands(readBarrierControlCommandInfo); - Map readBasicCommandInfo = new LinkedHashMap<>(); + readBarrierControlInteractionInfo.put( + "readClusterRevisionAttribute", readBarrierControlClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("barrierControl", readBarrierControlInteractionInfo); + Map readBasicInteractionInfo = new LinkedHashMap<>(); // read attribute Map readBasicInteractionModelVersionCommandParams = new LinkedHashMap(); - CommandInfo readBasicInteractionModelVersionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBasicInteractionModelVersionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BasicCluster) cluster) .readInteractionModelVersionAttribute( @@ -8357,91 +8529,97 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readBasicInteractionModelVersionCommandParams); - readBasicCommandInfo.put( + readBasicInteractionInfo.put( "readInteractionModelVersionAttribute", - readBasicInteractionModelVersionAttributeCommandInfo); + readBasicInteractionModelVersionAttributeInteractionInfo); Map readBasicVendorNameCommandParams = new LinkedHashMap(); - CommandInfo readBasicVendorNameAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBasicVendorNameAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BasicCluster) cluster) .readVendorNameAttribute((ChipClusters.CharStringAttributeCallback) callback); }, () -> new DelegatedCharStringAttributeCallback(), readBasicVendorNameCommandParams); - readBasicCommandInfo.put("readVendorNameAttribute", readBasicVendorNameAttributeCommandInfo); + readBasicInteractionInfo.put( + "readVendorNameAttribute", readBasicVendorNameAttributeInteractionInfo); Map readBasicVendorIDCommandParams = new LinkedHashMap(); - CommandInfo readBasicVendorIDAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBasicVendorIDAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BasicCluster) cluster) .readVendorIDAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readBasicVendorIDCommandParams); - readBasicCommandInfo.put("readVendorIDAttribute", readBasicVendorIDAttributeCommandInfo); + readBasicInteractionInfo.put( + "readVendorIDAttribute", readBasicVendorIDAttributeInteractionInfo); Map readBasicProductNameCommandParams = new LinkedHashMap(); - CommandInfo readBasicProductNameAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBasicProductNameAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BasicCluster) cluster) .readProductNameAttribute((ChipClusters.CharStringAttributeCallback) callback); }, () -> new DelegatedCharStringAttributeCallback(), readBasicProductNameCommandParams); - readBasicCommandInfo.put("readProductNameAttribute", readBasicProductNameAttributeCommandInfo); + readBasicInteractionInfo.put( + "readProductNameAttribute", readBasicProductNameAttributeInteractionInfo); Map readBasicProductIDCommandParams = new LinkedHashMap(); - CommandInfo readBasicProductIDAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBasicProductIDAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BasicCluster) cluster) .readProductIDAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readBasicProductIDCommandParams); - readBasicCommandInfo.put("readProductIDAttribute", readBasicProductIDAttributeCommandInfo); + readBasicInteractionInfo.put( + "readProductIDAttribute", readBasicProductIDAttributeInteractionInfo); Map readBasicUserLabelCommandParams = new LinkedHashMap(); - CommandInfo readBasicUserLabelAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBasicUserLabelAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BasicCluster) cluster) .readUserLabelAttribute((ChipClusters.CharStringAttributeCallback) callback); }, () -> new DelegatedCharStringAttributeCallback(), readBasicUserLabelCommandParams); - readBasicCommandInfo.put("readUserLabelAttribute", readBasicUserLabelAttributeCommandInfo); + readBasicInteractionInfo.put( + "readUserLabelAttribute", readBasicUserLabelAttributeInteractionInfo); Map readBasicLocationCommandParams = new LinkedHashMap(); - CommandInfo readBasicLocationAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBasicLocationAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BasicCluster) cluster) .readLocationAttribute((ChipClusters.CharStringAttributeCallback) callback); }, () -> new DelegatedCharStringAttributeCallback(), readBasicLocationCommandParams); - readBasicCommandInfo.put("readLocationAttribute", readBasicLocationAttributeCommandInfo); + readBasicInteractionInfo.put( + "readLocationAttribute", readBasicLocationAttributeInteractionInfo); Map readBasicHardwareVersionCommandParams = new LinkedHashMap(); - CommandInfo readBasicHardwareVersionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBasicHardwareVersionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BasicCluster) cluster) .readHardwareVersionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readBasicHardwareVersionCommandParams); - readBasicCommandInfo.put( - "readHardwareVersionAttribute", readBasicHardwareVersionAttributeCommandInfo); + readBasicInteractionInfo.put( + "readHardwareVersionAttribute", readBasicHardwareVersionAttributeInteractionInfo); Map readBasicHardwareVersionStringCommandParams = new LinkedHashMap(); - CommandInfo readBasicHardwareVersionStringAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBasicHardwareVersionStringAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BasicCluster) cluster) .readHardwareVersionStringAttribute( @@ -8449,24 +8627,25 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedCharStringAttributeCallback(), readBasicHardwareVersionStringCommandParams); - readBasicCommandInfo.put( - "readHardwareVersionStringAttribute", readBasicHardwareVersionStringAttributeCommandInfo); + readBasicInteractionInfo.put( + "readHardwareVersionStringAttribute", + readBasicHardwareVersionStringAttributeInteractionInfo); Map readBasicSoftwareVersionCommandParams = new LinkedHashMap(); - CommandInfo readBasicSoftwareVersionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBasicSoftwareVersionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BasicCluster) cluster) .readSoftwareVersionAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readBasicSoftwareVersionCommandParams); - readBasicCommandInfo.put( - "readSoftwareVersionAttribute", readBasicSoftwareVersionAttributeCommandInfo); + readBasicInteractionInfo.put( + "readSoftwareVersionAttribute", readBasicSoftwareVersionAttributeInteractionInfo); Map readBasicSoftwareVersionStringCommandParams = new LinkedHashMap(); - CommandInfo readBasicSoftwareVersionStringAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBasicSoftwareVersionStringAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BasicCluster) cluster) .readSoftwareVersionStringAttribute( @@ -8474,12 +8653,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedCharStringAttributeCallback(), readBasicSoftwareVersionStringCommandParams); - readBasicCommandInfo.put( - "readSoftwareVersionStringAttribute", readBasicSoftwareVersionStringAttributeCommandInfo); + readBasicInteractionInfo.put( + "readSoftwareVersionStringAttribute", + readBasicSoftwareVersionStringAttributeInteractionInfo); Map readBasicManufacturingDateCommandParams = new LinkedHashMap(); - CommandInfo readBasicManufacturingDateAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBasicManufacturingDateAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BasicCluster) cluster) .readManufacturingDateAttribute( @@ -8487,58 +8667,60 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedCharStringAttributeCallback(), readBasicManufacturingDateCommandParams); - readBasicCommandInfo.put( - "readManufacturingDateAttribute", readBasicManufacturingDateAttributeCommandInfo); + readBasicInteractionInfo.put( + "readManufacturingDateAttribute", readBasicManufacturingDateAttributeInteractionInfo); Map readBasicPartNumberCommandParams = new LinkedHashMap(); - CommandInfo readBasicPartNumberAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBasicPartNumberAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BasicCluster) cluster) .readPartNumberAttribute((ChipClusters.CharStringAttributeCallback) callback); }, () -> new DelegatedCharStringAttributeCallback(), readBasicPartNumberCommandParams); - readBasicCommandInfo.put("readPartNumberAttribute", readBasicPartNumberAttributeCommandInfo); + readBasicInteractionInfo.put( + "readPartNumberAttribute", readBasicPartNumberAttributeInteractionInfo); Map readBasicProductURLCommandParams = new LinkedHashMap(); - CommandInfo readBasicProductURLAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBasicProductURLAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BasicCluster) cluster) .readProductURLAttribute((ChipClusters.CharStringAttributeCallback) callback); }, () -> new DelegatedCharStringAttributeCallback(), readBasicProductURLCommandParams); - readBasicCommandInfo.put("readProductURLAttribute", readBasicProductURLAttributeCommandInfo); + readBasicInteractionInfo.put( + "readProductURLAttribute", readBasicProductURLAttributeInteractionInfo); Map readBasicProductLabelCommandParams = new LinkedHashMap(); - CommandInfo readBasicProductLabelAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBasicProductLabelAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BasicCluster) cluster) .readProductLabelAttribute((ChipClusters.CharStringAttributeCallback) callback); }, () -> new DelegatedCharStringAttributeCallback(), readBasicProductLabelCommandParams); - readBasicCommandInfo.put( - "readProductLabelAttribute", readBasicProductLabelAttributeCommandInfo); + readBasicInteractionInfo.put( + "readProductLabelAttribute", readBasicProductLabelAttributeInteractionInfo); Map readBasicSerialNumberCommandParams = new LinkedHashMap(); - CommandInfo readBasicSerialNumberAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBasicSerialNumberAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BasicCluster) cluster) .readSerialNumberAttribute((ChipClusters.CharStringAttributeCallback) callback); }, () -> new DelegatedCharStringAttributeCallback(), readBasicSerialNumberCommandParams); - readBasicCommandInfo.put( - "readSerialNumberAttribute", readBasicSerialNumberAttributeCommandInfo); + readBasicInteractionInfo.put( + "readSerialNumberAttribute", readBasicSerialNumberAttributeInteractionInfo); Map readBasicLocalConfigDisabledCommandParams = new LinkedHashMap(); - CommandInfo readBasicLocalConfigDisabledAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBasicLocalConfigDisabledAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BasicCluster) cluster) .readLocalConfigDisabledAttribute( @@ -8546,135 +8728,133 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedBooleanAttributeCallback(), readBasicLocalConfigDisabledCommandParams); - readBasicCommandInfo.put( - "readLocalConfigDisabledAttribute", readBasicLocalConfigDisabledAttributeCommandInfo); + readBasicInteractionInfo.put( + "readLocalConfigDisabledAttribute", readBasicLocalConfigDisabledAttributeInteractionInfo); Map readBasicReachableCommandParams = new LinkedHashMap(); - CommandInfo readBasicReachableAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBasicReachableAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BasicCluster) cluster) .readReachableAttribute((ChipClusters.BooleanAttributeCallback) callback); }, () -> new DelegatedBooleanAttributeCallback(), readBasicReachableCommandParams); - readBasicCommandInfo.put("readReachableAttribute", readBasicReachableAttributeCommandInfo); + readBasicInteractionInfo.put( + "readReachableAttribute", readBasicReachableAttributeInteractionInfo); Map readBasicClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readBasicClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBasicClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BasicCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readBasicClusterRevisionCommandParams); - readBasicCommandInfo.put( - "readClusterRevisionAttribute", readBasicClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("basic").combineCommands(readBasicCommandInfo); - Map readBinaryInputBasicCommandInfo = new LinkedHashMap<>(); + readBasicInteractionInfo.put( + "readClusterRevisionAttribute", readBasicClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("basic", readBasicInteractionInfo); + Map readBinaryInputBasicInteractionInfo = new LinkedHashMap<>(); // read attribute Map readBinaryInputBasicOutOfServiceCommandParams = new LinkedHashMap(); - CommandInfo readBinaryInputBasicOutOfServiceAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBinaryInputBasicOutOfServiceAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BinaryInputBasicCluster) cluster) .readOutOfServiceAttribute((ChipClusters.BooleanAttributeCallback) callback); }, () -> new DelegatedBooleanAttributeCallback(), readBinaryInputBasicOutOfServiceCommandParams); - readBinaryInputBasicCommandInfo.put( - "readOutOfServiceAttribute", readBinaryInputBasicOutOfServiceAttributeCommandInfo); + readBinaryInputBasicInteractionInfo.put( + "readOutOfServiceAttribute", readBinaryInputBasicOutOfServiceAttributeInteractionInfo); Map readBinaryInputBasicPresentValueCommandParams = new LinkedHashMap(); - CommandInfo readBinaryInputBasicPresentValueAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBinaryInputBasicPresentValueAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BinaryInputBasicCluster) cluster) .readPresentValueAttribute((ChipClusters.BooleanAttributeCallback) callback); }, () -> new DelegatedBooleanAttributeCallback(), readBinaryInputBasicPresentValueCommandParams); - readBinaryInputBasicCommandInfo.put( - "readPresentValueAttribute", readBinaryInputBasicPresentValueAttributeCommandInfo); + readBinaryInputBasicInteractionInfo.put( + "readPresentValueAttribute", readBinaryInputBasicPresentValueAttributeInteractionInfo); Map readBinaryInputBasicStatusFlagsCommandParams = new LinkedHashMap(); - CommandInfo readBinaryInputBasicStatusFlagsAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBinaryInputBasicStatusFlagsAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BinaryInputBasicCluster) cluster) .readStatusFlagsAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readBinaryInputBasicStatusFlagsCommandParams); - readBinaryInputBasicCommandInfo.put( - "readStatusFlagsAttribute", readBinaryInputBasicStatusFlagsAttributeCommandInfo); + readBinaryInputBasicInteractionInfo.put( + "readStatusFlagsAttribute", readBinaryInputBasicStatusFlagsAttributeInteractionInfo); Map readBinaryInputBasicClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readBinaryInputBasicClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBinaryInputBasicClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BinaryInputBasicCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readBinaryInputBasicClusterRevisionCommandParams); - readBinaryInputBasicCommandInfo.put( - "readClusterRevisionAttribute", readBinaryInputBasicClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("binaryInputBasic").combineCommands(readBinaryInputBasicCommandInfo); - Map readBindingCommandInfo = new LinkedHashMap<>(); + readBinaryInputBasicInteractionInfo.put( + "readClusterRevisionAttribute", + readBinaryInputBasicClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("binaryInputBasic", readBinaryInputBasicInteractionInfo); + Map readBindingInteractionInfo = new LinkedHashMap<>(); // read attribute Map readBindingClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readBindingClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBindingClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BindingCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readBindingClusterRevisionCommandParams); - readBindingCommandInfo.put( - "readClusterRevisionAttribute", readBindingClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("binding").combineCommands(readBindingCommandInfo); - Map readBooleanStateCommandInfo = new LinkedHashMap<>(); + readBindingInteractionInfo.put( + "readClusterRevisionAttribute", readBindingClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("binding", readBindingInteractionInfo); + Map readBooleanStateInteractionInfo = new LinkedHashMap<>(); // read attribute Map readBooleanStateStateValueCommandParams = new LinkedHashMap(); - CommandInfo readBooleanStateStateValueAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBooleanStateStateValueAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BooleanStateCluster) cluster) .readStateValueAttribute((ChipClusters.BooleanAttributeCallback) callback); }, () -> new DelegatedBooleanAttributeCallback(), readBooleanStateStateValueCommandParams); - readBooleanStateCommandInfo.put( - "readStateValueAttribute", readBooleanStateStateValueAttributeCommandInfo); + readBooleanStateInteractionInfo.put( + "readStateValueAttribute", readBooleanStateStateValueAttributeInteractionInfo); Map readBooleanStateClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readBooleanStateClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBooleanStateClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BooleanStateCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readBooleanStateClusterRevisionCommandParams); - readBooleanStateCommandInfo.put( - "readClusterRevisionAttribute", readBooleanStateClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("booleanState").combineCommands(readBooleanStateCommandInfo); - Map readBridgedActionsCommandInfo = new LinkedHashMap<>(); + readBooleanStateInteractionInfo.put( + "readClusterRevisionAttribute", readBooleanStateClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("booleanState", readBooleanStateInteractionInfo); + Map readBridgedActionsInteractionInfo = new LinkedHashMap<>(); // read attribute Map readBridgedActionsActionListCommandParams = new LinkedHashMap(); - CommandInfo readBridgedActionsActionListAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBridgedActionsActionListAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedActionsCluster) cluster) .readActionListAttribute( @@ -8682,12 +8862,12 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedActionListAttributeCallback(), readBridgedActionsActionListCommandParams); - readBridgedActionsCommandInfo.put( - "readActionListAttribute", readBridgedActionsActionListAttributeCommandInfo); + readBridgedActionsInteractionInfo.put( + "readActionListAttribute", readBridgedActionsActionListAttributeInteractionInfo); Map readBridgedActionsEndpointListCommandParams = new LinkedHashMap(); - CommandInfo readBridgedActionsEndpointListAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBridgedActionsEndpointListAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedActionsCluster) cluster) .readEndpointListAttribute( @@ -8695,100 +8875,100 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedEndpointListAttributeCallback(), readBridgedActionsEndpointListCommandParams); - readBridgedActionsCommandInfo.put( - "readEndpointListAttribute", readBridgedActionsEndpointListAttributeCommandInfo); + readBridgedActionsInteractionInfo.put( + "readEndpointListAttribute", readBridgedActionsEndpointListAttributeInteractionInfo); Map readBridgedActionsSetupUrlCommandParams = new LinkedHashMap(); - CommandInfo readBridgedActionsSetupUrlAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBridgedActionsSetupUrlAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedActionsCluster) cluster) .readSetupUrlAttribute((ChipClusters.CharStringAttributeCallback) callback); }, () -> new DelegatedCharStringAttributeCallback(), readBridgedActionsSetupUrlCommandParams); - readBridgedActionsCommandInfo.put( - "readSetupUrlAttribute", readBridgedActionsSetupUrlAttributeCommandInfo); + readBridgedActionsInteractionInfo.put( + "readSetupUrlAttribute", readBridgedActionsSetupUrlAttributeInteractionInfo); Map readBridgedActionsClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readBridgedActionsClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBridgedActionsClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedActionsCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readBridgedActionsClusterRevisionCommandParams); - readBridgedActionsCommandInfo.put( - "readClusterRevisionAttribute", readBridgedActionsClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("bridgedActions").combineCommands(readBridgedActionsCommandInfo); - Map readBridgedDeviceBasicCommandInfo = new LinkedHashMap<>(); + readBridgedActionsInteractionInfo.put( + "readClusterRevisionAttribute", readBridgedActionsClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("bridgedActions", readBridgedActionsInteractionInfo); + Map readBridgedDeviceBasicInteractionInfo = new LinkedHashMap<>(); // read attribute Map readBridgedDeviceBasicVendorNameCommandParams = new LinkedHashMap(); - CommandInfo readBridgedDeviceBasicVendorNameAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBridgedDeviceBasicVendorNameAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedDeviceBasicCluster) cluster) .readVendorNameAttribute((ChipClusters.CharStringAttributeCallback) callback); }, () -> new DelegatedCharStringAttributeCallback(), readBridgedDeviceBasicVendorNameCommandParams); - readBridgedDeviceBasicCommandInfo.put( - "readVendorNameAttribute", readBridgedDeviceBasicVendorNameAttributeCommandInfo); + readBridgedDeviceBasicInteractionInfo.put( + "readVendorNameAttribute", readBridgedDeviceBasicVendorNameAttributeInteractionInfo); Map readBridgedDeviceBasicVendorIDCommandParams = new LinkedHashMap(); - CommandInfo readBridgedDeviceBasicVendorIDAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBridgedDeviceBasicVendorIDAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedDeviceBasicCluster) cluster) .readVendorIDAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readBridgedDeviceBasicVendorIDCommandParams); - readBridgedDeviceBasicCommandInfo.put( - "readVendorIDAttribute", readBridgedDeviceBasicVendorIDAttributeCommandInfo); + readBridgedDeviceBasicInteractionInfo.put( + "readVendorIDAttribute", readBridgedDeviceBasicVendorIDAttributeInteractionInfo); Map readBridgedDeviceBasicProductNameCommandParams = new LinkedHashMap(); - CommandInfo readBridgedDeviceBasicProductNameAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBridgedDeviceBasicProductNameAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedDeviceBasicCluster) cluster) .readProductNameAttribute((ChipClusters.CharStringAttributeCallback) callback); }, () -> new DelegatedCharStringAttributeCallback(), readBridgedDeviceBasicProductNameCommandParams); - readBridgedDeviceBasicCommandInfo.put( - "readProductNameAttribute", readBridgedDeviceBasicProductNameAttributeCommandInfo); + readBridgedDeviceBasicInteractionInfo.put( + "readProductNameAttribute", readBridgedDeviceBasicProductNameAttributeInteractionInfo); Map readBridgedDeviceBasicUserLabelCommandParams = new LinkedHashMap(); - CommandInfo readBridgedDeviceBasicUserLabelAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBridgedDeviceBasicUserLabelAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedDeviceBasicCluster) cluster) .readUserLabelAttribute((ChipClusters.CharStringAttributeCallback) callback); }, () -> new DelegatedCharStringAttributeCallback(), readBridgedDeviceBasicUserLabelCommandParams); - readBridgedDeviceBasicCommandInfo.put( - "readUserLabelAttribute", readBridgedDeviceBasicUserLabelAttributeCommandInfo); + readBridgedDeviceBasicInteractionInfo.put( + "readUserLabelAttribute", readBridgedDeviceBasicUserLabelAttributeInteractionInfo); Map readBridgedDeviceBasicHardwareVersionCommandParams = new LinkedHashMap(); - CommandInfo readBridgedDeviceBasicHardwareVersionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBridgedDeviceBasicHardwareVersionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedDeviceBasicCluster) cluster) .readHardwareVersionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readBridgedDeviceBasicHardwareVersionCommandParams); - readBridgedDeviceBasicCommandInfo.put( - "readHardwareVersionAttribute", readBridgedDeviceBasicHardwareVersionAttributeCommandInfo); + readBridgedDeviceBasicInteractionInfo.put( + "readHardwareVersionAttribute", + readBridgedDeviceBasicHardwareVersionAttributeInteractionInfo); Map readBridgedDeviceBasicHardwareVersionStringCommandParams = new LinkedHashMap(); - CommandInfo readBridgedDeviceBasicHardwareVersionStringAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBridgedDeviceBasicHardwareVersionStringAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedDeviceBasicCluster) cluster) .readHardwareVersionStringAttribute( @@ -8796,25 +8976,26 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedCharStringAttributeCallback(), readBridgedDeviceBasicHardwareVersionStringCommandParams); - readBridgedDeviceBasicCommandInfo.put( + readBridgedDeviceBasicInteractionInfo.put( "readHardwareVersionStringAttribute", - readBridgedDeviceBasicHardwareVersionStringAttributeCommandInfo); + readBridgedDeviceBasicHardwareVersionStringAttributeInteractionInfo); Map readBridgedDeviceBasicSoftwareVersionCommandParams = new LinkedHashMap(); - CommandInfo readBridgedDeviceBasicSoftwareVersionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBridgedDeviceBasicSoftwareVersionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedDeviceBasicCluster) cluster) .readSoftwareVersionAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readBridgedDeviceBasicSoftwareVersionCommandParams); - readBridgedDeviceBasicCommandInfo.put( - "readSoftwareVersionAttribute", readBridgedDeviceBasicSoftwareVersionAttributeCommandInfo); + readBridgedDeviceBasicInteractionInfo.put( + "readSoftwareVersionAttribute", + readBridgedDeviceBasicSoftwareVersionAttributeInteractionInfo); Map readBridgedDeviceBasicSoftwareVersionStringCommandParams = new LinkedHashMap(); - CommandInfo readBridgedDeviceBasicSoftwareVersionStringAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBridgedDeviceBasicSoftwareVersionStringAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedDeviceBasicCluster) cluster) .readSoftwareVersionStringAttribute( @@ -8822,13 +9003,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedCharStringAttributeCallback(), readBridgedDeviceBasicSoftwareVersionStringCommandParams); - readBridgedDeviceBasicCommandInfo.put( + readBridgedDeviceBasicInteractionInfo.put( "readSoftwareVersionStringAttribute", - readBridgedDeviceBasicSoftwareVersionStringAttributeCommandInfo); + readBridgedDeviceBasicSoftwareVersionStringAttributeInteractionInfo); Map readBridgedDeviceBasicManufacturingDateCommandParams = new LinkedHashMap(); - CommandInfo readBridgedDeviceBasicManufacturingDateAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBridgedDeviceBasicManufacturingDateAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedDeviceBasicCluster) cluster) .readManufacturingDateAttribute( @@ -8836,161 +9017,163 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedCharStringAttributeCallback(), readBridgedDeviceBasicManufacturingDateCommandParams); - readBridgedDeviceBasicCommandInfo.put( + readBridgedDeviceBasicInteractionInfo.put( "readManufacturingDateAttribute", - readBridgedDeviceBasicManufacturingDateAttributeCommandInfo); + readBridgedDeviceBasicManufacturingDateAttributeInteractionInfo); Map readBridgedDeviceBasicPartNumberCommandParams = new LinkedHashMap(); - CommandInfo readBridgedDeviceBasicPartNumberAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBridgedDeviceBasicPartNumberAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedDeviceBasicCluster) cluster) .readPartNumberAttribute((ChipClusters.CharStringAttributeCallback) callback); }, () -> new DelegatedCharStringAttributeCallback(), readBridgedDeviceBasicPartNumberCommandParams); - readBridgedDeviceBasicCommandInfo.put( - "readPartNumberAttribute", readBridgedDeviceBasicPartNumberAttributeCommandInfo); + readBridgedDeviceBasicInteractionInfo.put( + "readPartNumberAttribute", readBridgedDeviceBasicPartNumberAttributeInteractionInfo); Map readBridgedDeviceBasicProductURLCommandParams = new LinkedHashMap(); - CommandInfo readBridgedDeviceBasicProductURLAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBridgedDeviceBasicProductURLAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedDeviceBasicCluster) cluster) .readProductURLAttribute((ChipClusters.CharStringAttributeCallback) callback); }, () -> new DelegatedCharStringAttributeCallback(), readBridgedDeviceBasicProductURLCommandParams); - readBridgedDeviceBasicCommandInfo.put( - "readProductURLAttribute", readBridgedDeviceBasicProductURLAttributeCommandInfo); + readBridgedDeviceBasicInteractionInfo.put( + "readProductURLAttribute", readBridgedDeviceBasicProductURLAttributeInteractionInfo); Map readBridgedDeviceBasicProductLabelCommandParams = new LinkedHashMap(); - CommandInfo readBridgedDeviceBasicProductLabelAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBridgedDeviceBasicProductLabelAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedDeviceBasicCluster) cluster) .readProductLabelAttribute((ChipClusters.CharStringAttributeCallback) callback); }, () -> new DelegatedCharStringAttributeCallback(), readBridgedDeviceBasicProductLabelCommandParams); - readBridgedDeviceBasicCommandInfo.put( - "readProductLabelAttribute", readBridgedDeviceBasicProductLabelAttributeCommandInfo); + readBridgedDeviceBasicInteractionInfo.put( + "readProductLabelAttribute", readBridgedDeviceBasicProductLabelAttributeInteractionInfo); Map readBridgedDeviceBasicSerialNumberCommandParams = new LinkedHashMap(); - CommandInfo readBridgedDeviceBasicSerialNumberAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBridgedDeviceBasicSerialNumberAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedDeviceBasicCluster) cluster) .readSerialNumberAttribute((ChipClusters.CharStringAttributeCallback) callback); }, () -> new DelegatedCharStringAttributeCallback(), readBridgedDeviceBasicSerialNumberCommandParams); - readBridgedDeviceBasicCommandInfo.put( - "readSerialNumberAttribute", readBridgedDeviceBasicSerialNumberAttributeCommandInfo); + readBridgedDeviceBasicInteractionInfo.put( + "readSerialNumberAttribute", readBridgedDeviceBasicSerialNumberAttributeInteractionInfo); Map readBridgedDeviceBasicReachableCommandParams = new LinkedHashMap(); - CommandInfo readBridgedDeviceBasicReachableAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBridgedDeviceBasicReachableAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedDeviceBasicCluster) cluster) .readReachableAttribute((ChipClusters.BooleanAttributeCallback) callback); }, () -> new DelegatedBooleanAttributeCallback(), readBridgedDeviceBasicReachableCommandParams); - readBridgedDeviceBasicCommandInfo.put( - "readReachableAttribute", readBridgedDeviceBasicReachableAttributeCommandInfo); + readBridgedDeviceBasicInteractionInfo.put( + "readReachableAttribute", readBridgedDeviceBasicReachableAttributeInteractionInfo); Map readBridgedDeviceBasicClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readBridgedDeviceBasicClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readBridgedDeviceBasicClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.BridgedDeviceBasicCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readBridgedDeviceBasicClusterRevisionCommandParams); - readBridgedDeviceBasicCommandInfo.put( - "readClusterRevisionAttribute", readBridgedDeviceBasicClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("bridgedDeviceBasic").combineCommands(readBridgedDeviceBasicCommandInfo); - Map readColorControlCommandInfo = new LinkedHashMap<>(); + readBridgedDeviceBasicInteractionInfo.put( + "readClusterRevisionAttribute", + readBridgedDeviceBasicClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("bridgedDeviceBasic", readBridgedDeviceBasicInteractionInfo); + Map readColorControlInteractionInfo = new LinkedHashMap<>(); // read attribute Map readColorControlCurrentHueCommandParams = new LinkedHashMap(); - CommandInfo readColorControlCurrentHueAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlCurrentHueAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readCurrentHueAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlCurrentHueCommandParams); - readColorControlCommandInfo.put( - "readCurrentHueAttribute", readColorControlCurrentHueAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readCurrentHueAttribute", readColorControlCurrentHueAttributeInteractionInfo); Map readColorControlCurrentSaturationCommandParams = new LinkedHashMap(); - CommandInfo readColorControlCurrentSaturationAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlCurrentSaturationAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readCurrentSaturationAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlCurrentSaturationCommandParams); - readColorControlCommandInfo.put( - "readCurrentSaturationAttribute", readColorControlCurrentSaturationAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readCurrentSaturationAttribute", + readColorControlCurrentSaturationAttributeInteractionInfo); Map readColorControlRemainingTimeCommandParams = new LinkedHashMap(); - CommandInfo readColorControlRemainingTimeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlRemainingTimeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readRemainingTimeAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlRemainingTimeCommandParams); - readColorControlCommandInfo.put( - "readRemainingTimeAttribute", readColorControlRemainingTimeAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readRemainingTimeAttribute", readColorControlRemainingTimeAttributeInteractionInfo); Map readColorControlCurrentXCommandParams = new LinkedHashMap(); - CommandInfo readColorControlCurrentXAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlCurrentXAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readCurrentXAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlCurrentXCommandParams); - readColorControlCommandInfo.put( - "readCurrentXAttribute", readColorControlCurrentXAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readCurrentXAttribute", readColorControlCurrentXAttributeInteractionInfo); Map readColorControlCurrentYCommandParams = new LinkedHashMap(); - CommandInfo readColorControlCurrentYAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlCurrentYAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readCurrentYAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlCurrentYCommandParams); - readColorControlCommandInfo.put( - "readCurrentYAttribute", readColorControlCurrentYAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readCurrentYAttribute", readColorControlCurrentYAttributeInteractionInfo); Map readColorControlDriftCompensationCommandParams = new LinkedHashMap(); - CommandInfo readColorControlDriftCompensationAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlDriftCompensationAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readDriftCompensationAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlDriftCompensationCommandParams); - readColorControlCommandInfo.put( - "readDriftCompensationAttribute", readColorControlDriftCompensationAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readDriftCompensationAttribute", + readColorControlDriftCompensationAttributeInteractionInfo); Map readColorControlCompensationTextCommandParams = new LinkedHashMap(); - CommandInfo readColorControlCompensationTextAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlCompensationTextAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readCompensationTextAttribute( @@ -8998,36 +9181,36 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedCharStringAttributeCallback(), readColorControlCompensationTextCommandParams); - readColorControlCommandInfo.put( - "readCompensationTextAttribute", readColorControlCompensationTextAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readCompensationTextAttribute", readColorControlCompensationTextAttributeInteractionInfo); Map readColorControlColorTemperatureCommandParams = new LinkedHashMap(); - CommandInfo readColorControlColorTemperatureAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlColorTemperatureAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readColorTemperatureAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlColorTemperatureCommandParams); - readColorControlCommandInfo.put( - "readColorTemperatureAttribute", readColorControlColorTemperatureAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readColorTemperatureAttribute", readColorControlColorTemperatureAttributeInteractionInfo); Map readColorControlColorModeCommandParams = new LinkedHashMap(); - CommandInfo readColorControlColorModeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlColorModeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readColorModeAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlColorModeCommandParams); - readColorControlCommandInfo.put( - "readColorModeAttribute", readColorControlColorModeAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readColorModeAttribute", readColorControlColorModeAttributeInteractionInfo); Map readColorControlColorControlOptionsCommandParams = new LinkedHashMap(); - CommandInfo readColorControlColorControlOptionsAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlColorControlOptionsAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readColorControlOptionsAttribute( @@ -9035,289 +9218,296 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readColorControlColorControlOptionsCommandParams); - readColorControlCommandInfo.put( + readColorControlInteractionInfo.put( "readColorControlOptionsAttribute", - readColorControlColorControlOptionsAttributeCommandInfo); + readColorControlColorControlOptionsAttributeInteractionInfo); Map readColorControlNumberOfPrimariesCommandParams = new LinkedHashMap(); - CommandInfo readColorControlNumberOfPrimariesAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlNumberOfPrimariesAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readNumberOfPrimariesAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlNumberOfPrimariesCommandParams); - readColorControlCommandInfo.put( - "readNumberOfPrimariesAttribute", readColorControlNumberOfPrimariesAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readNumberOfPrimariesAttribute", + readColorControlNumberOfPrimariesAttributeInteractionInfo); Map readColorControlPrimary1XCommandParams = new LinkedHashMap(); - CommandInfo readColorControlPrimary1XAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlPrimary1XAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readPrimary1XAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlPrimary1XCommandParams); - readColorControlCommandInfo.put( - "readPrimary1XAttribute", readColorControlPrimary1XAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readPrimary1XAttribute", readColorControlPrimary1XAttributeInteractionInfo); Map readColorControlPrimary1YCommandParams = new LinkedHashMap(); - CommandInfo readColorControlPrimary1YAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlPrimary1YAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readPrimary1YAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlPrimary1YCommandParams); - readColorControlCommandInfo.put( - "readPrimary1YAttribute", readColorControlPrimary1YAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readPrimary1YAttribute", readColorControlPrimary1YAttributeInteractionInfo); Map readColorControlPrimary1IntensityCommandParams = new LinkedHashMap(); - CommandInfo readColorControlPrimary1IntensityAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlPrimary1IntensityAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readPrimary1IntensityAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlPrimary1IntensityCommandParams); - readColorControlCommandInfo.put( - "readPrimary1IntensityAttribute", readColorControlPrimary1IntensityAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readPrimary1IntensityAttribute", + readColorControlPrimary1IntensityAttributeInteractionInfo); Map readColorControlPrimary2XCommandParams = new LinkedHashMap(); - CommandInfo readColorControlPrimary2XAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlPrimary2XAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readPrimary2XAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlPrimary2XCommandParams); - readColorControlCommandInfo.put( - "readPrimary2XAttribute", readColorControlPrimary2XAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readPrimary2XAttribute", readColorControlPrimary2XAttributeInteractionInfo); Map readColorControlPrimary2YCommandParams = new LinkedHashMap(); - CommandInfo readColorControlPrimary2YAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlPrimary2YAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readPrimary2YAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlPrimary2YCommandParams); - readColorControlCommandInfo.put( - "readPrimary2YAttribute", readColorControlPrimary2YAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readPrimary2YAttribute", readColorControlPrimary2YAttributeInteractionInfo); Map readColorControlPrimary2IntensityCommandParams = new LinkedHashMap(); - CommandInfo readColorControlPrimary2IntensityAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlPrimary2IntensityAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readPrimary2IntensityAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlPrimary2IntensityCommandParams); - readColorControlCommandInfo.put( - "readPrimary2IntensityAttribute", readColorControlPrimary2IntensityAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readPrimary2IntensityAttribute", + readColorControlPrimary2IntensityAttributeInteractionInfo); Map readColorControlPrimary3XCommandParams = new LinkedHashMap(); - CommandInfo readColorControlPrimary3XAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlPrimary3XAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readPrimary3XAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlPrimary3XCommandParams); - readColorControlCommandInfo.put( - "readPrimary3XAttribute", readColorControlPrimary3XAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readPrimary3XAttribute", readColorControlPrimary3XAttributeInteractionInfo); Map readColorControlPrimary3YCommandParams = new LinkedHashMap(); - CommandInfo readColorControlPrimary3YAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlPrimary3YAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readPrimary3YAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlPrimary3YCommandParams); - readColorControlCommandInfo.put( - "readPrimary3YAttribute", readColorControlPrimary3YAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readPrimary3YAttribute", readColorControlPrimary3YAttributeInteractionInfo); Map readColorControlPrimary3IntensityCommandParams = new LinkedHashMap(); - CommandInfo readColorControlPrimary3IntensityAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlPrimary3IntensityAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readPrimary3IntensityAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlPrimary3IntensityCommandParams); - readColorControlCommandInfo.put( - "readPrimary3IntensityAttribute", readColorControlPrimary3IntensityAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readPrimary3IntensityAttribute", + readColorControlPrimary3IntensityAttributeInteractionInfo); Map readColorControlPrimary4XCommandParams = new LinkedHashMap(); - CommandInfo readColorControlPrimary4XAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlPrimary4XAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readPrimary4XAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlPrimary4XCommandParams); - readColorControlCommandInfo.put( - "readPrimary4XAttribute", readColorControlPrimary4XAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readPrimary4XAttribute", readColorControlPrimary4XAttributeInteractionInfo); Map readColorControlPrimary4YCommandParams = new LinkedHashMap(); - CommandInfo readColorControlPrimary4YAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlPrimary4YAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readPrimary4YAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlPrimary4YCommandParams); - readColorControlCommandInfo.put( - "readPrimary4YAttribute", readColorControlPrimary4YAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readPrimary4YAttribute", readColorControlPrimary4YAttributeInteractionInfo); Map readColorControlPrimary4IntensityCommandParams = new LinkedHashMap(); - CommandInfo readColorControlPrimary4IntensityAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlPrimary4IntensityAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readPrimary4IntensityAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlPrimary4IntensityCommandParams); - readColorControlCommandInfo.put( - "readPrimary4IntensityAttribute", readColorControlPrimary4IntensityAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readPrimary4IntensityAttribute", + readColorControlPrimary4IntensityAttributeInteractionInfo); Map readColorControlPrimary5XCommandParams = new LinkedHashMap(); - CommandInfo readColorControlPrimary5XAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlPrimary5XAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readPrimary5XAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlPrimary5XCommandParams); - readColorControlCommandInfo.put( - "readPrimary5XAttribute", readColorControlPrimary5XAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readPrimary5XAttribute", readColorControlPrimary5XAttributeInteractionInfo); Map readColorControlPrimary5YCommandParams = new LinkedHashMap(); - CommandInfo readColorControlPrimary5YAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlPrimary5YAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readPrimary5YAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlPrimary5YCommandParams); - readColorControlCommandInfo.put( - "readPrimary5YAttribute", readColorControlPrimary5YAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readPrimary5YAttribute", readColorControlPrimary5YAttributeInteractionInfo); Map readColorControlPrimary5IntensityCommandParams = new LinkedHashMap(); - CommandInfo readColorControlPrimary5IntensityAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlPrimary5IntensityAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readPrimary5IntensityAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlPrimary5IntensityCommandParams); - readColorControlCommandInfo.put( - "readPrimary5IntensityAttribute", readColorControlPrimary5IntensityAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readPrimary5IntensityAttribute", + readColorControlPrimary5IntensityAttributeInteractionInfo); Map readColorControlPrimary6XCommandParams = new LinkedHashMap(); - CommandInfo readColorControlPrimary6XAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlPrimary6XAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readPrimary6XAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlPrimary6XCommandParams); - readColorControlCommandInfo.put( - "readPrimary6XAttribute", readColorControlPrimary6XAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readPrimary6XAttribute", readColorControlPrimary6XAttributeInteractionInfo); Map readColorControlPrimary6YCommandParams = new LinkedHashMap(); - CommandInfo readColorControlPrimary6YAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlPrimary6YAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readPrimary6YAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlPrimary6YCommandParams); - readColorControlCommandInfo.put( - "readPrimary6YAttribute", readColorControlPrimary6YAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readPrimary6YAttribute", readColorControlPrimary6YAttributeInteractionInfo); Map readColorControlPrimary6IntensityCommandParams = new LinkedHashMap(); - CommandInfo readColorControlPrimary6IntensityAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlPrimary6IntensityAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readPrimary6IntensityAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlPrimary6IntensityCommandParams); - readColorControlCommandInfo.put( - "readPrimary6IntensityAttribute", readColorControlPrimary6IntensityAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readPrimary6IntensityAttribute", + readColorControlPrimary6IntensityAttributeInteractionInfo); Map readColorControlWhitePointXCommandParams = new LinkedHashMap(); - CommandInfo readColorControlWhitePointXAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlWhitePointXAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readWhitePointXAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlWhitePointXCommandParams); - readColorControlCommandInfo.put( - "readWhitePointXAttribute", readColorControlWhitePointXAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readWhitePointXAttribute", readColorControlWhitePointXAttributeInteractionInfo); Map readColorControlWhitePointYCommandParams = new LinkedHashMap(); - CommandInfo readColorControlWhitePointYAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlWhitePointYAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readWhitePointYAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlWhitePointYCommandParams); - readColorControlCommandInfo.put( - "readWhitePointYAttribute", readColorControlWhitePointYAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readWhitePointYAttribute", readColorControlWhitePointYAttributeInteractionInfo); Map readColorControlColorPointRXCommandParams = new LinkedHashMap(); - CommandInfo readColorControlColorPointRXAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlColorPointRXAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readColorPointRXAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlColorPointRXCommandParams); - readColorControlCommandInfo.put( - "readColorPointRXAttribute", readColorControlColorPointRXAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readColorPointRXAttribute", readColorControlColorPointRXAttributeInteractionInfo); Map readColorControlColorPointRYCommandParams = new LinkedHashMap(); - CommandInfo readColorControlColorPointRYAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlColorPointRYAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readColorPointRYAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlColorPointRYCommandParams); - readColorControlCommandInfo.put( - "readColorPointRYAttribute", readColorControlColorPointRYAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readColorPointRYAttribute", readColorControlColorPointRYAttributeInteractionInfo); Map readColorControlColorPointRIntensityCommandParams = new LinkedHashMap(); - CommandInfo readColorControlColorPointRIntensityAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlColorPointRIntensityAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readColorPointRIntensityAttribute( @@ -9325,37 +9515,37 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readColorControlColorPointRIntensityCommandParams); - readColorControlCommandInfo.put( + readColorControlInteractionInfo.put( "readColorPointRIntensityAttribute", - readColorControlColorPointRIntensityAttributeCommandInfo); + readColorControlColorPointRIntensityAttributeInteractionInfo); Map readColorControlColorPointGXCommandParams = new LinkedHashMap(); - CommandInfo readColorControlColorPointGXAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlColorPointGXAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readColorPointGXAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlColorPointGXCommandParams); - readColorControlCommandInfo.put( - "readColorPointGXAttribute", readColorControlColorPointGXAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readColorPointGXAttribute", readColorControlColorPointGXAttributeInteractionInfo); Map readColorControlColorPointGYCommandParams = new LinkedHashMap(); - CommandInfo readColorControlColorPointGYAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlColorPointGYAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readColorPointGYAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlColorPointGYCommandParams); - readColorControlCommandInfo.put( - "readColorPointGYAttribute", readColorControlColorPointGYAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readColorPointGYAttribute", readColorControlColorPointGYAttributeInteractionInfo); Map readColorControlColorPointGIntensityCommandParams = new LinkedHashMap(); - CommandInfo readColorControlColorPointGIntensityAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlColorPointGIntensityAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readColorPointGIntensityAttribute( @@ -9363,37 +9553,37 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readColorControlColorPointGIntensityCommandParams); - readColorControlCommandInfo.put( + readColorControlInteractionInfo.put( "readColorPointGIntensityAttribute", - readColorControlColorPointGIntensityAttributeCommandInfo); + readColorControlColorPointGIntensityAttributeInteractionInfo); Map readColorControlColorPointBXCommandParams = new LinkedHashMap(); - CommandInfo readColorControlColorPointBXAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlColorPointBXAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readColorPointBXAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlColorPointBXCommandParams); - readColorControlCommandInfo.put( - "readColorPointBXAttribute", readColorControlColorPointBXAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readColorPointBXAttribute", readColorControlColorPointBXAttributeInteractionInfo); Map readColorControlColorPointBYCommandParams = new LinkedHashMap(); - CommandInfo readColorControlColorPointBYAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlColorPointBYAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readColorPointBYAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlColorPointBYCommandParams); - readColorControlCommandInfo.put( - "readColorPointBYAttribute", readColorControlColorPointBYAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readColorPointBYAttribute", readColorControlColorPointBYAttributeInteractionInfo); Map readColorControlColorPointBIntensityCommandParams = new LinkedHashMap(); - CommandInfo readColorControlColorPointBIntensityAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlColorPointBIntensityAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readColorPointBIntensityAttribute( @@ -9401,13 +9591,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readColorControlColorPointBIntensityCommandParams); - readColorControlCommandInfo.put( + readColorControlInteractionInfo.put( "readColorPointBIntensityAttribute", - readColorControlColorPointBIntensityAttributeCommandInfo); + readColorControlColorPointBIntensityAttributeInteractionInfo); Map readColorControlEnhancedCurrentHueCommandParams = new LinkedHashMap(); - CommandInfo readColorControlEnhancedCurrentHueAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlEnhancedCurrentHueAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readEnhancedCurrentHueAttribute( @@ -9415,36 +9605,38 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readColorControlEnhancedCurrentHueCommandParams); - readColorControlCommandInfo.put( - "readEnhancedCurrentHueAttribute", readColorControlEnhancedCurrentHueAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readEnhancedCurrentHueAttribute", + readColorControlEnhancedCurrentHueAttributeInteractionInfo); Map readColorControlEnhancedColorModeCommandParams = new LinkedHashMap(); - CommandInfo readColorControlEnhancedColorModeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlEnhancedColorModeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readEnhancedColorModeAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlEnhancedColorModeCommandParams); - readColorControlCommandInfo.put( - "readEnhancedColorModeAttribute", readColorControlEnhancedColorModeAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readEnhancedColorModeAttribute", + readColorControlEnhancedColorModeAttributeInteractionInfo); Map readColorControlColorLoopActiveCommandParams = new LinkedHashMap(); - CommandInfo readColorControlColorLoopActiveAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlColorLoopActiveAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readColorLoopActiveAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlColorLoopActiveCommandParams); - readColorControlCommandInfo.put( - "readColorLoopActiveAttribute", readColorControlColorLoopActiveAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readColorLoopActiveAttribute", readColorControlColorLoopActiveAttributeInteractionInfo); Map readColorControlColorLoopDirectionCommandParams = new LinkedHashMap(); - CommandInfo readColorControlColorLoopDirectionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlColorLoopDirectionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readColorLoopDirectionAttribute( @@ -9452,24 +9644,25 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readColorControlColorLoopDirectionCommandParams); - readColorControlCommandInfo.put( - "readColorLoopDirectionAttribute", readColorControlColorLoopDirectionAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readColorLoopDirectionAttribute", + readColorControlColorLoopDirectionAttributeInteractionInfo); Map readColorControlColorLoopTimeCommandParams = new LinkedHashMap(); - CommandInfo readColorControlColorLoopTimeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlColorLoopTimeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readColorLoopTimeAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlColorLoopTimeCommandParams); - readColorControlCommandInfo.put( - "readColorLoopTimeAttribute", readColorControlColorLoopTimeAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readColorLoopTimeAttribute", readColorControlColorLoopTimeAttributeInteractionInfo); Map readColorControlColorLoopStartEnhancedHueCommandParams = new LinkedHashMap(); - CommandInfo readColorControlColorLoopStartEnhancedHueAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlColorLoopStartEnhancedHueAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readColorLoopStartEnhancedHueAttribute( @@ -9477,13 +9670,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readColorControlColorLoopStartEnhancedHueCommandParams); - readColorControlCommandInfo.put( + readColorControlInteractionInfo.put( "readColorLoopStartEnhancedHueAttribute", - readColorControlColorLoopStartEnhancedHueAttributeCommandInfo); + readColorControlColorLoopStartEnhancedHueAttributeInteractionInfo); Map readColorControlColorLoopStoredEnhancedHueCommandParams = new LinkedHashMap(); - CommandInfo readColorControlColorLoopStoredEnhancedHueAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlColorLoopStoredEnhancedHueAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readColorLoopStoredEnhancedHueAttribute( @@ -9491,25 +9684,26 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readColorControlColorLoopStoredEnhancedHueCommandParams); - readColorControlCommandInfo.put( + readColorControlInteractionInfo.put( "readColorLoopStoredEnhancedHueAttribute", - readColorControlColorLoopStoredEnhancedHueAttributeCommandInfo); + readColorControlColorLoopStoredEnhancedHueAttributeInteractionInfo); Map readColorControlColorCapabilitiesCommandParams = new LinkedHashMap(); - CommandInfo readColorControlColorCapabilitiesAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlColorCapabilitiesAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readColorCapabilitiesAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlColorCapabilitiesCommandParams); - readColorControlCommandInfo.put( - "readColorCapabilitiesAttribute", readColorControlColorCapabilitiesAttributeCommandInfo); + readColorControlInteractionInfo.put( + "readColorCapabilitiesAttribute", + readColorControlColorCapabilitiesAttributeInteractionInfo); Map readColorControlColorTempPhysicalMinCommandParams = new LinkedHashMap(); - CommandInfo readColorControlColorTempPhysicalMinAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlColorTempPhysicalMinAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readColorTempPhysicalMinAttribute( @@ -9517,13 +9711,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readColorControlColorTempPhysicalMinCommandParams); - readColorControlCommandInfo.put( + readColorControlInteractionInfo.put( "readColorTempPhysicalMinAttribute", - readColorControlColorTempPhysicalMinAttributeCommandInfo); + readColorControlColorTempPhysicalMinAttributeInteractionInfo); Map readColorControlColorTempPhysicalMaxCommandParams = new LinkedHashMap(); - CommandInfo readColorControlColorTempPhysicalMaxAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlColorTempPhysicalMaxAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readColorTempPhysicalMaxAttribute( @@ -9531,13 +9725,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readColorControlColorTempPhysicalMaxCommandParams); - readColorControlCommandInfo.put( + readColorControlInteractionInfo.put( "readColorTempPhysicalMaxAttribute", - readColorControlColorTempPhysicalMaxAttributeCommandInfo); + readColorControlColorTempPhysicalMaxAttributeInteractionInfo); Map readColorControlCoupleColorTempToLevelMinMiredsCommandParams = new LinkedHashMap(); - CommandInfo readColorControlCoupleColorTempToLevelMinMiredsAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlCoupleColorTempToLevelMinMiredsAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readCoupleColorTempToLevelMinMiredsAttribute( @@ -9545,13 +9739,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readColorControlCoupleColorTempToLevelMinMiredsCommandParams); - readColorControlCommandInfo.put( + readColorControlInteractionInfo.put( "readCoupleColorTempToLevelMinMiredsAttribute", - readColorControlCoupleColorTempToLevelMinMiredsAttributeCommandInfo); + readColorControlCoupleColorTempToLevelMinMiredsAttributeInteractionInfo); Map readColorControlStartUpColorTemperatureMiredsCommandParams = new LinkedHashMap(); - CommandInfo readColorControlStartUpColorTemperatureMiredsAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlStartUpColorTemperatureMiredsAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readStartUpColorTemperatureMiredsAttribute( @@ -9559,29 +9753,28 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readColorControlStartUpColorTemperatureMiredsCommandParams); - readColorControlCommandInfo.put( + readColorControlInteractionInfo.put( "readStartUpColorTemperatureMiredsAttribute", - readColorControlStartUpColorTemperatureMiredsAttributeCommandInfo); + readColorControlStartUpColorTemperatureMiredsAttributeInteractionInfo); Map readColorControlClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readColorControlClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readColorControlClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readColorControlClusterRevisionCommandParams); - readColorControlCommandInfo.put( - "readClusterRevisionAttribute", readColorControlClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("colorControl").combineCommands(readColorControlCommandInfo); - Map readContentLauncherCommandInfo = new LinkedHashMap<>(); + readColorControlInteractionInfo.put( + "readClusterRevisionAttribute", readColorControlClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("colorControl", readColorControlInteractionInfo); + Map readContentLauncherInteractionInfo = new LinkedHashMap<>(); // read attribute Map readContentLauncherAcceptsHeaderListCommandParams = new LinkedHashMap(); - CommandInfo readContentLauncherAcceptsHeaderListAttributeCommandInfo = - new CommandInfo( + InteractionInfo readContentLauncherAcceptsHeaderListAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ContentLauncherCluster) cluster) .readAcceptsHeaderListAttribute( @@ -9590,12 +9783,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedAcceptsHeaderListAttributeCallback(), readContentLauncherAcceptsHeaderListCommandParams); - readContentLauncherCommandInfo.put( - "readAcceptsHeaderListAttribute", readContentLauncherAcceptsHeaderListAttributeCommandInfo); + readContentLauncherInteractionInfo.put( + "readAcceptsHeaderListAttribute", + readContentLauncherAcceptsHeaderListAttributeInteractionInfo); Map readContentLauncherSupportedStreamingTypesCommandParams = new LinkedHashMap(); - CommandInfo readContentLauncherSupportedStreamingTypesAttributeCommandInfo = - new CommandInfo( + InteractionInfo readContentLauncherSupportedStreamingTypesAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ContentLauncherCluster) cluster) .readSupportedStreamingTypesAttribute( @@ -9604,29 +9798,28 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedSupportedStreamingTypesAttributeCallback(), readContentLauncherSupportedStreamingTypesCommandParams); - readContentLauncherCommandInfo.put( + readContentLauncherInteractionInfo.put( "readSupportedStreamingTypesAttribute", - readContentLauncherSupportedStreamingTypesAttributeCommandInfo); + readContentLauncherSupportedStreamingTypesAttributeInteractionInfo); Map readContentLauncherClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readContentLauncherClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readContentLauncherClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ContentLauncherCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readContentLauncherClusterRevisionCommandParams); - readContentLauncherCommandInfo.put( - "readClusterRevisionAttribute", readContentLauncherClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("contentLauncher").combineCommands(readContentLauncherCommandInfo); - Map readDescriptorCommandInfo = new LinkedHashMap<>(); + readContentLauncherInteractionInfo.put( + "readClusterRevisionAttribute", readContentLauncherClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("contentLauncher", readContentLauncherInteractionInfo); + Map readDescriptorInteractionInfo = new LinkedHashMap<>(); // read attribute Map readDescriptorDeviceListCommandParams = new LinkedHashMap(); - CommandInfo readDescriptorDeviceListAttributeCommandInfo = - new CommandInfo( + InteractionInfo readDescriptorDeviceListAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DescriptorCluster) cluster) .readDeviceListAttribute( @@ -9634,12 +9827,12 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedDeviceListAttributeCallback(), readDescriptorDeviceListCommandParams); - readDescriptorCommandInfo.put( - "readDeviceListAttribute", readDescriptorDeviceListAttributeCommandInfo); + readDescriptorInteractionInfo.put( + "readDeviceListAttribute", readDescriptorDeviceListAttributeInteractionInfo); Map readDescriptorServerListCommandParams = new LinkedHashMap(); - CommandInfo readDescriptorServerListAttributeCommandInfo = - new CommandInfo( + InteractionInfo readDescriptorServerListAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DescriptorCluster) cluster) .readServerListAttribute( @@ -9647,12 +9840,12 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedServerListAttributeCallback(), readDescriptorServerListCommandParams); - readDescriptorCommandInfo.put( - "readServerListAttribute", readDescriptorServerListAttributeCommandInfo); + readDescriptorInteractionInfo.put( + "readServerListAttribute", readDescriptorServerListAttributeInteractionInfo); Map readDescriptorClientListCommandParams = new LinkedHashMap(); - CommandInfo readDescriptorClientListAttributeCommandInfo = - new CommandInfo( + InteractionInfo readDescriptorClientListAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DescriptorCluster) cluster) .readClientListAttribute( @@ -9660,12 +9853,12 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedClientListAttributeCallback(), readDescriptorClientListCommandParams); - readDescriptorCommandInfo.put( - "readClientListAttribute", readDescriptorClientListAttributeCommandInfo); + readDescriptorInteractionInfo.put( + "readClientListAttribute", readDescriptorClientListAttributeInteractionInfo); Map readDescriptorPartsListCommandParams = new LinkedHashMap(); - CommandInfo readDescriptorPartsListAttributeCommandInfo = - new CommandInfo( + InteractionInfo readDescriptorPartsListAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DescriptorCluster) cluster) .readPartsListAttribute( @@ -9673,367 +9866,371 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedPartsListAttributeCallback(), readDescriptorPartsListCommandParams); - readDescriptorCommandInfo.put( - "readPartsListAttribute", readDescriptorPartsListAttributeCommandInfo); + readDescriptorInteractionInfo.put( + "readPartsListAttribute", readDescriptorPartsListAttributeInteractionInfo); Map readDescriptorClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readDescriptorClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readDescriptorClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DescriptorCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readDescriptorClusterRevisionCommandParams); - readDescriptorCommandInfo.put( - "readClusterRevisionAttribute", readDescriptorClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("descriptor").combineCommands(readDescriptorCommandInfo); - Map readDiagnosticLogsCommandInfo = new LinkedHashMap<>(); + readDescriptorInteractionInfo.put( + "readClusterRevisionAttribute", readDescriptorClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("descriptor", readDescriptorInteractionInfo); + Map readDiagnosticLogsInteractionInfo = new LinkedHashMap<>(); // read attribute - // combine the read Attribute into the original commands - clusterMap.get("diagnosticLogs").combineCommands(readDiagnosticLogsCommandInfo); - Map readDoorLockCommandInfo = new LinkedHashMap<>(); + readAttributeMap.put("diagnosticLogs", readDiagnosticLogsInteractionInfo); + Map readDoorLockInteractionInfo = new LinkedHashMap<>(); // read attribute Map readDoorLockLockStateCommandParams = new LinkedHashMap(); - CommandInfo readDoorLockLockStateAttributeCommandInfo = - new CommandInfo( + InteractionInfo readDoorLockLockStateAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DoorLockCluster) cluster) .readLockStateAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readDoorLockLockStateCommandParams); - readDoorLockCommandInfo.put( - "readLockStateAttribute", readDoorLockLockStateAttributeCommandInfo); + readDoorLockInteractionInfo.put( + "readLockStateAttribute", readDoorLockLockStateAttributeInteractionInfo); Map readDoorLockLockTypeCommandParams = new LinkedHashMap(); - CommandInfo readDoorLockLockTypeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readDoorLockLockTypeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DoorLockCluster) cluster) .readLockTypeAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readDoorLockLockTypeCommandParams); - readDoorLockCommandInfo.put("readLockTypeAttribute", readDoorLockLockTypeAttributeCommandInfo); + readDoorLockInteractionInfo.put( + "readLockTypeAttribute", readDoorLockLockTypeAttributeInteractionInfo); Map readDoorLockActuatorEnabledCommandParams = new LinkedHashMap(); - CommandInfo readDoorLockActuatorEnabledAttributeCommandInfo = - new CommandInfo( + InteractionInfo readDoorLockActuatorEnabledAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DoorLockCluster) cluster) .readActuatorEnabledAttribute((ChipClusters.BooleanAttributeCallback) callback); }, () -> new DelegatedBooleanAttributeCallback(), readDoorLockActuatorEnabledCommandParams); - readDoorLockCommandInfo.put( - "readActuatorEnabledAttribute", readDoorLockActuatorEnabledAttributeCommandInfo); + readDoorLockInteractionInfo.put( + "readActuatorEnabledAttribute", readDoorLockActuatorEnabledAttributeInteractionInfo); Map readDoorLockClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readDoorLockClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readDoorLockClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.DoorLockCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readDoorLockClusterRevisionCommandParams); - readDoorLockCommandInfo.put( - "readClusterRevisionAttribute", readDoorLockClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("doorLock").combineCommands(readDoorLockCommandInfo); - Map readElectricalMeasurementCommandInfo = new LinkedHashMap<>(); + readDoorLockInteractionInfo.put( + "readClusterRevisionAttribute", readDoorLockClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("doorLock", readDoorLockInteractionInfo); + Map readElectricalMeasurementInteractionInfo = new LinkedHashMap<>(); // read attribute Map readElectricalMeasurementMeasurementTypeCommandParams = new LinkedHashMap(); - CommandInfo readElectricalMeasurementMeasurementTypeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readElectricalMeasurementMeasurementTypeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ElectricalMeasurementCluster) cluster) .readMeasurementTypeAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readElectricalMeasurementMeasurementTypeCommandParams); - readElectricalMeasurementCommandInfo.put( + readElectricalMeasurementInteractionInfo.put( "readMeasurementTypeAttribute", - readElectricalMeasurementMeasurementTypeAttributeCommandInfo); + readElectricalMeasurementMeasurementTypeAttributeInteractionInfo); Map readElectricalMeasurementTotalActivePowerCommandParams = new LinkedHashMap(); - CommandInfo readElectricalMeasurementTotalActivePowerAttributeCommandInfo = - new CommandInfo( + InteractionInfo readElectricalMeasurementTotalActivePowerAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ElectricalMeasurementCluster) cluster) .readTotalActivePowerAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readElectricalMeasurementTotalActivePowerCommandParams); - readElectricalMeasurementCommandInfo.put( + readElectricalMeasurementInteractionInfo.put( "readTotalActivePowerAttribute", - readElectricalMeasurementTotalActivePowerAttributeCommandInfo); + readElectricalMeasurementTotalActivePowerAttributeInteractionInfo); Map readElectricalMeasurementRmsVoltageCommandParams = new LinkedHashMap(); - CommandInfo readElectricalMeasurementRmsVoltageAttributeCommandInfo = - new CommandInfo( + InteractionInfo readElectricalMeasurementRmsVoltageAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ElectricalMeasurementCluster) cluster) .readRmsVoltageAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readElectricalMeasurementRmsVoltageCommandParams); - readElectricalMeasurementCommandInfo.put( - "readRmsVoltageAttribute", readElectricalMeasurementRmsVoltageAttributeCommandInfo); + readElectricalMeasurementInteractionInfo.put( + "readRmsVoltageAttribute", readElectricalMeasurementRmsVoltageAttributeInteractionInfo); Map readElectricalMeasurementRmsVoltageMinCommandParams = new LinkedHashMap(); - CommandInfo readElectricalMeasurementRmsVoltageMinAttributeCommandInfo = - new CommandInfo( + InteractionInfo readElectricalMeasurementRmsVoltageMinAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ElectricalMeasurementCluster) cluster) .readRmsVoltageMinAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readElectricalMeasurementRmsVoltageMinCommandParams); - readElectricalMeasurementCommandInfo.put( - "readRmsVoltageMinAttribute", readElectricalMeasurementRmsVoltageMinAttributeCommandInfo); + readElectricalMeasurementInteractionInfo.put( + "readRmsVoltageMinAttribute", + readElectricalMeasurementRmsVoltageMinAttributeInteractionInfo); Map readElectricalMeasurementRmsVoltageMaxCommandParams = new LinkedHashMap(); - CommandInfo readElectricalMeasurementRmsVoltageMaxAttributeCommandInfo = - new CommandInfo( + InteractionInfo readElectricalMeasurementRmsVoltageMaxAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ElectricalMeasurementCluster) cluster) .readRmsVoltageMaxAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readElectricalMeasurementRmsVoltageMaxCommandParams); - readElectricalMeasurementCommandInfo.put( - "readRmsVoltageMaxAttribute", readElectricalMeasurementRmsVoltageMaxAttributeCommandInfo); + readElectricalMeasurementInteractionInfo.put( + "readRmsVoltageMaxAttribute", + readElectricalMeasurementRmsVoltageMaxAttributeInteractionInfo); Map readElectricalMeasurementRmsCurrentCommandParams = new LinkedHashMap(); - CommandInfo readElectricalMeasurementRmsCurrentAttributeCommandInfo = - new CommandInfo( + InteractionInfo readElectricalMeasurementRmsCurrentAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ElectricalMeasurementCluster) cluster) .readRmsCurrentAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readElectricalMeasurementRmsCurrentCommandParams); - readElectricalMeasurementCommandInfo.put( - "readRmsCurrentAttribute", readElectricalMeasurementRmsCurrentAttributeCommandInfo); + readElectricalMeasurementInteractionInfo.put( + "readRmsCurrentAttribute", readElectricalMeasurementRmsCurrentAttributeInteractionInfo); Map readElectricalMeasurementRmsCurrentMinCommandParams = new LinkedHashMap(); - CommandInfo readElectricalMeasurementRmsCurrentMinAttributeCommandInfo = - new CommandInfo( + InteractionInfo readElectricalMeasurementRmsCurrentMinAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ElectricalMeasurementCluster) cluster) .readRmsCurrentMinAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readElectricalMeasurementRmsCurrentMinCommandParams); - readElectricalMeasurementCommandInfo.put( - "readRmsCurrentMinAttribute", readElectricalMeasurementRmsCurrentMinAttributeCommandInfo); + readElectricalMeasurementInteractionInfo.put( + "readRmsCurrentMinAttribute", + readElectricalMeasurementRmsCurrentMinAttributeInteractionInfo); Map readElectricalMeasurementRmsCurrentMaxCommandParams = new LinkedHashMap(); - CommandInfo readElectricalMeasurementRmsCurrentMaxAttributeCommandInfo = - new CommandInfo( + InteractionInfo readElectricalMeasurementRmsCurrentMaxAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ElectricalMeasurementCluster) cluster) .readRmsCurrentMaxAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readElectricalMeasurementRmsCurrentMaxCommandParams); - readElectricalMeasurementCommandInfo.put( - "readRmsCurrentMaxAttribute", readElectricalMeasurementRmsCurrentMaxAttributeCommandInfo); + readElectricalMeasurementInteractionInfo.put( + "readRmsCurrentMaxAttribute", + readElectricalMeasurementRmsCurrentMaxAttributeInteractionInfo); Map readElectricalMeasurementActivePowerCommandParams = new LinkedHashMap(); - CommandInfo readElectricalMeasurementActivePowerAttributeCommandInfo = - new CommandInfo( + InteractionInfo readElectricalMeasurementActivePowerAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ElectricalMeasurementCluster) cluster) .readActivePowerAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readElectricalMeasurementActivePowerCommandParams); - readElectricalMeasurementCommandInfo.put( - "readActivePowerAttribute", readElectricalMeasurementActivePowerAttributeCommandInfo); + readElectricalMeasurementInteractionInfo.put( + "readActivePowerAttribute", readElectricalMeasurementActivePowerAttributeInteractionInfo); Map readElectricalMeasurementActivePowerMinCommandParams = new LinkedHashMap(); - CommandInfo readElectricalMeasurementActivePowerMinAttributeCommandInfo = - new CommandInfo( + InteractionInfo readElectricalMeasurementActivePowerMinAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ElectricalMeasurementCluster) cluster) .readActivePowerMinAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readElectricalMeasurementActivePowerMinCommandParams); - readElectricalMeasurementCommandInfo.put( - "readActivePowerMinAttribute", readElectricalMeasurementActivePowerMinAttributeCommandInfo); + readElectricalMeasurementInteractionInfo.put( + "readActivePowerMinAttribute", + readElectricalMeasurementActivePowerMinAttributeInteractionInfo); Map readElectricalMeasurementActivePowerMaxCommandParams = new LinkedHashMap(); - CommandInfo readElectricalMeasurementActivePowerMaxAttributeCommandInfo = - new CommandInfo( + InteractionInfo readElectricalMeasurementActivePowerMaxAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ElectricalMeasurementCluster) cluster) .readActivePowerMaxAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readElectricalMeasurementActivePowerMaxCommandParams); - readElectricalMeasurementCommandInfo.put( - "readActivePowerMaxAttribute", readElectricalMeasurementActivePowerMaxAttributeCommandInfo); + readElectricalMeasurementInteractionInfo.put( + "readActivePowerMaxAttribute", + readElectricalMeasurementActivePowerMaxAttributeInteractionInfo); Map readElectricalMeasurementClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readElectricalMeasurementClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readElectricalMeasurementClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ElectricalMeasurementCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readElectricalMeasurementClusterRevisionCommandParams); - readElectricalMeasurementCommandInfo.put( + readElectricalMeasurementInteractionInfo.put( "readClusterRevisionAttribute", - readElectricalMeasurementClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("electricalMeasurement").combineCommands(readElectricalMeasurementCommandInfo); - Map readEthernetNetworkDiagnosticsCommandInfo = new LinkedHashMap<>(); + readElectricalMeasurementClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("electricalMeasurement", readElectricalMeasurementInteractionInfo); + Map readEthernetNetworkDiagnosticsInteractionInfo = + new LinkedHashMap<>(); // read attribute Map readEthernetNetworkDiagnosticsPHYRateCommandParams = new LinkedHashMap(); - CommandInfo readEthernetNetworkDiagnosticsPHYRateAttributeCommandInfo = - new CommandInfo( + InteractionInfo readEthernetNetworkDiagnosticsPHYRateAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) .readPHYRateAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readEthernetNetworkDiagnosticsPHYRateCommandParams); - readEthernetNetworkDiagnosticsCommandInfo.put( - "readPHYRateAttribute", readEthernetNetworkDiagnosticsPHYRateAttributeCommandInfo); + readEthernetNetworkDiagnosticsInteractionInfo.put( + "readPHYRateAttribute", readEthernetNetworkDiagnosticsPHYRateAttributeInteractionInfo); Map readEthernetNetworkDiagnosticsFullDuplexCommandParams = new LinkedHashMap(); - CommandInfo readEthernetNetworkDiagnosticsFullDuplexAttributeCommandInfo = - new CommandInfo( + InteractionInfo readEthernetNetworkDiagnosticsFullDuplexAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) .readFullDuplexAttribute((ChipClusters.BooleanAttributeCallback) callback); }, () -> new DelegatedBooleanAttributeCallback(), readEthernetNetworkDiagnosticsFullDuplexCommandParams); - readEthernetNetworkDiagnosticsCommandInfo.put( - "readFullDuplexAttribute", readEthernetNetworkDiagnosticsFullDuplexAttributeCommandInfo); + readEthernetNetworkDiagnosticsInteractionInfo.put( + "readFullDuplexAttribute", + readEthernetNetworkDiagnosticsFullDuplexAttributeInteractionInfo); Map readEthernetNetworkDiagnosticsPacketRxCountCommandParams = new LinkedHashMap(); - CommandInfo readEthernetNetworkDiagnosticsPacketRxCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readEthernetNetworkDiagnosticsPacketRxCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) .readPacketRxCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readEthernetNetworkDiagnosticsPacketRxCountCommandParams); - readEthernetNetworkDiagnosticsCommandInfo.put( + readEthernetNetworkDiagnosticsInteractionInfo.put( "readPacketRxCountAttribute", - readEthernetNetworkDiagnosticsPacketRxCountAttributeCommandInfo); + readEthernetNetworkDiagnosticsPacketRxCountAttributeInteractionInfo); Map readEthernetNetworkDiagnosticsPacketTxCountCommandParams = new LinkedHashMap(); - CommandInfo readEthernetNetworkDiagnosticsPacketTxCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readEthernetNetworkDiagnosticsPacketTxCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) .readPacketTxCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readEthernetNetworkDiagnosticsPacketTxCountCommandParams); - readEthernetNetworkDiagnosticsCommandInfo.put( + readEthernetNetworkDiagnosticsInteractionInfo.put( "readPacketTxCountAttribute", - readEthernetNetworkDiagnosticsPacketTxCountAttributeCommandInfo); + readEthernetNetworkDiagnosticsPacketTxCountAttributeInteractionInfo); Map readEthernetNetworkDiagnosticsTxErrCountCommandParams = new LinkedHashMap(); - CommandInfo readEthernetNetworkDiagnosticsTxErrCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readEthernetNetworkDiagnosticsTxErrCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) .readTxErrCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readEthernetNetworkDiagnosticsTxErrCountCommandParams); - readEthernetNetworkDiagnosticsCommandInfo.put( - "readTxErrCountAttribute", readEthernetNetworkDiagnosticsTxErrCountAttributeCommandInfo); + readEthernetNetworkDiagnosticsInteractionInfo.put( + "readTxErrCountAttribute", + readEthernetNetworkDiagnosticsTxErrCountAttributeInteractionInfo); Map readEthernetNetworkDiagnosticsCollisionCountCommandParams = new LinkedHashMap(); - CommandInfo readEthernetNetworkDiagnosticsCollisionCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readEthernetNetworkDiagnosticsCollisionCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) .readCollisionCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readEthernetNetworkDiagnosticsCollisionCountCommandParams); - readEthernetNetworkDiagnosticsCommandInfo.put( + readEthernetNetworkDiagnosticsInteractionInfo.put( "readCollisionCountAttribute", - readEthernetNetworkDiagnosticsCollisionCountAttributeCommandInfo); + readEthernetNetworkDiagnosticsCollisionCountAttributeInteractionInfo); Map readEthernetNetworkDiagnosticsOverrunCountCommandParams = new LinkedHashMap(); - CommandInfo readEthernetNetworkDiagnosticsOverrunCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readEthernetNetworkDiagnosticsOverrunCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) .readOverrunCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readEthernetNetworkDiagnosticsOverrunCountCommandParams); - readEthernetNetworkDiagnosticsCommandInfo.put( + readEthernetNetworkDiagnosticsInteractionInfo.put( "readOverrunCountAttribute", - readEthernetNetworkDiagnosticsOverrunCountAttributeCommandInfo); + readEthernetNetworkDiagnosticsOverrunCountAttributeInteractionInfo); Map readEthernetNetworkDiagnosticsCarrierDetectCommandParams = new LinkedHashMap(); - CommandInfo readEthernetNetworkDiagnosticsCarrierDetectAttributeCommandInfo = - new CommandInfo( + InteractionInfo readEthernetNetworkDiagnosticsCarrierDetectAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) .readCarrierDetectAttribute((ChipClusters.BooleanAttributeCallback) callback); }, () -> new DelegatedBooleanAttributeCallback(), readEthernetNetworkDiagnosticsCarrierDetectCommandParams); - readEthernetNetworkDiagnosticsCommandInfo.put( + readEthernetNetworkDiagnosticsInteractionInfo.put( "readCarrierDetectAttribute", - readEthernetNetworkDiagnosticsCarrierDetectAttributeCommandInfo); + readEthernetNetworkDiagnosticsCarrierDetectAttributeInteractionInfo); Map readEthernetNetworkDiagnosticsTimeSinceResetCommandParams = new LinkedHashMap(); - CommandInfo readEthernetNetworkDiagnosticsTimeSinceResetAttributeCommandInfo = - new CommandInfo( + InteractionInfo readEthernetNetworkDiagnosticsTimeSinceResetAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) .readTimeSinceResetAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readEthernetNetworkDiagnosticsTimeSinceResetCommandParams); - readEthernetNetworkDiagnosticsCommandInfo.put( + readEthernetNetworkDiagnosticsInteractionInfo.put( "readTimeSinceResetAttribute", - readEthernetNetworkDiagnosticsTimeSinceResetAttributeCommandInfo); + readEthernetNetworkDiagnosticsTimeSinceResetAttributeInteractionInfo); Map readEthernetNetworkDiagnosticsClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readEthernetNetworkDiagnosticsClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readEthernetNetworkDiagnosticsClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.EthernetNetworkDiagnosticsCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readEthernetNetworkDiagnosticsClusterRevisionCommandParams); - readEthernetNetworkDiagnosticsCommandInfo.put( + readEthernetNetworkDiagnosticsInteractionInfo.put( "readClusterRevisionAttribute", - readEthernetNetworkDiagnosticsClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap - .get("ethernetNetworkDiagnostics") - .combineCommands(readEthernetNetworkDiagnosticsCommandInfo); - Map readFixedLabelCommandInfo = new LinkedHashMap<>(); + readEthernetNetworkDiagnosticsClusterRevisionAttributeInteractionInfo); + readAttributeMap.put( + "ethernetNetworkDiagnostics", readEthernetNetworkDiagnosticsInteractionInfo); + Map readFixedLabelInteractionInfo = new LinkedHashMap<>(); // read attribute Map readFixedLabelLabelListCommandParams = new LinkedHashMap(); - CommandInfo readFixedLabelLabelListAttributeCommandInfo = - new CommandInfo( + InteractionInfo readFixedLabelLabelListAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.FixedLabelCluster) cluster) .readLabelListAttribute( @@ -10041,105 +10238,105 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedLabelListAttributeCallback(), readFixedLabelLabelListCommandParams); - readFixedLabelCommandInfo.put( - "readLabelListAttribute", readFixedLabelLabelListAttributeCommandInfo); + readFixedLabelInteractionInfo.put( + "readLabelListAttribute", readFixedLabelLabelListAttributeInteractionInfo); Map readFixedLabelClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readFixedLabelClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readFixedLabelClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.FixedLabelCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readFixedLabelClusterRevisionCommandParams); - readFixedLabelCommandInfo.put( - "readClusterRevisionAttribute", readFixedLabelClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("fixedLabel").combineCommands(readFixedLabelCommandInfo); - Map readFlowMeasurementCommandInfo = new LinkedHashMap<>(); + readFixedLabelInteractionInfo.put( + "readClusterRevisionAttribute", readFixedLabelClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("fixedLabel", readFixedLabelInteractionInfo); + Map readFlowMeasurementInteractionInfo = new LinkedHashMap<>(); // read attribute Map readFlowMeasurementMeasuredValueCommandParams = new LinkedHashMap(); - CommandInfo readFlowMeasurementMeasuredValueAttributeCommandInfo = - new CommandInfo( + InteractionInfo readFlowMeasurementMeasuredValueAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.FlowMeasurementCluster) cluster) .readMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readFlowMeasurementMeasuredValueCommandParams); - readFlowMeasurementCommandInfo.put( - "readMeasuredValueAttribute", readFlowMeasurementMeasuredValueAttributeCommandInfo); + readFlowMeasurementInteractionInfo.put( + "readMeasuredValueAttribute", readFlowMeasurementMeasuredValueAttributeInteractionInfo); Map readFlowMeasurementMinMeasuredValueCommandParams = new LinkedHashMap(); - CommandInfo readFlowMeasurementMinMeasuredValueAttributeCommandInfo = - new CommandInfo( + InteractionInfo readFlowMeasurementMinMeasuredValueAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.FlowMeasurementCluster) cluster) .readMinMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readFlowMeasurementMinMeasuredValueCommandParams); - readFlowMeasurementCommandInfo.put( - "readMinMeasuredValueAttribute", readFlowMeasurementMinMeasuredValueAttributeCommandInfo); + readFlowMeasurementInteractionInfo.put( + "readMinMeasuredValueAttribute", + readFlowMeasurementMinMeasuredValueAttributeInteractionInfo); Map readFlowMeasurementMaxMeasuredValueCommandParams = new LinkedHashMap(); - CommandInfo readFlowMeasurementMaxMeasuredValueAttributeCommandInfo = - new CommandInfo( + InteractionInfo readFlowMeasurementMaxMeasuredValueAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.FlowMeasurementCluster) cluster) .readMaxMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readFlowMeasurementMaxMeasuredValueCommandParams); - readFlowMeasurementCommandInfo.put( - "readMaxMeasuredValueAttribute", readFlowMeasurementMaxMeasuredValueAttributeCommandInfo); + readFlowMeasurementInteractionInfo.put( + "readMaxMeasuredValueAttribute", + readFlowMeasurementMaxMeasuredValueAttributeInteractionInfo); Map readFlowMeasurementToleranceCommandParams = new LinkedHashMap(); - CommandInfo readFlowMeasurementToleranceAttributeCommandInfo = - new CommandInfo( + InteractionInfo readFlowMeasurementToleranceAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.FlowMeasurementCluster) cluster) .readToleranceAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readFlowMeasurementToleranceCommandParams); - readFlowMeasurementCommandInfo.put( - "readToleranceAttribute", readFlowMeasurementToleranceAttributeCommandInfo); + readFlowMeasurementInteractionInfo.put( + "readToleranceAttribute", readFlowMeasurementToleranceAttributeInteractionInfo); Map readFlowMeasurementClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readFlowMeasurementClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readFlowMeasurementClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.FlowMeasurementCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readFlowMeasurementClusterRevisionCommandParams); - readFlowMeasurementCommandInfo.put( - "readClusterRevisionAttribute", readFlowMeasurementClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("flowMeasurement").combineCommands(readFlowMeasurementCommandInfo); - Map readGeneralCommissioningCommandInfo = new LinkedHashMap<>(); + readFlowMeasurementInteractionInfo.put( + "readClusterRevisionAttribute", readFlowMeasurementClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("flowMeasurement", readFlowMeasurementInteractionInfo); + Map readGeneralCommissioningInteractionInfo = new LinkedHashMap<>(); // read attribute Map readGeneralCommissioningBreadcrumbCommandParams = new LinkedHashMap(); - CommandInfo readGeneralCommissioningBreadcrumbAttributeCommandInfo = - new CommandInfo( + InteractionInfo readGeneralCommissioningBreadcrumbAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.GeneralCommissioningCluster) cluster) .readBreadcrumbAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readGeneralCommissioningBreadcrumbCommandParams); - readGeneralCommissioningCommandInfo.put( - "readBreadcrumbAttribute", readGeneralCommissioningBreadcrumbAttributeCommandInfo); + readGeneralCommissioningInteractionInfo.put( + "readBreadcrumbAttribute", readGeneralCommissioningBreadcrumbAttributeInteractionInfo); Map readGeneralCommissioningBasicCommissioningInfoListCommandParams = new LinkedHashMap(); - CommandInfo readGeneralCommissioningBasicCommissioningInfoListAttributeCommandInfo = - new CommandInfo( + InteractionInfo readGeneralCommissioningBasicCommissioningInfoListAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.GeneralCommissioningCluster) cluster) .readBasicCommissioningInfoListAttribute( @@ -10149,30 +10346,29 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedBasicCommissioningInfoListAttributeCallback(), readGeneralCommissioningBasicCommissioningInfoListCommandParams); - readGeneralCommissioningCommandInfo.put( + readGeneralCommissioningInteractionInfo.put( "readBasicCommissioningInfoListAttribute", - readGeneralCommissioningBasicCommissioningInfoListAttributeCommandInfo); + readGeneralCommissioningBasicCommissioningInfoListAttributeInteractionInfo); Map readGeneralCommissioningClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readGeneralCommissioningClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readGeneralCommissioningClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.GeneralCommissioningCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readGeneralCommissioningClusterRevisionCommandParams); - readGeneralCommissioningCommandInfo.put( + readGeneralCommissioningInteractionInfo.put( "readClusterRevisionAttribute", - readGeneralCommissioningClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("generalCommissioning").combineCommands(readGeneralCommissioningCommandInfo); - Map readGeneralDiagnosticsCommandInfo = new LinkedHashMap<>(); + readGeneralCommissioningClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("generalCommissioning", readGeneralCommissioningInteractionInfo); + Map readGeneralDiagnosticsInteractionInfo = new LinkedHashMap<>(); // read attribute Map readGeneralDiagnosticsNetworkInterfacesCommandParams = new LinkedHashMap(); - CommandInfo readGeneralDiagnosticsNetworkInterfacesAttributeCommandInfo = - new CommandInfo( + InteractionInfo readGeneralDiagnosticsNetworkInterfacesAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.GeneralDiagnosticsCluster) cluster) .readNetworkInterfacesAttribute( @@ -10181,37 +10377,37 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedNetworkInterfacesAttributeCallback(), readGeneralDiagnosticsNetworkInterfacesCommandParams); - readGeneralDiagnosticsCommandInfo.put( + readGeneralDiagnosticsInteractionInfo.put( "readNetworkInterfacesAttribute", - readGeneralDiagnosticsNetworkInterfacesAttributeCommandInfo); + readGeneralDiagnosticsNetworkInterfacesAttributeInteractionInfo); Map readGeneralDiagnosticsRebootCountCommandParams = new LinkedHashMap(); - CommandInfo readGeneralDiagnosticsRebootCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readGeneralDiagnosticsRebootCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.GeneralDiagnosticsCluster) cluster) .readRebootCountAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readGeneralDiagnosticsRebootCountCommandParams); - readGeneralDiagnosticsCommandInfo.put( - "readRebootCountAttribute", readGeneralDiagnosticsRebootCountAttributeCommandInfo); + readGeneralDiagnosticsInteractionInfo.put( + "readRebootCountAttribute", readGeneralDiagnosticsRebootCountAttributeInteractionInfo); Map readGeneralDiagnosticsUpTimeCommandParams = new LinkedHashMap(); - CommandInfo readGeneralDiagnosticsUpTimeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readGeneralDiagnosticsUpTimeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.GeneralDiagnosticsCluster) cluster) .readUpTimeAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readGeneralDiagnosticsUpTimeCommandParams); - readGeneralDiagnosticsCommandInfo.put( - "readUpTimeAttribute", readGeneralDiagnosticsUpTimeAttributeCommandInfo); + readGeneralDiagnosticsInteractionInfo.put( + "readUpTimeAttribute", readGeneralDiagnosticsUpTimeAttributeInteractionInfo); Map readGeneralDiagnosticsTotalOperationalHoursCommandParams = new LinkedHashMap(); - CommandInfo readGeneralDiagnosticsTotalOperationalHoursAttributeCommandInfo = - new CommandInfo( + InteractionInfo readGeneralDiagnosticsTotalOperationalHoursAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.GeneralDiagnosticsCluster) cluster) .readTotalOperationalHoursAttribute( @@ -10219,41 +10415,41 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedLongAttributeCallback(), readGeneralDiagnosticsTotalOperationalHoursCommandParams); - readGeneralDiagnosticsCommandInfo.put( + readGeneralDiagnosticsInteractionInfo.put( "readTotalOperationalHoursAttribute", - readGeneralDiagnosticsTotalOperationalHoursAttributeCommandInfo); + readGeneralDiagnosticsTotalOperationalHoursAttributeInteractionInfo); Map readGeneralDiagnosticsBootReasonsCommandParams = new LinkedHashMap(); - CommandInfo readGeneralDiagnosticsBootReasonsAttributeCommandInfo = - new CommandInfo( + InteractionInfo readGeneralDiagnosticsBootReasonsAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.GeneralDiagnosticsCluster) cluster) .readBootReasonsAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readGeneralDiagnosticsBootReasonsCommandParams); - readGeneralDiagnosticsCommandInfo.put( - "readBootReasonsAttribute", readGeneralDiagnosticsBootReasonsAttributeCommandInfo); + readGeneralDiagnosticsInteractionInfo.put( + "readBootReasonsAttribute", readGeneralDiagnosticsBootReasonsAttributeInteractionInfo); Map readGeneralDiagnosticsClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readGeneralDiagnosticsClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readGeneralDiagnosticsClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.GeneralDiagnosticsCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readGeneralDiagnosticsClusterRevisionCommandParams); - readGeneralDiagnosticsCommandInfo.put( - "readClusterRevisionAttribute", readGeneralDiagnosticsClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("generalDiagnostics").combineCommands(readGeneralDiagnosticsCommandInfo); - Map readGroupKeyManagementCommandInfo = new LinkedHashMap<>(); + readGeneralDiagnosticsInteractionInfo.put( + "readClusterRevisionAttribute", + readGeneralDiagnosticsClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("generalDiagnostics", readGeneralDiagnosticsInteractionInfo); + Map readGroupKeyManagementInteractionInfo = new LinkedHashMap<>(); // read attribute Map readGroupKeyManagementGroupsCommandParams = new LinkedHashMap(); - CommandInfo readGroupKeyManagementGroupsAttributeCommandInfo = - new CommandInfo( + InteractionInfo readGroupKeyManagementGroupsAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.GroupKeyManagementCluster) cluster) .readGroupsAttribute( @@ -10261,12 +10457,12 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedGroupsAttributeCallback(), readGroupKeyManagementGroupsCommandParams); - readGroupKeyManagementCommandInfo.put( - "readGroupsAttribute", readGroupKeyManagementGroupsAttributeCommandInfo); + readGroupKeyManagementInteractionInfo.put( + "readGroupsAttribute", readGroupKeyManagementGroupsAttributeInteractionInfo); Map readGroupKeyManagementGroupKeysCommandParams = new LinkedHashMap(); - CommandInfo readGroupKeyManagementGroupKeysAttributeCommandInfo = - new CommandInfo( + InteractionInfo readGroupKeyManagementGroupKeysAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.GroupKeyManagementCluster) cluster) .readGroupKeysAttribute( @@ -10274,288 +10470,285 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedGroupKeysAttributeCallback(), readGroupKeyManagementGroupKeysCommandParams); - readGroupKeyManagementCommandInfo.put( - "readGroupKeysAttribute", readGroupKeyManagementGroupKeysAttributeCommandInfo); + readGroupKeyManagementInteractionInfo.put( + "readGroupKeysAttribute", readGroupKeyManagementGroupKeysAttributeInteractionInfo); Map readGroupKeyManagementClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readGroupKeyManagementClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readGroupKeyManagementClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.GroupKeyManagementCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readGroupKeyManagementClusterRevisionCommandParams); - readGroupKeyManagementCommandInfo.put( - "readClusterRevisionAttribute", readGroupKeyManagementClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("groupKeyManagement").combineCommands(readGroupKeyManagementCommandInfo); - Map readGroupsCommandInfo = new LinkedHashMap<>(); + readGroupKeyManagementInteractionInfo.put( + "readClusterRevisionAttribute", + readGroupKeyManagementClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("groupKeyManagement", readGroupKeyManagementInteractionInfo); + Map readGroupsInteractionInfo = new LinkedHashMap<>(); // read attribute Map readGroupsNameSupportCommandParams = new LinkedHashMap(); - CommandInfo readGroupsNameSupportAttributeCommandInfo = - new CommandInfo( + InteractionInfo readGroupsNameSupportAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.GroupsCluster) cluster) .readNameSupportAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readGroupsNameSupportCommandParams); - readGroupsCommandInfo.put( - "readNameSupportAttribute", readGroupsNameSupportAttributeCommandInfo); + readGroupsInteractionInfo.put( + "readNameSupportAttribute", readGroupsNameSupportAttributeInteractionInfo); Map readGroupsClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readGroupsClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readGroupsClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.GroupsCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readGroupsClusterRevisionCommandParams); - readGroupsCommandInfo.put( - "readClusterRevisionAttribute", readGroupsClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("groups").combineCommands(readGroupsCommandInfo); - Map readIdentifyCommandInfo = new LinkedHashMap<>(); + readGroupsInteractionInfo.put( + "readClusterRevisionAttribute", readGroupsClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("groups", readGroupsInteractionInfo); + Map readIdentifyInteractionInfo = new LinkedHashMap<>(); // read attribute Map readIdentifyIdentifyTimeCommandParams = new LinkedHashMap(); - CommandInfo readIdentifyIdentifyTimeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readIdentifyIdentifyTimeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.IdentifyCluster) cluster) .readIdentifyTimeAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readIdentifyIdentifyTimeCommandParams); - readIdentifyCommandInfo.put( - "readIdentifyTimeAttribute", readIdentifyIdentifyTimeAttributeCommandInfo); + readIdentifyInteractionInfo.put( + "readIdentifyTimeAttribute", readIdentifyIdentifyTimeAttributeInteractionInfo); Map readIdentifyIdentifyTypeCommandParams = new LinkedHashMap(); - CommandInfo readIdentifyIdentifyTypeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readIdentifyIdentifyTypeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.IdentifyCluster) cluster) .readIdentifyTypeAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readIdentifyIdentifyTypeCommandParams); - readIdentifyCommandInfo.put( - "readIdentifyTypeAttribute", readIdentifyIdentifyTypeAttributeCommandInfo); + readIdentifyInteractionInfo.put( + "readIdentifyTypeAttribute", readIdentifyIdentifyTypeAttributeInteractionInfo); Map readIdentifyClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readIdentifyClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readIdentifyClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.IdentifyCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readIdentifyClusterRevisionCommandParams); - readIdentifyCommandInfo.put( - "readClusterRevisionAttribute", readIdentifyClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("identify").combineCommands(readIdentifyCommandInfo); - Map readIlluminanceMeasurementCommandInfo = new LinkedHashMap<>(); + readIdentifyInteractionInfo.put( + "readClusterRevisionAttribute", readIdentifyClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("identify", readIdentifyInteractionInfo); + Map readIlluminanceMeasurementInteractionInfo = new LinkedHashMap<>(); // read attribute Map readIlluminanceMeasurementMeasuredValueCommandParams = new LinkedHashMap(); - CommandInfo readIlluminanceMeasurementMeasuredValueAttributeCommandInfo = - new CommandInfo( + InteractionInfo readIlluminanceMeasurementMeasuredValueAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.IlluminanceMeasurementCluster) cluster) .readMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readIlluminanceMeasurementMeasuredValueCommandParams); - readIlluminanceMeasurementCommandInfo.put( - "readMeasuredValueAttribute", readIlluminanceMeasurementMeasuredValueAttributeCommandInfo); + readIlluminanceMeasurementInteractionInfo.put( + "readMeasuredValueAttribute", + readIlluminanceMeasurementMeasuredValueAttributeInteractionInfo); Map readIlluminanceMeasurementMinMeasuredValueCommandParams = new LinkedHashMap(); - CommandInfo readIlluminanceMeasurementMinMeasuredValueAttributeCommandInfo = - new CommandInfo( + InteractionInfo readIlluminanceMeasurementMinMeasuredValueAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.IlluminanceMeasurementCluster) cluster) .readMinMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readIlluminanceMeasurementMinMeasuredValueCommandParams); - readIlluminanceMeasurementCommandInfo.put( + readIlluminanceMeasurementInteractionInfo.put( "readMinMeasuredValueAttribute", - readIlluminanceMeasurementMinMeasuredValueAttributeCommandInfo); + readIlluminanceMeasurementMinMeasuredValueAttributeInteractionInfo); Map readIlluminanceMeasurementMaxMeasuredValueCommandParams = new LinkedHashMap(); - CommandInfo readIlluminanceMeasurementMaxMeasuredValueAttributeCommandInfo = - new CommandInfo( + InteractionInfo readIlluminanceMeasurementMaxMeasuredValueAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.IlluminanceMeasurementCluster) cluster) .readMaxMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readIlluminanceMeasurementMaxMeasuredValueCommandParams); - readIlluminanceMeasurementCommandInfo.put( + readIlluminanceMeasurementInteractionInfo.put( "readMaxMeasuredValueAttribute", - readIlluminanceMeasurementMaxMeasuredValueAttributeCommandInfo); + readIlluminanceMeasurementMaxMeasuredValueAttributeInteractionInfo); Map readIlluminanceMeasurementToleranceCommandParams = new LinkedHashMap(); - CommandInfo readIlluminanceMeasurementToleranceAttributeCommandInfo = - new CommandInfo( + InteractionInfo readIlluminanceMeasurementToleranceAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.IlluminanceMeasurementCluster) cluster) .readToleranceAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readIlluminanceMeasurementToleranceCommandParams); - readIlluminanceMeasurementCommandInfo.put( - "readToleranceAttribute", readIlluminanceMeasurementToleranceAttributeCommandInfo); + readIlluminanceMeasurementInteractionInfo.put( + "readToleranceAttribute", readIlluminanceMeasurementToleranceAttributeInteractionInfo); Map readIlluminanceMeasurementLightSensorTypeCommandParams = new LinkedHashMap(); - CommandInfo readIlluminanceMeasurementLightSensorTypeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readIlluminanceMeasurementLightSensorTypeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.IlluminanceMeasurementCluster) cluster) .readLightSensorTypeAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readIlluminanceMeasurementLightSensorTypeCommandParams); - readIlluminanceMeasurementCommandInfo.put( + readIlluminanceMeasurementInteractionInfo.put( "readLightSensorTypeAttribute", - readIlluminanceMeasurementLightSensorTypeAttributeCommandInfo); + readIlluminanceMeasurementLightSensorTypeAttributeInteractionInfo); Map readIlluminanceMeasurementClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readIlluminanceMeasurementClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readIlluminanceMeasurementClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.IlluminanceMeasurementCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readIlluminanceMeasurementClusterRevisionCommandParams); - readIlluminanceMeasurementCommandInfo.put( + readIlluminanceMeasurementInteractionInfo.put( "readClusterRevisionAttribute", - readIlluminanceMeasurementClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("illuminanceMeasurement").combineCommands(readIlluminanceMeasurementCommandInfo); - Map readKeypadInputCommandInfo = new LinkedHashMap<>(); + readIlluminanceMeasurementClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("illuminanceMeasurement", readIlluminanceMeasurementInteractionInfo); + Map readKeypadInputInteractionInfo = new LinkedHashMap<>(); // read attribute Map readKeypadInputClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readKeypadInputClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readKeypadInputClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.KeypadInputCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readKeypadInputClusterRevisionCommandParams); - readKeypadInputCommandInfo.put( - "readClusterRevisionAttribute", readKeypadInputClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("keypadInput").combineCommands(readKeypadInputCommandInfo); - Map readLevelControlCommandInfo = new LinkedHashMap<>(); + readKeypadInputInteractionInfo.put( + "readClusterRevisionAttribute", readKeypadInputClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("keypadInput", readKeypadInputInteractionInfo); + Map readLevelControlInteractionInfo = new LinkedHashMap<>(); // read attribute Map readLevelControlCurrentLevelCommandParams = new LinkedHashMap(); - CommandInfo readLevelControlCurrentLevelAttributeCommandInfo = - new CommandInfo( + InteractionInfo readLevelControlCurrentLevelAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.LevelControlCluster) cluster) .readCurrentLevelAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readLevelControlCurrentLevelCommandParams); - readLevelControlCommandInfo.put( - "readCurrentLevelAttribute", readLevelControlCurrentLevelAttributeCommandInfo); + readLevelControlInteractionInfo.put( + "readCurrentLevelAttribute", readLevelControlCurrentLevelAttributeInteractionInfo); Map readLevelControlRemainingTimeCommandParams = new LinkedHashMap(); - CommandInfo readLevelControlRemainingTimeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readLevelControlRemainingTimeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.LevelControlCluster) cluster) .readRemainingTimeAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readLevelControlRemainingTimeCommandParams); - readLevelControlCommandInfo.put( - "readRemainingTimeAttribute", readLevelControlRemainingTimeAttributeCommandInfo); + readLevelControlInteractionInfo.put( + "readRemainingTimeAttribute", readLevelControlRemainingTimeAttributeInteractionInfo); Map readLevelControlMinLevelCommandParams = new LinkedHashMap(); - CommandInfo readLevelControlMinLevelAttributeCommandInfo = - new CommandInfo( + InteractionInfo readLevelControlMinLevelAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.LevelControlCluster) cluster) .readMinLevelAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readLevelControlMinLevelCommandParams); - readLevelControlCommandInfo.put( - "readMinLevelAttribute", readLevelControlMinLevelAttributeCommandInfo); + readLevelControlInteractionInfo.put( + "readMinLevelAttribute", readLevelControlMinLevelAttributeInteractionInfo); Map readLevelControlMaxLevelCommandParams = new LinkedHashMap(); - CommandInfo readLevelControlMaxLevelAttributeCommandInfo = - new CommandInfo( + InteractionInfo readLevelControlMaxLevelAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.LevelControlCluster) cluster) .readMaxLevelAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readLevelControlMaxLevelCommandParams); - readLevelControlCommandInfo.put( - "readMaxLevelAttribute", readLevelControlMaxLevelAttributeCommandInfo); + readLevelControlInteractionInfo.put( + "readMaxLevelAttribute", readLevelControlMaxLevelAttributeInteractionInfo); Map readLevelControlCurrentFrequencyCommandParams = new LinkedHashMap(); - CommandInfo readLevelControlCurrentFrequencyAttributeCommandInfo = - new CommandInfo( + InteractionInfo readLevelControlCurrentFrequencyAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.LevelControlCluster) cluster) .readCurrentFrequencyAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readLevelControlCurrentFrequencyCommandParams); - readLevelControlCommandInfo.put( - "readCurrentFrequencyAttribute", readLevelControlCurrentFrequencyAttributeCommandInfo); + readLevelControlInteractionInfo.put( + "readCurrentFrequencyAttribute", readLevelControlCurrentFrequencyAttributeInteractionInfo); Map readLevelControlMinFrequencyCommandParams = new LinkedHashMap(); - CommandInfo readLevelControlMinFrequencyAttributeCommandInfo = - new CommandInfo( + InteractionInfo readLevelControlMinFrequencyAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.LevelControlCluster) cluster) .readMinFrequencyAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readLevelControlMinFrequencyCommandParams); - readLevelControlCommandInfo.put( - "readMinFrequencyAttribute", readLevelControlMinFrequencyAttributeCommandInfo); + readLevelControlInteractionInfo.put( + "readMinFrequencyAttribute", readLevelControlMinFrequencyAttributeInteractionInfo); Map readLevelControlMaxFrequencyCommandParams = new LinkedHashMap(); - CommandInfo readLevelControlMaxFrequencyAttributeCommandInfo = - new CommandInfo( + InteractionInfo readLevelControlMaxFrequencyAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.LevelControlCluster) cluster) .readMaxFrequencyAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readLevelControlMaxFrequencyCommandParams); - readLevelControlCommandInfo.put( - "readMaxFrequencyAttribute", readLevelControlMaxFrequencyAttributeCommandInfo); + readLevelControlInteractionInfo.put( + "readMaxFrequencyAttribute", readLevelControlMaxFrequencyAttributeInteractionInfo); Map readLevelControlOptionsCommandParams = new LinkedHashMap(); - CommandInfo readLevelControlOptionsAttributeCommandInfo = - new CommandInfo( + InteractionInfo readLevelControlOptionsAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.LevelControlCluster) cluster) .readOptionsAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readLevelControlOptionsCommandParams); - readLevelControlCommandInfo.put( - "readOptionsAttribute", readLevelControlOptionsAttributeCommandInfo); + readLevelControlInteractionInfo.put( + "readOptionsAttribute", readLevelControlOptionsAttributeInteractionInfo); Map readLevelControlOnOffTransitionTimeCommandParams = new LinkedHashMap(); - CommandInfo readLevelControlOnOffTransitionTimeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readLevelControlOnOffTransitionTimeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.LevelControlCluster) cluster) .readOnOffTransitionTimeAttribute( @@ -10563,61 +10756,62 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readLevelControlOnOffTransitionTimeCommandParams); - readLevelControlCommandInfo.put( + readLevelControlInteractionInfo.put( "readOnOffTransitionTimeAttribute", - readLevelControlOnOffTransitionTimeAttributeCommandInfo); + readLevelControlOnOffTransitionTimeAttributeInteractionInfo); Map readLevelControlOnLevelCommandParams = new LinkedHashMap(); - CommandInfo readLevelControlOnLevelAttributeCommandInfo = - new CommandInfo( + InteractionInfo readLevelControlOnLevelAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.LevelControlCluster) cluster) .readOnLevelAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readLevelControlOnLevelCommandParams); - readLevelControlCommandInfo.put( - "readOnLevelAttribute", readLevelControlOnLevelAttributeCommandInfo); + readLevelControlInteractionInfo.put( + "readOnLevelAttribute", readLevelControlOnLevelAttributeInteractionInfo); Map readLevelControlOnTransitionTimeCommandParams = new LinkedHashMap(); - CommandInfo readLevelControlOnTransitionTimeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readLevelControlOnTransitionTimeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.LevelControlCluster) cluster) .readOnTransitionTimeAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readLevelControlOnTransitionTimeCommandParams); - readLevelControlCommandInfo.put( - "readOnTransitionTimeAttribute", readLevelControlOnTransitionTimeAttributeCommandInfo); + readLevelControlInteractionInfo.put( + "readOnTransitionTimeAttribute", readLevelControlOnTransitionTimeAttributeInteractionInfo); Map readLevelControlOffTransitionTimeCommandParams = new LinkedHashMap(); - CommandInfo readLevelControlOffTransitionTimeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readLevelControlOffTransitionTimeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.LevelControlCluster) cluster) .readOffTransitionTimeAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readLevelControlOffTransitionTimeCommandParams); - readLevelControlCommandInfo.put( - "readOffTransitionTimeAttribute", readLevelControlOffTransitionTimeAttributeCommandInfo); + readLevelControlInteractionInfo.put( + "readOffTransitionTimeAttribute", + readLevelControlOffTransitionTimeAttributeInteractionInfo); Map readLevelControlDefaultMoveRateCommandParams = new LinkedHashMap(); - CommandInfo readLevelControlDefaultMoveRateAttributeCommandInfo = - new CommandInfo( + InteractionInfo readLevelControlDefaultMoveRateAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.LevelControlCluster) cluster) .readDefaultMoveRateAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readLevelControlDefaultMoveRateCommandParams); - readLevelControlCommandInfo.put( - "readDefaultMoveRateAttribute", readLevelControlDefaultMoveRateAttributeCommandInfo); + readLevelControlInteractionInfo.put( + "readDefaultMoveRateAttribute", readLevelControlDefaultMoveRateAttributeInteractionInfo); Map readLevelControlStartUpCurrentLevelCommandParams = new LinkedHashMap(); - CommandInfo readLevelControlStartUpCurrentLevelAttributeCommandInfo = - new CommandInfo( + InteractionInfo readLevelControlStartUpCurrentLevelAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.LevelControlCluster) cluster) .readStartUpCurrentLevelAttribute( @@ -10625,45 +10819,43 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readLevelControlStartUpCurrentLevelCommandParams); - readLevelControlCommandInfo.put( + readLevelControlInteractionInfo.put( "readStartUpCurrentLevelAttribute", - readLevelControlStartUpCurrentLevelAttributeCommandInfo); + readLevelControlStartUpCurrentLevelAttributeInteractionInfo); Map readLevelControlClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readLevelControlClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readLevelControlClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.LevelControlCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readLevelControlClusterRevisionCommandParams); - readLevelControlCommandInfo.put( - "readClusterRevisionAttribute", readLevelControlClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("levelControl").combineCommands(readLevelControlCommandInfo); - Map readLowPowerCommandInfo = new LinkedHashMap<>(); + readLevelControlInteractionInfo.put( + "readClusterRevisionAttribute", readLevelControlClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("levelControl", readLevelControlInteractionInfo); + Map readLowPowerInteractionInfo = new LinkedHashMap<>(); // read attribute Map readLowPowerClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readLowPowerClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readLowPowerClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.LowPowerCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readLowPowerClusterRevisionCommandParams); - readLowPowerCommandInfo.put( - "readClusterRevisionAttribute", readLowPowerClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("lowPower").combineCommands(readLowPowerCommandInfo); - Map readMediaInputCommandInfo = new LinkedHashMap<>(); + readLowPowerInteractionInfo.put( + "readClusterRevisionAttribute", readLowPowerClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("lowPower", readLowPowerInteractionInfo); + Map readMediaInputInteractionInfo = new LinkedHashMap<>(); // read attribute Map readMediaInputMediaInputListCommandParams = new LinkedHashMap(); - CommandInfo readMediaInputMediaInputListAttributeCommandInfo = - new CommandInfo( + InteractionInfo readMediaInputMediaInputListAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaInputCluster) cluster) .readMediaInputListAttribute( @@ -10671,164 +10863,163 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedMediaInputListAttributeCallback(), readMediaInputMediaInputListCommandParams); - readMediaInputCommandInfo.put( - "readMediaInputListAttribute", readMediaInputMediaInputListAttributeCommandInfo); + readMediaInputInteractionInfo.put( + "readMediaInputListAttribute", readMediaInputMediaInputListAttributeInteractionInfo); Map readMediaInputCurrentMediaInputCommandParams = new LinkedHashMap(); - CommandInfo readMediaInputCurrentMediaInputAttributeCommandInfo = - new CommandInfo( + InteractionInfo readMediaInputCurrentMediaInputAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaInputCluster) cluster) .readCurrentMediaInputAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readMediaInputCurrentMediaInputCommandParams); - readMediaInputCommandInfo.put( - "readCurrentMediaInputAttribute", readMediaInputCurrentMediaInputAttributeCommandInfo); + readMediaInputInteractionInfo.put( + "readCurrentMediaInputAttribute", readMediaInputCurrentMediaInputAttributeInteractionInfo); Map readMediaInputClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readMediaInputClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readMediaInputClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaInputCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readMediaInputClusterRevisionCommandParams); - readMediaInputCommandInfo.put( - "readClusterRevisionAttribute", readMediaInputClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("mediaInput").combineCommands(readMediaInputCommandInfo); - Map readMediaPlaybackCommandInfo = new LinkedHashMap<>(); + readMediaInputInteractionInfo.put( + "readClusterRevisionAttribute", readMediaInputClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("mediaInput", readMediaInputInteractionInfo); + Map readMediaPlaybackInteractionInfo = new LinkedHashMap<>(); // read attribute Map readMediaPlaybackPlaybackStateCommandParams = new LinkedHashMap(); - CommandInfo readMediaPlaybackPlaybackStateAttributeCommandInfo = - new CommandInfo( + InteractionInfo readMediaPlaybackPlaybackStateAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) .readPlaybackStateAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readMediaPlaybackPlaybackStateCommandParams); - readMediaPlaybackCommandInfo.put( - "readPlaybackStateAttribute", readMediaPlaybackPlaybackStateAttributeCommandInfo); + readMediaPlaybackInteractionInfo.put( + "readPlaybackStateAttribute", readMediaPlaybackPlaybackStateAttributeInteractionInfo); Map readMediaPlaybackStartTimeCommandParams = new LinkedHashMap(); - CommandInfo readMediaPlaybackStartTimeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readMediaPlaybackStartTimeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) .readStartTimeAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readMediaPlaybackStartTimeCommandParams); - readMediaPlaybackCommandInfo.put( - "readStartTimeAttribute", readMediaPlaybackStartTimeAttributeCommandInfo); + readMediaPlaybackInteractionInfo.put( + "readStartTimeAttribute", readMediaPlaybackStartTimeAttributeInteractionInfo); Map readMediaPlaybackDurationCommandParams = new LinkedHashMap(); - CommandInfo readMediaPlaybackDurationAttributeCommandInfo = - new CommandInfo( + InteractionInfo readMediaPlaybackDurationAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) .readDurationAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readMediaPlaybackDurationCommandParams); - readMediaPlaybackCommandInfo.put( - "readDurationAttribute", readMediaPlaybackDurationAttributeCommandInfo); + readMediaPlaybackInteractionInfo.put( + "readDurationAttribute", readMediaPlaybackDurationAttributeInteractionInfo); Map readMediaPlaybackPositionUpdatedAtCommandParams = new LinkedHashMap(); - CommandInfo readMediaPlaybackPositionUpdatedAtAttributeCommandInfo = - new CommandInfo( + InteractionInfo readMediaPlaybackPositionUpdatedAtAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) .readPositionUpdatedAtAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readMediaPlaybackPositionUpdatedAtCommandParams); - readMediaPlaybackCommandInfo.put( - "readPositionUpdatedAtAttribute", readMediaPlaybackPositionUpdatedAtAttributeCommandInfo); + readMediaPlaybackInteractionInfo.put( + "readPositionUpdatedAtAttribute", + readMediaPlaybackPositionUpdatedAtAttributeInteractionInfo); Map readMediaPlaybackPositionCommandParams = new LinkedHashMap(); - CommandInfo readMediaPlaybackPositionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readMediaPlaybackPositionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) .readPositionAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readMediaPlaybackPositionCommandParams); - readMediaPlaybackCommandInfo.put( - "readPositionAttribute", readMediaPlaybackPositionAttributeCommandInfo); + readMediaPlaybackInteractionInfo.put( + "readPositionAttribute", readMediaPlaybackPositionAttributeInteractionInfo); Map readMediaPlaybackPlaybackSpeedCommandParams = new LinkedHashMap(); - CommandInfo readMediaPlaybackPlaybackSpeedAttributeCommandInfo = - new CommandInfo( + InteractionInfo readMediaPlaybackPlaybackSpeedAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) .readPlaybackSpeedAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readMediaPlaybackPlaybackSpeedCommandParams); - readMediaPlaybackCommandInfo.put( - "readPlaybackSpeedAttribute", readMediaPlaybackPlaybackSpeedAttributeCommandInfo); + readMediaPlaybackInteractionInfo.put( + "readPlaybackSpeedAttribute", readMediaPlaybackPlaybackSpeedAttributeInteractionInfo); Map readMediaPlaybackSeekRangeEndCommandParams = new LinkedHashMap(); - CommandInfo readMediaPlaybackSeekRangeEndAttributeCommandInfo = - new CommandInfo( + InteractionInfo readMediaPlaybackSeekRangeEndAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) .readSeekRangeEndAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readMediaPlaybackSeekRangeEndCommandParams); - readMediaPlaybackCommandInfo.put( - "readSeekRangeEndAttribute", readMediaPlaybackSeekRangeEndAttributeCommandInfo); + readMediaPlaybackInteractionInfo.put( + "readSeekRangeEndAttribute", readMediaPlaybackSeekRangeEndAttributeInteractionInfo); Map readMediaPlaybackSeekRangeStartCommandParams = new LinkedHashMap(); - CommandInfo readMediaPlaybackSeekRangeStartAttributeCommandInfo = - new CommandInfo( + InteractionInfo readMediaPlaybackSeekRangeStartAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) .readSeekRangeStartAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readMediaPlaybackSeekRangeStartCommandParams); - readMediaPlaybackCommandInfo.put( - "readSeekRangeStartAttribute", readMediaPlaybackSeekRangeStartAttributeCommandInfo); + readMediaPlaybackInteractionInfo.put( + "readSeekRangeStartAttribute", readMediaPlaybackSeekRangeStartAttributeInteractionInfo); Map readMediaPlaybackClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readMediaPlaybackClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readMediaPlaybackClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readMediaPlaybackClusterRevisionCommandParams); - readMediaPlaybackCommandInfo.put( - "readClusterRevisionAttribute", readMediaPlaybackClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("mediaPlayback").combineCommands(readMediaPlaybackCommandInfo); - Map readModeSelectCommandInfo = new LinkedHashMap<>(); + readMediaPlaybackInteractionInfo.put( + "readClusterRevisionAttribute", readMediaPlaybackClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("mediaPlayback", readMediaPlaybackInteractionInfo); + Map readModeSelectInteractionInfo = new LinkedHashMap<>(); // read attribute Map readModeSelectCurrentModeCommandParams = new LinkedHashMap(); - CommandInfo readModeSelectCurrentModeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readModeSelectCurrentModeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ModeSelectCluster) cluster) .readCurrentModeAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readModeSelectCurrentModeCommandParams); - readModeSelectCommandInfo.put( - "readCurrentModeAttribute", readModeSelectCurrentModeAttributeCommandInfo); + readModeSelectInteractionInfo.put( + "readCurrentModeAttribute", readModeSelectCurrentModeAttributeInteractionInfo); Map readModeSelectSupportedModesCommandParams = new LinkedHashMap(); - CommandInfo readModeSelectSupportedModesAttributeCommandInfo = - new CommandInfo( + InteractionInfo readModeSelectSupportedModesAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ModeSelectCluster) cluster) .readSupportedModesAttribute( @@ -10836,112 +11027,110 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedSupportedModesAttributeCallback(), readModeSelectSupportedModesCommandParams); - readModeSelectCommandInfo.put( - "readSupportedModesAttribute", readModeSelectSupportedModesAttributeCommandInfo); + readModeSelectInteractionInfo.put( + "readSupportedModesAttribute", readModeSelectSupportedModesAttributeInteractionInfo); Map readModeSelectOnModeCommandParams = new LinkedHashMap(); - CommandInfo readModeSelectOnModeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readModeSelectOnModeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ModeSelectCluster) cluster) .readOnModeAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readModeSelectOnModeCommandParams); - readModeSelectCommandInfo.put("readOnModeAttribute", readModeSelectOnModeAttributeCommandInfo); + readModeSelectInteractionInfo.put( + "readOnModeAttribute", readModeSelectOnModeAttributeInteractionInfo); Map readModeSelectStartUpModeCommandParams = new LinkedHashMap(); - CommandInfo readModeSelectStartUpModeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readModeSelectStartUpModeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ModeSelectCluster) cluster) .readStartUpModeAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readModeSelectStartUpModeCommandParams); - readModeSelectCommandInfo.put( - "readStartUpModeAttribute", readModeSelectStartUpModeAttributeCommandInfo); + readModeSelectInteractionInfo.put( + "readStartUpModeAttribute", readModeSelectStartUpModeAttributeInteractionInfo); Map readModeSelectDescriptionCommandParams = new LinkedHashMap(); - CommandInfo readModeSelectDescriptionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readModeSelectDescriptionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ModeSelectCluster) cluster) .readDescriptionAttribute((ChipClusters.CharStringAttributeCallback) callback); }, () -> new DelegatedCharStringAttributeCallback(), readModeSelectDescriptionCommandParams); - readModeSelectCommandInfo.put( - "readDescriptionAttribute", readModeSelectDescriptionAttributeCommandInfo); + readModeSelectInteractionInfo.put( + "readDescriptionAttribute", readModeSelectDescriptionAttributeInteractionInfo); Map readModeSelectClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readModeSelectClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readModeSelectClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ModeSelectCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readModeSelectClusterRevisionCommandParams); - readModeSelectCommandInfo.put( - "readClusterRevisionAttribute", readModeSelectClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("modeSelect").combineCommands(readModeSelectCommandInfo); - Map readNetworkCommissioningCommandInfo = new LinkedHashMap<>(); + readModeSelectInteractionInfo.put( + "readClusterRevisionAttribute", readModeSelectClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("modeSelect", readModeSelectInteractionInfo); + Map readNetworkCommissioningInteractionInfo = new LinkedHashMap<>(); // read attribute Map readNetworkCommissioningFeatureMapCommandParams = new LinkedHashMap(); - CommandInfo readNetworkCommissioningFeatureMapAttributeCommandInfo = - new CommandInfo( + InteractionInfo readNetworkCommissioningFeatureMapAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.NetworkCommissioningCluster) cluster) .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readNetworkCommissioningFeatureMapCommandParams); - readNetworkCommissioningCommandInfo.put( - "readFeatureMapAttribute", readNetworkCommissioningFeatureMapAttributeCommandInfo); + readNetworkCommissioningInteractionInfo.put( + "readFeatureMapAttribute", readNetworkCommissioningFeatureMapAttributeInteractionInfo); Map readNetworkCommissioningClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readNetworkCommissioningClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readNetworkCommissioningClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.NetworkCommissioningCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readNetworkCommissioningClusterRevisionCommandParams); - readNetworkCommissioningCommandInfo.put( + readNetworkCommissioningInteractionInfo.put( "readClusterRevisionAttribute", - readNetworkCommissioningClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("networkCommissioning").combineCommands(readNetworkCommissioningCommandInfo); - Map readOtaSoftwareUpdateProviderCommandInfo = new LinkedHashMap<>(); + readNetworkCommissioningClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("networkCommissioning", readNetworkCommissioningInteractionInfo); + Map readOtaSoftwareUpdateProviderInteractionInfo = + new LinkedHashMap<>(); // read attribute Map readOtaSoftwareUpdateProviderClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readOtaSoftwareUpdateProviderClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readOtaSoftwareUpdateProviderClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OtaSoftwareUpdateProviderCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readOtaSoftwareUpdateProviderClusterRevisionCommandParams); - readOtaSoftwareUpdateProviderCommandInfo.put( + readOtaSoftwareUpdateProviderInteractionInfo.put( "readClusterRevisionAttribute", - readOtaSoftwareUpdateProviderClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap - .get("otaSoftwareUpdateProvider") - .combineCommands(readOtaSoftwareUpdateProviderCommandInfo); - Map readOtaSoftwareUpdateRequestorCommandInfo = new LinkedHashMap<>(); + readOtaSoftwareUpdateProviderClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("otaSoftwareUpdateProvider", readOtaSoftwareUpdateProviderInteractionInfo); + Map readOtaSoftwareUpdateRequestorInteractionInfo = + new LinkedHashMap<>(); // read attribute Map readOtaSoftwareUpdateRequestorDefaultOtaProviderCommandParams = new LinkedHashMap(); - CommandInfo readOtaSoftwareUpdateRequestorDefaultOtaProviderAttributeCommandInfo = - new CommandInfo( + InteractionInfo readOtaSoftwareUpdateRequestorDefaultOtaProviderAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OtaSoftwareUpdateRequestorCluster) cluster) .readDefaultOtaProviderAttribute( @@ -10949,57 +11138,55 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedOctetStringAttributeCallback(), readOtaSoftwareUpdateRequestorDefaultOtaProviderCommandParams); - readOtaSoftwareUpdateRequestorCommandInfo.put( + readOtaSoftwareUpdateRequestorInteractionInfo.put( "readDefaultOtaProviderAttribute", - readOtaSoftwareUpdateRequestorDefaultOtaProviderAttributeCommandInfo); + readOtaSoftwareUpdateRequestorDefaultOtaProviderAttributeInteractionInfo); Map readOtaSoftwareUpdateRequestorUpdatePossibleCommandParams = new LinkedHashMap(); - CommandInfo readOtaSoftwareUpdateRequestorUpdatePossibleAttributeCommandInfo = - new CommandInfo( + InteractionInfo readOtaSoftwareUpdateRequestorUpdatePossibleAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OtaSoftwareUpdateRequestorCluster) cluster) .readUpdatePossibleAttribute((ChipClusters.BooleanAttributeCallback) callback); }, () -> new DelegatedBooleanAttributeCallback(), readOtaSoftwareUpdateRequestorUpdatePossibleCommandParams); - readOtaSoftwareUpdateRequestorCommandInfo.put( + readOtaSoftwareUpdateRequestorInteractionInfo.put( "readUpdatePossibleAttribute", - readOtaSoftwareUpdateRequestorUpdatePossibleAttributeCommandInfo); + readOtaSoftwareUpdateRequestorUpdatePossibleAttributeInteractionInfo); Map readOtaSoftwareUpdateRequestorClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readOtaSoftwareUpdateRequestorClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readOtaSoftwareUpdateRequestorClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OtaSoftwareUpdateRequestorCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readOtaSoftwareUpdateRequestorClusterRevisionCommandParams); - readOtaSoftwareUpdateRequestorCommandInfo.put( + readOtaSoftwareUpdateRequestorInteractionInfo.put( "readClusterRevisionAttribute", - readOtaSoftwareUpdateRequestorClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap - .get("otaSoftwareUpdateRequestor") - .combineCommands(readOtaSoftwareUpdateRequestorCommandInfo); - Map readOccupancySensingCommandInfo = new LinkedHashMap<>(); + readOtaSoftwareUpdateRequestorClusterRevisionAttributeInteractionInfo); + readAttributeMap.put( + "otaSoftwareUpdateRequestor", readOtaSoftwareUpdateRequestorInteractionInfo); + Map readOccupancySensingInteractionInfo = new LinkedHashMap<>(); // read attribute Map readOccupancySensingOccupancyCommandParams = new LinkedHashMap(); - CommandInfo readOccupancySensingOccupancyAttributeCommandInfo = - new CommandInfo( + InteractionInfo readOccupancySensingOccupancyAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OccupancySensingCluster) cluster) .readOccupancyAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readOccupancySensingOccupancyCommandParams); - readOccupancySensingCommandInfo.put( - "readOccupancyAttribute", readOccupancySensingOccupancyAttributeCommandInfo); + readOccupancySensingInteractionInfo.put( + "readOccupancyAttribute", readOccupancySensingOccupancyAttributeInteractionInfo); Map readOccupancySensingOccupancySensorTypeCommandParams = new LinkedHashMap(); - CommandInfo readOccupancySensingOccupancySensorTypeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readOccupancySensingOccupancySensorTypeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OccupancySensingCluster) cluster) .readOccupancySensorTypeAttribute( @@ -11007,13 +11194,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readOccupancySensingOccupancySensorTypeCommandParams); - readOccupancySensingCommandInfo.put( + readOccupancySensingInteractionInfo.put( "readOccupancySensorTypeAttribute", - readOccupancySensingOccupancySensorTypeAttributeCommandInfo); + readOccupancySensingOccupancySensorTypeAttributeInteractionInfo); Map readOccupancySensingOccupancySensorTypeBitmapCommandParams = new LinkedHashMap(); - CommandInfo readOccupancySensingOccupancySensorTypeBitmapAttributeCommandInfo = - new CommandInfo( + InteractionInfo readOccupancySensingOccupancySensorTypeBitmapAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OccupancySensingCluster) cluster) .readOccupancySensorTypeBitmapAttribute( @@ -11021,40 +11208,40 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readOccupancySensingOccupancySensorTypeBitmapCommandParams); - readOccupancySensingCommandInfo.put( + readOccupancySensingInteractionInfo.put( "readOccupancySensorTypeBitmapAttribute", - readOccupancySensingOccupancySensorTypeBitmapAttributeCommandInfo); + readOccupancySensingOccupancySensorTypeBitmapAttributeInteractionInfo); Map readOccupancySensingClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readOccupancySensingClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readOccupancySensingClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OccupancySensingCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readOccupancySensingClusterRevisionCommandParams); - readOccupancySensingCommandInfo.put( - "readClusterRevisionAttribute", readOccupancySensingClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("occupancySensing").combineCommands(readOccupancySensingCommandInfo); - Map readOnOffCommandInfo = new LinkedHashMap<>(); + readOccupancySensingInteractionInfo.put( + "readClusterRevisionAttribute", + readOccupancySensingClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("occupancySensing", readOccupancySensingInteractionInfo); + Map readOnOffInteractionInfo = new LinkedHashMap<>(); // read attribute Map readOnOffOnOffCommandParams = new LinkedHashMap(); - CommandInfo readOnOffOnOffAttributeCommandInfo = - new CommandInfo( + InteractionInfo readOnOffOnOffAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OnOffCluster) cluster) .readOnOffAttribute((ChipClusters.BooleanAttributeCallback) callback); }, () -> new DelegatedBooleanAttributeCallback(), readOnOffOnOffCommandParams); - readOnOffCommandInfo.put("readOnOffAttribute", readOnOffOnOffAttributeCommandInfo); + readOnOffInteractionInfo.put("readOnOffAttribute", readOnOffOnOffAttributeInteractionInfo); Map readOnOffGlobalSceneControlCommandParams = new LinkedHashMap(); - CommandInfo readOnOffGlobalSceneControlAttributeCommandInfo = - new CommandInfo( + InteractionInfo readOnOffGlobalSceneControlAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OnOffCluster) cluster) .readGlobalSceneControlAttribute( @@ -11062,117 +11249,116 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedBooleanAttributeCallback(), readOnOffGlobalSceneControlCommandParams); - readOnOffCommandInfo.put( - "readGlobalSceneControlAttribute", readOnOffGlobalSceneControlAttributeCommandInfo); + readOnOffInteractionInfo.put( + "readGlobalSceneControlAttribute", readOnOffGlobalSceneControlAttributeInteractionInfo); Map readOnOffOnTimeCommandParams = new LinkedHashMap(); - CommandInfo readOnOffOnTimeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readOnOffOnTimeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OnOffCluster) cluster) .readOnTimeAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readOnOffOnTimeCommandParams); - readOnOffCommandInfo.put("readOnTimeAttribute", readOnOffOnTimeAttributeCommandInfo); + readOnOffInteractionInfo.put("readOnTimeAttribute", readOnOffOnTimeAttributeInteractionInfo); Map readOnOffOffWaitTimeCommandParams = new LinkedHashMap(); - CommandInfo readOnOffOffWaitTimeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readOnOffOffWaitTimeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OnOffCluster) cluster) .readOffWaitTimeAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readOnOffOffWaitTimeCommandParams); - readOnOffCommandInfo.put("readOffWaitTimeAttribute", readOnOffOffWaitTimeAttributeCommandInfo); + readOnOffInteractionInfo.put( + "readOffWaitTimeAttribute", readOnOffOffWaitTimeAttributeInteractionInfo); Map readOnOffStartUpOnOffCommandParams = new LinkedHashMap(); - CommandInfo readOnOffStartUpOnOffAttributeCommandInfo = - new CommandInfo( + InteractionInfo readOnOffStartUpOnOffAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OnOffCluster) cluster) .readStartUpOnOffAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readOnOffStartUpOnOffCommandParams); - readOnOffCommandInfo.put( - "readStartUpOnOffAttribute", readOnOffStartUpOnOffAttributeCommandInfo); + readOnOffInteractionInfo.put( + "readStartUpOnOffAttribute", readOnOffStartUpOnOffAttributeInteractionInfo); Map readOnOffFeatureMapCommandParams = new LinkedHashMap(); - CommandInfo readOnOffFeatureMapAttributeCommandInfo = - new CommandInfo( + InteractionInfo readOnOffFeatureMapAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OnOffCluster) cluster) .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readOnOffFeatureMapCommandParams); - readOnOffCommandInfo.put("readFeatureMapAttribute", readOnOffFeatureMapAttributeCommandInfo); + readOnOffInteractionInfo.put( + "readFeatureMapAttribute", readOnOffFeatureMapAttributeInteractionInfo); Map readOnOffClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readOnOffClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readOnOffClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OnOffCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readOnOffClusterRevisionCommandParams); - readOnOffCommandInfo.put( - "readClusterRevisionAttribute", readOnOffClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("onOff").combineCommands(readOnOffCommandInfo); - Map readOnOffSwitchConfigurationCommandInfo = new LinkedHashMap<>(); + readOnOffInteractionInfo.put( + "readClusterRevisionAttribute", readOnOffClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("onOff", readOnOffInteractionInfo); + Map readOnOffSwitchConfigurationInteractionInfo = + new LinkedHashMap<>(); // read attribute Map readOnOffSwitchConfigurationSwitchTypeCommandParams = new LinkedHashMap(); - CommandInfo readOnOffSwitchConfigurationSwitchTypeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readOnOffSwitchConfigurationSwitchTypeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OnOffSwitchConfigurationCluster) cluster) .readSwitchTypeAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readOnOffSwitchConfigurationSwitchTypeCommandParams); - readOnOffSwitchConfigurationCommandInfo.put( - "readSwitchTypeAttribute", readOnOffSwitchConfigurationSwitchTypeAttributeCommandInfo); + readOnOffSwitchConfigurationInteractionInfo.put( + "readSwitchTypeAttribute", readOnOffSwitchConfigurationSwitchTypeAttributeInteractionInfo); Map readOnOffSwitchConfigurationSwitchActionsCommandParams = new LinkedHashMap(); - CommandInfo readOnOffSwitchConfigurationSwitchActionsAttributeCommandInfo = - new CommandInfo( + InteractionInfo readOnOffSwitchConfigurationSwitchActionsAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OnOffSwitchConfigurationCluster) cluster) .readSwitchActionsAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readOnOffSwitchConfigurationSwitchActionsCommandParams); - readOnOffSwitchConfigurationCommandInfo.put( + readOnOffSwitchConfigurationInteractionInfo.put( "readSwitchActionsAttribute", - readOnOffSwitchConfigurationSwitchActionsAttributeCommandInfo); + readOnOffSwitchConfigurationSwitchActionsAttributeInteractionInfo); Map readOnOffSwitchConfigurationClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readOnOffSwitchConfigurationClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readOnOffSwitchConfigurationClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OnOffSwitchConfigurationCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readOnOffSwitchConfigurationClusterRevisionCommandParams); - readOnOffSwitchConfigurationCommandInfo.put( + readOnOffSwitchConfigurationInteractionInfo.put( "readClusterRevisionAttribute", - readOnOffSwitchConfigurationClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap - .get("onOffSwitchConfiguration") - .combineCommands(readOnOffSwitchConfigurationCommandInfo); - Map readOperationalCredentialsCommandInfo = new LinkedHashMap<>(); + readOnOffSwitchConfigurationClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("onOffSwitchConfiguration", readOnOffSwitchConfigurationInteractionInfo); + Map readOperationalCredentialsInteractionInfo = new LinkedHashMap<>(); // read attribute Map readOperationalCredentialsFabricsListCommandParams = new LinkedHashMap(); - CommandInfo readOperationalCredentialsFabricsListAttributeCommandInfo = - new CommandInfo( + InteractionInfo readOperationalCredentialsFabricsListAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OperationalCredentialsCluster) cluster) .readFabricsListAttribute( @@ -11181,25 +11367,25 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedFabricsListAttributeCallback(), readOperationalCredentialsFabricsListCommandParams); - readOperationalCredentialsCommandInfo.put( - "readFabricsListAttribute", readOperationalCredentialsFabricsListAttributeCommandInfo); + readOperationalCredentialsInteractionInfo.put( + "readFabricsListAttribute", readOperationalCredentialsFabricsListAttributeInteractionInfo); Map readOperationalCredentialsSupportedFabricsCommandParams = new LinkedHashMap(); - CommandInfo readOperationalCredentialsSupportedFabricsAttributeCommandInfo = - new CommandInfo( + InteractionInfo readOperationalCredentialsSupportedFabricsAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OperationalCredentialsCluster) cluster) .readSupportedFabricsAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readOperationalCredentialsSupportedFabricsCommandParams); - readOperationalCredentialsCommandInfo.put( + readOperationalCredentialsInteractionInfo.put( "readSupportedFabricsAttribute", - readOperationalCredentialsSupportedFabricsAttributeCommandInfo); + readOperationalCredentialsSupportedFabricsAttributeInteractionInfo); Map readOperationalCredentialsCommissionedFabricsCommandParams = new LinkedHashMap(); - CommandInfo readOperationalCredentialsCommissionedFabricsAttributeCommandInfo = - new CommandInfo( + InteractionInfo readOperationalCredentialsCommissionedFabricsAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OperationalCredentialsCluster) cluster) .readCommissionedFabricsAttribute( @@ -11207,14 +11393,14 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readOperationalCredentialsCommissionedFabricsCommandParams); - readOperationalCredentialsCommandInfo.put( + readOperationalCredentialsInteractionInfo.put( "readCommissionedFabricsAttribute", - readOperationalCredentialsCommissionedFabricsAttributeCommandInfo); + readOperationalCredentialsCommissionedFabricsAttributeInteractionInfo); Map readOperationalCredentialsTrustedRootCertificatesCommandParams = new LinkedHashMap(); - CommandInfo readOperationalCredentialsTrustedRootCertificatesAttributeCommandInfo = - new CommandInfo( + InteractionInfo readOperationalCredentialsTrustedRootCertificatesAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OperationalCredentialsCluster) cluster) .readTrustedRootCertificatesAttribute( @@ -11224,13 +11410,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedTrustedRootCertificatesAttributeCallback(), readOperationalCredentialsTrustedRootCertificatesCommandParams); - readOperationalCredentialsCommandInfo.put( + readOperationalCredentialsInteractionInfo.put( "readTrustedRootCertificatesAttribute", - readOperationalCredentialsTrustedRootCertificatesAttributeCommandInfo); + readOperationalCredentialsTrustedRootCertificatesAttributeInteractionInfo); Map readOperationalCredentialsCurrentFabricIndexCommandParams = new LinkedHashMap(); - CommandInfo readOperationalCredentialsCurrentFabricIndexAttributeCommandInfo = - new CommandInfo( + InteractionInfo readOperationalCredentialsCurrentFabricIndexAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OperationalCredentialsCluster) cluster) .readCurrentFabricIndexAttribute( @@ -11238,77 +11424,77 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readOperationalCredentialsCurrentFabricIndexCommandParams); - readOperationalCredentialsCommandInfo.put( + readOperationalCredentialsInteractionInfo.put( "readCurrentFabricIndexAttribute", - readOperationalCredentialsCurrentFabricIndexAttributeCommandInfo); + readOperationalCredentialsCurrentFabricIndexAttributeInteractionInfo); Map readOperationalCredentialsClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readOperationalCredentialsClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readOperationalCredentialsClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OperationalCredentialsCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readOperationalCredentialsClusterRevisionCommandParams); - readOperationalCredentialsCommandInfo.put( + readOperationalCredentialsInteractionInfo.put( "readClusterRevisionAttribute", - readOperationalCredentialsClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("operationalCredentials").combineCommands(readOperationalCredentialsCommandInfo); - Map readPowerSourceCommandInfo = new LinkedHashMap<>(); + readOperationalCredentialsClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("operationalCredentials", readOperationalCredentialsInteractionInfo); + Map readPowerSourceInteractionInfo = new LinkedHashMap<>(); // read attribute Map readPowerSourceStatusCommandParams = new LinkedHashMap(); - CommandInfo readPowerSourceStatusAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPowerSourceStatusAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PowerSourceCluster) cluster) .readStatusAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readPowerSourceStatusCommandParams); - readPowerSourceCommandInfo.put( - "readStatusAttribute", readPowerSourceStatusAttributeCommandInfo); + readPowerSourceInteractionInfo.put( + "readStatusAttribute", readPowerSourceStatusAttributeInteractionInfo); Map readPowerSourceOrderCommandParams = new LinkedHashMap(); - CommandInfo readPowerSourceOrderAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPowerSourceOrderAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PowerSourceCluster) cluster) .readOrderAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readPowerSourceOrderCommandParams); - readPowerSourceCommandInfo.put("readOrderAttribute", readPowerSourceOrderAttributeCommandInfo); + readPowerSourceInteractionInfo.put( + "readOrderAttribute", readPowerSourceOrderAttributeInteractionInfo); Map readPowerSourceDescriptionCommandParams = new LinkedHashMap(); - CommandInfo readPowerSourceDescriptionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPowerSourceDescriptionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PowerSourceCluster) cluster) .readDescriptionAttribute((ChipClusters.CharStringAttributeCallback) callback); }, () -> new DelegatedCharStringAttributeCallback(), readPowerSourceDescriptionCommandParams); - readPowerSourceCommandInfo.put( - "readDescriptionAttribute", readPowerSourceDescriptionAttributeCommandInfo); + readPowerSourceInteractionInfo.put( + "readDescriptionAttribute", readPowerSourceDescriptionAttributeInteractionInfo); Map readPowerSourceBatteryVoltageCommandParams = new LinkedHashMap(); - CommandInfo readPowerSourceBatteryVoltageAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPowerSourceBatteryVoltageAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PowerSourceCluster) cluster) .readBatteryVoltageAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readPowerSourceBatteryVoltageCommandParams); - readPowerSourceCommandInfo.put( - "readBatteryVoltageAttribute", readPowerSourceBatteryVoltageAttributeCommandInfo); + readPowerSourceInteractionInfo.put( + "readBatteryVoltageAttribute", readPowerSourceBatteryVoltageAttributeInteractionInfo); Map readPowerSourceBatteryPercentRemainingCommandParams = new LinkedHashMap(); - CommandInfo readPowerSourceBatteryPercentRemainingAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPowerSourceBatteryPercentRemainingAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PowerSourceCluster) cluster) .readBatteryPercentRemainingAttribute( @@ -11316,26 +11502,26 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readPowerSourceBatteryPercentRemainingCommandParams); - readPowerSourceCommandInfo.put( + readPowerSourceInteractionInfo.put( "readBatteryPercentRemainingAttribute", - readPowerSourceBatteryPercentRemainingAttributeCommandInfo); + readPowerSourceBatteryPercentRemainingAttributeInteractionInfo); Map readPowerSourceBatteryTimeRemainingCommandParams = new LinkedHashMap(); - CommandInfo readPowerSourceBatteryTimeRemainingAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPowerSourceBatteryTimeRemainingAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PowerSourceCluster) cluster) .readBatteryTimeRemainingAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readPowerSourceBatteryTimeRemainingCommandParams); - readPowerSourceCommandInfo.put( + readPowerSourceInteractionInfo.put( "readBatteryTimeRemainingAttribute", - readPowerSourceBatteryTimeRemainingAttributeCommandInfo); + readPowerSourceBatteryTimeRemainingAttributeInteractionInfo); Map readPowerSourceBatteryChargeLevelCommandParams = new LinkedHashMap(); - CommandInfo readPowerSourceBatteryChargeLevelAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPowerSourceBatteryChargeLevelAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PowerSourceCluster) cluster) .readBatteryChargeLevelAttribute( @@ -11343,12 +11529,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readPowerSourceBatteryChargeLevelCommandParams); - readPowerSourceCommandInfo.put( - "readBatteryChargeLevelAttribute", readPowerSourceBatteryChargeLevelAttributeCommandInfo); + readPowerSourceInteractionInfo.put( + "readBatteryChargeLevelAttribute", + readPowerSourceBatteryChargeLevelAttributeInteractionInfo); Map readPowerSourceActiveBatteryFaultsCommandParams = new LinkedHashMap(); - CommandInfo readPowerSourceActiveBatteryFaultsAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPowerSourceActiveBatteryFaultsAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PowerSourceCluster) cluster) .readActiveBatteryFaultsAttribute( @@ -11357,12 +11544,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedActiveBatteryFaultsAttributeCallback(), readPowerSourceActiveBatteryFaultsCommandParams); - readPowerSourceCommandInfo.put( - "readActiveBatteryFaultsAttribute", readPowerSourceActiveBatteryFaultsAttributeCommandInfo); + readPowerSourceInteractionInfo.put( + "readActiveBatteryFaultsAttribute", + readPowerSourceActiveBatteryFaultsAttributeInteractionInfo); Map readPowerSourceBatteryChargeStateCommandParams = new LinkedHashMap(); - CommandInfo readPowerSourceBatteryChargeStateAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPowerSourceBatteryChargeStateAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PowerSourceCluster) cluster) .readBatteryChargeStateAttribute( @@ -11370,273 +11558,276 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readPowerSourceBatteryChargeStateCommandParams); - readPowerSourceCommandInfo.put( - "readBatteryChargeStateAttribute", readPowerSourceBatteryChargeStateAttributeCommandInfo); + readPowerSourceInteractionInfo.put( + "readBatteryChargeStateAttribute", + readPowerSourceBatteryChargeStateAttributeInteractionInfo); Map readPowerSourceFeatureMapCommandParams = new LinkedHashMap(); - CommandInfo readPowerSourceFeatureMapAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPowerSourceFeatureMapAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PowerSourceCluster) cluster) .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readPowerSourceFeatureMapCommandParams); - readPowerSourceCommandInfo.put( - "readFeatureMapAttribute", readPowerSourceFeatureMapAttributeCommandInfo); + readPowerSourceInteractionInfo.put( + "readFeatureMapAttribute", readPowerSourceFeatureMapAttributeInteractionInfo); Map readPowerSourceClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readPowerSourceClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPowerSourceClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PowerSourceCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readPowerSourceClusterRevisionCommandParams); - readPowerSourceCommandInfo.put( - "readClusterRevisionAttribute", readPowerSourceClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("powerSource").combineCommands(readPowerSourceCommandInfo); - Map readPressureMeasurementCommandInfo = new LinkedHashMap<>(); + readPowerSourceInteractionInfo.put( + "readClusterRevisionAttribute", readPowerSourceClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("powerSource", readPowerSourceInteractionInfo); + Map readPressureMeasurementInteractionInfo = new LinkedHashMap<>(); // read attribute Map readPressureMeasurementMeasuredValueCommandParams = new LinkedHashMap(); - CommandInfo readPressureMeasurementMeasuredValueAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPressureMeasurementMeasuredValueAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PressureMeasurementCluster) cluster) .readMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readPressureMeasurementMeasuredValueCommandParams); - readPressureMeasurementCommandInfo.put( - "readMeasuredValueAttribute", readPressureMeasurementMeasuredValueAttributeCommandInfo); + readPressureMeasurementInteractionInfo.put( + "readMeasuredValueAttribute", readPressureMeasurementMeasuredValueAttributeInteractionInfo); Map readPressureMeasurementMinMeasuredValueCommandParams = new LinkedHashMap(); - CommandInfo readPressureMeasurementMinMeasuredValueAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPressureMeasurementMinMeasuredValueAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PressureMeasurementCluster) cluster) .readMinMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readPressureMeasurementMinMeasuredValueCommandParams); - readPressureMeasurementCommandInfo.put( + readPressureMeasurementInteractionInfo.put( "readMinMeasuredValueAttribute", - readPressureMeasurementMinMeasuredValueAttributeCommandInfo); + readPressureMeasurementMinMeasuredValueAttributeInteractionInfo); Map readPressureMeasurementMaxMeasuredValueCommandParams = new LinkedHashMap(); - CommandInfo readPressureMeasurementMaxMeasuredValueAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPressureMeasurementMaxMeasuredValueAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PressureMeasurementCluster) cluster) .readMaxMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readPressureMeasurementMaxMeasuredValueCommandParams); - readPressureMeasurementCommandInfo.put( + readPressureMeasurementInteractionInfo.put( "readMaxMeasuredValueAttribute", - readPressureMeasurementMaxMeasuredValueAttributeCommandInfo); + readPressureMeasurementMaxMeasuredValueAttributeInteractionInfo); Map readPressureMeasurementClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readPressureMeasurementClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPressureMeasurementClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PressureMeasurementCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readPressureMeasurementClusterRevisionCommandParams); - readPressureMeasurementCommandInfo.put( - "readClusterRevisionAttribute", readPressureMeasurementClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("pressureMeasurement").combineCommands(readPressureMeasurementCommandInfo); - Map readPumpConfigurationAndControlCommandInfo = new LinkedHashMap<>(); + readPressureMeasurementInteractionInfo.put( + "readClusterRevisionAttribute", + readPressureMeasurementClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("pressureMeasurement", readPressureMeasurementInteractionInfo); + Map readPumpConfigurationAndControlInteractionInfo = + new LinkedHashMap<>(); // read attribute Map readPumpConfigurationAndControlMaxPressureCommandParams = new LinkedHashMap(); - CommandInfo readPumpConfigurationAndControlMaxPressureAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPumpConfigurationAndControlMaxPressureAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PumpConfigurationAndControlCluster) cluster) .readMaxPressureAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readPumpConfigurationAndControlMaxPressureCommandParams); - readPumpConfigurationAndControlCommandInfo.put( - "readMaxPressureAttribute", readPumpConfigurationAndControlMaxPressureAttributeCommandInfo); + readPumpConfigurationAndControlInteractionInfo.put( + "readMaxPressureAttribute", + readPumpConfigurationAndControlMaxPressureAttributeInteractionInfo); Map readPumpConfigurationAndControlMaxSpeedCommandParams = new LinkedHashMap(); - CommandInfo readPumpConfigurationAndControlMaxSpeedAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPumpConfigurationAndControlMaxSpeedAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PumpConfigurationAndControlCluster) cluster) .readMaxSpeedAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readPumpConfigurationAndControlMaxSpeedCommandParams); - readPumpConfigurationAndControlCommandInfo.put( - "readMaxSpeedAttribute", readPumpConfigurationAndControlMaxSpeedAttributeCommandInfo); + readPumpConfigurationAndControlInteractionInfo.put( + "readMaxSpeedAttribute", readPumpConfigurationAndControlMaxSpeedAttributeInteractionInfo); Map readPumpConfigurationAndControlMaxFlowCommandParams = new LinkedHashMap(); - CommandInfo readPumpConfigurationAndControlMaxFlowAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPumpConfigurationAndControlMaxFlowAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PumpConfigurationAndControlCluster) cluster) .readMaxFlowAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readPumpConfigurationAndControlMaxFlowCommandParams); - readPumpConfigurationAndControlCommandInfo.put( - "readMaxFlowAttribute", readPumpConfigurationAndControlMaxFlowAttributeCommandInfo); + readPumpConfigurationAndControlInteractionInfo.put( + "readMaxFlowAttribute", readPumpConfigurationAndControlMaxFlowAttributeInteractionInfo); Map readPumpConfigurationAndControlMinConstPressureCommandParams = new LinkedHashMap(); - CommandInfo readPumpConfigurationAndControlMinConstPressureAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPumpConfigurationAndControlMinConstPressureAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PumpConfigurationAndControlCluster) cluster) .readMinConstPressureAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readPumpConfigurationAndControlMinConstPressureCommandParams); - readPumpConfigurationAndControlCommandInfo.put( + readPumpConfigurationAndControlInteractionInfo.put( "readMinConstPressureAttribute", - readPumpConfigurationAndControlMinConstPressureAttributeCommandInfo); + readPumpConfigurationAndControlMinConstPressureAttributeInteractionInfo); Map readPumpConfigurationAndControlMaxConstPressureCommandParams = new LinkedHashMap(); - CommandInfo readPumpConfigurationAndControlMaxConstPressureAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPumpConfigurationAndControlMaxConstPressureAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PumpConfigurationAndControlCluster) cluster) .readMaxConstPressureAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readPumpConfigurationAndControlMaxConstPressureCommandParams); - readPumpConfigurationAndControlCommandInfo.put( + readPumpConfigurationAndControlInteractionInfo.put( "readMaxConstPressureAttribute", - readPumpConfigurationAndControlMaxConstPressureAttributeCommandInfo); + readPumpConfigurationAndControlMaxConstPressureAttributeInteractionInfo); Map readPumpConfigurationAndControlMinCompPressureCommandParams = new LinkedHashMap(); - CommandInfo readPumpConfigurationAndControlMinCompPressureAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPumpConfigurationAndControlMinCompPressureAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PumpConfigurationAndControlCluster) cluster) .readMinCompPressureAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readPumpConfigurationAndControlMinCompPressureCommandParams); - readPumpConfigurationAndControlCommandInfo.put( + readPumpConfigurationAndControlInteractionInfo.put( "readMinCompPressureAttribute", - readPumpConfigurationAndControlMinCompPressureAttributeCommandInfo); + readPumpConfigurationAndControlMinCompPressureAttributeInteractionInfo); Map readPumpConfigurationAndControlMaxCompPressureCommandParams = new LinkedHashMap(); - CommandInfo readPumpConfigurationAndControlMaxCompPressureAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPumpConfigurationAndControlMaxCompPressureAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PumpConfigurationAndControlCluster) cluster) .readMaxCompPressureAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readPumpConfigurationAndControlMaxCompPressureCommandParams); - readPumpConfigurationAndControlCommandInfo.put( + readPumpConfigurationAndControlInteractionInfo.put( "readMaxCompPressureAttribute", - readPumpConfigurationAndControlMaxCompPressureAttributeCommandInfo); + readPumpConfigurationAndControlMaxCompPressureAttributeInteractionInfo); Map readPumpConfigurationAndControlMinConstSpeedCommandParams = new LinkedHashMap(); - CommandInfo readPumpConfigurationAndControlMinConstSpeedAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPumpConfigurationAndControlMinConstSpeedAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PumpConfigurationAndControlCluster) cluster) .readMinConstSpeedAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readPumpConfigurationAndControlMinConstSpeedCommandParams); - readPumpConfigurationAndControlCommandInfo.put( + readPumpConfigurationAndControlInteractionInfo.put( "readMinConstSpeedAttribute", - readPumpConfigurationAndControlMinConstSpeedAttributeCommandInfo); + readPumpConfigurationAndControlMinConstSpeedAttributeInteractionInfo); Map readPumpConfigurationAndControlMaxConstSpeedCommandParams = new LinkedHashMap(); - CommandInfo readPumpConfigurationAndControlMaxConstSpeedAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPumpConfigurationAndControlMaxConstSpeedAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PumpConfigurationAndControlCluster) cluster) .readMaxConstSpeedAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readPumpConfigurationAndControlMaxConstSpeedCommandParams); - readPumpConfigurationAndControlCommandInfo.put( + readPumpConfigurationAndControlInteractionInfo.put( "readMaxConstSpeedAttribute", - readPumpConfigurationAndControlMaxConstSpeedAttributeCommandInfo); + readPumpConfigurationAndControlMaxConstSpeedAttributeInteractionInfo); Map readPumpConfigurationAndControlMinConstFlowCommandParams = new LinkedHashMap(); - CommandInfo readPumpConfigurationAndControlMinConstFlowAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPumpConfigurationAndControlMinConstFlowAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PumpConfigurationAndControlCluster) cluster) .readMinConstFlowAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readPumpConfigurationAndControlMinConstFlowCommandParams); - readPumpConfigurationAndControlCommandInfo.put( + readPumpConfigurationAndControlInteractionInfo.put( "readMinConstFlowAttribute", - readPumpConfigurationAndControlMinConstFlowAttributeCommandInfo); + readPumpConfigurationAndControlMinConstFlowAttributeInteractionInfo); Map readPumpConfigurationAndControlMaxConstFlowCommandParams = new LinkedHashMap(); - CommandInfo readPumpConfigurationAndControlMaxConstFlowAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPumpConfigurationAndControlMaxConstFlowAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PumpConfigurationAndControlCluster) cluster) .readMaxConstFlowAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readPumpConfigurationAndControlMaxConstFlowCommandParams); - readPumpConfigurationAndControlCommandInfo.put( + readPumpConfigurationAndControlInteractionInfo.put( "readMaxConstFlowAttribute", - readPumpConfigurationAndControlMaxConstFlowAttributeCommandInfo); + readPumpConfigurationAndControlMaxConstFlowAttributeInteractionInfo); Map readPumpConfigurationAndControlMinConstTempCommandParams = new LinkedHashMap(); - CommandInfo readPumpConfigurationAndControlMinConstTempAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPumpConfigurationAndControlMinConstTempAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PumpConfigurationAndControlCluster) cluster) .readMinConstTempAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readPumpConfigurationAndControlMinConstTempCommandParams); - readPumpConfigurationAndControlCommandInfo.put( + readPumpConfigurationAndControlInteractionInfo.put( "readMinConstTempAttribute", - readPumpConfigurationAndControlMinConstTempAttributeCommandInfo); + readPumpConfigurationAndControlMinConstTempAttributeInteractionInfo); Map readPumpConfigurationAndControlMaxConstTempCommandParams = new LinkedHashMap(); - CommandInfo readPumpConfigurationAndControlMaxConstTempAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPumpConfigurationAndControlMaxConstTempAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PumpConfigurationAndControlCluster) cluster) .readMaxConstTempAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readPumpConfigurationAndControlMaxConstTempCommandParams); - readPumpConfigurationAndControlCommandInfo.put( + readPumpConfigurationAndControlInteractionInfo.put( "readMaxConstTempAttribute", - readPumpConfigurationAndControlMaxConstTempAttributeCommandInfo); + readPumpConfigurationAndControlMaxConstTempAttributeInteractionInfo); Map readPumpConfigurationAndControlPumpStatusCommandParams = new LinkedHashMap(); - CommandInfo readPumpConfigurationAndControlPumpStatusAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPumpConfigurationAndControlPumpStatusAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PumpConfigurationAndControlCluster) cluster) .readPumpStatusAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readPumpConfigurationAndControlPumpStatusCommandParams); - readPumpConfigurationAndControlCommandInfo.put( - "readPumpStatusAttribute", readPumpConfigurationAndControlPumpStatusAttributeCommandInfo); + readPumpConfigurationAndControlInteractionInfo.put( + "readPumpStatusAttribute", + readPumpConfigurationAndControlPumpStatusAttributeInteractionInfo); Map readPumpConfigurationAndControlEffectiveOperationModeCommandParams = new LinkedHashMap(); - CommandInfo readPumpConfigurationAndControlEffectiveOperationModeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPumpConfigurationAndControlEffectiveOperationModeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PumpConfigurationAndControlCluster) cluster) .readEffectiveOperationModeAttribute( @@ -11644,14 +11835,14 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readPumpConfigurationAndControlEffectiveOperationModeCommandParams); - readPumpConfigurationAndControlCommandInfo.put( + readPumpConfigurationAndControlInteractionInfo.put( "readEffectiveOperationModeAttribute", - readPumpConfigurationAndControlEffectiveOperationModeAttributeCommandInfo); + readPumpConfigurationAndControlEffectiveOperationModeAttributeInteractionInfo); Map readPumpConfigurationAndControlEffectiveControlModeCommandParams = new LinkedHashMap(); - CommandInfo readPumpConfigurationAndControlEffectiveControlModeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPumpConfigurationAndControlEffectiveControlModeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PumpConfigurationAndControlCluster) cluster) .readEffectiveControlModeAttribute( @@ -11659,38 +11850,38 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readPumpConfigurationAndControlEffectiveControlModeCommandParams); - readPumpConfigurationAndControlCommandInfo.put( + readPumpConfigurationAndControlInteractionInfo.put( "readEffectiveControlModeAttribute", - readPumpConfigurationAndControlEffectiveControlModeAttributeCommandInfo); + readPumpConfigurationAndControlEffectiveControlModeAttributeInteractionInfo); Map readPumpConfigurationAndControlCapacityCommandParams = new LinkedHashMap(); - CommandInfo readPumpConfigurationAndControlCapacityAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPumpConfigurationAndControlCapacityAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PumpConfigurationAndControlCluster) cluster) .readCapacityAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readPumpConfigurationAndControlCapacityCommandParams); - readPumpConfigurationAndControlCommandInfo.put( - "readCapacityAttribute", readPumpConfigurationAndControlCapacityAttributeCommandInfo); + readPumpConfigurationAndControlInteractionInfo.put( + "readCapacityAttribute", readPumpConfigurationAndControlCapacityAttributeInteractionInfo); Map readPumpConfigurationAndControlSpeedCommandParams = new LinkedHashMap(); - CommandInfo readPumpConfigurationAndControlSpeedAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPumpConfigurationAndControlSpeedAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PumpConfigurationAndControlCluster) cluster) .readSpeedAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readPumpConfigurationAndControlSpeedCommandParams); - readPumpConfigurationAndControlCommandInfo.put( - "readSpeedAttribute", readPumpConfigurationAndControlSpeedAttributeCommandInfo); + readPumpConfigurationAndControlInteractionInfo.put( + "readSpeedAttribute", readPumpConfigurationAndControlSpeedAttributeInteractionInfo); Map readPumpConfigurationAndControlLifetimeEnergyConsumedCommandParams = new LinkedHashMap(); - CommandInfo readPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPumpConfigurationAndControlLifetimeEnergyConsumedAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PumpConfigurationAndControlCluster) cluster) .readLifetimeEnergyConsumedAttribute( @@ -11698,249 +11889,265 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedLongAttributeCallback(), readPumpConfigurationAndControlLifetimeEnergyConsumedCommandParams); - readPumpConfigurationAndControlCommandInfo.put( + readPumpConfigurationAndControlInteractionInfo.put( "readLifetimeEnergyConsumedAttribute", - readPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCommandInfo); + readPumpConfigurationAndControlLifetimeEnergyConsumedAttributeInteractionInfo); Map readPumpConfigurationAndControlOperationModeCommandParams = new LinkedHashMap(); - CommandInfo readPumpConfigurationAndControlOperationModeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPumpConfigurationAndControlOperationModeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PumpConfigurationAndControlCluster) cluster) .readOperationModeAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readPumpConfigurationAndControlOperationModeCommandParams); - readPumpConfigurationAndControlCommandInfo.put( + readPumpConfigurationAndControlInteractionInfo.put( "readOperationModeAttribute", - readPumpConfigurationAndControlOperationModeAttributeCommandInfo); + readPumpConfigurationAndControlOperationModeAttributeInteractionInfo); Map readPumpConfigurationAndControlControlModeCommandParams = new LinkedHashMap(); - CommandInfo readPumpConfigurationAndControlControlModeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPumpConfigurationAndControlControlModeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PumpConfigurationAndControlCluster) cluster) .readControlModeAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readPumpConfigurationAndControlControlModeCommandParams); - readPumpConfigurationAndControlCommandInfo.put( - "readControlModeAttribute", readPumpConfigurationAndControlControlModeAttributeCommandInfo); + readPumpConfigurationAndControlInteractionInfo.put( + "readControlModeAttribute", + readPumpConfigurationAndControlControlModeAttributeInteractionInfo); Map readPumpConfigurationAndControlAlarmMaskCommandParams = new LinkedHashMap(); - CommandInfo readPumpConfigurationAndControlAlarmMaskAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPumpConfigurationAndControlAlarmMaskAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PumpConfigurationAndControlCluster) cluster) .readAlarmMaskAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readPumpConfigurationAndControlAlarmMaskCommandParams); - readPumpConfigurationAndControlCommandInfo.put( - "readAlarmMaskAttribute", readPumpConfigurationAndControlAlarmMaskAttributeCommandInfo); + readPumpConfigurationAndControlInteractionInfo.put( + "readAlarmMaskAttribute", readPumpConfigurationAndControlAlarmMaskAttributeInteractionInfo); Map readPumpConfigurationAndControlFeatureMapCommandParams = new LinkedHashMap(); - CommandInfo readPumpConfigurationAndControlFeatureMapAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPumpConfigurationAndControlFeatureMapAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PumpConfigurationAndControlCluster) cluster) .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readPumpConfigurationAndControlFeatureMapCommandParams); - readPumpConfigurationAndControlCommandInfo.put( - "readFeatureMapAttribute", readPumpConfigurationAndControlFeatureMapAttributeCommandInfo); + readPumpConfigurationAndControlInteractionInfo.put( + "readFeatureMapAttribute", + readPumpConfigurationAndControlFeatureMapAttributeInteractionInfo); Map readPumpConfigurationAndControlClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readPumpConfigurationAndControlClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readPumpConfigurationAndControlClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.PumpConfigurationAndControlCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readPumpConfigurationAndControlClusterRevisionCommandParams); - readPumpConfigurationAndControlCommandInfo.put( + readPumpConfigurationAndControlInteractionInfo.put( "readClusterRevisionAttribute", - readPumpConfigurationAndControlClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap - .get("pumpConfigurationAndControl") - .combineCommands(readPumpConfigurationAndControlCommandInfo); - Map readRelativeHumidityMeasurementCommandInfo = new LinkedHashMap<>(); + readPumpConfigurationAndControlClusterRevisionAttributeInteractionInfo); + readAttributeMap.put( + "pumpConfigurationAndControl", readPumpConfigurationAndControlInteractionInfo); + Map readRelativeHumidityMeasurementInteractionInfo = + new LinkedHashMap<>(); // read attribute Map readRelativeHumidityMeasurementMeasuredValueCommandParams = new LinkedHashMap(); - CommandInfo readRelativeHumidityMeasurementMeasuredValueAttributeCommandInfo = - new CommandInfo( + InteractionInfo readRelativeHumidityMeasurementMeasuredValueAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.RelativeHumidityMeasurementCluster) cluster) .readMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readRelativeHumidityMeasurementMeasuredValueCommandParams); - readRelativeHumidityMeasurementCommandInfo.put( + readRelativeHumidityMeasurementInteractionInfo.put( "readMeasuredValueAttribute", - readRelativeHumidityMeasurementMeasuredValueAttributeCommandInfo); + readRelativeHumidityMeasurementMeasuredValueAttributeInteractionInfo); Map readRelativeHumidityMeasurementMinMeasuredValueCommandParams = new LinkedHashMap(); - CommandInfo readRelativeHumidityMeasurementMinMeasuredValueAttributeCommandInfo = - new CommandInfo( + InteractionInfo readRelativeHumidityMeasurementMinMeasuredValueAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.RelativeHumidityMeasurementCluster) cluster) .readMinMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readRelativeHumidityMeasurementMinMeasuredValueCommandParams); - readRelativeHumidityMeasurementCommandInfo.put( + readRelativeHumidityMeasurementInteractionInfo.put( "readMinMeasuredValueAttribute", - readRelativeHumidityMeasurementMinMeasuredValueAttributeCommandInfo); + readRelativeHumidityMeasurementMinMeasuredValueAttributeInteractionInfo); Map readRelativeHumidityMeasurementMaxMeasuredValueCommandParams = new LinkedHashMap(); - CommandInfo readRelativeHumidityMeasurementMaxMeasuredValueAttributeCommandInfo = - new CommandInfo( + InteractionInfo readRelativeHumidityMeasurementMaxMeasuredValueAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.RelativeHumidityMeasurementCluster) cluster) .readMaxMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readRelativeHumidityMeasurementMaxMeasuredValueCommandParams); - readRelativeHumidityMeasurementCommandInfo.put( + readRelativeHumidityMeasurementInteractionInfo.put( "readMaxMeasuredValueAttribute", - readRelativeHumidityMeasurementMaxMeasuredValueAttributeCommandInfo); + readRelativeHumidityMeasurementMaxMeasuredValueAttributeInteractionInfo); Map readRelativeHumidityMeasurementToleranceCommandParams = new LinkedHashMap(); - CommandInfo readRelativeHumidityMeasurementToleranceAttributeCommandInfo = - new CommandInfo( + InteractionInfo readRelativeHumidityMeasurementToleranceAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.RelativeHumidityMeasurementCluster) cluster) .readToleranceAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readRelativeHumidityMeasurementToleranceCommandParams); - readRelativeHumidityMeasurementCommandInfo.put( - "readToleranceAttribute", readRelativeHumidityMeasurementToleranceAttributeCommandInfo); + readRelativeHumidityMeasurementInteractionInfo.put( + "readToleranceAttribute", readRelativeHumidityMeasurementToleranceAttributeInteractionInfo); Map readRelativeHumidityMeasurementClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readRelativeHumidityMeasurementClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readRelativeHumidityMeasurementClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.RelativeHumidityMeasurementCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readRelativeHumidityMeasurementClusterRevisionCommandParams); - readRelativeHumidityMeasurementCommandInfo.put( + readRelativeHumidityMeasurementInteractionInfo.put( "readClusterRevisionAttribute", - readRelativeHumidityMeasurementClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap - .get("relativeHumidityMeasurement") - .combineCommands(readRelativeHumidityMeasurementCommandInfo); - Map readScenesCommandInfo = new LinkedHashMap<>(); + readRelativeHumidityMeasurementClusterRevisionAttributeInteractionInfo); + readAttributeMap.put( + "relativeHumidityMeasurement", readRelativeHumidityMeasurementInteractionInfo); + Map readScenesInteractionInfo = new LinkedHashMap<>(); // read attribute Map readScenesSceneCountCommandParams = new LinkedHashMap(); - CommandInfo readScenesSceneCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readScenesSceneCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ScenesCluster) cluster) .readSceneCountAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readScenesSceneCountCommandParams); - readScenesCommandInfo.put("readSceneCountAttribute", readScenesSceneCountAttributeCommandInfo); + readScenesInteractionInfo.put( + "readSceneCountAttribute", readScenesSceneCountAttributeInteractionInfo); Map readScenesCurrentSceneCommandParams = new LinkedHashMap(); - CommandInfo readScenesCurrentSceneAttributeCommandInfo = - new CommandInfo( + InteractionInfo readScenesCurrentSceneAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ScenesCluster) cluster) .readCurrentSceneAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readScenesCurrentSceneCommandParams); - readScenesCommandInfo.put( - "readCurrentSceneAttribute", readScenesCurrentSceneAttributeCommandInfo); + readScenesInteractionInfo.put( + "readCurrentSceneAttribute", readScenesCurrentSceneAttributeInteractionInfo); Map readScenesCurrentGroupCommandParams = new LinkedHashMap(); - CommandInfo readScenesCurrentGroupAttributeCommandInfo = - new CommandInfo( + InteractionInfo readScenesCurrentGroupAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ScenesCluster) cluster) .readCurrentGroupAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readScenesCurrentGroupCommandParams); - readScenesCommandInfo.put( - "readCurrentGroupAttribute", readScenesCurrentGroupAttributeCommandInfo); + readScenesInteractionInfo.put( + "readCurrentGroupAttribute", readScenesCurrentGroupAttributeInteractionInfo); Map readScenesSceneValidCommandParams = new LinkedHashMap(); - CommandInfo readScenesSceneValidAttributeCommandInfo = - new CommandInfo( + InteractionInfo readScenesSceneValidAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ScenesCluster) cluster) .readSceneValidAttribute((ChipClusters.BooleanAttributeCallback) callback); }, () -> new DelegatedBooleanAttributeCallback(), readScenesSceneValidCommandParams); - readScenesCommandInfo.put("readSceneValidAttribute", readScenesSceneValidAttributeCommandInfo); + readScenesInteractionInfo.put( + "readSceneValidAttribute", readScenesSceneValidAttributeInteractionInfo); Map readScenesNameSupportCommandParams = new LinkedHashMap(); - CommandInfo readScenesNameSupportAttributeCommandInfo = - new CommandInfo( + InteractionInfo readScenesNameSupportAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ScenesCluster) cluster) .readNameSupportAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readScenesNameSupportCommandParams); - readScenesCommandInfo.put( - "readNameSupportAttribute", readScenesNameSupportAttributeCommandInfo); + readScenesInteractionInfo.put( + "readNameSupportAttribute", readScenesNameSupportAttributeInteractionInfo); Map readScenesClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readScenesClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readScenesClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ScenesCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readScenesClusterRevisionCommandParams); - readScenesCommandInfo.put( - "readClusterRevisionAttribute", readScenesClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("scenes").combineCommands(readScenesCommandInfo); - Map readSoftwareDiagnosticsCommandInfo = new LinkedHashMap<>(); + readScenesInteractionInfo.put( + "readClusterRevisionAttribute", readScenesClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("scenes", readScenesInteractionInfo); + Map readSoftwareDiagnosticsInteractionInfo = new LinkedHashMap<>(); // read attribute + Map readSoftwareDiagnosticsThreadMetricsCommandParams = + new LinkedHashMap(); + InteractionInfo readSoftwareDiagnosticsThreadMetricsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SoftwareDiagnosticsCluster) cluster) + .readThreadMetricsAttribute( + (ChipClusters.SoftwareDiagnosticsCluster.ThreadMetricsAttributeCallback) + callback); + }, + () -> new DelegatedThreadMetricsAttributeCallback(), + readSoftwareDiagnosticsThreadMetricsCommandParams); + readSoftwareDiagnosticsInteractionInfo.put( + "readThreadMetricsAttribute", readSoftwareDiagnosticsThreadMetricsAttributeInteractionInfo); Map readSoftwareDiagnosticsCurrentHeapFreeCommandParams = new LinkedHashMap(); - CommandInfo readSoftwareDiagnosticsCurrentHeapFreeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readSoftwareDiagnosticsCurrentHeapFreeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.SoftwareDiagnosticsCluster) cluster) .readCurrentHeapFreeAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readSoftwareDiagnosticsCurrentHeapFreeCommandParams); - readSoftwareDiagnosticsCommandInfo.put( - "readCurrentHeapFreeAttribute", readSoftwareDiagnosticsCurrentHeapFreeAttributeCommandInfo); + readSoftwareDiagnosticsInteractionInfo.put( + "readCurrentHeapFreeAttribute", + readSoftwareDiagnosticsCurrentHeapFreeAttributeInteractionInfo); Map readSoftwareDiagnosticsCurrentHeapUsedCommandParams = new LinkedHashMap(); - CommandInfo readSoftwareDiagnosticsCurrentHeapUsedAttributeCommandInfo = - new CommandInfo( + InteractionInfo readSoftwareDiagnosticsCurrentHeapUsedAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.SoftwareDiagnosticsCluster) cluster) .readCurrentHeapUsedAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readSoftwareDiagnosticsCurrentHeapUsedCommandParams); - readSoftwareDiagnosticsCommandInfo.put( - "readCurrentHeapUsedAttribute", readSoftwareDiagnosticsCurrentHeapUsedAttributeCommandInfo); + readSoftwareDiagnosticsInteractionInfo.put( + "readCurrentHeapUsedAttribute", + readSoftwareDiagnosticsCurrentHeapUsedAttributeInteractionInfo); Map readSoftwareDiagnosticsCurrentHeapHighWatermarkCommandParams = new LinkedHashMap(); - CommandInfo readSoftwareDiagnosticsCurrentHeapHighWatermarkAttributeCommandInfo = - new CommandInfo( + InteractionInfo readSoftwareDiagnosticsCurrentHeapHighWatermarkAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.SoftwareDiagnosticsCluster) cluster) .readCurrentHeapHighWatermarkAttribute( @@ -11948,92 +12155,92 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedLongAttributeCallback(), readSoftwareDiagnosticsCurrentHeapHighWatermarkCommandParams); - readSoftwareDiagnosticsCommandInfo.put( + readSoftwareDiagnosticsInteractionInfo.put( "readCurrentHeapHighWatermarkAttribute", - readSoftwareDiagnosticsCurrentHeapHighWatermarkAttributeCommandInfo); + readSoftwareDiagnosticsCurrentHeapHighWatermarkAttributeInteractionInfo); Map readSoftwareDiagnosticsClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readSoftwareDiagnosticsClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readSoftwareDiagnosticsClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.SoftwareDiagnosticsCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readSoftwareDiagnosticsClusterRevisionCommandParams); - readSoftwareDiagnosticsCommandInfo.put( - "readClusterRevisionAttribute", readSoftwareDiagnosticsClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("softwareDiagnostics").combineCommands(readSoftwareDiagnosticsCommandInfo); - Map readSwitchCommandInfo = new LinkedHashMap<>(); + readSoftwareDiagnosticsInteractionInfo.put( + "readClusterRevisionAttribute", + readSoftwareDiagnosticsClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("softwareDiagnostics", readSoftwareDiagnosticsInteractionInfo); + Map readSwitchInteractionInfo = new LinkedHashMap<>(); // read attribute Map readSwitchNumberOfPositionsCommandParams = new LinkedHashMap(); - CommandInfo readSwitchNumberOfPositionsAttributeCommandInfo = - new CommandInfo( + InteractionInfo readSwitchNumberOfPositionsAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.SwitchCluster) cluster) .readNumberOfPositionsAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readSwitchNumberOfPositionsCommandParams); - readSwitchCommandInfo.put( - "readNumberOfPositionsAttribute", readSwitchNumberOfPositionsAttributeCommandInfo); + readSwitchInteractionInfo.put( + "readNumberOfPositionsAttribute", readSwitchNumberOfPositionsAttributeInteractionInfo); Map readSwitchCurrentPositionCommandParams = new LinkedHashMap(); - CommandInfo readSwitchCurrentPositionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readSwitchCurrentPositionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.SwitchCluster) cluster) .readCurrentPositionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readSwitchCurrentPositionCommandParams); - readSwitchCommandInfo.put( - "readCurrentPositionAttribute", readSwitchCurrentPositionAttributeCommandInfo); + readSwitchInteractionInfo.put( + "readCurrentPositionAttribute", readSwitchCurrentPositionAttributeInteractionInfo); Map readSwitchMultiPressMaxCommandParams = new LinkedHashMap(); - CommandInfo readSwitchMultiPressMaxAttributeCommandInfo = - new CommandInfo( + InteractionInfo readSwitchMultiPressMaxAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.SwitchCluster) cluster) .readMultiPressMaxAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readSwitchMultiPressMaxCommandParams); - readSwitchCommandInfo.put( - "readMultiPressMaxAttribute", readSwitchMultiPressMaxAttributeCommandInfo); + readSwitchInteractionInfo.put( + "readMultiPressMaxAttribute", readSwitchMultiPressMaxAttributeInteractionInfo); Map readSwitchFeatureMapCommandParams = new LinkedHashMap(); - CommandInfo readSwitchFeatureMapAttributeCommandInfo = - new CommandInfo( + InteractionInfo readSwitchFeatureMapAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.SwitchCluster) cluster) .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readSwitchFeatureMapCommandParams); - readSwitchCommandInfo.put("readFeatureMapAttribute", readSwitchFeatureMapAttributeCommandInfo); + readSwitchInteractionInfo.put( + "readFeatureMapAttribute", readSwitchFeatureMapAttributeInteractionInfo); Map readSwitchClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readSwitchClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readSwitchClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.SwitchCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readSwitchClusterRevisionCommandParams); - readSwitchCommandInfo.put( - "readClusterRevisionAttribute", readSwitchClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("switch").combineCommands(readSwitchCommandInfo); - Map readTvChannelCommandInfo = new LinkedHashMap<>(); + readSwitchInteractionInfo.put( + "readClusterRevisionAttribute", readSwitchClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("switch", readSwitchInteractionInfo); + Map readTvChannelInteractionInfo = new LinkedHashMap<>(); // read attribute Map readTvChannelTvChannelListCommandParams = new LinkedHashMap(); - CommandInfo readTvChannelTvChannelListAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTvChannelTvChannelListAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TvChannelCluster) cluster) .readTvChannelListAttribute( @@ -12041,12 +12248,12 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedTvChannelListAttributeCallback(), readTvChannelTvChannelListCommandParams); - readTvChannelCommandInfo.put( - "readTvChannelListAttribute", readTvChannelTvChannelListAttributeCommandInfo); + readTvChannelInteractionInfo.put( + "readTvChannelListAttribute", readTvChannelTvChannelListAttributeInteractionInfo); Map readTvChannelTvChannelLineupCommandParams = new LinkedHashMap(); - CommandInfo readTvChannelTvChannelLineupAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTvChannelTvChannelLineupAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TvChannelCluster) cluster) .readTvChannelLineupAttribute( @@ -12054,12 +12261,12 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedOctetStringAttributeCallback(), readTvChannelTvChannelLineupCommandParams); - readTvChannelCommandInfo.put( - "readTvChannelLineupAttribute", readTvChannelTvChannelLineupAttributeCommandInfo); + readTvChannelInteractionInfo.put( + "readTvChannelLineupAttribute", readTvChannelTvChannelLineupAttributeInteractionInfo); Map readTvChannelCurrentTvChannelCommandParams = new LinkedHashMap(); - CommandInfo readTvChannelCurrentTvChannelAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTvChannelCurrentTvChannelAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TvChannelCluster) cluster) .readCurrentTvChannelAttribute( @@ -12067,28 +12274,27 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedOctetStringAttributeCallback(), readTvChannelCurrentTvChannelCommandParams); - readTvChannelCommandInfo.put( - "readCurrentTvChannelAttribute", readTvChannelCurrentTvChannelAttributeCommandInfo); + readTvChannelInteractionInfo.put( + "readCurrentTvChannelAttribute", readTvChannelCurrentTvChannelAttributeInteractionInfo); Map readTvChannelClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readTvChannelClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTvChannelClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TvChannelCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readTvChannelClusterRevisionCommandParams); - readTvChannelCommandInfo.put( - "readClusterRevisionAttribute", readTvChannelClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("tvChannel").combineCommands(readTvChannelCommandInfo); - Map readTargetNavigatorCommandInfo = new LinkedHashMap<>(); + readTvChannelInteractionInfo.put( + "readClusterRevisionAttribute", readTvChannelClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("tvChannel", readTvChannelInteractionInfo); + Map readTargetNavigatorInteractionInfo = new LinkedHashMap<>(); // read attribute Map readTargetNavigatorTargetNavigatorListCommandParams = new LinkedHashMap(); - CommandInfo readTargetNavigatorTargetNavigatorListAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTargetNavigatorTargetNavigatorListAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TargetNavigatorCluster) cluster) .readTargetNavigatorListAttribute( @@ -12097,285 +12303,287 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedTargetNavigatorListAttributeCallback(), readTargetNavigatorTargetNavigatorListCommandParams); - readTargetNavigatorCommandInfo.put( + readTargetNavigatorInteractionInfo.put( "readTargetNavigatorListAttribute", - readTargetNavigatorTargetNavigatorListAttributeCommandInfo); + readTargetNavigatorTargetNavigatorListAttributeInteractionInfo); Map readTargetNavigatorClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readTargetNavigatorClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTargetNavigatorClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TargetNavigatorCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readTargetNavigatorClusterRevisionCommandParams); - readTargetNavigatorCommandInfo.put( - "readClusterRevisionAttribute", readTargetNavigatorClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("targetNavigator").combineCommands(readTargetNavigatorCommandInfo); - Map readTemperatureMeasurementCommandInfo = new LinkedHashMap<>(); + readTargetNavigatorInteractionInfo.put( + "readClusterRevisionAttribute", readTargetNavigatorClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("targetNavigator", readTargetNavigatorInteractionInfo); + Map readTemperatureMeasurementInteractionInfo = new LinkedHashMap<>(); // read attribute Map readTemperatureMeasurementMeasuredValueCommandParams = new LinkedHashMap(); - CommandInfo readTemperatureMeasurementMeasuredValueAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTemperatureMeasurementMeasuredValueAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TemperatureMeasurementCluster) cluster) .readMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readTemperatureMeasurementMeasuredValueCommandParams); - readTemperatureMeasurementCommandInfo.put( - "readMeasuredValueAttribute", readTemperatureMeasurementMeasuredValueAttributeCommandInfo); + readTemperatureMeasurementInteractionInfo.put( + "readMeasuredValueAttribute", + readTemperatureMeasurementMeasuredValueAttributeInteractionInfo); Map readTemperatureMeasurementMinMeasuredValueCommandParams = new LinkedHashMap(); - CommandInfo readTemperatureMeasurementMinMeasuredValueAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTemperatureMeasurementMinMeasuredValueAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TemperatureMeasurementCluster) cluster) .readMinMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readTemperatureMeasurementMinMeasuredValueCommandParams); - readTemperatureMeasurementCommandInfo.put( + readTemperatureMeasurementInteractionInfo.put( "readMinMeasuredValueAttribute", - readTemperatureMeasurementMinMeasuredValueAttributeCommandInfo); + readTemperatureMeasurementMinMeasuredValueAttributeInteractionInfo); Map readTemperatureMeasurementMaxMeasuredValueCommandParams = new LinkedHashMap(); - CommandInfo readTemperatureMeasurementMaxMeasuredValueAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTemperatureMeasurementMaxMeasuredValueAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TemperatureMeasurementCluster) cluster) .readMaxMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readTemperatureMeasurementMaxMeasuredValueCommandParams); - readTemperatureMeasurementCommandInfo.put( + readTemperatureMeasurementInteractionInfo.put( "readMaxMeasuredValueAttribute", - readTemperatureMeasurementMaxMeasuredValueAttributeCommandInfo); + readTemperatureMeasurementMaxMeasuredValueAttributeInteractionInfo); Map readTemperatureMeasurementToleranceCommandParams = new LinkedHashMap(); - CommandInfo readTemperatureMeasurementToleranceAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTemperatureMeasurementToleranceAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TemperatureMeasurementCluster) cluster) .readToleranceAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readTemperatureMeasurementToleranceCommandParams); - readTemperatureMeasurementCommandInfo.put( - "readToleranceAttribute", readTemperatureMeasurementToleranceAttributeCommandInfo); + readTemperatureMeasurementInteractionInfo.put( + "readToleranceAttribute", readTemperatureMeasurementToleranceAttributeInteractionInfo); Map readTemperatureMeasurementClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readTemperatureMeasurementClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTemperatureMeasurementClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TemperatureMeasurementCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readTemperatureMeasurementClusterRevisionCommandParams); - readTemperatureMeasurementCommandInfo.put( + readTemperatureMeasurementInteractionInfo.put( "readClusterRevisionAttribute", - readTemperatureMeasurementClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("temperatureMeasurement").combineCommands(readTemperatureMeasurementCommandInfo); - Map readTestClusterCommandInfo = new LinkedHashMap<>(); + readTemperatureMeasurementClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("temperatureMeasurement", readTemperatureMeasurementInteractionInfo); + Map readTestClusterInteractionInfo = new LinkedHashMap<>(); // read attribute Map readTestClusterBooleanCommandParams = new LinkedHashMap(); - CommandInfo readTestClusterBooleanAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTestClusterBooleanAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readBooleanAttribute((ChipClusters.BooleanAttributeCallback) callback); }, () -> new DelegatedBooleanAttributeCallback(), readTestClusterBooleanCommandParams); - readTestClusterCommandInfo.put( - "readBooleanAttribute", readTestClusterBooleanAttributeCommandInfo); + readTestClusterInteractionInfo.put( + "readBooleanAttribute", readTestClusterBooleanAttributeInteractionInfo); Map readTestClusterBitmap8CommandParams = new LinkedHashMap(); - CommandInfo readTestClusterBitmap8AttributeCommandInfo = - new CommandInfo( + InteractionInfo readTestClusterBitmap8AttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readBitmap8Attribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readTestClusterBitmap8CommandParams); - readTestClusterCommandInfo.put( - "readBitmap8Attribute", readTestClusterBitmap8AttributeCommandInfo); + readTestClusterInteractionInfo.put( + "readBitmap8Attribute", readTestClusterBitmap8AttributeInteractionInfo); Map readTestClusterBitmap16CommandParams = new LinkedHashMap(); - CommandInfo readTestClusterBitmap16AttributeCommandInfo = - new CommandInfo( + InteractionInfo readTestClusterBitmap16AttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readBitmap16Attribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readTestClusterBitmap16CommandParams); - readTestClusterCommandInfo.put( - "readBitmap16Attribute", readTestClusterBitmap16AttributeCommandInfo); + readTestClusterInteractionInfo.put( + "readBitmap16Attribute", readTestClusterBitmap16AttributeInteractionInfo); Map readTestClusterBitmap32CommandParams = new LinkedHashMap(); - CommandInfo readTestClusterBitmap32AttributeCommandInfo = - new CommandInfo( + InteractionInfo readTestClusterBitmap32AttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readBitmap32Attribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readTestClusterBitmap32CommandParams); - readTestClusterCommandInfo.put( - "readBitmap32Attribute", readTestClusterBitmap32AttributeCommandInfo); + readTestClusterInteractionInfo.put( + "readBitmap32Attribute", readTestClusterBitmap32AttributeInteractionInfo); Map readTestClusterBitmap64CommandParams = new LinkedHashMap(); - CommandInfo readTestClusterBitmap64AttributeCommandInfo = - new CommandInfo( + InteractionInfo readTestClusterBitmap64AttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readBitmap64Attribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readTestClusterBitmap64CommandParams); - readTestClusterCommandInfo.put( - "readBitmap64Attribute", readTestClusterBitmap64AttributeCommandInfo); + readTestClusterInteractionInfo.put( + "readBitmap64Attribute", readTestClusterBitmap64AttributeInteractionInfo); Map readTestClusterInt8uCommandParams = new LinkedHashMap(); - CommandInfo readTestClusterInt8uAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTestClusterInt8uAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readInt8uAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readTestClusterInt8uCommandParams); - readTestClusterCommandInfo.put("readInt8uAttribute", readTestClusterInt8uAttributeCommandInfo); + readTestClusterInteractionInfo.put( + "readInt8uAttribute", readTestClusterInt8uAttributeInteractionInfo); Map readTestClusterInt16uCommandParams = new LinkedHashMap(); - CommandInfo readTestClusterInt16uAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTestClusterInt16uAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readInt16uAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readTestClusterInt16uCommandParams); - readTestClusterCommandInfo.put( - "readInt16uAttribute", readTestClusterInt16uAttributeCommandInfo); + readTestClusterInteractionInfo.put( + "readInt16uAttribute", readTestClusterInt16uAttributeInteractionInfo); Map readTestClusterInt32uCommandParams = new LinkedHashMap(); - CommandInfo readTestClusterInt32uAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTestClusterInt32uAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readInt32uAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readTestClusterInt32uCommandParams); - readTestClusterCommandInfo.put( - "readInt32uAttribute", readTestClusterInt32uAttributeCommandInfo); + readTestClusterInteractionInfo.put( + "readInt32uAttribute", readTestClusterInt32uAttributeInteractionInfo); Map readTestClusterInt64uCommandParams = new LinkedHashMap(); - CommandInfo readTestClusterInt64uAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTestClusterInt64uAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readInt64uAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readTestClusterInt64uCommandParams); - readTestClusterCommandInfo.put( - "readInt64uAttribute", readTestClusterInt64uAttributeCommandInfo); + readTestClusterInteractionInfo.put( + "readInt64uAttribute", readTestClusterInt64uAttributeInteractionInfo); Map readTestClusterInt8sCommandParams = new LinkedHashMap(); - CommandInfo readTestClusterInt8sAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTestClusterInt8sAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readInt8sAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readTestClusterInt8sCommandParams); - readTestClusterCommandInfo.put("readInt8sAttribute", readTestClusterInt8sAttributeCommandInfo); + readTestClusterInteractionInfo.put( + "readInt8sAttribute", readTestClusterInt8sAttributeInteractionInfo); Map readTestClusterInt16sCommandParams = new LinkedHashMap(); - CommandInfo readTestClusterInt16sAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTestClusterInt16sAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readInt16sAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readTestClusterInt16sCommandParams); - readTestClusterCommandInfo.put( - "readInt16sAttribute", readTestClusterInt16sAttributeCommandInfo); + readTestClusterInteractionInfo.put( + "readInt16sAttribute", readTestClusterInt16sAttributeInteractionInfo); Map readTestClusterInt32sCommandParams = new LinkedHashMap(); - CommandInfo readTestClusterInt32sAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTestClusterInt32sAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readInt32sAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readTestClusterInt32sCommandParams); - readTestClusterCommandInfo.put( - "readInt32sAttribute", readTestClusterInt32sAttributeCommandInfo); + readTestClusterInteractionInfo.put( + "readInt32sAttribute", readTestClusterInt32sAttributeInteractionInfo); Map readTestClusterInt64sCommandParams = new LinkedHashMap(); - CommandInfo readTestClusterInt64sAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTestClusterInt64sAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readInt64sAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readTestClusterInt64sCommandParams); - readTestClusterCommandInfo.put( - "readInt64sAttribute", readTestClusterInt64sAttributeCommandInfo); + readTestClusterInteractionInfo.put( + "readInt64sAttribute", readTestClusterInt64sAttributeInteractionInfo); Map readTestClusterEnum8CommandParams = new LinkedHashMap(); - CommandInfo readTestClusterEnum8AttributeCommandInfo = - new CommandInfo( + InteractionInfo readTestClusterEnum8AttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readEnum8Attribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readTestClusterEnum8CommandParams); - readTestClusterCommandInfo.put("readEnum8Attribute", readTestClusterEnum8AttributeCommandInfo); + readTestClusterInteractionInfo.put( + "readEnum8Attribute", readTestClusterEnum8AttributeInteractionInfo); Map readTestClusterEnum16CommandParams = new LinkedHashMap(); - CommandInfo readTestClusterEnum16AttributeCommandInfo = - new CommandInfo( + InteractionInfo readTestClusterEnum16AttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readEnum16Attribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readTestClusterEnum16CommandParams); - readTestClusterCommandInfo.put( - "readEnum16Attribute", readTestClusterEnum16AttributeCommandInfo); + readTestClusterInteractionInfo.put( + "readEnum16Attribute", readTestClusterEnum16AttributeInteractionInfo); Map readTestClusterOctetStringCommandParams = new LinkedHashMap(); - CommandInfo readTestClusterOctetStringAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTestClusterOctetStringAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readOctetStringAttribute((ChipClusters.OctetStringAttributeCallback) callback); }, () -> new DelegatedOctetStringAttributeCallback(), readTestClusterOctetStringCommandParams); - readTestClusterCommandInfo.put( - "readOctetStringAttribute", readTestClusterOctetStringAttributeCommandInfo); + readTestClusterInteractionInfo.put( + "readOctetStringAttribute", readTestClusterOctetStringAttributeInteractionInfo); Map readTestClusterListInt8uCommandParams = new LinkedHashMap(); - CommandInfo readTestClusterListInt8uAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTestClusterListInt8uAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readListInt8uAttribute( @@ -12383,12 +12591,12 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedListInt8uAttributeCallback(), readTestClusterListInt8uCommandParams); - readTestClusterCommandInfo.put( - "readListInt8uAttribute", readTestClusterListInt8uAttributeCommandInfo); + readTestClusterInteractionInfo.put( + "readListInt8uAttribute", readTestClusterListInt8uAttributeInteractionInfo); Map readTestClusterListOctetStringCommandParams = new LinkedHashMap(); - CommandInfo readTestClusterListOctetStringAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTestClusterListOctetStringAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readListOctetStringAttribute( @@ -12396,12 +12604,12 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedListOctetStringAttributeCallback(), readTestClusterListOctetStringCommandParams); - readTestClusterCommandInfo.put( - "readListOctetStringAttribute", readTestClusterListOctetStringAttributeCommandInfo); + readTestClusterInteractionInfo.put( + "readListOctetStringAttribute", readTestClusterListOctetStringAttributeInteractionInfo); Map readTestClusterListStructOctetStringCommandParams = new LinkedHashMap(); - CommandInfo readTestClusterListStructOctetStringAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTestClusterListStructOctetStringAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readListStructOctetStringAttribute( @@ -12410,13 +12618,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedListStructOctetStringAttributeCallback(), readTestClusterListStructOctetStringCommandParams); - readTestClusterCommandInfo.put( + readTestClusterInteractionInfo.put( "readListStructOctetStringAttribute", - readTestClusterListStructOctetStringAttributeCommandInfo); + readTestClusterListStructOctetStringAttributeInteractionInfo); Map readTestClusterLongOctetStringCommandParams = new LinkedHashMap(); - CommandInfo readTestClusterLongOctetStringAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTestClusterLongOctetStringAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readLongOctetStringAttribute( @@ -12424,72 +12632,72 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedOctetStringAttributeCallback(), readTestClusterLongOctetStringCommandParams); - readTestClusterCommandInfo.put( - "readLongOctetStringAttribute", readTestClusterLongOctetStringAttributeCommandInfo); + readTestClusterInteractionInfo.put( + "readLongOctetStringAttribute", readTestClusterLongOctetStringAttributeInteractionInfo); Map readTestClusterCharStringCommandParams = new LinkedHashMap(); - CommandInfo readTestClusterCharStringAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTestClusterCharStringAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readCharStringAttribute((ChipClusters.CharStringAttributeCallback) callback); }, () -> new DelegatedCharStringAttributeCallback(), readTestClusterCharStringCommandParams); - readTestClusterCommandInfo.put( - "readCharStringAttribute", readTestClusterCharStringAttributeCommandInfo); + readTestClusterInteractionInfo.put( + "readCharStringAttribute", readTestClusterCharStringAttributeInteractionInfo); Map readTestClusterLongCharStringCommandParams = new LinkedHashMap(); - CommandInfo readTestClusterLongCharStringAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTestClusterLongCharStringAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readLongCharStringAttribute((ChipClusters.CharStringAttributeCallback) callback); }, () -> new DelegatedCharStringAttributeCallback(), readTestClusterLongCharStringCommandParams); - readTestClusterCommandInfo.put( - "readLongCharStringAttribute", readTestClusterLongCharStringAttributeCommandInfo); + readTestClusterInteractionInfo.put( + "readLongCharStringAttribute", readTestClusterLongCharStringAttributeInteractionInfo); Map readTestClusterEpochUsCommandParams = new LinkedHashMap(); - CommandInfo readTestClusterEpochUsAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTestClusterEpochUsAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readEpochUsAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readTestClusterEpochUsCommandParams); - readTestClusterCommandInfo.put( - "readEpochUsAttribute", readTestClusterEpochUsAttributeCommandInfo); + readTestClusterInteractionInfo.put( + "readEpochUsAttribute", readTestClusterEpochUsAttributeInteractionInfo); Map readTestClusterEpochSCommandParams = new LinkedHashMap(); - CommandInfo readTestClusterEpochSAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTestClusterEpochSAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readEpochSAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readTestClusterEpochSCommandParams); - readTestClusterCommandInfo.put( - "readEpochSAttribute", readTestClusterEpochSAttributeCommandInfo); + readTestClusterInteractionInfo.put( + "readEpochSAttribute", readTestClusterEpochSAttributeInteractionInfo); Map readTestClusterVendorIdCommandParams = new LinkedHashMap(); - CommandInfo readTestClusterVendorIdAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTestClusterVendorIdAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readVendorIdAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readTestClusterVendorIdCommandParams); - readTestClusterCommandInfo.put( - "readVendorIdAttribute", readTestClusterVendorIdAttributeCommandInfo); + readTestClusterInteractionInfo.put( + "readVendorIdAttribute", readTestClusterVendorIdAttributeInteractionInfo); Map readTestClusterListNullablesAndOptionalsStructCommandParams = new LinkedHashMap(); - CommandInfo readTestClusterListNullablesAndOptionalsStructAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTestClusterListNullablesAndOptionalsStructAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readListNullablesAndOptionalsStructAttribute( @@ -12499,53 +12707,260 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedListNullablesAndOptionalsStructAttributeCallback(), readTestClusterListNullablesAndOptionalsStructCommandParams); - readTestClusterCommandInfo.put( + readTestClusterInteractionInfo.put( "readListNullablesAndOptionalsStructAttribute", - readTestClusterListNullablesAndOptionalsStructAttributeCommandInfo); + readTestClusterListNullablesAndOptionalsStructAttributeInteractionInfo); Map readTestClusterUnsupportedCommandParams = new LinkedHashMap(); - CommandInfo readTestClusterUnsupportedAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTestClusterUnsupportedAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readUnsupportedAttribute((ChipClusters.BooleanAttributeCallback) callback); }, () -> new DelegatedBooleanAttributeCallback(), readTestClusterUnsupportedCommandParams); - readTestClusterCommandInfo.put( - "readUnsupportedAttribute", readTestClusterUnsupportedAttributeCommandInfo); + readTestClusterInteractionInfo.put( + "readUnsupportedAttribute", readTestClusterUnsupportedAttributeInteractionInfo); + Map readTestClusterNullableBooleanCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableBooleanAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableBooleanAttribute((ChipClusters.BooleanAttributeCallback) callback); + }, + () -> new DelegatedBooleanAttributeCallback(), + readTestClusterNullableBooleanCommandParams); + readTestClusterInteractionInfo.put( + "readNullableBooleanAttribute", readTestClusterNullableBooleanAttributeInteractionInfo); + Map readTestClusterNullableBitmap8CommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableBitmap8AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableBitmap8Attribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new DelegatedIntegerAttributeCallback(), + readTestClusterNullableBitmap8CommandParams); + readTestClusterInteractionInfo.put( + "readNullableBitmap8Attribute", readTestClusterNullableBitmap8AttributeInteractionInfo); + Map readTestClusterNullableBitmap16CommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableBitmap16AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableBitmap16Attribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new DelegatedIntegerAttributeCallback(), + readTestClusterNullableBitmap16CommandParams); + readTestClusterInteractionInfo.put( + "readNullableBitmap16Attribute", readTestClusterNullableBitmap16AttributeInteractionInfo); + Map readTestClusterNullableBitmap32CommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableBitmap32AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableBitmap32Attribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new DelegatedLongAttributeCallback(), + readTestClusterNullableBitmap32CommandParams); + readTestClusterInteractionInfo.put( + "readNullableBitmap32Attribute", readTestClusterNullableBitmap32AttributeInteractionInfo); + Map readTestClusterNullableBitmap64CommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableBitmap64AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableBitmap64Attribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new DelegatedLongAttributeCallback(), + readTestClusterNullableBitmap64CommandParams); + readTestClusterInteractionInfo.put( + "readNullableBitmap64Attribute", readTestClusterNullableBitmap64AttributeInteractionInfo); + Map readTestClusterNullableInt8uCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableInt8uAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableInt8uAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new DelegatedIntegerAttributeCallback(), + readTestClusterNullableInt8uCommandParams); + readTestClusterInteractionInfo.put( + "readNullableInt8uAttribute", readTestClusterNullableInt8uAttributeInteractionInfo); + Map readTestClusterNullableInt16uCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableInt16uAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableInt16uAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new DelegatedIntegerAttributeCallback(), + readTestClusterNullableInt16uCommandParams); + readTestClusterInteractionInfo.put( + "readNullableInt16uAttribute", readTestClusterNullableInt16uAttributeInteractionInfo); + Map readTestClusterNullableInt32uCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableInt32uAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableInt32uAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new DelegatedLongAttributeCallback(), + readTestClusterNullableInt32uCommandParams); + readTestClusterInteractionInfo.put( + "readNullableInt32uAttribute", readTestClusterNullableInt32uAttributeInteractionInfo); + Map readTestClusterNullableInt64uCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableInt64uAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableInt64uAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new DelegatedLongAttributeCallback(), + readTestClusterNullableInt64uCommandParams); + readTestClusterInteractionInfo.put( + "readNullableInt64uAttribute", readTestClusterNullableInt64uAttributeInteractionInfo); + Map readTestClusterNullableInt8sCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableInt8sAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableInt8sAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new DelegatedIntegerAttributeCallback(), + readTestClusterNullableInt8sCommandParams); + readTestClusterInteractionInfo.put( + "readNullableInt8sAttribute", readTestClusterNullableInt8sAttributeInteractionInfo); + Map readTestClusterNullableInt16sCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableInt16sAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableInt16sAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new DelegatedIntegerAttributeCallback(), + readTestClusterNullableInt16sCommandParams); + readTestClusterInteractionInfo.put( + "readNullableInt16sAttribute", readTestClusterNullableInt16sAttributeInteractionInfo); + Map readTestClusterNullableInt32sCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableInt32sAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableInt32sAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new DelegatedLongAttributeCallback(), + readTestClusterNullableInt32sCommandParams); + readTestClusterInteractionInfo.put( + "readNullableInt32sAttribute", readTestClusterNullableInt32sAttributeInteractionInfo); + Map readTestClusterNullableInt64sCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableInt64sAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableInt64sAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new DelegatedLongAttributeCallback(), + readTestClusterNullableInt64sCommandParams); + readTestClusterInteractionInfo.put( + "readNullableInt64sAttribute", readTestClusterNullableInt64sAttributeInteractionInfo); + Map readTestClusterNullableEnum8CommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableEnum8AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableEnum8Attribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new DelegatedIntegerAttributeCallback(), + readTestClusterNullableEnum8CommandParams); + readTestClusterInteractionInfo.put( + "readNullableEnum8Attribute", readTestClusterNullableEnum8AttributeInteractionInfo); + Map readTestClusterNullableEnum16CommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableEnum16AttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableEnum16Attribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new DelegatedIntegerAttributeCallback(), + readTestClusterNullableEnum16CommandParams); + readTestClusterInteractionInfo.put( + "readNullableEnum16Attribute", readTestClusterNullableEnum16AttributeInteractionInfo); + Map readTestClusterNullableOctetStringCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableOctetStringAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableOctetStringAttribute( + (ChipClusters.OctetStringAttributeCallback) callback); + }, + () -> new DelegatedOctetStringAttributeCallback(), + readTestClusterNullableOctetStringCommandParams); + readTestClusterInteractionInfo.put( + "readNullableOctetStringAttribute", + readTestClusterNullableOctetStringAttributeInteractionInfo); + Map readTestClusterNullableCharStringCommandParams = + new LinkedHashMap(); + InteractionInfo readTestClusterNullableCharStringAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TestClusterCluster) cluster) + .readNullableCharStringAttribute( + (ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new DelegatedCharStringAttributeCallback(), + readTestClusterNullableCharStringCommandParams); + readTestClusterInteractionInfo.put( + "readNullableCharStringAttribute", + readTestClusterNullableCharStringAttributeInteractionInfo); Map readTestClusterClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readTestClusterClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readTestClusterClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readTestClusterClusterRevisionCommandParams); - readTestClusterCommandInfo.put( - "readClusterRevisionAttribute", readTestClusterClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("testCluster").combineCommands(readTestClusterCommandInfo); - Map readThermostatCommandInfo = new LinkedHashMap<>(); + readTestClusterInteractionInfo.put( + "readClusterRevisionAttribute", readTestClusterClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("testCluster", readTestClusterInteractionInfo); + Map readThermostatInteractionInfo = new LinkedHashMap<>(); // read attribute Map readThermostatLocalTemperatureCommandParams = new LinkedHashMap(); - CommandInfo readThermostatLocalTemperatureAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThermostatLocalTemperatureAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThermostatCluster) cluster) .readLocalTemperatureAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readThermostatLocalTemperatureCommandParams); - readThermostatCommandInfo.put( - "readLocalTemperatureAttribute", readThermostatLocalTemperatureAttributeCommandInfo); + readThermostatInteractionInfo.put( + "readLocalTemperatureAttribute", readThermostatLocalTemperatureAttributeInteractionInfo); Map readThermostatAbsMinHeatSetpointLimitCommandParams = new LinkedHashMap(); - CommandInfo readThermostatAbsMinHeatSetpointLimitAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThermostatAbsMinHeatSetpointLimitAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThermostatCluster) cluster) .readAbsMinHeatSetpointLimitAttribute( @@ -12553,13 +12968,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readThermostatAbsMinHeatSetpointLimitCommandParams); - readThermostatCommandInfo.put( + readThermostatInteractionInfo.put( "readAbsMinHeatSetpointLimitAttribute", - readThermostatAbsMinHeatSetpointLimitAttributeCommandInfo); + readThermostatAbsMinHeatSetpointLimitAttributeInteractionInfo); Map readThermostatAbsMaxHeatSetpointLimitCommandParams = new LinkedHashMap(); - CommandInfo readThermostatAbsMaxHeatSetpointLimitAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThermostatAbsMaxHeatSetpointLimitAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThermostatCluster) cluster) .readAbsMaxHeatSetpointLimitAttribute( @@ -12567,13 +12982,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readThermostatAbsMaxHeatSetpointLimitCommandParams); - readThermostatCommandInfo.put( + readThermostatInteractionInfo.put( "readAbsMaxHeatSetpointLimitAttribute", - readThermostatAbsMaxHeatSetpointLimitAttributeCommandInfo); + readThermostatAbsMaxHeatSetpointLimitAttributeInteractionInfo); Map readThermostatAbsMinCoolSetpointLimitCommandParams = new LinkedHashMap(); - CommandInfo readThermostatAbsMinCoolSetpointLimitAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThermostatAbsMinCoolSetpointLimitAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThermostatCluster) cluster) .readAbsMinCoolSetpointLimitAttribute( @@ -12581,13 +12996,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readThermostatAbsMinCoolSetpointLimitCommandParams); - readThermostatCommandInfo.put( + readThermostatInteractionInfo.put( "readAbsMinCoolSetpointLimitAttribute", - readThermostatAbsMinCoolSetpointLimitAttributeCommandInfo); + readThermostatAbsMinCoolSetpointLimitAttributeInteractionInfo); Map readThermostatAbsMaxCoolSetpointLimitCommandParams = new LinkedHashMap(); - CommandInfo readThermostatAbsMaxCoolSetpointLimitAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThermostatAbsMaxCoolSetpointLimitAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThermostatCluster) cluster) .readAbsMaxCoolSetpointLimitAttribute( @@ -12595,13 +13010,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readThermostatAbsMaxCoolSetpointLimitCommandParams); - readThermostatCommandInfo.put( + readThermostatInteractionInfo.put( "readAbsMaxCoolSetpointLimitAttribute", - readThermostatAbsMaxCoolSetpointLimitAttributeCommandInfo); + readThermostatAbsMaxCoolSetpointLimitAttributeInteractionInfo); Map readThermostatOccupiedCoolingSetpointCommandParams = new LinkedHashMap(); - CommandInfo readThermostatOccupiedCoolingSetpointAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThermostatOccupiedCoolingSetpointAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThermostatCluster) cluster) .readOccupiedCoolingSetpointAttribute( @@ -12609,13 +13024,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readThermostatOccupiedCoolingSetpointCommandParams); - readThermostatCommandInfo.put( + readThermostatInteractionInfo.put( "readOccupiedCoolingSetpointAttribute", - readThermostatOccupiedCoolingSetpointAttributeCommandInfo); + readThermostatOccupiedCoolingSetpointAttributeInteractionInfo); Map readThermostatOccupiedHeatingSetpointCommandParams = new LinkedHashMap(); - CommandInfo readThermostatOccupiedHeatingSetpointAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThermostatOccupiedHeatingSetpointAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThermostatCluster) cluster) .readOccupiedHeatingSetpointAttribute( @@ -12623,13 +13038,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readThermostatOccupiedHeatingSetpointCommandParams); - readThermostatCommandInfo.put( + readThermostatInteractionInfo.put( "readOccupiedHeatingSetpointAttribute", - readThermostatOccupiedHeatingSetpointAttributeCommandInfo); + readThermostatOccupiedHeatingSetpointAttributeInteractionInfo); Map readThermostatMinHeatSetpointLimitCommandParams = new LinkedHashMap(); - CommandInfo readThermostatMinHeatSetpointLimitAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThermostatMinHeatSetpointLimitAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThermostatCluster) cluster) .readMinHeatSetpointLimitAttribute( @@ -12637,13 +13052,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readThermostatMinHeatSetpointLimitCommandParams); - readThermostatCommandInfo.put( + readThermostatInteractionInfo.put( "readMinHeatSetpointLimitAttribute", - readThermostatMinHeatSetpointLimitAttributeCommandInfo); + readThermostatMinHeatSetpointLimitAttributeInteractionInfo); Map readThermostatMaxHeatSetpointLimitCommandParams = new LinkedHashMap(); - CommandInfo readThermostatMaxHeatSetpointLimitAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThermostatMaxHeatSetpointLimitAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThermostatCluster) cluster) .readMaxHeatSetpointLimitAttribute( @@ -12651,13 +13066,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readThermostatMaxHeatSetpointLimitCommandParams); - readThermostatCommandInfo.put( + readThermostatInteractionInfo.put( "readMaxHeatSetpointLimitAttribute", - readThermostatMaxHeatSetpointLimitAttributeCommandInfo); + readThermostatMaxHeatSetpointLimitAttributeInteractionInfo); Map readThermostatMinCoolSetpointLimitCommandParams = new LinkedHashMap(); - CommandInfo readThermostatMinCoolSetpointLimitAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThermostatMinCoolSetpointLimitAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThermostatCluster) cluster) .readMinCoolSetpointLimitAttribute( @@ -12665,13 +13080,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readThermostatMinCoolSetpointLimitCommandParams); - readThermostatCommandInfo.put( + readThermostatInteractionInfo.put( "readMinCoolSetpointLimitAttribute", - readThermostatMinCoolSetpointLimitAttributeCommandInfo); + readThermostatMinCoolSetpointLimitAttributeInteractionInfo); Map readThermostatMaxCoolSetpointLimitCommandParams = new LinkedHashMap(); - CommandInfo readThermostatMaxCoolSetpointLimitAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThermostatMaxCoolSetpointLimitAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThermostatCluster) cluster) .readMaxCoolSetpointLimitAttribute( @@ -12679,13 +13094,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readThermostatMaxCoolSetpointLimitCommandParams); - readThermostatCommandInfo.put( + readThermostatInteractionInfo.put( "readMaxCoolSetpointLimitAttribute", - readThermostatMaxCoolSetpointLimitAttributeCommandInfo); + readThermostatMaxCoolSetpointLimitAttributeInteractionInfo); Map readThermostatMinSetpointDeadBandCommandParams = new LinkedHashMap(); - CommandInfo readThermostatMinSetpointDeadBandAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThermostatMinSetpointDeadBandAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThermostatCluster) cluster) .readMinSetpointDeadBandAttribute( @@ -12693,12 +13108,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readThermostatMinSetpointDeadBandCommandParams); - readThermostatCommandInfo.put( - "readMinSetpointDeadBandAttribute", readThermostatMinSetpointDeadBandAttributeCommandInfo); + readThermostatInteractionInfo.put( + "readMinSetpointDeadBandAttribute", + readThermostatMinSetpointDeadBandAttributeInteractionInfo); Map readThermostatControlSequenceOfOperationCommandParams = new LinkedHashMap(); - CommandInfo readThermostatControlSequenceOfOperationAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThermostatControlSequenceOfOperationAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThermostatCluster) cluster) .readControlSequenceOfOperationAttribute( @@ -12706,37 +13122,37 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readThermostatControlSequenceOfOperationCommandParams); - readThermostatCommandInfo.put( + readThermostatInteractionInfo.put( "readControlSequenceOfOperationAttribute", - readThermostatControlSequenceOfOperationAttributeCommandInfo); + readThermostatControlSequenceOfOperationAttributeInteractionInfo); Map readThermostatSystemModeCommandParams = new LinkedHashMap(); - CommandInfo readThermostatSystemModeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThermostatSystemModeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThermostatCluster) cluster) .readSystemModeAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readThermostatSystemModeCommandParams); - readThermostatCommandInfo.put( - "readSystemModeAttribute", readThermostatSystemModeAttributeCommandInfo); + readThermostatInteractionInfo.put( + "readSystemModeAttribute", readThermostatSystemModeAttributeInteractionInfo); Map readThermostatStartOfWeekCommandParams = new LinkedHashMap(); - CommandInfo readThermostatStartOfWeekAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThermostatStartOfWeekAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThermostatCluster) cluster) .readStartOfWeekAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readThermostatStartOfWeekCommandParams); - readThermostatCommandInfo.put( - "readStartOfWeekAttribute", readThermostatStartOfWeekAttributeCommandInfo); + readThermostatInteractionInfo.put( + "readStartOfWeekAttribute", readThermostatStartOfWeekAttributeInteractionInfo); Map readThermostatNumberOfWeeklyTransitionsCommandParams = new LinkedHashMap(); - CommandInfo readThermostatNumberOfWeeklyTransitionsAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThermostatNumberOfWeeklyTransitionsAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThermostatCluster) cluster) .readNumberOfWeeklyTransitionsAttribute( @@ -12744,13 +13160,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readThermostatNumberOfWeeklyTransitionsCommandParams); - readThermostatCommandInfo.put( + readThermostatInteractionInfo.put( "readNumberOfWeeklyTransitionsAttribute", - readThermostatNumberOfWeeklyTransitionsAttributeCommandInfo); + readThermostatNumberOfWeeklyTransitionsAttributeInteractionInfo); Map readThermostatNumberOfDailyTransitionsCommandParams = new LinkedHashMap(); - CommandInfo readThermostatNumberOfDailyTransitionsAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThermostatNumberOfDailyTransitionsAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThermostatCluster) cluster) .readNumberOfDailyTransitionsAttribute( @@ -12758,73 +13174,73 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readThermostatNumberOfDailyTransitionsCommandParams); - readThermostatCommandInfo.put( + readThermostatInteractionInfo.put( "readNumberOfDailyTransitionsAttribute", - readThermostatNumberOfDailyTransitionsAttributeCommandInfo); + readThermostatNumberOfDailyTransitionsAttributeInteractionInfo); Map readThermostatFeatureMapCommandParams = new LinkedHashMap(); - CommandInfo readThermostatFeatureMapAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThermostatFeatureMapAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThermostatCluster) cluster) .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThermostatFeatureMapCommandParams); - readThermostatCommandInfo.put( - "readFeatureMapAttribute", readThermostatFeatureMapAttributeCommandInfo); + readThermostatInteractionInfo.put( + "readFeatureMapAttribute", readThermostatFeatureMapAttributeInteractionInfo); Map readThermostatClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readThermostatClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThermostatClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThermostatCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readThermostatClusterRevisionCommandParams); - readThermostatCommandInfo.put( - "readClusterRevisionAttribute", readThermostatClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("thermostat").combineCommands(readThermostatCommandInfo); - Map readThermostatUserInterfaceConfigurationCommandInfo = + readThermostatInteractionInfo.put( + "readClusterRevisionAttribute", readThermostatClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("thermostat", readThermostatInteractionInfo); + Map readThermostatUserInterfaceConfigurationInteractionInfo = new LinkedHashMap<>(); // read attribute Map readThermostatUserInterfaceConfigurationTemperatureDisplayModeCommandParams = new LinkedHashMap(); - CommandInfo readThermostatUserInterfaceConfigurationTemperatureDisplayModeAttributeCommandInfo = - new CommandInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatUserInterfaceConfigurationCluster) cluster) - .readTemperatureDisplayModeAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThermostatUserInterfaceConfigurationTemperatureDisplayModeCommandParams); - readThermostatUserInterfaceConfigurationCommandInfo.put( + InteractionInfo + readThermostatUserInterfaceConfigurationTemperatureDisplayModeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatUserInterfaceConfigurationCluster) cluster) + .readTemperatureDisplayModeAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new DelegatedIntegerAttributeCallback(), + readThermostatUserInterfaceConfigurationTemperatureDisplayModeCommandParams); + readThermostatUserInterfaceConfigurationInteractionInfo.put( "readTemperatureDisplayModeAttribute", - readThermostatUserInterfaceConfigurationTemperatureDisplayModeAttributeCommandInfo); + readThermostatUserInterfaceConfigurationTemperatureDisplayModeAttributeInteractionInfo); Map readThermostatUserInterfaceConfigurationKeypadLockoutCommandParams = new LinkedHashMap(); - CommandInfo readThermostatUserInterfaceConfigurationKeypadLockoutAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThermostatUserInterfaceConfigurationKeypadLockoutAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThermostatUserInterfaceConfigurationCluster) cluster) .readKeypadLockoutAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readThermostatUserInterfaceConfigurationKeypadLockoutCommandParams); - readThermostatUserInterfaceConfigurationCommandInfo.put( + readThermostatUserInterfaceConfigurationInteractionInfo.put( "readKeypadLockoutAttribute", - readThermostatUserInterfaceConfigurationKeypadLockoutAttributeCommandInfo); + readThermostatUserInterfaceConfigurationKeypadLockoutAttributeInteractionInfo); Map readThermostatUserInterfaceConfigurationScheduleProgrammingVisibilityCommandParams = new LinkedHashMap(); - CommandInfo - readThermostatUserInterfaceConfigurationScheduleProgrammingVisibilityAttributeCommandInfo = - new CommandInfo( + InteractionInfo + readThermostatUserInterfaceConfigurationScheduleProgrammingVisibilityAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThermostatUserInterfaceConfigurationCluster) cluster) .readScheduleProgrammingVisibilityAttribute( @@ -12832,94 +13248,98 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readThermostatUserInterfaceConfigurationScheduleProgrammingVisibilityCommandParams); - readThermostatUserInterfaceConfigurationCommandInfo.put( + readThermostatUserInterfaceConfigurationInteractionInfo.put( "readScheduleProgrammingVisibilityAttribute", - readThermostatUserInterfaceConfigurationScheduleProgrammingVisibilityAttributeCommandInfo); + readThermostatUserInterfaceConfigurationScheduleProgrammingVisibilityAttributeInteractionInfo); Map readThermostatUserInterfaceConfigurationClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readThermostatUserInterfaceConfigurationClusterRevisionAttributeCommandInfo = - new CommandInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatUserInterfaceConfigurationCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThermostatUserInterfaceConfigurationClusterRevisionCommandParams); - readThermostatUserInterfaceConfigurationCommandInfo.put( + InteractionInfo + readThermostatUserInterfaceConfigurationClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatUserInterfaceConfigurationCluster) cluster) + .readClusterRevisionAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new DelegatedIntegerAttributeCallback(), + readThermostatUserInterfaceConfigurationClusterRevisionCommandParams); + readThermostatUserInterfaceConfigurationInteractionInfo.put( "readClusterRevisionAttribute", - readThermostatUserInterfaceConfigurationClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap - .get("thermostatUserInterfaceConfiguration") - .combineCommands(readThermostatUserInterfaceConfigurationCommandInfo); - Map readThreadNetworkDiagnosticsCommandInfo = new LinkedHashMap<>(); + readThermostatUserInterfaceConfigurationClusterRevisionAttributeInteractionInfo); + readAttributeMap.put( + "thermostatUserInterfaceConfiguration", + readThermostatUserInterfaceConfigurationInteractionInfo); + Map readThreadNetworkDiagnosticsInteractionInfo = + new LinkedHashMap<>(); // read attribute Map readThreadNetworkDiagnosticsChannelCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsChannelAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsChannelAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readChannelAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readThreadNetworkDiagnosticsChannelCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( - "readChannelAttribute", readThreadNetworkDiagnosticsChannelAttributeCommandInfo); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readChannelAttribute", readThreadNetworkDiagnosticsChannelAttributeInteractionInfo); Map readThreadNetworkDiagnosticsRoutingRoleCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsRoutingRoleAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsRoutingRoleAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readRoutingRoleAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readThreadNetworkDiagnosticsRoutingRoleCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( - "readRoutingRoleAttribute", readThreadNetworkDiagnosticsRoutingRoleAttributeCommandInfo); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readRoutingRoleAttribute", + readThreadNetworkDiagnosticsRoutingRoleAttributeInteractionInfo); Map readThreadNetworkDiagnosticsNetworkNameCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsNetworkNameAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsNetworkNameAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readNetworkNameAttribute((ChipClusters.OctetStringAttributeCallback) callback); }, () -> new DelegatedOctetStringAttributeCallback(), readThreadNetworkDiagnosticsNetworkNameCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( - "readNetworkNameAttribute", readThreadNetworkDiagnosticsNetworkNameAttributeCommandInfo); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readNetworkNameAttribute", + readThreadNetworkDiagnosticsNetworkNameAttributeInteractionInfo); Map readThreadNetworkDiagnosticsPanIdCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsPanIdAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsPanIdAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readPanIdAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readThreadNetworkDiagnosticsPanIdCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( - "readPanIdAttribute", readThreadNetworkDiagnosticsPanIdAttributeCommandInfo); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readPanIdAttribute", readThreadNetworkDiagnosticsPanIdAttributeInteractionInfo); Map readThreadNetworkDiagnosticsExtendedPanIdCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsExtendedPanIdAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsExtendedPanIdAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readExtendedPanIdAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsExtendedPanIdCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readExtendedPanIdAttribute", - readThreadNetworkDiagnosticsExtendedPanIdAttributeCommandInfo); + readThreadNetworkDiagnosticsExtendedPanIdAttributeInteractionInfo); Map readThreadNetworkDiagnosticsMeshLocalPrefixCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsMeshLocalPrefixAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsMeshLocalPrefixAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readMeshLocalPrefixAttribute( @@ -12927,25 +13347,26 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedOctetStringAttributeCallback(), readThreadNetworkDiagnosticsMeshLocalPrefixCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readMeshLocalPrefixAttribute", - readThreadNetworkDiagnosticsMeshLocalPrefixAttributeCommandInfo); + readThreadNetworkDiagnosticsMeshLocalPrefixAttributeInteractionInfo); Map readThreadNetworkDiagnosticsOverrunCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsOverrunCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsOverrunCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readOverrunCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsOverrunCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( - "readOverrunCountAttribute", readThreadNetworkDiagnosticsOverrunCountAttributeCommandInfo); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readOverrunCountAttribute", + readThreadNetworkDiagnosticsOverrunCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsNeighborTableListCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsNeighborTableListAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsNeighborTableListAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readNeighborTableListAttribute( @@ -12955,13 +13376,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedNeighborTableListAttributeCallback(), readThreadNetworkDiagnosticsNeighborTableListCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readNeighborTableListAttribute", - readThreadNetworkDiagnosticsNeighborTableListAttributeCommandInfo); + readThreadNetworkDiagnosticsNeighborTableListAttributeInteractionInfo); Map readThreadNetworkDiagnosticsRouteTableListCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsRouteTableListAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsRouteTableListAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readRouteTableListAttribute( @@ -12970,127 +13391,129 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedRouteTableListAttributeCallback(), readThreadNetworkDiagnosticsRouteTableListCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readRouteTableListAttribute", - readThreadNetworkDiagnosticsRouteTableListAttributeCommandInfo); + readThreadNetworkDiagnosticsRouteTableListAttributeInteractionInfo); Map readThreadNetworkDiagnosticsPartitionIdCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsPartitionIdAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsPartitionIdAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readPartitionIdAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsPartitionIdCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( - "readPartitionIdAttribute", readThreadNetworkDiagnosticsPartitionIdAttributeCommandInfo); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readPartitionIdAttribute", + readThreadNetworkDiagnosticsPartitionIdAttributeInteractionInfo); Map readThreadNetworkDiagnosticsWeightingCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsWeightingAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsWeightingAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readWeightingAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readThreadNetworkDiagnosticsWeightingCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( - "readWeightingAttribute", readThreadNetworkDiagnosticsWeightingAttributeCommandInfo); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readWeightingAttribute", readThreadNetworkDiagnosticsWeightingAttributeInteractionInfo); Map readThreadNetworkDiagnosticsDataVersionCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsDataVersionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsDataVersionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readDataVersionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readThreadNetworkDiagnosticsDataVersionCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( - "readDataVersionAttribute", readThreadNetworkDiagnosticsDataVersionAttributeCommandInfo); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readDataVersionAttribute", + readThreadNetworkDiagnosticsDataVersionAttributeInteractionInfo); Map readThreadNetworkDiagnosticsStableDataVersionCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsStableDataVersionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsStableDataVersionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readStableDataVersionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readThreadNetworkDiagnosticsStableDataVersionCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readStableDataVersionAttribute", - readThreadNetworkDiagnosticsStableDataVersionAttributeCommandInfo); + readThreadNetworkDiagnosticsStableDataVersionAttributeInteractionInfo); Map readThreadNetworkDiagnosticsLeaderRouterIdCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsLeaderRouterIdAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsLeaderRouterIdAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readLeaderRouterIdAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readThreadNetworkDiagnosticsLeaderRouterIdCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readLeaderRouterIdAttribute", - readThreadNetworkDiagnosticsLeaderRouterIdAttributeCommandInfo); + readThreadNetworkDiagnosticsLeaderRouterIdAttributeInteractionInfo); Map readThreadNetworkDiagnosticsDetachedRoleCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsDetachedRoleCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsDetachedRoleCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readDetachedRoleCountAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readThreadNetworkDiagnosticsDetachedRoleCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readDetachedRoleCountAttribute", - readThreadNetworkDiagnosticsDetachedRoleCountAttributeCommandInfo); + readThreadNetworkDiagnosticsDetachedRoleCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsChildRoleCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsChildRoleCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsChildRoleCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readChildRoleCountAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readThreadNetworkDiagnosticsChildRoleCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readChildRoleCountAttribute", - readThreadNetworkDiagnosticsChildRoleCountAttributeCommandInfo); + readThreadNetworkDiagnosticsChildRoleCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsRouterRoleCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsRouterRoleCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsRouterRoleCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readRouterRoleCountAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readThreadNetworkDiagnosticsRouterRoleCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readRouterRoleCountAttribute", - readThreadNetworkDiagnosticsRouterRoleCountAttributeCommandInfo); + readThreadNetworkDiagnosticsRouterRoleCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsLeaderRoleCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsLeaderRoleCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsLeaderRoleCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readLeaderRoleCountAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readThreadNetworkDiagnosticsLeaderRoleCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readLeaderRoleCountAttribute", - readThreadNetworkDiagnosticsLeaderRoleCountAttributeCommandInfo); + readThreadNetworkDiagnosticsLeaderRoleCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsAttachAttemptCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsAttachAttemptCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsAttachAttemptCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readAttachAttemptCountAttribute( @@ -13098,14 +13521,14 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readThreadNetworkDiagnosticsAttachAttemptCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readAttachAttemptCountAttribute", - readThreadNetworkDiagnosticsAttachAttemptCountAttributeCommandInfo); + readThreadNetworkDiagnosticsAttachAttemptCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsPartitionIdChangeCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsPartitionIdChangeCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsPartitionIdChangeCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readPartitionIdChangeCountAttribute( @@ -13113,105 +13536,108 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readThreadNetworkDiagnosticsPartitionIdChangeCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readPartitionIdChangeCountAttribute", - readThreadNetworkDiagnosticsPartitionIdChangeCountAttributeCommandInfo); + readThreadNetworkDiagnosticsPartitionIdChangeCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsBetterPartitionAttachAttemptCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsBetterPartitionAttachAttemptCountAttributeCommandInfo = - new CommandInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readBetterPartitionAttachAttemptCountAttribute( - (ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new DelegatedIntegerAttributeCallback(), - readThreadNetworkDiagnosticsBetterPartitionAttachAttemptCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + InteractionInfo + readThreadNetworkDiagnosticsBetterPartitionAttachAttemptCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readBetterPartitionAttachAttemptCountAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new DelegatedIntegerAttributeCallback(), + readThreadNetworkDiagnosticsBetterPartitionAttachAttemptCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( "readBetterPartitionAttachAttemptCountAttribute", - readThreadNetworkDiagnosticsBetterPartitionAttachAttemptCountAttributeCommandInfo); + readThreadNetworkDiagnosticsBetterPartitionAttachAttemptCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsParentChangeCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsParentChangeCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsParentChangeCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readParentChangeCountAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readThreadNetworkDiagnosticsParentChangeCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readParentChangeCountAttribute", - readThreadNetworkDiagnosticsParentChangeCountAttributeCommandInfo); + readThreadNetworkDiagnosticsParentChangeCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsTxTotalCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsTxTotalCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsTxTotalCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readTxTotalCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsTxTotalCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( - "readTxTotalCountAttribute", readThreadNetworkDiagnosticsTxTotalCountAttributeCommandInfo); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readTxTotalCountAttribute", + readThreadNetworkDiagnosticsTxTotalCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsTxUnicastCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsTxUnicastCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsTxUnicastCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readTxUnicastCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsTxUnicastCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readTxUnicastCountAttribute", - readThreadNetworkDiagnosticsTxUnicastCountAttributeCommandInfo); + readThreadNetworkDiagnosticsTxUnicastCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsTxBroadcastCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsTxBroadcastCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsTxBroadcastCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readTxBroadcastCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsTxBroadcastCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readTxBroadcastCountAttribute", - readThreadNetworkDiagnosticsTxBroadcastCountAttributeCommandInfo); + readThreadNetworkDiagnosticsTxBroadcastCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsTxAckRequestedCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsTxAckRequestedCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsTxAckRequestedCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readTxAckRequestedCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsTxAckRequestedCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readTxAckRequestedCountAttribute", - readThreadNetworkDiagnosticsTxAckRequestedCountAttributeCommandInfo); + readThreadNetworkDiagnosticsTxAckRequestedCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsTxAckedCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsTxAckedCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsTxAckedCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readTxAckedCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsTxAckedCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( - "readTxAckedCountAttribute", readThreadNetworkDiagnosticsTxAckedCountAttributeCommandInfo); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readTxAckedCountAttribute", + readThreadNetworkDiagnosticsTxAckedCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsTxNoAckRequestedCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsTxNoAckRequestedCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsTxNoAckRequestedCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readTxNoAckRequestedCountAttribute( @@ -13219,146 +13645,151 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsTxNoAckRequestedCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readTxNoAckRequestedCountAttribute", - readThreadNetworkDiagnosticsTxNoAckRequestedCountAttributeCommandInfo); + readThreadNetworkDiagnosticsTxNoAckRequestedCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsTxDataCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsTxDataCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsTxDataCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readTxDataCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsTxDataCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( - "readTxDataCountAttribute", readThreadNetworkDiagnosticsTxDataCountAttributeCommandInfo); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readTxDataCountAttribute", + readThreadNetworkDiagnosticsTxDataCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsTxDataPollCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsTxDataPollCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsTxDataPollCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readTxDataPollCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsTxDataPollCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readTxDataPollCountAttribute", - readThreadNetworkDiagnosticsTxDataPollCountAttributeCommandInfo); + readThreadNetworkDiagnosticsTxDataPollCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsTxBeaconCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsTxBeaconCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsTxBeaconCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readTxBeaconCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsTxBeaconCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readTxBeaconCountAttribute", - readThreadNetworkDiagnosticsTxBeaconCountAttributeCommandInfo); + readThreadNetworkDiagnosticsTxBeaconCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsTxBeaconRequestCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsTxBeaconRequestCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsTxBeaconRequestCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readTxBeaconRequestCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsTxBeaconRequestCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readTxBeaconRequestCountAttribute", - readThreadNetworkDiagnosticsTxBeaconRequestCountAttributeCommandInfo); + readThreadNetworkDiagnosticsTxBeaconRequestCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsTxOtherCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsTxOtherCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsTxOtherCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readTxOtherCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsTxOtherCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( - "readTxOtherCountAttribute", readThreadNetworkDiagnosticsTxOtherCountAttributeCommandInfo); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readTxOtherCountAttribute", + readThreadNetworkDiagnosticsTxOtherCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsTxRetryCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsTxRetryCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsTxRetryCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readTxRetryCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsTxRetryCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( - "readTxRetryCountAttribute", readThreadNetworkDiagnosticsTxRetryCountAttributeCommandInfo); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readTxRetryCountAttribute", + readThreadNetworkDiagnosticsTxRetryCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsTxDirectMaxRetryExpiryCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsTxDirectMaxRetryExpiryCountAttributeCommandInfo = - new CommandInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readTxDirectMaxRetryExpiryCountAttribute( - (ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsTxDirectMaxRetryExpiryCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + InteractionInfo + readThreadNetworkDiagnosticsTxDirectMaxRetryExpiryCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readTxDirectMaxRetryExpiryCountAttribute( + (ChipClusters.LongAttributeCallback) callback); + }, + () -> new DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsTxDirectMaxRetryExpiryCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( "readTxDirectMaxRetryExpiryCountAttribute", - readThreadNetworkDiagnosticsTxDirectMaxRetryExpiryCountAttributeCommandInfo); + readThreadNetworkDiagnosticsTxDirectMaxRetryExpiryCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsTxIndirectMaxRetryExpiryCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsTxIndirectMaxRetryExpiryCountAttributeCommandInfo = - new CommandInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readTxIndirectMaxRetryExpiryCountAttribute( - (ChipClusters.LongAttributeCallback) callback); - }, - () -> new DelegatedLongAttributeCallback(), - readThreadNetworkDiagnosticsTxIndirectMaxRetryExpiryCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + InteractionInfo + readThreadNetworkDiagnosticsTxIndirectMaxRetryExpiryCountAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readTxIndirectMaxRetryExpiryCountAttribute( + (ChipClusters.LongAttributeCallback) callback); + }, + () -> new DelegatedLongAttributeCallback(), + readThreadNetworkDiagnosticsTxIndirectMaxRetryExpiryCountCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( "readTxIndirectMaxRetryExpiryCountAttribute", - readThreadNetworkDiagnosticsTxIndirectMaxRetryExpiryCountAttributeCommandInfo); + readThreadNetworkDiagnosticsTxIndirectMaxRetryExpiryCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsTxErrCcaCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsTxErrCcaCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsTxErrCcaCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readTxErrCcaCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsTxErrCcaCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readTxErrCcaCountAttribute", - readThreadNetworkDiagnosticsTxErrCcaCountAttributeCommandInfo); + readThreadNetworkDiagnosticsTxErrCcaCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsTxErrAbortCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsTxErrAbortCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsTxErrAbortCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readTxErrAbortCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsTxErrAbortCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readTxErrAbortCountAttribute", - readThreadNetworkDiagnosticsTxErrAbortCountAttributeCommandInfo); + readThreadNetworkDiagnosticsTxErrAbortCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsTxErrBusyChannelCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsTxErrBusyChannelCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsTxErrBusyChannelCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readTxErrBusyChannelCountAttribute( @@ -13366,116 +13797,119 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsTxErrBusyChannelCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readTxErrBusyChannelCountAttribute", - readThreadNetworkDiagnosticsTxErrBusyChannelCountAttributeCommandInfo); + readThreadNetworkDiagnosticsTxErrBusyChannelCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsRxTotalCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsRxTotalCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsRxTotalCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readRxTotalCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsRxTotalCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( - "readRxTotalCountAttribute", readThreadNetworkDiagnosticsRxTotalCountAttributeCommandInfo); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readRxTotalCountAttribute", + readThreadNetworkDiagnosticsRxTotalCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsRxUnicastCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsRxUnicastCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsRxUnicastCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readRxUnicastCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsRxUnicastCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readRxUnicastCountAttribute", - readThreadNetworkDiagnosticsRxUnicastCountAttributeCommandInfo); + readThreadNetworkDiagnosticsRxUnicastCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsRxBroadcastCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsRxBroadcastCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsRxBroadcastCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readRxBroadcastCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsRxBroadcastCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readRxBroadcastCountAttribute", - readThreadNetworkDiagnosticsRxBroadcastCountAttributeCommandInfo); + readThreadNetworkDiagnosticsRxBroadcastCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsRxDataCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsRxDataCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsRxDataCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readRxDataCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsRxDataCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( - "readRxDataCountAttribute", readThreadNetworkDiagnosticsRxDataCountAttributeCommandInfo); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readRxDataCountAttribute", + readThreadNetworkDiagnosticsRxDataCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsRxDataPollCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsRxDataPollCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsRxDataPollCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readRxDataPollCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsRxDataPollCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readRxDataPollCountAttribute", - readThreadNetworkDiagnosticsRxDataPollCountAttributeCommandInfo); + readThreadNetworkDiagnosticsRxDataPollCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsRxBeaconCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsRxBeaconCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsRxBeaconCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readRxBeaconCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsRxBeaconCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readRxBeaconCountAttribute", - readThreadNetworkDiagnosticsRxBeaconCountAttributeCommandInfo); + readThreadNetworkDiagnosticsRxBeaconCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsRxBeaconRequestCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsRxBeaconRequestCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsRxBeaconRequestCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readRxBeaconRequestCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsRxBeaconRequestCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readRxBeaconRequestCountAttribute", - readThreadNetworkDiagnosticsRxBeaconRequestCountAttributeCommandInfo); + readThreadNetworkDiagnosticsRxBeaconRequestCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsRxOtherCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsRxOtherCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsRxOtherCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readRxOtherCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsRxOtherCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( - "readRxOtherCountAttribute", readThreadNetworkDiagnosticsRxOtherCountAttributeCommandInfo); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readRxOtherCountAttribute", + readThreadNetworkDiagnosticsRxOtherCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsRxAddressFilteredCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsRxAddressFilteredCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsRxAddressFilteredCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readRxAddressFilteredCountAttribute( @@ -13483,14 +13917,14 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsRxAddressFilteredCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readRxAddressFilteredCountAttribute", - readThreadNetworkDiagnosticsRxAddressFilteredCountAttributeCommandInfo); + readThreadNetworkDiagnosticsRxAddressFilteredCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsRxDestAddrFilteredCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsRxDestAddrFilteredCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsRxDestAddrFilteredCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readRxDestAddrFilteredCountAttribute( @@ -13498,40 +13932,40 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsRxDestAddrFilteredCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readRxDestAddrFilteredCountAttribute", - readThreadNetworkDiagnosticsRxDestAddrFilteredCountAttributeCommandInfo); + readThreadNetworkDiagnosticsRxDestAddrFilteredCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsRxDuplicatedCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsRxDuplicatedCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsRxDuplicatedCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readRxDuplicatedCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsRxDuplicatedCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readRxDuplicatedCountAttribute", - readThreadNetworkDiagnosticsRxDuplicatedCountAttributeCommandInfo); + readThreadNetworkDiagnosticsRxDuplicatedCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsRxErrNoFrameCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsRxErrNoFrameCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsRxErrNoFrameCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readRxErrNoFrameCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsRxErrNoFrameCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readRxErrNoFrameCountAttribute", - readThreadNetworkDiagnosticsRxErrNoFrameCountAttributeCommandInfo); + readThreadNetworkDiagnosticsRxErrNoFrameCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsRxErrUnknownNeighborCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsRxErrUnknownNeighborCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsRxErrUnknownNeighborCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readRxErrUnknownNeighborCountAttribute( @@ -13539,14 +13973,14 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsRxErrUnknownNeighborCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readRxErrUnknownNeighborCountAttribute", - readThreadNetworkDiagnosticsRxErrUnknownNeighborCountAttributeCommandInfo); + readThreadNetworkDiagnosticsRxErrUnknownNeighborCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsRxErrInvalidSrcAddrCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsRxErrInvalidSrcAddrCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsRxErrInvalidSrcAddrCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readRxErrInvalidSrcAddrCountAttribute( @@ -13554,90 +13988,90 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsRxErrInvalidSrcAddrCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readRxErrInvalidSrcAddrCountAttribute", - readThreadNetworkDiagnosticsRxErrInvalidSrcAddrCountAttributeCommandInfo); + readThreadNetworkDiagnosticsRxErrInvalidSrcAddrCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsRxErrSecCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsRxErrSecCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsRxErrSecCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readRxErrSecCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsRxErrSecCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readRxErrSecCountAttribute", - readThreadNetworkDiagnosticsRxErrSecCountAttributeCommandInfo); + readThreadNetworkDiagnosticsRxErrSecCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsRxErrFcsCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsRxErrFcsCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsRxErrFcsCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readRxErrFcsCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsRxErrFcsCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readRxErrFcsCountAttribute", - readThreadNetworkDiagnosticsRxErrFcsCountAttributeCommandInfo); + readThreadNetworkDiagnosticsRxErrFcsCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsRxErrOtherCountCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsRxErrOtherCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsRxErrOtherCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readRxErrOtherCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsRxErrOtherCountCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readRxErrOtherCountAttribute", - readThreadNetworkDiagnosticsRxErrOtherCountAttributeCommandInfo); + readThreadNetworkDiagnosticsRxErrOtherCountAttributeInteractionInfo); Map readThreadNetworkDiagnosticsActiveTimestampCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsActiveTimestampAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsActiveTimestampAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readActiveTimestampAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsActiveTimestampCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readActiveTimestampAttribute", - readThreadNetworkDiagnosticsActiveTimestampAttributeCommandInfo); + readThreadNetworkDiagnosticsActiveTimestampAttributeInteractionInfo); Map readThreadNetworkDiagnosticsPendingTimestampCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsPendingTimestampAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsPendingTimestampAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readPendingTimestampAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsPendingTimestampCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readPendingTimestampAttribute", - readThreadNetworkDiagnosticsPendingTimestampAttributeCommandInfo); + readThreadNetworkDiagnosticsPendingTimestampAttributeInteractionInfo); Map readThreadNetworkDiagnosticsDelayCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsDelayAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsDelayAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readDelayAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readThreadNetworkDiagnosticsDelayCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( - "readDelayAttribute", readThreadNetworkDiagnosticsDelayAttributeCommandInfo); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readDelayAttribute", readThreadNetworkDiagnosticsDelayAttributeInteractionInfo); Map readThreadNetworkDiagnosticsSecurityPolicyCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsSecurityPolicyAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsSecurityPolicyAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readSecurityPolicyAttribute( @@ -13646,43 +14080,45 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedSecurityPolicyAttributeCallback(), readThreadNetworkDiagnosticsSecurityPolicyCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readSecurityPolicyAttribute", - readThreadNetworkDiagnosticsSecurityPolicyAttributeCommandInfo); + readThreadNetworkDiagnosticsSecurityPolicyAttributeInteractionInfo); Map readThreadNetworkDiagnosticsChannelMaskCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsChannelMaskAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsChannelMaskAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readChannelMaskAttribute((ChipClusters.OctetStringAttributeCallback) callback); }, () -> new DelegatedOctetStringAttributeCallback(), readThreadNetworkDiagnosticsChannelMaskCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( - "readChannelMaskAttribute", readThreadNetworkDiagnosticsChannelMaskAttributeCommandInfo); + readThreadNetworkDiagnosticsInteractionInfo.put( + "readChannelMaskAttribute", + readThreadNetworkDiagnosticsChannelMaskAttributeInteractionInfo); Map readThreadNetworkDiagnosticsOperationalDatasetComponentsCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCommandInfo = - new CommandInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) - .readOperationalDatasetComponentsAttribute( - (ChipClusters.ThreadNetworkDiagnosticsCluster - .OperationalDatasetComponentsAttributeCallback) - callback); - }, - () -> new DelegatedOperationalDatasetComponentsAttributeCallback(), - readThreadNetworkDiagnosticsOperationalDatasetComponentsCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + InteractionInfo + readThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) + .readOperationalDatasetComponentsAttribute( + (ChipClusters.ThreadNetworkDiagnosticsCluster + .OperationalDatasetComponentsAttributeCallback) + callback); + }, + () -> new DelegatedOperationalDatasetComponentsAttributeCallback(), + readThreadNetworkDiagnosticsOperationalDatasetComponentsCommandParams); + readThreadNetworkDiagnosticsInteractionInfo.put( "readOperationalDatasetComponentsAttribute", - readThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCommandInfo); + readThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeInteractionInfo); Map readThreadNetworkDiagnosticsActiveNetworkFaultsListCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readActiveNetworkFaultsListAttribute( @@ -13692,32 +14128,29 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedActiveNetworkFaultsListAttributeCallback(), readThreadNetworkDiagnosticsActiveNetworkFaultsListCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readActiveNetworkFaultsListAttribute", - readThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCommandInfo); + readThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeInteractionInfo); Map readThreadNetworkDiagnosticsClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readThreadNetworkDiagnosticsClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readThreadNetworkDiagnosticsClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThreadNetworkDiagnosticsCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readThreadNetworkDiagnosticsClusterRevisionCommandParams); - readThreadNetworkDiagnosticsCommandInfo.put( + readThreadNetworkDiagnosticsInteractionInfo.put( "readClusterRevisionAttribute", - readThreadNetworkDiagnosticsClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap - .get("threadNetworkDiagnostics") - .combineCommands(readThreadNetworkDiagnosticsCommandInfo); - Map readWakeOnLanCommandInfo = new LinkedHashMap<>(); + readThreadNetworkDiagnosticsClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("threadNetworkDiagnostics", readThreadNetworkDiagnosticsInteractionInfo); + Map readWakeOnLanInteractionInfo = new LinkedHashMap<>(); // read attribute Map readWakeOnLanWakeOnLanMacAddressCommandParams = new LinkedHashMap(); - CommandInfo readWakeOnLanWakeOnLanMacAddressAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWakeOnLanWakeOnLanMacAddressAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WakeOnLanCluster) cluster) .readWakeOnLanMacAddressAttribute( @@ -13725,114 +14158,117 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedCharStringAttributeCallback(), readWakeOnLanWakeOnLanMacAddressCommandParams); - readWakeOnLanCommandInfo.put( - "readWakeOnLanMacAddressAttribute", readWakeOnLanWakeOnLanMacAddressAttributeCommandInfo); + readWakeOnLanInteractionInfo.put( + "readWakeOnLanMacAddressAttribute", + readWakeOnLanWakeOnLanMacAddressAttributeInteractionInfo); Map readWakeOnLanClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readWakeOnLanClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWakeOnLanClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WakeOnLanCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readWakeOnLanClusterRevisionCommandParams); - readWakeOnLanCommandInfo.put( - "readClusterRevisionAttribute", readWakeOnLanClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("wakeOnLan").combineCommands(readWakeOnLanCommandInfo); - Map readWiFiNetworkDiagnosticsCommandInfo = new LinkedHashMap<>(); + readWakeOnLanInteractionInfo.put( + "readClusterRevisionAttribute", readWakeOnLanClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("wakeOnLan", readWakeOnLanInteractionInfo); + Map readWiFiNetworkDiagnosticsInteractionInfo = new LinkedHashMap<>(); // read attribute Map readWiFiNetworkDiagnosticsBssidCommandParams = new LinkedHashMap(); - CommandInfo readWiFiNetworkDiagnosticsBssidAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWiFiNetworkDiagnosticsBssidAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) .readBssidAttribute((ChipClusters.OctetStringAttributeCallback) callback); }, () -> new DelegatedOctetStringAttributeCallback(), readWiFiNetworkDiagnosticsBssidCommandParams); - readWiFiNetworkDiagnosticsCommandInfo.put( - "readBssidAttribute", readWiFiNetworkDiagnosticsBssidAttributeCommandInfo); + readWiFiNetworkDiagnosticsInteractionInfo.put( + "readBssidAttribute", readWiFiNetworkDiagnosticsBssidAttributeInteractionInfo); Map readWiFiNetworkDiagnosticsSecurityTypeCommandParams = new LinkedHashMap(); - CommandInfo readWiFiNetworkDiagnosticsSecurityTypeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWiFiNetworkDiagnosticsSecurityTypeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) .readSecurityTypeAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readWiFiNetworkDiagnosticsSecurityTypeCommandParams); - readWiFiNetworkDiagnosticsCommandInfo.put( - "readSecurityTypeAttribute", readWiFiNetworkDiagnosticsSecurityTypeAttributeCommandInfo); + readWiFiNetworkDiagnosticsInteractionInfo.put( + "readSecurityTypeAttribute", + readWiFiNetworkDiagnosticsSecurityTypeAttributeInteractionInfo); Map readWiFiNetworkDiagnosticsWiFiVersionCommandParams = new LinkedHashMap(); - CommandInfo readWiFiNetworkDiagnosticsWiFiVersionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWiFiNetworkDiagnosticsWiFiVersionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) .readWiFiVersionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readWiFiNetworkDiagnosticsWiFiVersionCommandParams); - readWiFiNetworkDiagnosticsCommandInfo.put( - "readWiFiVersionAttribute", readWiFiNetworkDiagnosticsWiFiVersionAttributeCommandInfo); + readWiFiNetworkDiagnosticsInteractionInfo.put( + "readWiFiVersionAttribute", readWiFiNetworkDiagnosticsWiFiVersionAttributeInteractionInfo); Map readWiFiNetworkDiagnosticsChannelNumberCommandParams = new LinkedHashMap(); - CommandInfo readWiFiNetworkDiagnosticsChannelNumberAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWiFiNetworkDiagnosticsChannelNumberAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) .readChannelNumberAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readWiFiNetworkDiagnosticsChannelNumberCommandParams); - readWiFiNetworkDiagnosticsCommandInfo.put( - "readChannelNumberAttribute", readWiFiNetworkDiagnosticsChannelNumberAttributeCommandInfo); + readWiFiNetworkDiagnosticsInteractionInfo.put( + "readChannelNumberAttribute", + readWiFiNetworkDiagnosticsChannelNumberAttributeInteractionInfo); Map readWiFiNetworkDiagnosticsRssiCommandParams = new LinkedHashMap(); - CommandInfo readWiFiNetworkDiagnosticsRssiAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWiFiNetworkDiagnosticsRssiAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) .readRssiAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readWiFiNetworkDiagnosticsRssiCommandParams); - readWiFiNetworkDiagnosticsCommandInfo.put( - "readRssiAttribute", readWiFiNetworkDiagnosticsRssiAttributeCommandInfo); + readWiFiNetworkDiagnosticsInteractionInfo.put( + "readRssiAttribute", readWiFiNetworkDiagnosticsRssiAttributeInteractionInfo); Map readWiFiNetworkDiagnosticsBeaconLostCountCommandParams = new LinkedHashMap(); - CommandInfo readWiFiNetworkDiagnosticsBeaconLostCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWiFiNetworkDiagnosticsBeaconLostCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) .readBeaconLostCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readWiFiNetworkDiagnosticsBeaconLostCountCommandParams); - readWiFiNetworkDiagnosticsCommandInfo.put( + readWiFiNetworkDiagnosticsInteractionInfo.put( "readBeaconLostCountAttribute", - readWiFiNetworkDiagnosticsBeaconLostCountAttributeCommandInfo); + readWiFiNetworkDiagnosticsBeaconLostCountAttributeInteractionInfo); Map readWiFiNetworkDiagnosticsBeaconRxCountCommandParams = new LinkedHashMap(); - CommandInfo readWiFiNetworkDiagnosticsBeaconRxCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWiFiNetworkDiagnosticsBeaconRxCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) .readBeaconRxCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readWiFiNetworkDiagnosticsBeaconRxCountCommandParams); - readWiFiNetworkDiagnosticsCommandInfo.put( - "readBeaconRxCountAttribute", readWiFiNetworkDiagnosticsBeaconRxCountAttributeCommandInfo); + readWiFiNetworkDiagnosticsInteractionInfo.put( + "readBeaconRxCountAttribute", + readWiFiNetworkDiagnosticsBeaconRxCountAttributeInteractionInfo); Map readWiFiNetworkDiagnosticsPacketMulticastRxCountCommandParams = new LinkedHashMap(); - CommandInfo readWiFiNetworkDiagnosticsPacketMulticastRxCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWiFiNetworkDiagnosticsPacketMulticastRxCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) .readPacketMulticastRxCountAttribute( @@ -13840,14 +14276,14 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedLongAttributeCallback(), readWiFiNetworkDiagnosticsPacketMulticastRxCountCommandParams); - readWiFiNetworkDiagnosticsCommandInfo.put( + readWiFiNetworkDiagnosticsInteractionInfo.put( "readPacketMulticastRxCountAttribute", - readWiFiNetworkDiagnosticsPacketMulticastRxCountAttributeCommandInfo); + readWiFiNetworkDiagnosticsPacketMulticastRxCountAttributeInteractionInfo); Map readWiFiNetworkDiagnosticsPacketMulticastTxCountCommandParams = new LinkedHashMap(); - CommandInfo readWiFiNetworkDiagnosticsPacketMulticastTxCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWiFiNetworkDiagnosticsPacketMulticastTxCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) .readPacketMulticastTxCountAttribute( @@ -13855,93 +14291,93 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedLongAttributeCallback(), readWiFiNetworkDiagnosticsPacketMulticastTxCountCommandParams); - readWiFiNetworkDiagnosticsCommandInfo.put( + readWiFiNetworkDiagnosticsInteractionInfo.put( "readPacketMulticastTxCountAttribute", - readWiFiNetworkDiagnosticsPacketMulticastTxCountAttributeCommandInfo); + readWiFiNetworkDiagnosticsPacketMulticastTxCountAttributeInteractionInfo); Map readWiFiNetworkDiagnosticsPacketUnicastRxCountCommandParams = new LinkedHashMap(); - CommandInfo readWiFiNetworkDiagnosticsPacketUnicastRxCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWiFiNetworkDiagnosticsPacketUnicastRxCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) .readPacketUnicastRxCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readWiFiNetworkDiagnosticsPacketUnicastRxCountCommandParams); - readWiFiNetworkDiagnosticsCommandInfo.put( + readWiFiNetworkDiagnosticsInteractionInfo.put( "readPacketUnicastRxCountAttribute", - readWiFiNetworkDiagnosticsPacketUnicastRxCountAttributeCommandInfo); + readWiFiNetworkDiagnosticsPacketUnicastRxCountAttributeInteractionInfo); Map readWiFiNetworkDiagnosticsPacketUnicastTxCountCommandParams = new LinkedHashMap(); - CommandInfo readWiFiNetworkDiagnosticsPacketUnicastTxCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWiFiNetworkDiagnosticsPacketUnicastTxCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) .readPacketUnicastTxCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readWiFiNetworkDiagnosticsPacketUnicastTxCountCommandParams); - readWiFiNetworkDiagnosticsCommandInfo.put( + readWiFiNetworkDiagnosticsInteractionInfo.put( "readPacketUnicastTxCountAttribute", - readWiFiNetworkDiagnosticsPacketUnicastTxCountAttributeCommandInfo); + readWiFiNetworkDiagnosticsPacketUnicastTxCountAttributeInteractionInfo); Map readWiFiNetworkDiagnosticsCurrentMaxRateCommandParams = new LinkedHashMap(); - CommandInfo readWiFiNetworkDiagnosticsCurrentMaxRateAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWiFiNetworkDiagnosticsCurrentMaxRateAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) .readCurrentMaxRateAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readWiFiNetworkDiagnosticsCurrentMaxRateCommandParams); - readWiFiNetworkDiagnosticsCommandInfo.put( + readWiFiNetworkDiagnosticsInteractionInfo.put( "readCurrentMaxRateAttribute", - readWiFiNetworkDiagnosticsCurrentMaxRateAttributeCommandInfo); + readWiFiNetworkDiagnosticsCurrentMaxRateAttributeInteractionInfo); Map readWiFiNetworkDiagnosticsOverrunCountCommandParams = new LinkedHashMap(); - CommandInfo readWiFiNetworkDiagnosticsOverrunCountAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWiFiNetworkDiagnosticsOverrunCountAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) .readOverrunCountAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readWiFiNetworkDiagnosticsOverrunCountCommandParams); - readWiFiNetworkDiagnosticsCommandInfo.put( - "readOverrunCountAttribute", readWiFiNetworkDiagnosticsOverrunCountAttributeCommandInfo); + readWiFiNetworkDiagnosticsInteractionInfo.put( + "readOverrunCountAttribute", + readWiFiNetworkDiagnosticsOverrunCountAttributeInteractionInfo); Map readWiFiNetworkDiagnosticsClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readWiFiNetworkDiagnosticsClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWiFiNetworkDiagnosticsClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WiFiNetworkDiagnosticsCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readWiFiNetworkDiagnosticsClusterRevisionCommandParams); - readWiFiNetworkDiagnosticsCommandInfo.put( + readWiFiNetworkDiagnosticsInteractionInfo.put( "readClusterRevisionAttribute", - readWiFiNetworkDiagnosticsClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("wiFiNetworkDiagnostics").combineCommands(readWiFiNetworkDiagnosticsCommandInfo); - Map readWindowCoveringCommandInfo = new LinkedHashMap<>(); + readWiFiNetworkDiagnosticsClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("wiFiNetworkDiagnostics", readWiFiNetworkDiagnosticsInteractionInfo); + Map readWindowCoveringInteractionInfo = new LinkedHashMap<>(); // read attribute Map readWindowCoveringTypeCommandParams = new LinkedHashMap(); - CommandInfo readWindowCoveringTypeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWindowCoveringTypeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .readTypeAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readWindowCoveringTypeCommandParams); - readWindowCoveringCommandInfo.put( - "readTypeAttribute", readWindowCoveringTypeAttributeCommandInfo); + readWindowCoveringInteractionInfo.put( + "readTypeAttribute", readWindowCoveringTypeAttributeInteractionInfo); Map readWindowCoveringCurrentPositionLiftCommandParams = new LinkedHashMap(); - CommandInfo readWindowCoveringCurrentPositionLiftAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWindowCoveringCurrentPositionLiftAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .readCurrentPositionLiftAttribute( @@ -13949,13 +14385,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readWindowCoveringCurrentPositionLiftCommandParams); - readWindowCoveringCommandInfo.put( + readWindowCoveringInteractionInfo.put( "readCurrentPositionLiftAttribute", - readWindowCoveringCurrentPositionLiftAttributeCommandInfo); + readWindowCoveringCurrentPositionLiftAttributeInteractionInfo); Map readWindowCoveringCurrentPositionTiltCommandParams = new LinkedHashMap(); - CommandInfo readWindowCoveringCurrentPositionTiltAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWindowCoveringCurrentPositionTiltAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .readCurrentPositionTiltAttribute( @@ -13963,25 +14399,25 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readWindowCoveringCurrentPositionTiltCommandParams); - readWindowCoveringCommandInfo.put( + readWindowCoveringInteractionInfo.put( "readCurrentPositionTiltAttribute", - readWindowCoveringCurrentPositionTiltAttributeCommandInfo); + readWindowCoveringCurrentPositionTiltAttributeInteractionInfo); Map readWindowCoveringConfigStatusCommandParams = new LinkedHashMap(); - CommandInfo readWindowCoveringConfigStatusAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWindowCoveringConfigStatusAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .readConfigStatusAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readWindowCoveringConfigStatusCommandParams); - readWindowCoveringCommandInfo.put( - "readConfigStatusAttribute", readWindowCoveringConfigStatusAttributeCommandInfo); + readWindowCoveringInteractionInfo.put( + "readConfigStatusAttribute", readWindowCoveringConfigStatusAttributeInteractionInfo); Map readWindowCoveringCurrentPositionLiftPercentageCommandParams = new LinkedHashMap(); - CommandInfo readWindowCoveringCurrentPositionLiftPercentageAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWindowCoveringCurrentPositionLiftPercentageAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .readCurrentPositionLiftPercentageAttribute( @@ -13989,13 +14425,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readWindowCoveringCurrentPositionLiftPercentageCommandParams); - readWindowCoveringCommandInfo.put( + readWindowCoveringInteractionInfo.put( "readCurrentPositionLiftPercentageAttribute", - readWindowCoveringCurrentPositionLiftPercentageAttributeCommandInfo); + readWindowCoveringCurrentPositionLiftPercentageAttributeInteractionInfo); Map readWindowCoveringCurrentPositionTiltPercentageCommandParams = new LinkedHashMap(); - CommandInfo readWindowCoveringCurrentPositionTiltPercentageAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWindowCoveringCurrentPositionTiltPercentageAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .readCurrentPositionTiltPercentageAttribute( @@ -14003,26 +14439,27 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readWindowCoveringCurrentPositionTiltPercentageCommandParams); - readWindowCoveringCommandInfo.put( + readWindowCoveringInteractionInfo.put( "readCurrentPositionTiltPercentageAttribute", - readWindowCoveringCurrentPositionTiltPercentageAttributeCommandInfo); + readWindowCoveringCurrentPositionTiltPercentageAttributeInteractionInfo); Map readWindowCoveringOperationalStatusCommandParams = new LinkedHashMap(); - CommandInfo readWindowCoveringOperationalStatusAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWindowCoveringOperationalStatusAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .readOperationalStatusAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readWindowCoveringOperationalStatusCommandParams); - readWindowCoveringCommandInfo.put( - "readOperationalStatusAttribute", readWindowCoveringOperationalStatusAttributeCommandInfo); + readWindowCoveringInteractionInfo.put( + "readOperationalStatusAttribute", + readWindowCoveringOperationalStatusAttributeInteractionInfo); Map readWindowCoveringTargetPositionLiftPercent100thsCommandParams = new LinkedHashMap(); - CommandInfo readWindowCoveringTargetPositionLiftPercent100thsAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWindowCoveringTargetPositionLiftPercent100thsAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .readTargetPositionLiftPercent100thsAttribute( @@ -14030,14 +14467,14 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readWindowCoveringTargetPositionLiftPercent100thsCommandParams); - readWindowCoveringCommandInfo.put( + readWindowCoveringInteractionInfo.put( "readTargetPositionLiftPercent100thsAttribute", - readWindowCoveringTargetPositionLiftPercent100thsAttributeCommandInfo); + readWindowCoveringTargetPositionLiftPercent100thsAttributeInteractionInfo); Map readWindowCoveringTargetPositionTiltPercent100thsCommandParams = new LinkedHashMap(); - CommandInfo readWindowCoveringTargetPositionTiltPercent100thsAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWindowCoveringTargetPositionTiltPercent100thsAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .readTargetPositionTiltPercent100thsAttribute( @@ -14045,26 +14482,26 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readWindowCoveringTargetPositionTiltPercent100thsCommandParams); - readWindowCoveringCommandInfo.put( + readWindowCoveringInteractionInfo.put( "readTargetPositionTiltPercent100thsAttribute", - readWindowCoveringTargetPositionTiltPercent100thsAttributeCommandInfo); + readWindowCoveringTargetPositionTiltPercent100thsAttributeInteractionInfo); Map readWindowCoveringEndProductTypeCommandParams = new LinkedHashMap(); - CommandInfo readWindowCoveringEndProductTypeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWindowCoveringEndProductTypeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .readEndProductTypeAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readWindowCoveringEndProductTypeCommandParams); - readWindowCoveringCommandInfo.put( - "readEndProductTypeAttribute", readWindowCoveringEndProductTypeAttributeCommandInfo); + readWindowCoveringInteractionInfo.put( + "readEndProductTypeAttribute", readWindowCoveringEndProductTypeAttributeInteractionInfo); Map readWindowCoveringCurrentPositionLiftPercent100thsCommandParams = new LinkedHashMap(); - CommandInfo readWindowCoveringCurrentPositionLiftPercent100thsAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWindowCoveringCurrentPositionLiftPercent100thsAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .readCurrentPositionLiftPercent100thsAttribute( @@ -14072,14 +14509,14 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readWindowCoveringCurrentPositionLiftPercent100thsCommandParams); - readWindowCoveringCommandInfo.put( + readWindowCoveringInteractionInfo.put( "readCurrentPositionLiftPercent100thsAttribute", - readWindowCoveringCurrentPositionLiftPercent100thsAttributeCommandInfo); + readWindowCoveringCurrentPositionLiftPercent100thsAttributeInteractionInfo); Map readWindowCoveringCurrentPositionTiltPercent100thsCommandParams = new LinkedHashMap(); - CommandInfo readWindowCoveringCurrentPositionTiltPercent100thsAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWindowCoveringCurrentPositionTiltPercent100thsAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .readCurrentPositionTiltPercent100thsAttribute( @@ -14087,13 +14524,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readWindowCoveringCurrentPositionTiltPercent100thsCommandParams); - readWindowCoveringCommandInfo.put( + readWindowCoveringInteractionInfo.put( "readCurrentPositionTiltPercent100thsAttribute", - readWindowCoveringCurrentPositionTiltPercent100thsAttributeCommandInfo); + readWindowCoveringCurrentPositionTiltPercent100thsAttributeInteractionInfo); Map readWindowCoveringInstalledOpenLimitLiftCommandParams = new LinkedHashMap(); - CommandInfo readWindowCoveringInstalledOpenLimitLiftAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWindowCoveringInstalledOpenLimitLiftAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .readInstalledOpenLimitLiftAttribute( @@ -14101,13 +14538,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readWindowCoveringInstalledOpenLimitLiftCommandParams); - readWindowCoveringCommandInfo.put( + readWindowCoveringInteractionInfo.put( "readInstalledOpenLimitLiftAttribute", - readWindowCoveringInstalledOpenLimitLiftAttributeCommandInfo); + readWindowCoveringInstalledOpenLimitLiftAttributeInteractionInfo); Map readWindowCoveringInstalledClosedLimitLiftCommandParams = new LinkedHashMap(); - CommandInfo readWindowCoveringInstalledClosedLimitLiftAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWindowCoveringInstalledClosedLimitLiftAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .readInstalledClosedLimitLiftAttribute( @@ -14115,13 +14552,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readWindowCoveringInstalledClosedLimitLiftCommandParams); - readWindowCoveringCommandInfo.put( + readWindowCoveringInteractionInfo.put( "readInstalledClosedLimitLiftAttribute", - readWindowCoveringInstalledClosedLimitLiftAttributeCommandInfo); + readWindowCoveringInstalledClosedLimitLiftAttributeInteractionInfo); Map readWindowCoveringInstalledOpenLimitTiltCommandParams = new LinkedHashMap(); - CommandInfo readWindowCoveringInstalledOpenLimitTiltAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWindowCoveringInstalledOpenLimitTiltAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .readInstalledOpenLimitTiltAttribute( @@ -14129,13 +14566,13 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readWindowCoveringInstalledOpenLimitTiltCommandParams); - readWindowCoveringCommandInfo.put( + readWindowCoveringInteractionInfo.put( "readInstalledOpenLimitTiltAttribute", - readWindowCoveringInstalledOpenLimitTiltAttributeCommandInfo); + readWindowCoveringInstalledOpenLimitTiltAttributeInteractionInfo); Map readWindowCoveringInstalledClosedLimitTiltCommandParams = new LinkedHashMap(); - CommandInfo readWindowCoveringInstalledClosedLimitTiltAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWindowCoveringInstalledClosedLimitTiltAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .readInstalledClosedLimitTiltAttribute( @@ -14143,59 +14580,58 @@ public Map getReadAttributeMap(Map clu }, () -> new DelegatedIntegerAttributeCallback(), readWindowCoveringInstalledClosedLimitTiltCommandParams); - readWindowCoveringCommandInfo.put( + readWindowCoveringInteractionInfo.put( "readInstalledClosedLimitTiltAttribute", - readWindowCoveringInstalledClosedLimitTiltAttributeCommandInfo); + readWindowCoveringInstalledClosedLimitTiltAttributeInteractionInfo); Map readWindowCoveringModeCommandParams = new LinkedHashMap(); - CommandInfo readWindowCoveringModeAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWindowCoveringModeAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .readModeAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readWindowCoveringModeCommandParams); - readWindowCoveringCommandInfo.put( - "readModeAttribute", readWindowCoveringModeAttributeCommandInfo); + readWindowCoveringInteractionInfo.put( + "readModeAttribute", readWindowCoveringModeAttributeInteractionInfo); Map readWindowCoveringSafetyStatusCommandParams = new LinkedHashMap(); - CommandInfo readWindowCoveringSafetyStatusAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWindowCoveringSafetyStatusAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .readSafetyStatusAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readWindowCoveringSafetyStatusCommandParams); - readWindowCoveringCommandInfo.put( - "readSafetyStatusAttribute", readWindowCoveringSafetyStatusAttributeCommandInfo); + readWindowCoveringInteractionInfo.put( + "readSafetyStatusAttribute", readWindowCoveringSafetyStatusAttributeInteractionInfo); Map readWindowCoveringFeatureMapCommandParams = new LinkedHashMap(); - CommandInfo readWindowCoveringFeatureMapAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWindowCoveringFeatureMapAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); }, () -> new DelegatedLongAttributeCallback(), readWindowCoveringFeatureMapCommandParams); - readWindowCoveringCommandInfo.put( - "readFeatureMapAttribute", readWindowCoveringFeatureMapAttributeCommandInfo); + readWindowCoveringInteractionInfo.put( + "readFeatureMapAttribute", readWindowCoveringFeatureMapAttributeInteractionInfo); Map readWindowCoveringClusterRevisionCommandParams = new LinkedHashMap(); - CommandInfo readWindowCoveringClusterRevisionAttributeCommandInfo = - new CommandInfo( + InteractionInfo readWindowCoveringClusterRevisionAttributeInteractionInfo = + new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); }, () -> new DelegatedIntegerAttributeCallback(), readWindowCoveringClusterRevisionCommandParams); - readWindowCoveringCommandInfo.put( - "readClusterRevisionAttribute", readWindowCoveringClusterRevisionAttributeCommandInfo); - // combine the read Attribute into the original commands - clusterMap.get("windowCovering").combineCommands(readWindowCoveringCommandInfo); - return clusterMap; + readWindowCoveringInteractionInfo.put( + "readClusterRevisionAttribute", readWindowCoveringClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("windowCovering", readWindowCoveringInteractionInfo); + return readAttributeMap; } } diff --git a/src/controller/python/BUILD.gn b/src/controller/python/BUILD.gn index 06bea6a49b5086..3584261f0c5931 100644 --- a/src/controller/python/BUILD.gn +++ b/src/controller/python/BUILD.gn @@ -45,8 +45,8 @@ shared_library("ChipDeviceCtrl") { "ChipDeviceController-StorageDelegate.cpp", "ChipDeviceController-StorageDelegate.h", "chip/clusters/CHIPClusters.cpp", + "chip/clusters/attribute.cpp", "chip/clusters/command.cpp", - "chip/clusters/write.cpp", "chip/discovery/NodeResolution.cpp", "chip/interaction_model/Delegate.cpp", "chip/interaction_model/Delegate.h", diff --git a/src/controller/python/chip/ChipDeviceCtrl.py b/src/controller/python/chip/ChipDeviceCtrl.py index 3eee5650981f72..82e7461f282929 100644 --- a/src/controller/python/chip/ChipDeviceCtrl.py +++ b/src/controller/python/chip/ChipDeviceCtrl.py @@ -133,6 +133,8 @@ def HandleCommissioningComplete(nodeid, err): self.state = DCState.IDLE self._ChipStack.callbackRes = err self._ChipStack.completeEvent.set() + self._ChipStack.commissioningCompleteEvent.set() + self._ChipStack.commissioningEventRes = err im.InitIMDelegate() ClusterCommand.Init(self) @@ -197,11 +199,20 @@ def CloseSession(self, nodeid): ) def ConnectIP(self, ipaddr, setupPinCode, nodeid): + # IP connection will run through full commissioning, so we need to wait + # for the commissioning complete event, not just any callback. self.state = DCState.RENDEZVOUS_ONGOING - return self._ChipStack.CallAsync( + self._ChipStack.CallAsync( lambda: self._dmLib.pychip_DeviceController_ConnectIP( self.devCtrl, ipaddr, setupPinCode, nodeid) ) + # Wait up to 5 additional seconds for the commissioning complete event + if not self._ChipStack.commissioningCompleteEvent.isSet(): + self._ChipStack.commissioningCompleteEvent.wait(5.0) + if not self._ChipStack.commissioningCompleteEvent.isSet(): + # Error 50 is a timeout + return False + return self._ChipStack.commissioningEventRes == 0 def ResolveNode(self, nodeid): return self._ChipStack.CallAsync( @@ -378,37 +389,54 @@ def WriteAttribute(self, nodeid: int, attributes): raise self._ChipStack.ErrorToException(res) return future - def ReadAttribute(self, nodeid: int, attributes: typing.List[typing.Tuple[int, ClusterAttribute.AttributeReadRequest]]): + def ReadAttribute(self, nodeid: int, attributes: typing.List[typing.Union[ + None, # Empty tuple, all wildcard + typing.Tuple[int], # Endpoint + # Wildcard endpoint, Cluster id present + typing.Tuple[typing.Type[ClusterObjects.Cluster]], + # Wildcard endpoint, Cluster + Attribute present + typing.Tuple[typing.Type[ClusterObjects.ClusterAttributeDescriptor]], + # Wildcard attribute id + typing.Tuple[int, typing.Type[ClusterObjects.Cluster]], + # Concrete path + typing.Tuple[int, typing.Type[ClusterObjects.ClusterAttributeDescriptor]] + ]]): eventLoop = asyncio.get_running_loop() future = eventLoop.create_future() device = self.GetConnectedDeviceSync(nodeid) - # TODO: Here, we translates multi attribute read into many individual attribute reads, this should be fixed by implementing Python's attribute read API. - res = [] - for attr in attributes: - endpointId = attr[0] - attribute = attr[1] - clusterInfo = self._Cluster.GetClusterInfoById( - attribute.cluster_id) - if not clusterInfo: - raise UnknownCluster(attribute.cluster_id) - attributeInfo = clusterInfo.get("attributes", {}).get( - attribute.attribute_id, None) - if not attributeInfo: - raise UnknownAttribute( - clusterInfo["clusterName"], attribute.attribute_id) - self._Cluster.ReadAttribute( - device, clusterInfo["clusterName"], attributeInfo["attributeName"], endpointId, 0, False) - readRes = im.GetAttributeReadResponse( - im.DEFAULT_ATTRIBUTEREAD_APPID) - res.append(ClusterAttribute.AttributeReadResult( - Path=ClusterAttribute.AttributePath( - EndpointId=endpointId, ClusterId=attribute.cluster_id, AttributeId=attribute.attribute_id), - Status=readRes.status, - Data=(attribute.FromTagDictOrRawValue( - readRes.value) if readRes.value is not None else None), - )) - future.set_result(res) + attrs = [] + for v in attributes: + endpoint = None + cluster = None + attribute = None + if v == () or v == ('*'): + # Wildcard + pass + elif len(v) == 1: + if v[0] is int: + endpoint = v[0] + elif issubclass(v[0], ClusterObjects.Cluster): + cluster = v[0] + elif issubclass(v[0], ClusterObjects.ClusterAttributeDescriptor): + attribute = v[0] + else: + raise ValueError("Unsupported Attribute Path") + elif len(v) == 2: + # endpoint + (cluster) attribute / endpoint + cluster + endpoint = v[0] + if issubclass(v[1], ClusterObjects.Cluster): + cluster = v[1] + elif issubclass(v[1], ClusterAttribute.ClusterAttributeDescriptor): + attribute = v[1] + else: + raise ValueError("Unsupported Attribute Path") + attrs.append(ClusterAttribute.AttributePath( + EndpointId=endpoint, Cluster=cluster, Attribute=attribute)) + res = self._ChipStack.Call( + lambda: ClusterAttribute.ReadAttributes(future, eventLoop, device, attrs)) + if res != 0: + raise self._ChipStack.ErrorToException(res) return future def ZCLSend(self, cluster, command, nodeid, endpoint, groupid, args, blocking=False): diff --git a/src/controller/python/chip/ChipStack.py b/src/controller/python/chip/ChipStack.py index dc3930cf046ad5..e3bc1922442a31 100644 --- a/src/controller/python/chip/ChipStack.py +++ b/src/controller/python/chip/ChipStack.py @@ -162,10 +162,12 @@ class ChipStack(object): def __init__(self, installDefaultLogHandler=True, bluetoothAdapter=0): self.networkLock = Lock() self.completeEvent = Event() + self.commissioningCompleteEvent = Event() self._ChipStackLib = None self._chipDLLPath = None self.devMgr = None self.callbackRes = None + self.commissioningEventRes = None self._activeLogFunct = None self.addModulePrefixToLogMessage = True diff --git a/src/controller/python/chip/clusters/Attribute.py b/src/controller/python/chip/clusters/Attribute.py index e8c3f0527e81e5..72fc6331605bf3 100644 --- a/src/controller/python/chip/clusters/Attribute.py +++ b/src/controller/python/chip/clusters/Attribute.py @@ -24,13 +24,40 @@ from .ClusterObjects import ClusterAttributeDescriptor import chip.exceptions import chip.interaction_model +import chip.tlv + +import inspect +import sys +import logging @dataclass class AttributePath: - EndpointId: int - ClusterId: int - AttributeId: int + EndpointId: int = None + ClusterId: int = None + AttributeId: int = None + + def __init__(self, EndpointId: int = None, Cluster=None, Attribute=None, ClusterId=None, AttributeId=None): + self.EndpointId = EndpointId + if Cluster is not None: + # Wildcard read for a specific cluster + if (Attribute is not None) or (ClusterId is not None) or (AttributeId is not None): + raise Warning( + "Attribute, ClusterId and AttributeId is ignored when Cluster is specified") + self.ClusterId = Cluster.id + return + if Attribute is not None: + if (ClusterId is not None) or (AttributeId is not None): + raise Warning( + "ClusterId and AttributeId is ignored when Attribute is specified") + self.ClusterId = Attribute.cluster_id + self.AttributeId = Attribute.attribute_id + return + self.ClusterId = ClusterId + self.AttributeId = AttributeId + + def __str__(self) -> str: + return f"{self.EndpointId}/{self.ClusterId}/{self.AttributeId}" @dataclass @@ -61,6 +88,72 @@ class AttributeReadResult(AttributeStatus): Data: Any = None +_AttributeIndex = {} + + +def _BuildAttributeIndex(): + ''' Build internal attribute index for locating the corresponding cluster object by path in the future. + We do this because this operation will take a long time when there are lots of attributes, it takes about 300ms for a single query. + This is acceptable during init, but unacceptable when the server returns lots of attributes at the same time. + ''' + for clusterName, obj in inspect.getmembers(sys.modules['chip.clusters.Objects']): + if ('chip.clusters.Objects' in str(obj)) and inspect.isclass(obj): + for objName, subclass in inspect.getmembers(obj): + if inspect.isclass(subclass) and (('Attribute') in str(subclass)): + for attributeName, attribute in inspect.getmembers(subclass): + if inspect.isclass(attribute): + for name, field in inspect.getmembers(attribute): + if ('__dataclass_fields__' in name): + _AttributeIndex[str(AttributePath(ClusterId=field['cluster_id'].default, AttributeId=field['attribute_id'].default))] = eval( + 'chip.clusters.Objects.' + clusterName + '.Attributes.' + attributeName) + + +class AsyncReadTransaction: + def __init__(self, future: Future, eventLoop): + self._event_loop = eventLoop + self._future = future + self._res = [] + + def _handleAttributeData(self, path: AttributePath, status: int, data: bytes): + try: + imStatus = status + try: + imStatus = chip.interaction_model.Status(status) + except: + pass + attributeType = _AttributeIndex.get(str(AttributePath( + ClusterId=path.ClusterId, AttributeId=path.AttributeId)), None) + attributeValue = None + if attributeType is None: + attributeValue = chip.tlv.TLVReader(data).get().get("Any", {}) + else: + attributeValue = attributeType.FromTLV(data) + self._res.append(AttributeReadResult( + Path=path, Status=imStatus, Data=attributeValue)) + except Exception as ex: + logging.exception(ex) + + def handleAttributeData(self, path: AttributePath, status: int, data: bytes): + self._event_loop.call_soon_threadsafe( + self._handleAttributeData, path, status, data) + + def _handleError(self, chipError: int): + self._future.set_exception( + chip.exceptions.ChipStackError(chipError)) + + def handleError(self, chipError: int): + self._event_loop.call_soon_threadsafe( + self._handleError, chipError + ) + + def _handleDone(self, asd): + if not self._future.done(): + self._future.set_result(self._res) + + def handleDone(self): + self._event_loop.call_soon_threadsafe(self._handleDone, "asdasa") + + class AsyncWriteTransaction: def __init__(self, future: Future, eventLoop): self._event_loop = eventLoop @@ -95,6 +188,32 @@ def handleDone(self): self._event_loop.call_soon_threadsafe(self._handleDone) +_OnReadAttributeDataCallbackFunct = CFUNCTYPE( + None, py_object, c_uint16, c_uint32, c_uint32, c_uint16, c_char_p, c_size_t) +_OnReadErrorCallbackFunct = CFUNCTYPE( + None, py_object, c_uint32) +_OnReadDoneCallbackFunct = CFUNCTYPE( + None, py_object) + + +@_OnReadAttributeDataCallbackFunct +def _OnReadAttributeDataCallback(closure, endpoint: int, cluster: int, attribute: int, status, data, len): + dataBytes = ctypes.string_at(data, len) + closure.handleAttributeData(AttributePath( + EndpointId=endpoint, ClusterId=cluster, AttributeId=attribute), status, dataBytes[:]) + + +@_OnReadErrorCallbackFunct +def _OnReadErrorCallback(closure, chiperror: int): + closure.handleError(chiperror) + + +@_OnReadDoneCallbackFunct +def _OnReadDoneCallback(closure): + closure.handleDone() + ctypes.pythonapi.Py_DecRef(ctypes.py_object(closure)) + + _OnWriteResponseCallbackFunct = CFUNCTYPE( None, py_object, c_uint16, c_uint32, c_uint32, c_uint16) _OnWriteErrorCallbackFunct = CFUNCTYPE( @@ -105,7 +224,8 @@ def handleDone(self): @_OnWriteResponseCallbackFunct def _OnWriteResponseCallback(closure, endpoint: int, cluster: int, attribute: int, status): - closure.handleResponse(AttributePath(endpoint, cluster, attribute), status) + closure.handleResponse(AttributePath( + EndpointId=endpoint, ClusterId=cluster, AttributeId=attribute), status) @_OnWriteErrorCallbackFunct @@ -144,6 +264,31 @@ def WriteAttributes(future: Future, eventLoop, device, attributes: List[Attribut return res +def ReadAttributes(future: Future, eventLoop, device, attributes: List[AttributePath]) -> int: + handle = chip.native.GetLibraryHandle() + transaction = AsyncReadTransaction(future, eventLoop) + + readargs = [] + for attr in attributes: + path = chip.interaction_model.AttributePathIBstruct.parse( + b'\xff' * chip.interaction_model.AttributePathIBstruct.sizeof()) + if attr.EndpointId is not None: + path.EndpointId = attr.EndpointId + if attr.ClusterId is not None: + path.ClusterId = attr.ClusterId + if attr.AttributeId is not None: + path.AttributeId = attr.AttributeId + path = chip.interaction_model.AttributePathIBstruct.build(path) + readargs.append(ctypes.c_char_p(path)) + + ctypes.pythonapi.Py_IncRef(ctypes.py_object(transaction)) + res = handle.pychip_ReadClient_ReadAttributes( + ctypes.py_object(transaction), device, ctypes.c_size_t(len(attributes)), *readargs) + if res != 0: + ctypes.pythonapi.Py_DecRef(ctypes.py_object(transaction)) + return res + + def Init(): handle = chip.native.GetLibraryHandle() @@ -155,6 +300,13 @@ def Init(): handle.pychip_WriteClient_WriteAttributes.restype = c_uint32 setter.Set('pychip_WriteClient_InitCallbacks', None, [ _OnWriteResponseCallbackFunct, _OnWriteErrorCallbackFunct, _OnWriteDoneCallbackFunct]) + handle.pychip_ReadClient_ReadAttributes.restype = c_uint32 + setter.Set('pychip_ReadClient_InitCallbacks', None, [ + _OnReadAttributeDataCallbackFunct, _OnReadErrorCallbackFunct, _OnReadDoneCallbackFunct]) handle.pychip_WriteClient_InitCallbacks( _OnWriteResponseCallback, _OnWriteErrorCallback, _OnWriteDoneCallback) + handle.pychip_ReadClient_InitCallbacks( + _OnReadAttributeDataCallback, _OnReadErrorCallback, _OnReadDoneCallback) + + _BuildAttributeIndex() diff --git a/src/controller/python/chip/clusters/CHIPClusters.cpp b/src/controller/python/chip/clusters/CHIPClusters.cpp index 5d5d36eb9d97cb..987b34ae603ad1 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.cpp +++ b/src/controller/python/chip/clusters/CHIPClusters.cpp @@ -1078,6 +1078,58 @@ static void OnPowerSourceActiveBatteryFaultsListAttributeResponse(void * context chip::Callback::Callback gPowerSourceActiveBatteryFaultsListAttributeCallback{ OnPowerSourceActiveBatteryFaultsListAttributeResponse, nullptr }; +static void OnSoftwareDiagnosticsThreadMetricsListAttributeResponse( + void * context, + const chip::app::DataModel::DecodableList & + list) +{ + size_t count = 0; + CHIP_ERROR err = list.ComputeSize(&count); + if (err != CHIP_NO_ERROR) + { + if (gFailureResponseDelegate != nullptr) + { + gFailureResponseDelegate(EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + ChipLogProgress(Zcl, " attributeValue:%s", count > 0 ? "" : " []"); + + if (count > 0) + ChipLogProgress(Zcl, " ["); + + auto iter = list.begin(); + while (iter.Next()) + { +#if CHIP_PROGRESS_LOGGING + auto & entry = iter.GetValue(); + ChipLogProgress(Zcl, " {"); + ChipLogProgress(Zcl, " Id: %" PRIu64 ",", entry.id); + ChipLogProgress(Zcl, " Name: %.*s,", static_cast(entry.name.size()), entry.name.data()); + ChipLogProgress(Zcl, " StackFreeCurrent: %" PRIu32 ",", entry.stackFreeCurrent); + ChipLogProgress(Zcl, " StackFreeMinimum: %" PRIu32 ",", entry.stackFreeMinimum); + ChipLogProgress(Zcl, " StackSize: %" PRIu32 ",", entry.stackSize); + ChipLogProgress(Zcl, " },"); +#endif // CHIP_PROGRESS_LOGGING + } + if (iter.GetStatus() != CHIP_NO_ERROR) + { + if (gFailureResponseDelegate != nullptr) + { + gFailureResponseDelegate(EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + if (count > 0) + ChipLogProgress(Zcl, " ]"); + + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback + gSoftwareDiagnosticsThreadMetricsListAttributeCallback{ OnSoftwareDiagnosticsThreadMetricsListAttributeResponse, nullptr }; static void OnTvChannelTvChannelListListAttributeResponse( void * context, const chip::app::DataModel::DecodableList & list) @@ -6923,6 +6975,19 @@ chip::ChipError::StorageType chip_ime_AppendCommand_SoftwareDiagnostics_ResetWat return cluster.ResetWatermarks(nullptr, nullptr).AsInteger(); } +chip::ChipError::StorageType chip_ime_ReadAttribute_SoftwareDiagnostics_ThreadMetrics(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::SoftwareDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeThreadMetrics(gSoftwareDiagnosticsThreadMetricsListAttributeCallback.Cancel(), + gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + chip::ChipError::StorageType chip_ime_ReadAttribute_SoftwareDiagnostics_CurrentHeapFree(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */) @@ -7794,6 +7859,352 @@ chip::ChipError::StorageType chip_ime_WriteAttribute_TestCluster_Unsupported(chi cluster.Associate(device, ZCLendpointId); return cluster.WriteAttributeUnsupported(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value).AsInteger(); } +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableBoolean(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableBoolean(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_WriteAttribute_TestCluster_NullableBoolean(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, chip::GroupId, + bool value) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.WriteAttributeNullableBoolean(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value) + .AsInteger(); +} +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableBitmap8(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableBitmap8(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_WriteAttribute_TestCluster_NullableBitmap8(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, chip::GroupId, + uint8_t value) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.WriteAttributeNullableBitmap8(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value) + .AsInteger(); +} +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableBitmap16(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableBitmap16(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_WriteAttribute_TestCluster_NullableBitmap16(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, chip::GroupId, + uint16_t value) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.WriteAttributeNullableBitmap16(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value) + .AsInteger(); +} +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableBitmap32(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableBitmap32(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_WriteAttribute_TestCluster_NullableBitmap32(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, chip::GroupId, + uint32_t value) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.WriteAttributeNullableBitmap32(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value) + .AsInteger(); +} +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableBitmap64(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableBitmap64(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_WriteAttribute_TestCluster_NullableBitmap64(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, chip::GroupId, + uint64_t value) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.WriteAttributeNullableBitmap64(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value) + .AsInteger(); +} +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableInt8u(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableInt8u(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_WriteAttribute_TestCluster_NullableInt8u(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, chip::GroupId, + uint8_t value) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.WriteAttributeNullableInt8u(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value) + .AsInteger(); +} +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableInt16u(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableInt16u(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_WriteAttribute_TestCluster_NullableInt16u(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, chip::GroupId, + uint16_t value) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.WriteAttributeNullableInt16u(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value) + .AsInteger(); +} +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableInt32u(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableInt32u(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_WriteAttribute_TestCluster_NullableInt32u(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, chip::GroupId, + uint32_t value) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.WriteAttributeNullableInt32u(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value) + .AsInteger(); +} +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableInt64u(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableInt64u(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_WriteAttribute_TestCluster_NullableInt64u(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, chip::GroupId, + uint64_t value) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.WriteAttributeNullableInt64u(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value) + .AsInteger(); +} +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableInt8s(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableInt8s(gInt8sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_WriteAttribute_TestCluster_NullableInt8s(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, chip::GroupId, + int8_t value) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.WriteAttributeNullableInt8s(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value) + .AsInteger(); +} +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableInt16s(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableInt16s(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_WriteAttribute_TestCluster_NullableInt16s(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, chip::GroupId, + int16_t value) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.WriteAttributeNullableInt16s(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value) + .AsInteger(); +} +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableInt32s(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableInt32s(gInt32sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_WriteAttribute_TestCluster_NullableInt32s(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, chip::GroupId, + int32_t value) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.WriteAttributeNullableInt32s(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value) + .AsInteger(); +} +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableInt64s(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableInt64s(gInt64sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_WriteAttribute_TestCluster_NullableInt64s(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, chip::GroupId, + int64_t value) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.WriteAttributeNullableInt64s(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value) + .AsInteger(); +} +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableEnum8(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableEnum8(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_WriteAttribute_TestCluster_NullableEnum8(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, chip::GroupId, + uint8_t value) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.WriteAttributeNullableEnum8(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value) + .AsInteger(); +} +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableEnum16(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableEnum16(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_WriteAttribute_TestCluster_NullableEnum16(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, chip::GroupId, + uint16_t value) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.WriteAttributeNullableEnum16(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value) + .AsInteger(); +} +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableOctetString(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableOctetString(gOctetStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_WriteAttribute_TestCluster_NullableOctetString(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, chip::GroupId, + uint8_t * value, size_t len) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .WriteAttributeNullableOctetString(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), + chip::ByteSpan(value, len)) + .AsInteger(); +} +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableCharString(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableCharString(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_WriteAttribute_TestCluster_NullableCharString(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, chip::GroupId, + uint8_t * value, size_t len) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .WriteAttributeNullableCharString(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), + chip::CharSpan(reinterpret_cast(value), len)) + .AsInteger(); +} chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_ClusterRevision(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */) diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 598db37a94a31c..8bebdfb76ff55b 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -3121,6 +3121,11 @@ class ChipClusters: }, }, "attributes": { + 0x00000000: { + "attributeName": "ThreadMetrics", + "attributeId": 0x00000000, + "type": "", + }, 0x00000001: { "attributeName": "CurrentHeapFree", "attributeId": 0x00000001, @@ -3537,6 +3542,108 @@ class ChipClusters: "type": "bool", "writable": True, }, + 0x00008000: { + "attributeName": "NullableBoolean", + "attributeId": 0x00008000, + "type": "bool", + "writable": True, + }, + 0x00008001: { + "attributeName": "NullableBitmap8", + "attributeId": 0x00008001, + "type": "int", + "writable": True, + }, + 0x00008002: { + "attributeName": "NullableBitmap16", + "attributeId": 0x00008002, + "type": "int", + "writable": True, + }, + 0x00008003: { + "attributeName": "NullableBitmap32", + "attributeId": 0x00008003, + "type": "int", + "writable": True, + }, + 0x00008004: { + "attributeName": "NullableBitmap64", + "attributeId": 0x00008004, + "type": "int", + "writable": True, + }, + 0x00008005: { + "attributeName": "NullableInt8u", + "attributeId": 0x00008005, + "type": "int", + "writable": True, + }, + 0x00008006: { + "attributeName": "NullableInt16u", + "attributeId": 0x00008006, + "type": "int", + "writable": True, + }, + 0x00008008: { + "attributeName": "NullableInt32u", + "attributeId": 0x00008008, + "type": "int", + "writable": True, + }, + 0x0000800C: { + "attributeName": "NullableInt64u", + "attributeId": 0x0000800C, + "type": "int", + "writable": True, + }, + 0x0000800D: { + "attributeName": "NullableInt8s", + "attributeId": 0x0000800D, + "type": "int", + "writable": True, + }, + 0x0000800E: { + "attributeName": "NullableInt16s", + "attributeId": 0x0000800E, + "type": "int", + "writable": True, + }, + 0x00008010: { + "attributeName": "NullableInt32s", + "attributeId": 0x00008010, + "type": "int", + "writable": True, + }, + 0x00008014: { + "attributeName": "NullableInt64s", + "attributeId": 0x00008014, + "type": "int", + "writable": True, + }, + 0x00008015: { + "attributeName": "NullableEnum8", + "attributeId": 0x00008015, + "type": "int", + "writable": True, + }, + 0x00008016: { + "attributeName": "NullableEnum16", + "attributeId": 0x00008016, + "type": "int", + "writable": True, + }, + 0x00008019: { + "attributeName": "NullableOctetString", + "attributeId": 0x00008019, + "type": "bytes", + "writable": True, + }, + 0x0000801E: { + "attributeName": "NullableCharString", + "attributeId": 0x0000801E, + "type": "str", + "writable": True, + }, 0x0000FFFD: { "attributeName": "ClusterRevision", "attributeId": 0x0000FFFD, @@ -6482,6 +6589,9 @@ def ClusterScenes_ReadAttributeNameSupport(self, device: ctypes.c_void_p, ZCLend def ClusterScenes_ReadAttributeClusterRevision(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_Scenes_ClusterRevision(device, ZCLendpoint, ZCLgroupid) + def ClusterSoftwareDiagnostics_ReadAttributeThreadMetrics(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_SoftwareDiagnostics_ThreadMetrics(device, ZCLendpoint, ZCLgroupid) + def ClusterSoftwareDiagnostics_ReadAttributeCurrentHeapFree(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_SoftwareDiagnostics_CurrentHeapFree(device, ZCLendpoint, ZCLgroupid) @@ -6703,6 +6813,109 @@ def ClusterTestCluster_ReadAttributeUnsupported(self, device: ctypes.c_void_p, Z def ClusterTestCluster_WriteAttributeUnsupported(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, value: bool): return self._chipLib.chip_ime_WriteAttribute_TestCluster_Unsupported(device, ZCLendpoint, ZCLgroupid, value) + def ClusterTestCluster_ReadAttributeNullableBoolean(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableBoolean(device, ZCLendpoint, ZCLgroupid) + + def ClusterTestCluster_WriteAttributeNullableBoolean(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, value: bool): + return self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableBoolean(device, ZCLendpoint, ZCLgroupid, value) + + def ClusterTestCluster_ReadAttributeNullableBitmap8(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableBitmap8(device, ZCLendpoint, ZCLgroupid) + + def ClusterTestCluster_WriteAttributeNullableBitmap8(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, value: int): + return self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableBitmap8(device, ZCLendpoint, ZCLgroupid, value) + + def ClusterTestCluster_ReadAttributeNullableBitmap16(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableBitmap16(device, ZCLendpoint, ZCLgroupid) + + def ClusterTestCluster_WriteAttributeNullableBitmap16(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, value: int): + return self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableBitmap16(device, ZCLendpoint, ZCLgroupid, value) + + def ClusterTestCluster_ReadAttributeNullableBitmap32(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableBitmap32(device, ZCLendpoint, ZCLgroupid) + + def ClusterTestCluster_WriteAttributeNullableBitmap32(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, value: int): + return self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableBitmap32(device, ZCLendpoint, ZCLgroupid, value) + + def ClusterTestCluster_ReadAttributeNullableBitmap64(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableBitmap64(device, ZCLendpoint, ZCLgroupid) + + def ClusterTestCluster_WriteAttributeNullableBitmap64(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, value: int): + return self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableBitmap64(device, ZCLendpoint, ZCLgroupid, value) + + def ClusterTestCluster_ReadAttributeNullableInt8u(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableInt8u(device, ZCLendpoint, ZCLgroupid) + + def ClusterTestCluster_WriteAttributeNullableInt8u(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, value: int): + return self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableInt8u(device, ZCLendpoint, ZCLgroupid, value) + + def ClusterTestCluster_ReadAttributeNullableInt16u(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableInt16u(device, ZCLendpoint, ZCLgroupid) + + def ClusterTestCluster_WriteAttributeNullableInt16u(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, value: int): + return self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableInt16u(device, ZCLendpoint, ZCLgroupid, value) + + def ClusterTestCluster_ReadAttributeNullableInt32u(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableInt32u(device, ZCLendpoint, ZCLgroupid) + + def ClusterTestCluster_WriteAttributeNullableInt32u(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, value: int): + return self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableInt32u(device, ZCLendpoint, ZCLgroupid, value) + + def ClusterTestCluster_ReadAttributeNullableInt64u(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableInt64u(device, ZCLendpoint, ZCLgroupid) + + def ClusterTestCluster_WriteAttributeNullableInt64u(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, value: int): + return self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableInt64u(device, ZCLendpoint, ZCLgroupid, value) + + def ClusterTestCluster_ReadAttributeNullableInt8s(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableInt8s(device, ZCLendpoint, ZCLgroupid) + + def ClusterTestCluster_WriteAttributeNullableInt8s(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, value: int): + return self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableInt8s(device, ZCLendpoint, ZCLgroupid, value) + + def ClusterTestCluster_ReadAttributeNullableInt16s(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableInt16s(device, ZCLendpoint, ZCLgroupid) + + def ClusterTestCluster_WriteAttributeNullableInt16s(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, value: int): + return self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableInt16s(device, ZCLendpoint, ZCLgroupid, value) + + def ClusterTestCluster_ReadAttributeNullableInt32s(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableInt32s(device, ZCLendpoint, ZCLgroupid) + + def ClusterTestCluster_WriteAttributeNullableInt32s(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, value: int): + return self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableInt32s(device, ZCLendpoint, ZCLgroupid, value) + + def ClusterTestCluster_ReadAttributeNullableInt64s(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableInt64s(device, ZCLendpoint, ZCLgroupid) + + def ClusterTestCluster_WriteAttributeNullableInt64s(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, value: int): + return self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableInt64s(device, ZCLendpoint, ZCLgroupid, value) + + def ClusterTestCluster_ReadAttributeNullableEnum8(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableEnum8(device, ZCLendpoint, ZCLgroupid) + + def ClusterTestCluster_WriteAttributeNullableEnum8(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, value: int): + return self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableEnum8(device, ZCLendpoint, ZCLgroupid, value) + + def ClusterTestCluster_ReadAttributeNullableEnum16(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableEnum16(device, ZCLendpoint, ZCLgroupid) + + def ClusterTestCluster_WriteAttributeNullableEnum16(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, value: int): + return self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableEnum16(device, ZCLendpoint, ZCLgroupid, value) + + def ClusterTestCluster_ReadAttributeNullableOctetString(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableOctetString(device, ZCLendpoint, ZCLgroupid) + + def ClusterTestCluster_WriteAttributeNullableOctetString(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, value: bytes): + return self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableOctetString(device, ZCLendpoint, ZCLgroupid, value, len(value)) + + def ClusterTestCluster_ReadAttributeNullableCharString(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableCharString(device, ZCLendpoint, ZCLgroupid) + + def ClusterTestCluster_WriteAttributeNullableCharString(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, value: str): + value = value.encode("utf-8") + return self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableCharString(device, ZCLendpoint, ZCLgroupid, value, len(value)) + def ClusterTestCluster_ReadAttributeClusterRevision(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_TestCluster_ClusterRevision(device, ZCLendpoint, ZCLgroupid) @@ -9178,6 +9391,10 @@ def InitLib(self, chipLib): self._chipLib.chip_ime_AppendCommand_SoftwareDiagnostics_ResetWatermarks.argtypes = [ ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] self._chipLib.chip_ime_AppendCommand_SoftwareDiagnostics_ResetWatermarks.restype = ctypes.c_uint32 + # Cluster SoftwareDiagnostics ReadAttribute ThreadMetrics + self._chipLib.chip_ime_ReadAttribute_SoftwareDiagnostics_ThreadMetrics.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_SoftwareDiagnostics_ThreadMetrics.restype = ctypes.c_uint32 # Cluster SoftwareDiagnostics ReadAttribute CurrentHeapFree self._chipLib.chip_ime_ReadAttribute_SoftwareDiagnostics_CurrentHeapFree.argtypes = [ ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] @@ -9535,6 +9752,142 @@ def InitLib(self, chipLib): self._chipLib.chip_ime_WriteAttribute_TestCluster_Unsupported.argtypes = [ ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_bool] self._chipLib.chip_ime_WriteAttribute_TestCluster_Unsupported.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute NullableBoolean + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableBoolean.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableBoolean.restype = ctypes.c_uint32 + # Cluster TestCluster WriteAttribute NullableBoolean + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableBoolean.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_bool] + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableBoolean.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute NullableBitmap8 + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableBitmap8.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableBitmap8.restype = ctypes.c_uint32 + # Cluster TestCluster WriteAttribute NullableBitmap8 + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableBitmap8.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint8] + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableBitmap8.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute NullableBitmap16 + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableBitmap16.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableBitmap16.restype = ctypes.c_uint32 + # Cluster TestCluster WriteAttribute NullableBitmap16 + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableBitmap16.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint16] + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableBitmap16.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute NullableBitmap32 + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableBitmap32.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableBitmap32.restype = ctypes.c_uint32 + # Cluster TestCluster WriteAttribute NullableBitmap32 + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableBitmap32.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint32] + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableBitmap32.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute NullableBitmap64 + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableBitmap64.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableBitmap64.restype = ctypes.c_uint32 + # Cluster TestCluster WriteAttribute NullableBitmap64 + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableBitmap64.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint64] + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableBitmap64.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute NullableInt8u + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableInt8u.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableInt8u.restype = ctypes.c_uint32 + # Cluster TestCluster WriteAttribute NullableInt8u + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableInt8u.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint8] + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableInt8u.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute NullableInt16u + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableInt16u.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableInt16u.restype = ctypes.c_uint32 + # Cluster TestCluster WriteAttribute NullableInt16u + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableInt16u.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint16] + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableInt16u.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute NullableInt32u + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableInt32u.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableInt32u.restype = ctypes.c_uint32 + # Cluster TestCluster WriteAttribute NullableInt32u + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableInt32u.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint32] + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableInt32u.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute NullableInt64u + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableInt64u.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableInt64u.restype = ctypes.c_uint32 + # Cluster TestCluster WriteAttribute NullableInt64u + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableInt64u.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint64] + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableInt64u.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute NullableInt8s + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableInt8s.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableInt8s.restype = ctypes.c_uint32 + # Cluster TestCluster WriteAttribute NullableInt8s + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableInt8s.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_int8] + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableInt8s.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute NullableInt16s + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableInt16s.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableInt16s.restype = ctypes.c_uint32 + # Cluster TestCluster WriteAttribute NullableInt16s + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableInt16s.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_int16] + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableInt16s.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute NullableInt32s + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableInt32s.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableInt32s.restype = ctypes.c_uint32 + # Cluster TestCluster WriteAttribute NullableInt32s + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableInt32s.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_int32] + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableInt32s.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute NullableInt64s + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableInt64s.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableInt64s.restype = ctypes.c_uint32 + # Cluster TestCluster WriteAttribute NullableInt64s + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableInt64s.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_int64] + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableInt64s.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute NullableEnum8 + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableEnum8.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableEnum8.restype = ctypes.c_uint32 + # Cluster TestCluster WriteAttribute NullableEnum8 + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableEnum8.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint8] + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableEnum8.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute NullableEnum16 + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableEnum16.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableEnum16.restype = ctypes.c_uint32 + # Cluster TestCluster WriteAttribute NullableEnum16 + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableEnum16.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint16] + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableEnum16.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute NullableOctetString + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableOctetString.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableOctetString.restype = ctypes.c_uint32 + # Cluster TestCluster WriteAttribute NullableOctetString + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableOctetString.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_char_p, ctypes.c_uint32] + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableOctetString.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute NullableCharString + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableCharString.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_NullableCharString.restype = ctypes.c_uint32 + # Cluster TestCluster WriteAttribute NullableCharString + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableCharString.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_char_p, ctypes.c_uint32] + self._chipLib.chip_ime_WriteAttribute_TestCluster_NullableCharString.restype = ctypes.c_uint32 # Cluster TestCluster ReadAttribute ClusterRevision self._chipLib.chip_ime_ReadAttribute_TestCluster_ClusterRevision.argtypes = [ ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] diff --git a/src/controller/python/chip/clusters/ClusterObjects.py b/src/controller/python/chip/clusters/ClusterObjects.py index e441a9e1efdf38..d8d6b78aad0961 100644 --- a/src/controller/python/chip/clusters/ClusterObjects.py +++ b/src/controller/python/chip/clusters/ClusterObjects.py @@ -149,6 +149,13 @@ def command_id(self) -> int: raise NotImplementedError() +class Cluster: + ''' This class does nothing, but a convenient class that generated clusters can inherit from. + This gives the ability that the users can use issubclass(X, Cluster) to determine if the class represnents a Cluster. + ''' + pass + + class ClusterAttributeDescriptor: ''' The ClusterAttributeDescriptor is used for holding an attribute's metadata like its cluster id, attribute id and its type. diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 53b8781615cc12..9dace1e78c97c2 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -29,11 +29,11 @@ from chip.tlv import uint -from .ClusterObjects import ClusterObject, ClusterObjectDescriptor, ClusterObjectFieldDescriptor, ClusterCommand, ClusterAttributeDescriptor +from .ClusterObjects import ClusterObject, ClusterObjectDescriptor, ClusterObjectFieldDescriptor, ClusterCommand, ClusterAttributeDescriptor, Cluster @dataclass -class PowerConfiguration: +class PowerConfiguration(Cluster): id: typing.ClassVar[int] = 0x0001 class Attributes: @@ -806,7 +806,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class DeviceTemperatureConfiguration: +class DeviceTemperatureConfiguration(Cluster): id: typing.ClassVar[int] = 0x0002 class Attributes: @@ -955,7 +955,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class Identify: +class Identify(Cluster): id: typing.ClassVar[int] = 0x0003 class Enums: @@ -1097,7 +1097,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class Groups: +class Groups(Cluster): id: typing.ClassVar[int] = 0x0004 class Commands: @@ -1326,7 +1326,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class Scenes: +class Scenes(Cluster): id: typing.ClassVar[int] = 0x0005 class Structs: @@ -1889,7 +1889,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class OnOff: +class OnOff(Cluster): id: typing.ClassVar[int] = 0x0006 class Enums: @@ -2201,7 +2201,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class OnOffSwitchConfiguration: +class OnOffSwitchConfiguration(Cluster): id: typing.ClassVar[int] = 0x0007 class Attributes: @@ -2259,7 +2259,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class LevelControl: +class LevelControl(Cluster): id: typing.ClassVar[int] = 0x0008 class Enums: @@ -2652,7 +2652,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class Alarms: +class Alarms(Cluster): id: typing.ClassVar[int] = 0x0009 class Commands: @@ -2797,7 +2797,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class Time: +class Time(Cluster): id: typing.ClassVar[int] = 0x000A class Attributes: @@ -2959,7 +2959,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class BinaryInputBasic: +class BinaryInputBasic(Cluster): id: typing.ClassVar[int] = 0x000F class Attributes: @@ -3108,7 +3108,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class PowerProfile: +class PowerProfile(Cluster): id: typing.ClassVar[int] = 0x001A class Structs: @@ -3688,7 +3688,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class ApplianceControl: +class ApplianceControl(Cluster): id: typing.ClassVar[int] = 0x001B class Enums: @@ -3932,7 +3932,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class Descriptor: +class Descriptor(Cluster): id: typing.ClassVar[int] = 0x001D class Structs: @@ -4032,7 +4032,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class PollControl: +class PollControl(Cluster): id: typing.ClassVar[int] = 0x0020 class Commands: @@ -4231,7 +4231,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class BridgedActions: +class BridgedActions(Cluster): id: typing.ClassVar[int] = 0x0025 class Enums: @@ -4620,7 +4620,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class Basic: +class Basic(Cluster): id: typing.ClassVar[int] = 0x0028 class Commands: @@ -4935,7 +4935,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class OtaSoftwareUpdateProvider: +class OtaSoftwareUpdateProvider(Cluster): id: typing.ClassVar[int] = 0x0029 class Enums: @@ -5116,7 +5116,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class OtaSoftwareUpdateRequestor: +class OtaSoftwareUpdateRequestor(Cluster): id: typing.ClassVar[int] = 0x002A class Enums: @@ -5206,7 +5206,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class PowerSource: +class PowerSource(Cluster): id: typing.ClassVar[int] = 0x002F class Attributes: @@ -5641,7 +5641,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class GeneralCommissioning: +class GeneralCommissioning(Cluster): id: typing.ClassVar[int] = 0x0030 class Enums: @@ -5866,7 +5866,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class NetworkCommissioning: +class NetworkCommissioning(Cluster): id: typing.ClassVar[int] = 0x0031 class Enums: @@ -6299,7 +6299,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class DiagnosticLogs: +class DiagnosticLogs(Cluster): id: typing.ClassVar[int] = 0x0032 class Enums: @@ -6396,7 +6396,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class GeneralDiagnostics: +class GeneralDiagnostics(Cluster): id: typing.ClassVar[int] = 0x0033 class Enums: @@ -6605,7 +6605,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class SoftwareDiagnostics: +class SoftwareDiagnostics(Cluster): id: typing.ClassVar[int] = 0x0034 class Structs: @@ -6745,7 +6745,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class ThreadNetworkDiagnostics: +class ThreadNetworkDiagnostics(Cluster): id: typing.ClassVar[int] = 0x0035 class Enums: @@ -7780,7 +7780,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class WiFiNetworkDiagnostics: +class WiFiNetworkDiagnostics(Cluster): id: typing.ClassVar[int] = 0x0036 class Enums: @@ -8021,7 +8021,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class EthernetNetworkDiagnostics: +class EthernetNetworkDiagnostics(Cluster): id: typing.ClassVar[int] = 0x0037 class Enums: @@ -8196,7 +8196,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class BridgedDeviceBasic: +class BridgedDeviceBasic(Cluster): id: typing.ClassVar[int] = 0x0039 class Commands: @@ -8459,7 +8459,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class Switch: +class Switch(Cluster): id: typing.ClassVar[int] = 0x003B class Attributes: @@ -8530,7 +8530,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class AdministratorCommissioning: +class AdministratorCommissioning(Cluster): id: typing.ClassVar[int] = 0x003C class Enums: @@ -8628,7 +8628,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class OperationalCredentials: +class OperationalCredentials(Cluster): id: typing.ClassVar[int] = 0x003E class Enums: @@ -9017,7 +9017,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class FixedLabel: +class FixedLabel(Cluster): id: typing.ClassVar[int] = 0x0040 class Structs: @@ -9078,7 +9078,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class BooleanState: +class BooleanState(Cluster): id: typing.ClassVar[int] = 0x0045 class Attributes: @@ -9123,7 +9123,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class ModeSelect: +class ModeSelect(Cluster): id: typing.ClassVar[int] = 0x0050 class Structs: @@ -9271,7 +9271,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class ShadeConfiguration: +class ShadeConfiguration(Cluster): id: typing.ClassVar[int] = 0x0100 class Attributes: @@ -9368,7 +9368,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class DoorLock: +class DoorLock(Cluster): id: typing.ClassVar[int] = 0x0101 class Enums: @@ -11061,7 +11061,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class WindowCovering: +class WindowCovering(Cluster): id: typing.ClassVar[int] = 0x0102 class Commands: @@ -11551,7 +11551,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class BarrierControl: +class BarrierControl(Cluster): id: typing.ClassVar[int] = 0x0103 class Commands: @@ -11742,7 +11742,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class PumpConfigurationAndControl: +class PumpConfigurationAndControl(Cluster): id: typing.ClassVar[int] = 0x0200 class Enums: @@ -12101,7 +12101,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class Thermostat: +class Thermostat(Cluster): id: typing.ClassVar[int] = 0x0201 class Enums: @@ -12842,7 +12842,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class FanControl: +class FanControl(Cluster): id: typing.ClassVar[int] = 0x0202 class Attributes: @@ -12900,7 +12900,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class DehumidificationControl: +class DehumidificationControl(Cluster): id: typing.ClassVar[int] = 0x0203 class Attributes: @@ -13036,7 +13036,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class ThermostatUserInterfaceConfiguration: +class ThermostatUserInterfaceConfiguration(Cluster): id: typing.ClassVar[int] = 0x0204 class Attributes: @@ -13107,7 +13107,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class ColorControl: +class ColorControl(Cluster): id: typing.ClassVar[int] = 0x0300 class Enums: @@ -14375,7 +14375,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class BallastConfiguration: +class BallastConfiguration(Cluster): id: typing.ClassVar[int] = 0x0301 class Attributes: @@ -14615,7 +14615,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class IlluminanceMeasurement: +class IlluminanceMeasurement(Cluster): id: typing.ClassVar[int] = 0x0400 class Enums: @@ -14717,7 +14717,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class TemperatureMeasurement: +class TemperatureMeasurement(Cluster): id: typing.ClassVar[int] = 0x0402 class Attributes: @@ -14801,7 +14801,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class PressureMeasurement: +class PressureMeasurement(Cluster): id: typing.ClassVar[int] = 0x0403 class Attributes: @@ -14950,7 +14950,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class FlowMeasurement: +class FlowMeasurement(Cluster): id: typing.ClassVar[int] = 0x0404 class Attributes: @@ -15034,7 +15034,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class RelativeHumidityMeasurement: +class RelativeHumidityMeasurement(Cluster): id: typing.ClassVar[int] = 0x0405 class Attributes: @@ -15118,7 +15118,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class OccupancySensing: +class OccupancySensing(Cluster): id: typing.ClassVar[int] = 0x0406 class Attributes: @@ -15306,7 +15306,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class CarbonMonoxideConcentrationMeasurement: +class CarbonMonoxideConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x040C class Attributes: @@ -15390,7 +15390,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class CarbonDioxideConcentrationMeasurement: +class CarbonDioxideConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x040D class Attributes: @@ -15474,7 +15474,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class EthyleneConcentrationMeasurement: +class EthyleneConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x040E class Attributes: @@ -15558,7 +15558,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class EthyleneOxideConcentrationMeasurement: +class EthyleneOxideConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x040F class Attributes: @@ -15642,7 +15642,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class HydrogenConcentrationMeasurement: +class HydrogenConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x0410 class Attributes: @@ -15726,7 +15726,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class HydrogenSulphideConcentrationMeasurement: +class HydrogenSulphideConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x0411 class Attributes: @@ -15810,7 +15810,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class NitricOxideConcentrationMeasurement: +class NitricOxideConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x0412 class Attributes: @@ -15894,7 +15894,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class NitrogenDioxideConcentrationMeasurement: +class NitrogenDioxideConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x0413 class Attributes: @@ -15978,7 +15978,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class OxygenConcentrationMeasurement: +class OxygenConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x0414 class Attributes: @@ -16062,7 +16062,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class OzoneConcentrationMeasurement: +class OzoneConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x0415 class Attributes: @@ -16146,7 +16146,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class SulfurDioxideConcentrationMeasurement: +class SulfurDioxideConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x0416 class Attributes: @@ -16230,7 +16230,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class DissolvedOxygenConcentrationMeasurement: +class DissolvedOxygenConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x0417 class Attributes: @@ -16314,7 +16314,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class BromateConcentrationMeasurement: +class BromateConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x0418 class Attributes: @@ -16398,7 +16398,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class ChloraminesConcentrationMeasurement: +class ChloraminesConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x0419 class Attributes: @@ -16482,7 +16482,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class ChlorineConcentrationMeasurement: +class ChlorineConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x041A class Attributes: @@ -16566,7 +16566,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class FecalColiformAndEColiConcentrationMeasurement: +class FecalColiformAndEColiConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x041B class Attributes: @@ -16650,7 +16650,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class FluorideConcentrationMeasurement: +class FluorideConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x041C class Attributes: @@ -16734,7 +16734,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class HaloaceticAcidsConcentrationMeasurement: +class HaloaceticAcidsConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x041D class Attributes: @@ -16818,7 +16818,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class TotalTrihalomethanesConcentrationMeasurement: +class TotalTrihalomethanesConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x041E class Attributes: @@ -16902,7 +16902,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class TotalColiformBacteriaConcentrationMeasurement: +class TotalColiformBacteriaConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x041F class Attributes: @@ -16986,7 +16986,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class TurbidityConcentrationMeasurement: +class TurbidityConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x0420 class Attributes: @@ -17070,7 +17070,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class CopperConcentrationMeasurement: +class CopperConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x0421 class Attributes: @@ -17154,7 +17154,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class LeadConcentrationMeasurement: +class LeadConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x0422 class Attributes: @@ -17238,7 +17238,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class ManganeseConcentrationMeasurement: +class ManganeseConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x0423 class Attributes: @@ -17322,7 +17322,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class SulfateConcentrationMeasurement: +class SulfateConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x0424 class Attributes: @@ -17406,7 +17406,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class BromodichloromethaneConcentrationMeasurement: +class BromodichloromethaneConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x0425 class Attributes: @@ -17490,7 +17490,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class BromoformConcentrationMeasurement: +class BromoformConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x0426 class Attributes: @@ -17574,7 +17574,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class ChlorodibromomethaneConcentrationMeasurement: +class ChlorodibromomethaneConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x0427 class Attributes: @@ -17658,7 +17658,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class ChloroformConcentrationMeasurement: +class ChloroformConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x0428 class Attributes: @@ -17742,7 +17742,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class SodiumConcentrationMeasurement: +class SodiumConcentrationMeasurement(Cluster): id: typing.ClassVar[int] = 0x0429 class Attributes: @@ -17826,7 +17826,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class IasZone: +class IasZone(Cluster): id: typing.ClassVar[int] = 0x0500 class Enums: @@ -18093,7 +18093,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class IasAce: +class IasAce(Cluster): id: typing.ClassVar[int] = 0x0501 class Enums: @@ -18604,7 +18604,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class IasWd: +class IasWd(Cluster): id: typing.ClassVar[int] = 0x0502 class Commands: @@ -18691,7 +18691,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class WakeOnLan: +class WakeOnLan(Cluster): id: typing.ClassVar[int] = 0x0503 class Attributes: @@ -18736,7 +18736,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class TvChannel: +class TvChannel(Cluster): id: typing.ClassVar[int] = 0x0504 class Enums: @@ -18932,7 +18932,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class TargetNavigator: +class TargetNavigator(Cluster): id: typing.ClassVar[int] = 0x0505 class Enums: @@ -19051,7 +19051,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class MediaPlayback: +class MediaPlayback(Cluster): id: typing.ClassVar[int] = 0x0506 class Enums: @@ -19539,7 +19539,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class MediaInput: +class MediaInput(Cluster): id: typing.ClassVar[int] = 0x0507 class Enums: @@ -19694,7 +19694,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class LowPower: +class LowPower(Cluster): id: typing.ClassVar[int] = 0x0508 class Commands: @@ -19739,7 +19739,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class KeypadInput: +class KeypadInput(Cluster): id: typing.ClassVar[int] = 0x0509 class Enums: @@ -19898,7 +19898,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class ContentLauncher: +class ContentLauncher(Cluster): id: typing.ClassVar[int] = 0x050A class Enums: @@ -20157,7 +20157,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class AudioOutput: +class AudioOutput(Cluster): id: typing.ClassVar[int] = 0x050B class Enums: @@ -20279,7 +20279,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class ApplicationLauncher: +class ApplicationLauncher(Cluster): id: typing.ClassVar[int] = 0x050C class Enums: @@ -20414,7 +20414,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class ApplicationBasic: +class ApplicationBasic(Cluster): id: typing.ClassVar[int] = 0x050D class Enums: @@ -20561,7 +20561,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class AccountLogin: +class AccountLogin(Cluster): id: typing.ClassVar[int] = 0x050E class Commands: @@ -20645,7 +20645,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class TestCluster: +class TestCluster(Cluster): id: typing.ClassVar[int] = 0x050F class Enums: @@ -21718,6 +21718,227 @@ def attribute_id(cls) -> int: def attribute_type(cls) -> ClusterObjectFieldDescriptor: return ClusterObjectFieldDescriptor(Type=bool) + class NullableBoolean(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x8000 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=bool) + + class NullableBitmap8(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x8001 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + class NullableBitmap16(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x8002 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + class NullableBitmap32(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x8003 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + class NullableBitmap64(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x8004 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + class NullableInt8u(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x8005 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + class NullableInt16u(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x8006 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + class NullableInt32u(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x8008 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + class NullableInt64u(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x800C + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + class NullableInt8s(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x800D + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=int) + + class NullableInt16s(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x800E + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=int) + + class NullableInt32s(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x8010 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=int) + + class NullableInt64s(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x8014 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=int) + + class NullableEnum8(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x8015 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + class NullableEnum16(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x8016 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + class NullableOctetString(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x8019 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=bytes) + + class NullableCharString(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x801E + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=str) + class FeatureMap(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: @@ -21746,7 +21967,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class Messaging: +class Messaging(Cluster): id: typing.ClassVar[int] = 0x0703 class Enums: @@ -22033,7 +22254,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class ApplianceIdentification: +class ApplianceIdentification(Cluster): id: typing.ClassVar[int] = 0x0B00 class Attributes: @@ -22221,7 +22442,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class MeterIdentification: +class MeterIdentification(Cluster): id: typing.ClassVar[int] = 0x0B01 class Attributes: @@ -22409,7 +22630,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class ApplianceEventsAndAlert: +class ApplianceEventsAndAlert(Cluster): id: typing.ClassVar[int] = 0x0B02 class Enums: @@ -22519,7 +22740,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class ApplianceStatistics: +class ApplianceStatistics(Cluster): id: typing.ClassVar[int] = 0x0B03 class Commands: @@ -22694,7 +22915,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class ElectricalMeasurement: +class ElectricalMeasurement(Cluster): id: typing.ClassVar[int] = 0x0B04 class Commands: @@ -24481,7 +24702,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class Binding: +class Binding(Cluster): id: typing.ClassVar[int] = 0xF000 class Commands: @@ -24564,7 +24785,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class GroupKeyManagement: +class GroupKeyManagement(Cluster): id: typing.ClassVar[int] = 0xF004 class Enums: @@ -24670,7 +24891,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class SampleMfgSpecificCluster: +class SampleMfgSpecificCluster(Cluster): id: typing.ClassVar[int] = 0xFC00 class Commands: @@ -24745,7 +24966,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class SampleMfgSpecificCluster2: +class SampleMfgSpecificCluster2(Cluster): id: typing.ClassVar[int] = 0xFC00 class Commands: diff --git a/src/controller/python/chip/clusters/attribute.cpp b/src/controller/python/chip/clusters/attribute.cpp new file mode 100644 index 00000000000000..e7745cc77f03c6 --- /dev/null +++ b/src/controller/python/chip/clusters/attribute.cpp @@ -0,0 +1,265 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +using namespace chip; +using namespace chip::app; + +using PyObject = void; + +extern "C" { +// Encodes n attribute write requests, follows 3 * n arguments, in the (AttributeWritePath*=void *, uint8_t*, size_t) order. +chip::ChipError::StorageType pychip_WriteClient_WriteAttributes(void * appContext, DeviceProxy * device, size_t n, ...); +chip::ChipError::StorageType pychip_ReadClient_ReadAttributes(void * appContext, DeviceProxy * device, size_t n, ...); +} + +namespace chip { +namespace python { + +struct __attribute__((packed)) AttributePath +{ + chip::EndpointId endpointId; + chip::ClusterId clusterId; + chip::AttributeId attributeId; +}; + +using OnReadAttributeDataCallback = void (*)(PyObject * appContext, chip::EndpointId endpointId, chip::ClusterId clusterId, + chip::AttributeId attributeId, + std::underlying_type_t imstatus, uint8_t * data, + uint32_t dataLen); +using OnReadErrorCallback = void (*)(PyObject * appContext, uint32_t chiperror); +using OnReadDoneCallback = void (*)(PyObject * appContext); + +OnReadAttributeDataCallback gOnReadAttributeDataCallback = nullptr; +OnReadErrorCallback gOnReadErrorCallback = nullptr; +OnReadDoneCallback gOnReadDoneCallback = nullptr; + +class ReadClientCallback : public ReadClient::Callback +{ +public: + ReadClientCallback(PyObject * appContext) : mAppContext(appContext) {} + + void OnAttributeData(const ReadClient * apReadClient, const ConcreteAttributePath & aPath, TLV::TLVReader * apData, + const StatusIB & aStatus) override + { + uint8_t buffer[CHIP_CONFIG_DEFAULT_UDP_MTU_SIZE]; + uint32_t size = 0; + // When the apData is nullptr, means we did not receive a valid attribute data from server, status will be some error + // status. + if (apData != nullptr) + { + // The TLVReader's read head is not pointing to the first element in the container instead of the container itself, use + // a TLVWriter to get a TLV with a normalized TLV buffer (Wrapped with a anonymous tag, no extra "end of container" tag + // at the end.) + TLV::TLVWriter writer; + writer.Init(buffer); + CHIP_ERROR err = writer.CopyElement(TLV::AnonymousTag, *apData); + if (err != CHIP_NO_ERROR) + { + app::StatusIB status; + status.mStatus = Protocols::InteractionModel::Status::Failure; + this->OnError(apReadClient, err); + return; + } + size = writer.GetLengthWritten(); + } + + gOnReadAttributeDataCallback(mAppContext, aPath.mEndpointId, aPath.mClusterId, aPath.mAttributeId, + to_underlying(aStatus.mStatus), buffer, size); + } + + void OnError(const ReadClient * apReadClient, CHIP_ERROR aError) override + { + gOnReadErrorCallback(mAppContext, aError.AsInteger()); + } + + void OnDone(ReadClient * apReadClient) override + { + gOnReadDoneCallback(mAppContext); + // delete apReadClient; + delete this; + }; + +private: + PyObject * mAppContext; +}; + +using OnWriteResponseCallback = void (*)(PyObject * appContext, chip::EndpointId endpointId, chip::ClusterId clusterId, + chip::AttributeId attributeId, + std::underlying_type_t imstatus); +using OnWriteErrorCallback = void (*)(PyObject * appContext, uint32_t chiperror); +using OnWriteDoneCallback = void (*)(PyObject * appContext); + +OnWriteResponseCallback gOnWriteResponseCallback = nullptr; +OnWriteErrorCallback gOnWriteErrorCallback = nullptr; +OnWriteDoneCallback gOnWriteDoneCallback = nullptr; + +class WriteClientCallback : public WriteClient::Callback +{ +public: + WriteClientCallback(PyObject * appContext) : mAppContext(appContext) {} + + void OnResponse(const WriteClient * apWriteClient, const ConcreteAttributePath & aPath, app::StatusIB aStatus) override + { + gOnWriteResponseCallback(mAppContext, aPath.mEndpointId, aPath.mClusterId, aPath.mAttributeId, + to_underlying(aStatus.mStatus)); + } + + void OnError(const WriteClient * apWriteClient, CHIP_ERROR aProtocolError) override + { + gOnWriteErrorCallback(mAppContext, aProtocolError.AsInteger()); + } + + void OnDone(WriteClient * apWriteClient) override + { + gOnWriteDoneCallback(mAppContext); + // delete apWriteClient; + delete this; + }; + +private: + PyObject * mAppContext = nullptr; +}; + +} // namespace python +} // namespace chip + +using namespace chip::python; + +extern "C" { +void pychip_WriteClient_InitCallbacks(OnWriteResponseCallback onWriteResponseCallback, OnWriteErrorCallback onWriteErrorCallback, + OnWriteDoneCallback onWriteDoneCallback) +{ + gOnWriteResponseCallback = onWriteResponseCallback; + gOnWriteErrorCallback = onWriteErrorCallback; + gOnWriteDoneCallback = onWriteDoneCallback; +} + +void pychip_ReadClient_InitCallbacks(OnReadAttributeDataCallback onReadAttributeDataCallback, + OnReadErrorCallback onReadErrorCallback, OnReadDoneCallback onReadDoneCallback) +{ + gOnReadAttributeDataCallback = onReadAttributeDataCallback; + gOnReadErrorCallback = onReadErrorCallback; + gOnReadDoneCallback = onReadDoneCallback; +} + +chip::ChipError::StorageType pychip_WriteClient_WriteAttributes(void * appContext, DeviceProxy * device, size_t n, ...) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + std::unique_ptr callback = std::make_unique(appContext); + app::WriteClientHandle client; + + va_list args; + va_start(args, n); + + SuccessOrExit(err = app::InteractionModelEngine::GetInstance()->NewWriteClient(client, callback.get())); + + { + for (size_t i = 0; i < n; i++) + { + void * path = va_arg(args, void *); + void * tlv = va_arg(args, void *); + int length = va_arg(args, int); + + python::AttributePath pathObj; + memcpy(&pathObj, path, sizeof(python::AttributePath)); + uint8_t * tlvBuffer = reinterpret_cast(tlv); + + TLV::TLVWriter * writer; + TLV::TLVReader reader; + + SuccessOrExit(err = client->PrepareAttribute( + chip::app::AttributePathParams(pathObj.endpointId, pathObj.clusterId, pathObj.attributeId))); + VerifyOrExit((writer = client->GetAttributeDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + + reader.Init(tlvBuffer, static_cast(length)); + reader.Next(); + SuccessOrExit( + err = writer->CopyElement(chip::TLV::ContextTag(to_underlying(chip::app::AttributeDataIB::Tag::kData)), reader)); + + SuccessOrExit(err = client->FinishAttribute()); + } + } + + SuccessOrExit(err = device->SendWriteAttributeRequest(std::move(client), nullptr, nullptr)); + + callback.release(); + +exit: + va_end(args); + return err.AsInteger(); +} + +chip::ChipError::StorageType pychip_ReadClient_ReadAttributes(void * appContext, DeviceProxy * device, size_t n, ...) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + std::unique_ptr callback = std::make_unique(appContext); + + va_list args; + va_start(args, n); + + std::unique_ptr readPaths(new AttributePathParams[n]); + + { + for (size_t i = 0; i < n; i++) + { + void * path = va_arg(args, void *); + + python::AttributePath pathObj; + memcpy(&pathObj, path, sizeof(python::AttributePath)); + + readPaths[i] = AttributePathParams(pathObj.endpointId, pathObj.clusterId, pathObj.attributeId); + } + } + + Optional session = device->GetSecureSession(); + ReadClient * readClient; + + VerifyOrExit(session.HasValue(), err = CHIP_ERROR_NOT_CONNECTED); + { + app::InteractionModelEngine::GetInstance()->NewReadClient(&readClient, ReadClient::InteractionType::Read, callback.get()); + ReadPrepareParams params(session.Value()); + params.mpAttributePathParamsList = readPaths.get(); + params.mAttributePathParamsListSize = n; + + err = readClient->SendReadRequest(params); + if (err != CHIP_NO_ERROR) + { + readClient->Shutdown(); + } + } + + callback.release(); + +exit: + va_end(args); + return err.AsInteger(); +} +} diff --git a/src/controller/python/chip/clusters/write.cpp b/src/controller/python/chip/clusters/write.cpp deleted file mode 100644 index 9d5549c1164cc4..00000000000000 --- a/src/controller/python/chip/clusters/write.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/* - * - * Copyright (c) 2021 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include - -#include -#include -#include - -#include -#include - -using namespace chip; -using namespace chip::app; - -using PyObject = void *; - -extern "C" { -// Encodes n attribute write requests, follows 3 * n arguments, in the (AttributeWritePath*=void *, uint8_t*, size_t) order. -chip::ChipError::StorageType pychip_WriteClient_WriteAttributes(void * appContext, DeviceProxy * device, size_t n, ...); -} - -namespace chip { -namespace python { - -struct __attribute__((packed)) AttributeWritePath -{ - chip::EndpointId endpointId; - chip::ClusterId clusterId; - chip::AttributeId attributeId; -}; - -using OnWriteResponseCallback = void (*)(PyObject appContext, chip::EndpointId endpointId, chip::ClusterId clusterId, - chip::AttributeId attributeId, - std::underlying_type_t imstatus); -using OnWriteErrorCallback = void (*)(PyObject appContext, uint32_t chiperror); -using OnWriteDoneCallback = void (*)(PyObject appContext); - -OnWriteResponseCallback gOnWriteResponseCallback = nullptr; -OnWriteErrorCallback gOnWriteErrorCallback = nullptr; -OnWriteDoneCallback gOnWriteDoneCallback = nullptr; - -class WriteClientCallback : public WriteClient::Callback -{ -public: - WriteClientCallback(PyObject appContext) : mAppContext(appContext) {} - - void OnResponse(const WriteClient * apWriteClient, const ConcreteAttributePath & aPath, app::StatusIB aStatus) override - { - gOnWriteResponseCallback(mAppContext, aPath.mEndpointId, aPath.mClusterId, aPath.mAttributeId, - to_underlying(aStatus.mStatus)); - } - - void OnError(const WriteClient * apWriteClient, CHIP_ERROR aProtocolError) override - { - gOnWriteErrorCallback(mAppContext, aProtocolError.AsInteger()); - } - - void OnDone(WriteClient * apCommandSender) override - { - gOnWriteDoneCallback(mAppContext); - // delete apCommandSender; - delete this; - }; - -private: - PyObject mAppContext = nullptr; -}; - -} // namespace python -} // namespace chip - -using namespace chip::python; - -extern "C" { -void pychip_WriteClient_InitCallbacks(OnWriteResponseCallback onWriteResponseCallback, OnWriteErrorCallback onWriteErrorCallback, - OnWriteDoneCallback onWriteDoneCallback) -{ - gOnWriteResponseCallback = onWriteResponseCallback; - gOnWriteErrorCallback = onWriteErrorCallback; - gOnWriteDoneCallback = onWriteDoneCallback; -} - -chip::ChipError::StorageType pychip_WriteClient_WriteAttributes(void * appContext, DeviceProxy * device, size_t n, ...) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - std::unique_ptr callback = std::make_unique(appContext); - app::WriteClientHandle client; - - va_list args; - va_start(args, n); - - SuccessOrExit(err = app::InteractionModelEngine::GetInstance()->NewWriteClient(client, callback.get())); - - { - for (size_t i = 0; i < n; i++) - { - void * path = va_arg(args, void *); - void * tlv = va_arg(args, void *); - int length = va_arg(args, int); - - AttributeWritePath pathObj; - memcpy(&pathObj, path, sizeof(AttributeWritePath)); - uint8_t * tlvBuffer = reinterpret_cast(tlv); - - TLV::TLVWriter * writer; - TLV::TLVReader reader; - - SuccessOrExit(err = client->PrepareAttribute( - chip::app::AttributePathParams(pathObj.endpointId, pathObj.clusterId, pathObj.attributeId))); - VerifyOrExit((writer = client->GetAttributeDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - - reader.Init(tlvBuffer, static_cast(length)); - reader.Next(); - SuccessOrExit(err = writer->CopyElement( - chip::TLV::ContextTag(chip::to_underlying(chip::app::AttributeDataIB::Tag::kData)), reader)); - - SuccessOrExit(err = client->FinishAttribute()); - } - } - - SuccessOrExit(err = device->SendWriteAttributeRequest(std::move(client), nullptr, nullptr)); - - callback.release(); - -exit: - va_end(args); - return err.AsInteger(); -} -} diff --git a/src/controller/python/templates/python-cluster-Objects-py.zapt b/src/controller/python/templates/python-cluster-Objects-py.zapt index 9a08a833d8ba11..4fad616d1dbed5 100644 --- a/src/controller/python/templates/python-cluster-Objects-py.zapt +++ b/src/controller/python/templates/python-cluster-Objects-py.zapt @@ -12,12 +12,12 @@ from chip import ChipUtility from chip.tlv import uint -from .ClusterObjects import ClusterObject, ClusterObjectDescriptor, ClusterObjectFieldDescriptor, ClusterCommand, ClusterAttributeDescriptor +from .ClusterObjects import ClusterObject, ClusterObjectDescriptor, ClusterObjectFieldDescriptor, ClusterCommand, ClusterAttributeDescriptor, Cluster {{#zcl_clusters}} @dataclass -class {{asUpperCamelCase name}}: +class {{asUpperCamelCase name}}(Cluster): id: typing.ClassVar[int] = {{asHex code 4}} {{#zcl_enums}} diff --git a/src/controller/python/test/test_scripts/cluster_objects.py b/src/controller/python/test/test_scripts/cluster_objects.py index c12fba16ffbce1..2895d612435b43 100644 --- a/src/controller/python/test/test_scripts/cluster_objects.py +++ b/src/controller/python/test/test_scripts/cluster_objects.py @@ -97,40 +97,45 @@ async def SendWriteRequest(cls, devCtrl): @classmethod async def SendReadRequest(cls, devCtrl): - res = await devCtrl.ReadAttribute(nodeid=NODE_ID, - attributes=[ - (0, Clusters.Basic.Attributes.VendorName), - (0, Clusters.Basic.Attributes.VendorID), - (0, Clusters.Basic.Attributes.ProductName), - (0, Clusters.Basic.Attributes.ProductID), - (0, Clusters.Basic.Attributes.UserLabel), - (0, Clusters.Basic.Attributes.Location), - (0, Clusters.Basic.Attributes.HardwareVersion), - (0, Clusters.Basic.Attributes.HardwareVersionString), - (0, Clusters.Basic.Attributes.SoftwareVersion), - (0, Clusters.Basic.Attributes.SoftwareVersionString), - ]) + req = [ + (0, Clusters.Basic.Attributes.VendorName), + (0, Clusters.Basic.Attributes.VendorID), + (0, Clusters.Basic.Attributes.ProductName), + (0, Clusters.Basic.Attributes.ProductID), + (0, Clusters.Basic.Attributes.UserLabel), + (0, Clusters.Basic.Attributes.Location), + (0, Clusters.Basic.Attributes.HardwareVersion), + (0, Clusters.Basic.Attributes.HardwareVersionString), + (0, Clusters.Basic.Attributes.SoftwareVersion), + (0, Clusters.Basic.Attributes.SoftwareVersionString), + ] + + # Note: The server might be too small to handle reading lots of attributes at the same time. + res = [ + await devCtrl.ReadAttribute(nodeid=NODE_ID, attributes=[r]) for r in req + ] + expectedRes = [ - AttributeReadResult(Path=AttributePath( - EndpointId=0, ClusterId=40, AttributeId=1), Status=0, Data='TEST_VENDOR'), - AttributeReadResult(Path=AttributePath( - EndpointId=0, ClusterId=40, AttributeId=2), Status=0, Data=9050), - AttributeReadResult(Path=AttributePath( - EndpointId=0, ClusterId=40, AttributeId=3), Status=0, Data='TEST_PRODUCT'), - AttributeReadResult(Path=AttributePath( - EndpointId=0, ClusterId=40, AttributeId=4), Status=0, Data=65279), - AttributeReadResult(Path=AttributePath( - EndpointId=0, ClusterId=40, AttributeId=5), Status=0, Data='Test'), - AttributeReadResult(Path=AttributePath( - EndpointId=0, ClusterId=40, AttributeId=6), Status=0, Data=''), - AttributeReadResult(Path=AttributePath( - EndpointId=0, ClusterId=40, AttributeId=7), Status=0, Data=0), - AttributeReadResult(Path=AttributePath( - EndpointId=0, ClusterId=40, AttributeId=8), Status=0, Data='TEST_VERSION'), - AttributeReadResult(Path=AttributePath( - EndpointId=0, ClusterId=40, AttributeId=9), Status=0, Data=0), - AttributeReadResult(Path=AttributePath( - EndpointId=0, ClusterId=40, AttributeId=10), Status=0, Data='prerelease') + [AttributeReadResult(Path=AttributePath( + EndpointId=0, ClusterId=40, AttributeId=1), Status=chip.interaction_model.Status.Success, Data='TEST_VENDOR'), ], + [AttributeReadResult(Path=AttributePath( + EndpointId=0, ClusterId=40, AttributeId=2), Status=chip.interaction_model.Status.Success, Data=9050), ], + [AttributeReadResult(Path=AttributePath( + EndpointId=0, ClusterId=40, AttributeId=3), Status=chip.interaction_model.Status.Success, Data='TEST_PRODUCT'), ], + [AttributeReadResult(Path=AttributePath( + EndpointId=0, ClusterId=40, AttributeId=4), Status=chip.interaction_model.Status.Success, Data=65279), ], + [AttributeReadResult(Path=AttributePath( + EndpointId=0, ClusterId=40, AttributeId=5), Status=chip.interaction_model.Status.Success, Data='Test'), ], + [AttributeReadResult(Path=AttributePath( + EndpointId=0, ClusterId=40, AttributeId=6), Status=chip.interaction_model.Status.Success, Data=''), ], + [AttributeReadResult(Path=AttributePath( + EndpointId=0, ClusterId=40, AttributeId=7), Status=chip.interaction_model.Status.Success, Data=0), ], + [AttributeReadResult(Path=AttributePath( + EndpointId=0, ClusterId=40, AttributeId=8), Status=chip.interaction_model.Status.Success, Data='TEST_VERSION'), ], + [AttributeReadResult(Path=AttributePath( + EndpointId=0, ClusterId=40, AttributeId=9), Status=chip.interaction_model.Status.Success, Data=0), ], + [AttributeReadResult(Path=AttributePath( + EndpointId=0, ClusterId=40, AttributeId=10), Status=chip.interaction_model.Status.Success, Data='prerelease')], ] if res != expectedRes: diff --git a/src/controller/python/test/test_scripts/mobile-device-test.py b/src/controller/python/test/test_scripts/mobile-device-test.py index a86906da210a82..1f542cdc11c1c9 100755 --- a/src/controller/python/test/test_scripts/mobile-device-test.py +++ b/src/controller/python/test/test_scripts/mobile-device-test.py @@ -85,6 +85,13 @@ def main(): nodeid=1), "Failed to finish key exchange") + logger.info("Testing closing sessions") + FailIfNot(test.TestCloseSession(nodeid=1), "Failed to close sessions") + + logger.info("Testing resolve") + FailIfNot(test.TestResolve(nodeid=1), + "Failed to resolve nodeid") + logger.info("Testing network commissioning") FailIfNot(test.TestNetworkCommissioning(nodeid=1, endpoint=ENDPOINT_ID, @@ -134,13 +141,6 @@ def main(): FailIfNot(test.TestSubscription(nodeid=1, endpoint=LIGHTING_ENDPOINT_ID), "Failed to subscribe attributes.") - logger.info("Testing closing sessions") - FailIfNot(test.TestCloseSession(nodeid=1), "Failed to close sessions") - - logger.info("Testing resolve") - FailIfNot(test.TestResolve(nodeid=1), - "Failed to resolve nodeid") - logger.info("Testing on off cluster over resolved connection") FailIfNot(test.TestOnOffCluster(nodeid=1, endpoint=LIGHTING_ENDPOINT_ID, diff --git a/src/controller/tests/BUILD.gn b/src/controller/tests/BUILD.gn index f944124b504fcd..f274c53eb96862 100644 --- a/src/controller/tests/BUILD.gn +++ b/src/controller/tests/BUILD.gn @@ -33,7 +33,6 @@ chip_test_suite("tests") { "${chip_root}/src/app/common:cluster-objects", "${chip_root}/src/app/tests:helpers", "${chip_root}/src/controller", - "${chip_root}/src/controller/tests/data_model:interaction-tests", "${chip_root}/src/messaging/tests:helpers", "${chip_root}/src/transport/raw/tests:helpers", "${nlunit_test_root}:nlunit-test", diff --git a/src/controller/tests/data_model/BUILD.gn b/src/controller/tests/data_model/BUILD.gn index 7912f6c724422c..ca5c751390f0f9 100644 --- a/src/controller/tests/data_model/BUILD.gn +++ b/src/controller/tests/data_model/BUILD.gn @@ -19,8 +19,8 @@ import("//build_overrides/nlunit_test.gni") import("${chip_root}/build/chip/chip_test_suite.gni") import("${chip_root}/src/platform/device.gni") -chip_test_suite("interaction-tests") { - output_name = "libInteractionTests" +chip_test_suite("data_model") { + output_name = "libDataModelTests" if (chip_device_platform != "mbed" && chip_device_platform != "efr32") { test_sources = [ "TestCommands.cpp" ] diff --git a/src/controller/tests/data_model/TestCommands.cpp b/src/controller/tests/data_model/TestCommands.cpp index faec93baf52364..9eb0523bdb4133 100644 --- a/src/controller/tests/data_model/TestCommands.cpp +++ b/src/controller/tests/data_model/TestCommands.cpp @@ -22,6 +22,7 @@ * */ +#include "app/data-model/NullObject.h" #include #include #include @@ -223,8 +224,13 @@ void TestCommandInteraction::TestDataResponse(nlTestSuite * apSuite, void * apCo void TestCommandInteraction::TestSuccessNoDataResponse(nlTestSuite * apSuite, void * apContext) { + struct FakeRequest : public TestCluster::Commands::TestSimpleArgumentRequest::Type + { + using ResponseType = DataModel::NullObjectType; + }; + TestContext & ctx = *static_cast(apContext); - TestCluster::Commands::TestSimpleArgumentRequest::Type request; + FakeRequest request; auto sessionHandle = ctx.GetSessionBobToAlice(); bool onSuccessWasCalled = false; @@ -257,8 +263,13 @@ void TestCommandInteraction::TestSuccessNoDataResponse(nlTestSuite * apSuite, vo void TestCommandInteraction::TestAsyncResponse(nlTestSuite * apSuite, void * apContext) { + struct FakeRequest : public TestCluster::Commands::TestSimpleArgumentRequest::Type + { + using ResponseType = DataModel::NullObjectType; + }; + TestContext & ctx = *static_cast(apContext); - TestCluster::Commands::TestSimpleArgumentRequest::Type request; + FakeRequest request; auto sessionHandle = ctx.GetSessionBobToAlice(); bool onSuccessWasCalled = false; @@ -342,8 +353,13 @@ void TestCommandInteraction::TestFailure(nlTestSuite * apSuite, void * apContext void TestCommandInteraction::TestSuccessNoDataResponseWithClusterStatus(nlTestSuite * apSuite, void * apContext) { + struct FakeRequest : public TestCluster::Commands::TestSimpleArgumentRequest::Type + { + using ResponseType = DataModel::NullObjectType; + }; + TestContext & ctx = *static_cast(apContext); - TestCluster::Commands::TestSimpleArgumentRequest::Type request; + FakeRequest request; auto sessionHandle = ctx.GetSessionBobToAlice(); bool onSuccessWasCalled = false; diff --git a/src/controller/tests/data_model/TestRead.cpp b/src/controller/tests/data_model/TestRead.cpp index ea6519cc78ca8e..763d6a787ea309 100644 --- a/src/controller/tests/data_model/TestRead.cpp +++ b/src/controller/tests/data_model/TestRead.cpp @@ -83,7 +83,7 @@ CHIP_ERROR ReadSingleClusterData(FabricIndex aAccessingFabricIndex, const Concre ReturnErrorOnFailure(DataModel::Encode(*(attributeData.GetWriter()), chip::TLV::ContextTag(chip::to_underlying(AttributeDataIB::Tag::kData)), value)); - attributeData.DataVersion(0); + attributeData.DataVersion(0).EndOfAttributeDataIB(); return CHIP_NO_ERROR; } else diff --git a/src/credentials/BUILD.gn b/src/credentials/BUILD.gn index fa9335993eac9c..c4790e9f3d0235 100644 --- a/src/credentials/BUILD.gn +++ b/src/credentials/BUILD.gn @@ -29,6 +29,7 @@ static_library("credentials") { "DeviceAttestationConstructor.h", "DeviceAttestationCredsProvider.cpp", "DeviceAttestationCredsProvider.h", + "DeviceAttestationVendorReserved.h", "DeviceAttestationVerifier.cpp", "DeviceAttestationVerifier.h", "GenerateChipX509Cert.cpp", diff --git a/src/credentials/CHIPCert.cpp b/src/credentials/CHIPCert.cpp index 58f1bdd08a4872..5bb47aea3aba84 100644 --- a/src/credentials/CHIPCert.cpp +++ b/src/credentials/CHIPCert.cpp @@ -883,6 +883,32 @@ CHIP_ERROR ExtractFabricIdFromCert(const ChipCertificateData & cert, FabricId * return CHIP_ERROR_INVALID_ARGUMENT; } +CHIP_ERROR ExtractCATsFromOpCert(const ChipCertificateData & opcert, uint32_t * cats, uint8_t catsSize) +{ + uint8_t catCount = 0; + uint8_t certType; + + ReturnErrorOnFailure(opcert.mSubjectDN.GetCertType(certType)); + VerifyOrReturnError(certType == kCertType_Node, CHIP_ERROR_INVALID_ARGUMENT); + + const ChipDN & subjectDN = opcert.mSubjectDN; + for (uint8_t i = 0; i < subjectDN.RDNCount(); ++i) + { + const auto & rdn = subjectDN.rdn[i]; + if (rdn.mAttrOID == ASN1::kOID_AttributeType_ChipCASEAuthenticatedTag) + { + ReturnErrorCodeIf(catCount == catsSize, CHIP_ERROR_BUFFER_TOO_SMALL); + cats[catCount++] = static_cast(rdn.mChipVal); + } + } + for (uint8_t i = catCount; i < catsSize; ++i) + { + cats[i] = 0; + } + + return CHIP_NO_ERROR; +} + CHIP_ERROR ExtractNodeIdFabricIdFromOpCert(const ByteSpan & opcert, NodeId * nodeId, FabricId * fabricId) { ChipCertificateSet certSet; diff --git a/src/credentials/CHIPCert.h b/src/credentials/CHIPCert.h index 07f11b4b6f7473..762e0f25f209f6 100644 --- a/src/credentials/CHIPCert.h +++ b/src/credentials/CHIPCert.h @@ -54,6 +54,9 @@ static constexpr uint32_t kMaxDERCertLength = 600; // The decode buffer is used to reconstruct TBS section of X.509 certificate, which doesn't include signature. static constexpr uint32_t kMaxCHIPCertDecodeBufLength = kMaxDERCertLength - Crypto::kMax_ECDSA_Signature_Length_Der; +// Muximum number of CASE Authenticated Tags (CAT) in the CHIP certificate subject. +static constexpr size_t kMaxSubjectCATAttributeCount = CHIP_CONFIG_CERT_MAX_RDN_ATTRIBUTES - 2; + /** Data Element Tags for the CHIP Certificate */ enum @@ -715,7 +718,7 @@ inline bool IsChip64bitDNAttr(chip::ASN1::OID oid) **/ inline bool IsChip32bitDNAttr(chip::ASN1::OID oid) { - return (oid == chip::ASN1::kOID_AttributeType_ChipAuthTag1 || oid == chip::ASN1::kOID_AttributeType_ChipAuthTag2); + return (oid == chip::ASN1::kOID_AttributeType_ChipCASEAuthenticatedTag); } /** @@ -796,6 +799,17 @@ CHIP_ERROR ExtractFabricIdFromCert(const ChipCertificateData & cert, FabricId * */ CHIP_ERROR ExtractNodeIdFabricIdFromOpCert(const ChipCertificateData & opcert, NodeId * nodeId, FabricId * fabricId); +/** + * Extract CASE Authenticated Tags from an operational certificate that has already been + * parsed. + * + * All values in the 'cats' array will be set either to a valid CAT value or zero (undefined) value. + * + * @return CHIP_ERROR_INVALID_ARGUMENT if the passed-in cert is not NOC. + * @return CHIP_ERROR_BUFFER_TOO_SMALL if the passed-in CATs array is too small. + */ +CHIP_ERROR ExtractCATsFromOpCert(const ChipCertificateData & opcert, uint32_t * cats, uint8_t catsSize); + /** * Extract Node ID and Fabric ID from an operational certificate in ByteSpan TLV-encoded * form. This does not perform any sort of validation on the certificate diff --git a/src/credentials/DeviceAttestationConstructor.cpp b/src/credentials/DeviceAttestationConstructor.cpp index 447ff61a5a1576..eb206f2f56aa43 100644 --- a/src/credentials/DeviceAttestationConstructor.cpp +++ b/src/credentials/DeviceAttestationConstructor.cpp @@ -15,6 +15,7 @@ * limitations under the License. */ #include "DeviceAttestationConstructor.h" +#include "DeviceAttestationVendorReserved.h" #include #include @@ -34,16 +35,40 @@ enum : uint32_t kFirmwareInfoTagId = 4, }; +// utility to determine number of Vendor Reserved elements in a bytespan +CHIP_ERROR CountVendorReservedElementsInDA(const ByteSpan & attestationElements, size_t & numOfElements) +{ + TLV::ContiguousBufferTLVReader tlvReader; + TLV::TLVType containerType = TLV::kTLVType_Structure; + + tlvReader.Init(attestationElements); + ReturnErrorOnFailure(tlvReader.Next(containerType, TLV::AnonymousTag)); + ReturnErrorOnFailure(tlvReader.EnterContainer(containerType)); + + size_t count = 0; + CHIP_ERROR error; + while ((error = tlvReader.Next()) == CHIP_NO_ERROR) + { + uint64_t tag = tlvReader.GetTag(); + if (TLV::IsProfileTag(tag)) + { + count++; + } + } + VerifyOrReturnError(error == CHIP_NO_ERROR || error == CHIP_END_OF_TLV, error); + + numOfElements = count; + return CHIP_NO_ERROR; +} + CHIP_ERROR DeconstructAttestationElements(const ByteSpan & attestationElements, ByteSpan & certificationDeclaration, ByteSpan & attestationNonce, uint32_t & timestamp, ByteSpan & firmwareInfo, - ByteSpan * vendorReservedArray, size_t & vendorReservedArraySize, uint16_t & vendorId, - uint16_t & profileNum) + DeviceAttestationVendorReservedDeconstructor & vendorReserved) { bool certificationDeclarationExists = false; bool attestationNonceExists = false; bool timestampExists = false; bool firmwareInfoExists = false; - size_t vendorReservedIdx = 0; uint32_t lastContextTagId = UINT32_MAX; TLV::ContiguousBufferTLVReader tlvReader; TLV::TLVType containerType = TLV::kTLVType_Structure; @@ -54,99 +79,65 @@ CHIP_ERROR DeconstructAttestationElements(const ByteSpan & attestationElements, ReturnErrorOnFailure(tlvReader.Next(containerType, TLV::AnonymousTag)); ReturnErrorOnFailure(tlvReader.EnterContainer(containerType)); - CHIP_ERROR error = CHIP_NO_ERROR; + CHIP_ERROR error; - // TODO: per conversation with Tennessee, shold be two consecutive loops (rather than one big - // loop, since the contextTags come before the profileTags) + // process context tags first (should be in sorted order) while ((error = tlvReader.Next()) == CHIP_NO_ERROR) { TLV::Tag tag = tlvReader.GetTag(); - if (TLV::IsContextTag(tag)) - { - switch (TLV::TagNumFromTag(tag)) - { - case kCertificationDeclarationTagId: - VerifyOrReturnError(lastContextTagId == UINT32_MAX, CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT); - VerifyOrReturnError(certificationDeclarationExists == false, CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT); - ReturnErrorOnFailure(tlvReader.GetByteView(certificationDeclaration)); - certificationDeclarationExists = true; - break; - case kAttestationNonceTagId: - VerifyOrReturnError(lastContextTagId == kCertificationDeclarationTagId, - CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT); - VerifyOrReturnError(attestationNonceExists == false, CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT); - ReturnErrorOnFailure(tlvReader.GetByteView(attestationNonce)); - attestationNonceExists = true; - break; - case kTimestampTagId: - VerifyOrReturnError(lastContextTagId == kAttestationNonceTagId, CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT); - VerifyOrReturnError(timestampExists == false, CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT); - ReturnErrorOnFailure(tlvReader.Get(timestamp)); - timestampExists = true; - break; - case kFirmwareInfoTagId: - VerifyOrReturnError(lastContextTagId == kTimestampTagId, CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT); - VerifyOrReturnError(firmwareInfoExists == false, CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT); - ReturnErrorOnFailure(tlvReader.GetByteView(firmwareInfo)); - firmwareInfoExists = true; - break; - default: - return CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - } - - lastContextTagId = TLV::TagNumFromTag(tag); - } - else if (TLV::IsProfileTag(tag)) - { - // vendor fields - bool seenProfile = false; - uint16_t currentVendorId; - uint16_t currentProfileNum; - - currentVendorId = TLV::VendorIdFromTag(tag); - currentProfileNum = TLV::ProfileNumFromTag(tag); - if (!seenProfile) - { - seenProfile = true; - vendorId = currentVendorId; - profileNum = currentProfileNum; - } - else - { - // TODO: do not check for this - map vendorId and profileNum to each Vendor Reserved entry - // check that vendorId and profileNum match in every Vendor Reserved entry - VerifyOrReturnError(currentVendorId == vendorId && currentProfileNum == profileNum, - CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT); - } - - ByteSpan vendorReservedEntry; - ReturnErrorOnFailure(tlvReader.GetByteView(vendorReservedEntry)); - VerifyOrReturnError(vendorReservedIdx < vendorReservedArraySize, CHIP_ERROR_NO_MEMORY); - vendorReservedArray[vendorReservedIdx++] = vendorReservedEntry; - } - else + if (!TLV::IsContextTag(tag)) + break; + + switch (TLV::TagNumFromTag(tag)) { + case kCertificationDeclarationTagId: + VerifyOrReturnError(lastContextTagId == UINT32_MAX, CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT); + VerifyOrReturnError(certificationDeclarationExists == false, CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT); + ReturnErrorOnFailure(tlvReader.GetByteView(certificationDeclaration)); + certificationDeclarationExists = true; + break; + case kAttestationNonceTagId: + VerifyOrReturnError(lastContextTagId == kCertificationDeclarationTagId, CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT); + VerifyOrReturnError(attestationNonceExists == false, CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT); + ReturnErrorOnFailure(tlvReader.GetByteView(attestationNonce)); + attestationNonceExists = true; + break; + case kTimestampTagId: + VerifyOrReturnError(lastContextTagId == kAttestationNonceTagId, CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT); + VerifyOrReturnError(timestampExists == false, CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT); + ReturnErrorOnFailure(tlvReader.Get(timestamp)); + timestampExists = true; + break; + case kFirmwareInfoTagId: + VerifyOrReturnError(lastContextTagId == kTimestampTagId, CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT); + VerifyOrReturnError(firmwareInfoExists == false, CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT); + ReturnErrorOnFailure(tlvReader.GetByteView(firmwareInfo)); + firmwareInfoExists = true; + break; + default: return CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; } + + lastContextTagId = TLV::TagNumFromTag(tag); } - vendorReservedArraySize = vendorReservedIdx; + VerifyOrReturnError(error == CHIP_NO_ERROR || error == CHIP_END_OF_TLV, error); - VerifyOrReturnError(error == CHIP_END_OF_TLV, error); - VerifyOrReturnError(lastContextTagId != UINT32_MAX, CHIP_ERROR_MISSING_TLV_ELEMENT); - VerifyOrReturnError(certificationDeclarationExists && attestationNonceExists && timestampExists, + VerifyOrReturnError(lastContextTagId == kTimestampTagId || lastContextTagId == kFirmwareInfoTagId, CHIP_ERROR_MISSING_TLV_ELEMENT); + size_t count = 0; + ReturnErrorOnFailure(CountVendorReservedElementsInDA(attestationElements, count)); + ReturnErrorOnFailure(vendorReserved.PrepareToReadVendorReservedElements(attestationElements, count)); return CHIP_NO_ERROR; } -// TODO: have independent vendorId and profileNum entries map to each vendor Reserved entry // Have a class for vendor reserved data, discussed in: // https://github.com/project-chip/connectedhomeip/issues/9825 CHIP_ERROR ConstructAttestationElements(const ByteSpan & certificationDeclaration, const ByteSpan & attestationNonce, - uint32_t timestamp, const ByteSpan & firmwareInfo, ByteSpan * vendorReservedArray, - size_t vendorReservedArraySize, uint16_t vendorId, uint16_t profileNum, + uint32_t timestamp, const ByteSpan & firmwareInfo, + DeviceAttestationVendorReservedConstructor & vendorReserved, MutableByteSpan & attestationElements) { TLV::TLVWriter tlvWriter; @@ -154,10 +145,6 @@ CHIP_ERROR ConstructAttestationElements(const ByteSpan & certificationDeclaratio VerifyOrReturnError(!certificationDeclaration.empty() && !attestationNonce.empty(), CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(attestationNonce.size() == 32, CHIP_ERROR_INVALID_ARGUMENT); - if (vendorReservedArraySize != 0) - { - VerifyOrReturnError(vendorReservedArray != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - } tlvWriter.Init(attestationElements.data(), static_cast(attestationElements.size())); outerContainerType = TLV::kTLVType_NotSpecified; @@ -170,15 +157,11 @@ CHIP_ERROR ConstructAttestationElements(const ByteSpan & certificationDeclaratio ReturnErrorOnFailure(tlvWriter.Put(TLV::ContextTag(4), firmwareInfo)); } - uint8_t vendorTagNum = 1; - for (size_t vendorReservedIdx = 0; vendorReservedIdx < vendorReservedArraySize; ++vendorReservedIdx) + const VendorReservedElement * element = vendorReserved.cbegin(); + while ((element = vendorReserved.Next()) != nullptr) { - if (!vendorReservedArray[vendorReservedIdx].empty()) - { - ReturnErrorOnFailure( - tlvWriter.Put(TLV::ProfileTag(vendorId, profileNum, vendorTagNum), vendorReservedArray[vendorReservedIdx])); - } - vendorTagNum++; + ReturnErrorOnFailure( + tlvWriter.Put(TLV::ProfileTag(element->vendorId, element->profileNum, element->tagNum), element->vendorReservedData)); } ReturnErrorOnFailure(tlvWriter.EndContainer(outerContainerType)); diff --git a/src/credentials/DeviceAttestationConstructor.h b/src/credentials/DeviceAttestationConstructor.h index 5bde9560fd01e9..84ee02b5de38e7 100644 --- a/src/credentials/DeviceAttestationConstructor.h +++ b/src/credentials/DeviceAttestationConstructor.h @@ -16,11 +16,10 @@ */ #pragma once +#include #include #include -#include - namespace chip { namespace Credentials { @@ -34,15 +33,11 @@ namespace Credentials { * @param[out] timestamp * @param[out] firmwareInfo ByteSpan containing Firmware Information data if present within attestationElements. * Empty ByteSpan if not present in attestationElements. - * @param[out] vendorReservedArray - * @param[inout] vendorReservedArraySize - * @param[out] vendorId Vendor ID fetched from Attestation Elements data. - * @param[out] profileNum Profile Number fetched from Attestation Elements data. + * @param[out] VendorReserved Placeholder to for client to examine VendorReserved elements later */ CHIP_ERROR DeconstructAttestationElements(const ByteSpan & attestationElements, ByteSpan & certificationDeclaration, ByteSpan & attestationNonce, uint32_t & timestamp, ByteSpan & firmwareInfo, - ByteSpan * vendorReservedArray, size_t & vendorReservedArraySize, uint16_t & vendorId, - uint16_t & profileNum); + DeviceAttestationVendorReservedDeconstructor & vendorReserved); /** * @brief Take each component separately and form the Attestation Elements buffer. @@ -51,17 +46,23 @@ CHIP_ERROR DeconstructAttestationElements(const ByteSpan & attestationElements, * @param[in] attestationNonce Attestation Nonce - 32 octets required. * @param[in] timestamp Timestamp data in epoch time format. * @param[in] firmwareInfo Optional Firmware Information data - Can be empty. - * @param[in] vendorReservedArray Array of Vendor Reserved entries. - * @param[in] vendorReservedArraySize Number of Vendor Reserved entries present in the array. - * @param[in] vendorId Vendor ID to be written to Vendor Reserved entries' Qualified Tags - * @param[in] profileNum Profile Number to be written to Vendor Reserved entries' Qualified Tags + * @param[in] VendorReserved Prefilled-in vendor reserved elements to be put into DA elements. * @param[out] attestationElements Buffer used to write all AttestationElements data, formed with all the data fields above. * Provided buffer needs to be capable to handle all data fields + tags. */ CHIP_ERROR ConstructAttestationElements(const ByteSpan & certificationDeclaration, const ByteSpan & attestationNonce, - uint32_t timestamp, const ByteSpan & firmwareInfo, ByteSpan * vendorReservedArray, - size_t vendorReservedArraySize, uint16_t vendorId, uint16_t profileNum, + uint32_t timestamp, const ByteSpan & firmwareInfo, + DeviceAttestationVendorReservedConstructor & vendorReserved, MutableByteSpan & attestationElements); +/*** + * @brief Count the number of VendorReservedElements in a DeviceAttestation blob + * + * @param[in] attestationElements ByeSpan conitaining source of Attestation Elements data + * @param[out] + * @returns CHIP_NO_ERROR on success + */ +CHIP_ERROR CountVendorReservedElementsInDA(const ByteSpan & attestationElements, size_t & numElements); + } // namespace Credentials } // namespace chip diff --git a/src/credentials/DeviceAttestationVendorReserved.h b/src/credentials/DeviceAttestationVendorReserved.h new file mode 100644 index 00000000000000..576ff2dfff3e22 --- /dev/null +++ b/src/credentials/DeviceAttestationVendorReserved.h @@ -0,0 +1,218 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include +#include +#include + +#include + +namespace chip { +namespace Credentials { + +struct VendorReservedElement +{ + uint16_t vendorId; + uint16_t profileNum; + uint32_t tagNum; + ByteSpan vendorReservedData; +}; + +// extract elements out of the device attestation bytespan +class DeviceAttestationVendorReservedDeconstructor +{ + +public: + DeviceAttestationVendorReservedDeconstructor() {} + + // read TLV until first profile tag + CHIP_ERROR PrepareToReadVendorReservedElements(const ByteSpan & attestationElements, size_t count) + { + mIsInitialized = false; + mNumVendorReservedData = count; + mAttestationData = attestationElements; + + mTlvReader.Init(mAttestationData); + ReturnErrorOnFailure(mTlvReader.Next(containerType, TLV::AnonymousTag)); + ReturnErrorOnFailure(mTlvReader.EnterContainer(containerType)); + + // position to first ProfileTag + while (true) + { + ReturnErrorOnFailure(mTlvReader.Next()); + if (!TLV::IsProfileTag(mTlvReader.GetTag())) + break; + } + // positioned to first context tag (vendor reserved data) + mIsInitialized = true; + return CHIP_NO_ERROR; + } + + size_t GetNumberOfElements() { return mNumVendorReservedData; } + + /** + * @brief Return next VendorReserved element. PrepareToReadVendorReservedElements must be called first. + * + * @param[out] element Next vendor Reserved element + * + * @returns CHIP_NO_ERROR on success + * CHIP_ERROR_INCORRECT_STATE if PrepareToReadVendorReservedElements hasn't been called first + * CHIP_END_OF_TLV if not further entries are present + */ + CHIP_ERROR GetNextVendorReservedElement(struct VendorReservedElement & element) + { + CHIP_ERROR err; + + VerifyOrReturnError(mIsInitialized, CHIP_ERROR_INCORRECT_STATE); + + while ((err = mTlvReader.Next()) == CHIP_NO_ERROR) + { + uint64_t tag = mTlvReader.GetTag(); + if (!TLV::IsProfileTag(tag)) + { + continue; + } + // tag is profile tag + element.vendorId = TLV::VendorIdFromTag(tag); + element.profileNum = TLV::ProfileNumFromTag(tag); + element.tagNum = TLV::TagNumFromTag(tag); + + return mTlvReader.GetByteView(element.vendorReservedData); + } + + return err; + } + +private: + size_t mNumVendorReservedData; // number of VendorReserved entries (could be 0) + ByteSpan mAttestationData; + bool mIsInitialized = false; + TLV::ContiguousBufferTLVReader mTlvReader; + TLV::TLVType containerType = TLV::kTLVType_Structure; +}; + +class DeviceAttestationVendorReservedConstructor +{ +public: + DeviceAttestationVendorReservedConstructor(struct VendorReservedElement * array, size_t size) : mElements(array), mMaxSize(size) + {} + + typedef const struct VendorReservedElement * const_iterator; + + const_iterator Next() + { + VerifyOrReturnError(mCurrentIndex < mNumEntriesUsed, nullptr); + return &mElements[mCurrentIndex++]; + } + + const_iterator cbegin() + { + // sort the array in place and return the head element. + do_sorting(); + mCurrentIndex = 0; + return mElements; + } + + CHIP_ERROR addVendorReservedElement(uint16_t vendorId, uint16_t profileNum, uint32_t tagNum, ByteSpan span) + { + if (mNumEntriesUsed == mMaxSize) + return CHIP_ERROR_NO_MEMORY; + + mElements[mNumEntriesUsed].tagNum = tagNum; + mElements[mNumEntriesUsed].profileNum = profileNum; + mElements[mNumEntriesUsed].vendorId = vendorId; + mElements[mNumEntriesUsed].vendorReservedData = span; + mNumEntriesUsed++; + return CHIP_NO_ERROR; + } + + size_t GetNumberOfElements() { return mNumEntriesUsed; } + +private: + /* + * Sort according to A.2.4 in the spec. + * Mark all sorted entries by setting used flag. + * Order is head to tail, sorted by next + * Executed when entries are about to be read + */ + void do_sorting() + { + size_t starting = 0; + + while (starting < mNumEntriesUsed) + { + uint32_t minVendor = UINT32_MAX; + + // find lowest vendorId + size_t i; + for (i = starting; i < mNumEntriesUsed; i++) + { + if (mElements[i].vendorId < minVendor) + { + minVendor = mElements[i].vendorId; + } + } + + uint32_t minProfile = UINT32_MAX; + // find lowest ProfileNum + for (i = starting; i < mNumEntriesUsed; i++) + { + if (mElements[i].vendorId == minVendor) + { + if (mElements[i].profileNum < minProfile) + minProfile = mElements[i].profileNum; + } + } + + // first lowest tagNum for this vendorId/profileNum + uint64_t minTagNum = UINT64_MAX; + size_t lowestIndex; + for (i = starting; i < mNumEntriesUsed; i++) + { + if (mElements[i].vendorId == minVendor && mElements[i].profileNum == minProfile) + { + if (mElements[i].tagNum < minTagNum) + { + minTagNum = mElements[i].tagNum; + lowestIndex = i; + } + } + } + + // lowestIndex is the element to move into elements[starting]. + if (lowestIndex != starting) + { + // + VendorReservedElement tmpElement; + + tmpElement = mElements[starting]; + mElements[starting] = mElements[lowestIndex]; + mElements[lowestIndex] = tmpElement; + } + starting++; + } + } + + VendorReservedElement * mElements; + size_t mMaxSize; // size of elements array + size_t mNumEntriesUsed = 0; // elements used + size_t mCurrentIndex; // iterating from [0...maxSize -1] +}; + +} // namespace Credentials +} // namespace chip diff --git a/src/credentials/examples/DeviceAttestationVerifierExample.cpp b/src/credentials/examples/DeviceAttestationVerifierExample.cpp index a2720012d628a6..43b42ed1fbc79a 100644 --- a/src/credentials/examples/DeviceAttestationVerifierExample.cpp +++ b/src/credentials/examples/DeviceAttestationVerifierExample.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -260,15 +261,10 @@ AttestationVerificationResult ExampleDACVerifier::VerifyAttestationInformation(c ByteSpan attestationNonceSpan; uint32_t timestampDeconstructed; ByteSpan firmwareInfoSpan; - // TODO: refactor once final vendor-specific data tags is handled. - ByteSpan vendorReservedDeconstructed[2]; - size_t vendorReservedDeconstructedSize = ArraySize(vendorReservedDeconstructed); - uint16_t vendorIdDeconstructed; - uint16_t profileNumDeconstructed; + DeviceAttestationVendorReservedDeconstructor vendorReserved; + VerifyOrReturnError(DeconstructAttestationElements(attestationInfoBuffer, certificationDeclarationSpan, attestationNonceSpan, - timestampDeconstructed, firmwareInfoSpan, vendorReservedDeconstructed, - vendorReservedDeconstructedSize, vendorIdDeconstructed, - profileNumDeconstructed) == CHIP_NO_ERROR, + timestampDeconstructed, firmwareInfoSpan, vendorReserved) == CHIP_NO_ERROR, AttestationVerificationResult::kAttestationElementsMalformed); // Verify that Nonce matches with what we sent diff --git a/src/credentials/tests/CHIPCert_test_vectors.cpp b/src/credentials/tests/CHIPCert_test_vectors.cpp index 8b6829758dcffd..efa1c74ccdc089 100644 --- a/src/credentials/tests/CHIPCert_test_vectors.cpp +++ b/src/credentials/tests/CHIPCert_test_vectors.cpp @@ -51,6 +51,7 @@ extern const uint8_t gTestCerts[] = { TestCert::kNode02_05, TestCert::kNode02_06, TestCert::kNode02_07, + TestCert::kNode02_08, }; // clang-format on @@ -93,6 +94,7 @@ CHIP_ERROR GetTestCert(uint8_t certType, BitFlags certLoadFla SELECT_CERT(Node02_05); SELECT_CERT(Node02_06); SELECT_CERT(Node02_07); + SELECT_CERT(Node02_08); #undef SELECT_CERT @@ -128,6 +130,7 @@ const char * GetTestCertName(uint8_t certType) NAME_CERT(Node02_05); NAME_CERT(Node02_06); NAME_CERT(Node02_07); + NAME_CERT(Node02_08); #undef NAME_CERT @@ -163,6 +166,7 @@ CHIP_ERROR GetTestCertPubkey(uint8_t certType, ByteSpan & pubkey) SELECT_PUBKEY(Node02_05); SELECT_PUBKEY(Node02_06); SELECT_PUBKEY(Node02_07); + SELECT_PUBKEY(Node02_08); #undef SELECT_PUBKEY @@ -201,6 +205,7 @@ CHIP_ERROR GetTestCertSKID(uint8_t certType, ByteSpan & skid) SELECT_SKID(Node02_05); SELECT_SKID(Node02_06); SELECT_SKID(Node02_07); + SELECT_SKID(Node02_08); #undef SELECT_SKID @@ -239,6 +244,7 @@ CHIP_ERROR GetTestCertAKID(uint8_t certType, ByteSpan & akid) SELECT_AKID(Node02_05); SELECT_AKID(Node02_06); SELECT_AKID(Node02_07); + SELECT_AKID(Node02_08); #undef SELECT_AKID @@ -296,7 +302,7 @@ CHIP_ERROR LoadTestCert(ChipCertificateSet & certSet, uint8_t certType, BitFlags Certificate: Data: Version: 3 (0x2) - Serial Number: 6479173750095827996 (0x59eaa632947f541c) + Serial Number: 6002248829961909524 (0x534c458273623514) Signature Algorithm: ecdsa-with-SHA256 Issuer: 1.3.6.1.4.1.37244.1.4 = CACACACA00000001 Validity @@ -307,11 +313,11 @@ CHIP_ERROR LoadTestCert(ChipCertificateSet & certSet, uint8_t certType, BitFlags Public Key Algorithm: id-ecPublicKey Public-Key: (256 bit) pub: - 04:13:53:a3:b3:ef:1d:a7:08:c4:90:80:48:01:4e: - 40:7d:59:90:ce:22:bc:4e:b3:3e:9a:5a:cb:25:a8: - 56:03:eb:a6:dc:d8:21:36:66:a4:e4:4f:5a:ca:13: - eb:76:7f:af:a7:dc:dd:dc:33:41:1f:82:a3:0b:54: - 3d:d1:d2:4b:a8 + 04:3b:88:46:0e:c9:68:7a:5d:0f:3b:4b:3b:13:fc: + d2:99:c2:f6:d5:05:1d:00:3e:e4:9c:99:24:cf:98: + f4:f7:80:eb:20:fd:37:c8:d3:58:34:7f:5f:87:d0: + 8c:32:13:e5:40:af:11:ba:b9:13:7e:49:35:4f:0c: + 5b:63:43:de:63 ASN1 OID: prime256v1 NIST CURVE: P-256 X509v3 extensions: @@ -320,110 +326,110 @@ CHIP_ERROR LoadTestCert(ChipCertificateSet & certSet, uint8_t certType, BitFlags X509v3 Key Usage: critical Certificate Sign, CRL Sign X509v3 Subject Key Identifier: - 13:AF:81:AB:37:37:4B:2E:D2:A9:64:9B:12:B7:A3:A4:28:7E:15:1D + CC:13:08:AF:82:CF:EE:50:5E:B2:3B:57:BF:E8:6A:31:16:65:53:5F X509v3 Authority Key Identifier: - keyid:13:AF:81:AB:37:37:4B:2E:D2:A9:64:9B:12:B7:A3:A4:28:7E:15:1D + keyid:CC:13:08:AF:82:CF:EE:50:5E:B2:3B:57:BF:E8:6A:31:16:65:53:5F Signature Algorithm: ecdsa-with-SHA256 - 30:45:02:20:45:81:64:46:6c:8f:19:5a:bc:0a:bb:7c:6c:b5: - a2:7a:83:f4:1d:37:f8:d5:3b:ee:c5:20:ab:d2:a0:da:05:09: - 02:21:00:b8:a7:c2:5c:04:2e:30:cf:64:dc:30:fe:33:4e:12: - 00:19:66:4e:51:50:49:13:4f:57:81:23:84:44:fc:75:31 + 30:46:02:21:00:f7:f0:09:26:90:49:4e:46:c8:b1:c5:cb:d1: + a5:08:5e:1e:65:d4:36:0f:98:e9:6c:4e:8e:49:5d:c5:e2:16: + d0:02:21:00:bf:a2:3d:8f:57:47:0d:89:fd:da:f0:3f:04:64: + b0:ae:8e:1f:95:6d:6f:67:a3:11:24:38:58:24:68:97:80:a9 -----BEGIN CERTIFICATE----- -MIIBnTCCAUOgAwIBAgIIWeqmMpR/VBwwCgYIKoZIzj0EAwIwIjEgMB4GCisGAQQB +MIIBnjCCAUOgAwIBAgIIU0xFgnNiNRQwCgYIKoZIzj0EAwIwIjEgMB4GCisGAQQB gqJ8AQQMEENBQ0FDQUNBMDAwMDAwMDEwHhcNMjAxMDE1MTQyMzQzWhcNNDAxMDE1 MTQyMzQyWjAiMSAwHgYKKwYBBAGConwBBAwQQ0FDQUNBQ0EwMDAwMDAwMTBZMBMG -ByqGSM49AgEGCCqGSM49AwEHA0IABBNTo7PvHacIxJCASAFOQH1ZkM4ivE6zPppa -yyWoVgPrptzYITZmpORPWsoT63Z/r6fc3dwzQR+CowtUPdHSS6ijYzBhMA8GA1Ud -EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBQTr4GrNzdLLtKp -ZJsSt6OkKH4VHTAfBgNVHSMEGDAWgBQTr4GrNzdLLtKpZJsSt6OkKH4VHTAKBggq -hkjOPQQDAgNIADBFAiBFgWRGbI8ZWrwKu3xstaJ6g/QdN/jVO+7FIKvSoNoFCQIh -ALinwlwELjDPZNww/jNOEgAZZk5RUEkTT1eBI4RE/HUx +ByqGSM49AgEGCCqGSM49AwEHA0IABDuIRg7JaHpdDztLOxP80pnC9tUFHQA+5JyZ +JM+Y9PeA6yD9N8jTWDR/X4fQjDIT5UCvEbq5E35JNU8MW2ND3mOjYzBhMA8GA1Ud +EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTMEwivgs/uUF6y +O1e/6GoxFmVTXzAfBgNVHSMEGDAWgBTMEwivgs/uUF6yO1e/6GoxFmVTXzAKBggq +hkjOPQQDAgNJADBGAiEA9/AJJpBJTkbIscXL0aUIXh5l1DYPmOlsTo5JXcXiFtAC +IQC/oj2PV0cNif3a8D8EZLCujh+VbW9noxEkOFgkaJeAqQ== -----END CERTIFICATE----- -----BEGIN EC PRIVATE KEY----- -MHcCAQEEIH1zW+/pFqHAygL4ypiB5CZjqq+aucQzsom+JnAQdXQaoAoGCCqGSM49 -AwEHoUQDQgAEE1Ojs+8dpwjEkIBIAU5AfVmQziK8TrM+mlrLJahWA+um3NghNmak -5E9ayhPrdn+vp9zd3DNBH4KjC1Q90dJLqA== +MHcCAQEEIPzd/ZESsw0kD2rm3ieiAp57tudDd+O3l1120j3jw2gUoAoGCCqGSM49 +AwEHoUQDQgAEO4hGDsloel0PO0s7E/zSmcL21QUdAD7knJkkz5j094DrIP03yNNY +NH9fh9CMMhPlQK8RurkTfkk1TwxbY0PeYw== -----END EC PRIVATE KEY----- */ extern const uint8_t sTestCert_Root01_Chip[] = { - 0x15, 0x30, 0x01, 0x08, 0x59, 0xea, 0xa6, 0x32, 0x94, 0x7f, 0x54, 0x1c, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, + 0x15, 0x30, 0x01, 0x08, 0x53, 0x4c, 0x45, 0x82, 0x73, 0x62, 0x35, 0x14, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, - 0x13, 0x53, 0xa3, 0xb3, 0xef, 0x1d, 0xa7, 0x08, 0xc4, 0x90, 0x80, 0x48, 0x01, 0x4e, 0x40, 0x7d, 0x59, 0x90, 0xce, 0x22, 0xbc, - 0x4e, 0xb3, 0x3e, 0x9a, 0x5a, 0xcb, 0x25, 0xa8, 0x56, 0x03, 0xeb, 0xa6, 0xdc, 0xd8, 0x21, 0x36, 0x66, 0xa4, 0xe4, 0x4f, 0x5a, - 0xca, 0x13, 0xeb, 0x76, 0x7f, 0xaf, 0xa7, 0xdc, 0xdd, 0xdc, 0x33, 0x41, 0x1f, 0x82, 0xa3, 0x0b, 0x54, 0x3d, 0xd1, 0xd2, 0x4b, - 0xa8, 0x37, 0x0a, 0x35, 0x01, 0x29, 0x01, 0x18, 0x24, 0x02, 0x60, 0x30, 0x04, 0x14, 0x13, 0xaf, 0x81, 0xab, 0x37, 0x37, 0x4b, - 0x2e, 0xd2, 0xa9, 0x64, 0x9b, 0x12, 0xb7, 0xa3, 0xa4, 0x28, 0x7e, 0x15, 0x1d, 0x30, 0x05, 0x14, 0x13, 0xaf, 0x81, 0xab, 0x37, - 0x37, 0x4b, 0x2e, 0xd2, 0xa9, 0x64, 0x9b, 0x12, 0xb7, 0xa3, 0xa4, 0x28, 0x7e, 0x15, 0x1d, 0x18, 0x30, 0x0b, 0x40, 0x45, 0x81, - 0x64, 0x46, 0x6c, 0x8f, 0x19, 0x5a, 0xbc, 0x0a, 0xbb, 0x7c, 0x6c, 0xb5, 0xa2, 0x7a, 0x83, 0xf4, 0x1d, 0x37, 0xf8, 0xd5, 0x3b, - 0xee, 0xc5, 0x20, 0xab, 0xd2, 0xa0, 0xda, 0x05, 0x09, 0xb8, 0xa7, 0xc2, 0x5c, 0x04, 0x2e, 0x30, 0xcf, 0x64, 0xdc, 0x30, 0xfe, - 0x33, 0x4e, 0x12, 0x00, 0x19, 0x66, 0x4e, 0x51, 0x50, 0x49, 0x13, 0x4f, 0x57, 0x81, 0x23, 0x84, 0x44, 0xfc, 0x75, 0x31, 0x18, + 0x3b, 0x88, 0x46, 0x0e, 0xc9, 0x68, 0x7a, 0x5d, 0x0f, 0x3b, 0x4b, 0x3b, 0x13, 0xfc, 0xd2, 0x99, 0xc2, 0xf6, 0xd5, 0x05, 0x1d, + 0x00, 0x3e, 0xe4, 0x9c, 0x99, 0x24, 0xcf, 0x98, 0xf4, 0xf7, 0x80, 0xeb, 0x20, 0xfd, 0x37, 0xc8, 0xd3, 0x58, 0x34, 0x7f, 0x5f, + 0x87, 0xd0, 0x8c, 0x32, 0x13, 0xe5, 0x40, 0xaf, 0x11, 0xba, 0xb9, 0x13, 0x7e, 0x49, 0x35, 0x4f, 0x0c, 0x5b, 0x63, 0x43, 0xde, + 0x63, 0x37, 0x0a, 0x35, 0x01, 0x29, 0x01, 0x18, 0x24, 0x02, 0x60, 0x30, 0x04, 0x14, 0xcc, 0x13, 0x08, 0xaf, 0x82, 0xcf, 0xee, + 0x50, 0x5e, 0xb2, 0x3b, 0x57, 0xbf, 0xe8, 0x6a, 0x31, 0x16, 0x65, 0x53, 0x5f, 0x30, 0x05, 0x14, 0xcc, 0x13, 0x08, 0xaf, 0x82, + 0xcf, 0xee, 0x50, 0x5e, 0xb2, 0x3b, 0x57, 0xbf, 0xe8, 0x6a, 0x31, 0x16, 0x65, 0x53, 0x5f, 0x18, 0x30, 0x0b, 0x40, 0xf7, 0xf0, + 0x09, 0x26, 0x90, 0x49, 0x4e, 0x46, 0xc8, 0xb1, 0xc5, 0xcb, 0xd1, 0xa5, 0x08, 0x5e, 0x1e, 0x65, 0xd4, 0x36, 0x0f, 0x98, 0xe9, + 0x6c, 0x4e, 0x8e, 0x49, 0x5d, 0xc5, 0xe2, 0x16, 0xd0, 0xbf, 0xa2, 0x3d, 0x8f, 0x57, 0x47, 0x0d, 0x89, 0xfd, 0xda, 0xf0, 0x3f, + 0x04, 0x64, 0xb0, 0xae, 0x8e, 0x1f, 0x95, 0x6d, 0x6f, 0x67, 0xa3, 0x11, 0x24, 0x38, 0x58, 0x24, 0x68, 0x97, 0x80, 0xa9, 0x18, }; -extern const uint32_t sTestCert_Root01_Chip_Len = sizeof(sTestCert_Root01_Chip); +extern const size_t sTestCert_Root01_Chip_Len = sizeof(sTestCert_Root01_Chip); extern const uint8_t sTestCert_Root01_DER[] = { - 0x30, 0x82, 0x01, 0x9d, 0x30, 0x82, 0x01, 0x43, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x59, 0xea, 0xa6, 0x32, 0x94, 0x7f, - 0x54, 0x1c, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, + 0x30, 0x82, 0x01, 0x9e, 0x30, 0x82, 0x01, 0x43, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x53, 0x4c, 0x45, 0x82, 0x73, 0x62, + 0x35, 0x14, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x30, 0x1e, 0x17, 0x0d, 0x32, 0x30, 0x31, 0x30, 0x31, 0x35, 0x31, 0x34, 0x32, 0x33, 0x34, 0x33, 0x5a, 0x17, 0x0d, 0x34, 0x30, 0x31, 0x30, 0x31, 0x35, 0x31, 0x34, 0x32, 0x33, 0x34, 0x32, 0x5a, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, - 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x13, 0x53, - 0xa3, 0xb3, 0xef, 0x1d, 0xa7, 0x08, 0xc4, 0x90, 0x80, 0x48, 0x01, 0x4e, 0x40, 0x7d, 0x59, 0x90, 0xce, 0x22, 0xbc, 0x4e, 0xb3, - 0x3e, 0x9a, 0x5a, 0xcb, 0x25, 0xa8, 0x56, 0x03, 0xeb, 0xa6, 0xdc, 0xd8, 0x21, 0x36, 0x66, 0xa4, 0xe4, 0x4f, 0x5a, 0xca, 0x13, - 0xeb, 0x76, 0x7f, 0xaf, 0xa7, 0xdc, 0xdd, 0xdc, 0x33, 0x41, 0x1f, 0x82, 0xa3, 0x0b, 0x54, 0x3d, 0xd1, 0xd2, 0x4b, 0xa8, 0xa3, + 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x3b, 0x88, + 0x46, 0x0e, 0xc9, 0x68, 0x7a, 0x5d, 0x0f, 0x3b, 0x4b, 0x3b, 0x13, 0xfc, 0xd2, 0x99, 0xc2, 0xf6, 0xd5, 0x05, 0x1d, 0x00, 0x3e, + 0xe4, 0x9c, 0x99, 0x24, 0xcf, 0x98, 0xf4, 0xf7, 0x80, 0xeb, 0x20, 0xfd, 0x37, 0xc8, 0xd3, 0x58, 0x34, 0x7f, 0x5f, 0x87, 0xd0, + 0x8c, 0x32, 0x13, 0xe5, 0x40, 0xaf, 0x11, 0xba, 0xb9, 0x13, 0x7e, 0x49, 0x35, 0x4f, 0x0c, 0x5b, 0x63, 0x43, 0xde, 0x63, 0xa3, 0x63, 0x30, 0x61, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x01, 0x06, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, - 0x0e, 0x04, 0x16, 0x04, 0x14, 0x13, 0xaf, 0x81, 0xab, 0x37, 0x37, 0x4b, 0x2e, 0xd2, 0xa9, 0x64, 0x9b, 0x12, 0xb7, 0xa3, 0xa4, - 0x28, 0x7e, 0x15, 0x1d, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x13, 0xaf, 0x81, 0xab, - 0x37, 0x37, 0x4b, 0x2e, 0xd2, 0xa9, 0x64, 0x9b, 0x12, 0xb7, 0xa3, 0xa4, 0x28, 0x7e, 0x15, 0x1d, 0x30, 0x0a, 0x06, 0x08, 0x2a, - 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, 0x45, 0x02, 0x20, 0x45, 0x81, 0x64, 0x46, 0x6c, 0x8f, 0x19, - 0x5a, 0xbc, 0x0a, 0xbb, 0x7c, 0x6c, 0xb5, 0xa2, 0x7a, 0x83, 0xf4, 0x1d, 0x37, 0xf8, 0xd5, 0x3b, 0xee, 0xc5, 0x20, 0xab, 0xd2, - 0xa0, 0xda, 0x05, 0x09, 0x02, 0x21, 0x00, 0xb8, 0xa7, 0xc2, 0x5c, 0x04, 0x2e, 0x30, 0xcf, 0x64, 0xdc, 0x30, 0xfe, 0x33, 0x4e, - 0x12, 0x00, 0x19, 0x66, 0x4e, 0x51, 0x50, 0x49, 0x13, 0x4f, 0x57, 0x81, 0x23, 0x84, 0x44, 0xfc, 0x75, 0x31, + 0x0e, 0x04, 0x16, 0x04, 0x14, 0xcc, 0x13, 0x08, 0xaf, 0x82, 0xcf, 0xee, 0x50, 0x5e, 0xb2, 0x3b, 0x57, 0xbf, 0xe8, 0x6a, 0x31, + 0x16, 0x65, 0x53, 0x5f, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xcc, 0x13, 0x08, 0xaf, + 0x82, 0xcf, 0xee, 0x50, 0x5e, 0xb2, 0x3b, 0x57, 0xbf, 0xe8, 0x6a, 0x31, 0x16, 0x65, 0x53, 0x5f, 0x30, 0x0a, 0x06, 0x08, 0x2a, + 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x49, 0x00, 0x30, 0x46, 0x02, 0x21, 0x00, 0xf7, 0xf0, 0x09, 0x26, 0x90, 0x49, + 0x4e, 0x46, 0xc8, 0xb1, 0xc5, 0xcb, 0xd1, 0xa5, 0x08, 0x5e, 0x1e, 0x65, 0xd4, 0x36, 0x0f, 0x98, 0xe9, 0x6c, 0x4e, 0x8e, 0x49, + 0x5d, 0xc5, 0xe2, 0x16, 0xd0, 0x02, 0x21, 0x00, 0xbf, 0xa2, 0x3d, 0x8f, 0x57, 0x47, 0x0d, 0x89, 0xfd, 0xda, 0xf0, 0x3f, 0x04, + 0x64, 0xb0, 0xae, 0x8e, 0x1f, 0x95, 0x6d, 0x6f, 0x67, 0xa3, 0x11, 0x24, 0x38, 0x58, 0x24, 0x68, 0x97, 0x80, 0xa9, }; -extern const uint32_t sTestCert_Root01_DER_Len = sizeof(sTestCert_Root01_DER); +extern const size_t sTestCert_Root01_DER_Len = sizeof(sTestCert_Root01_DER); extern const uint8_t sTestCert_Root01_PublicKey[] = { - 0x04, 0x13, 0x53, 0xa3, 0xb3, 0xef, 0x1d, 0xa7, 0x08, 0xc4, 0x90, 0x80, 0x48, 0x01, 0x4e, 0x40, 0x7d, - 0x59, 0x90, 0xce, 0x22, 0xbc, 0x4e, 0xb3, 0x3e, 0x9a, 0x5a, 0xcb, 0x25, 0xa8, 0x56, 0x03, 0xeb, 0xa6, - 0xdc, 0xd8, 0x21, 0x36, 0x66, 0xa4, 0xe4, 0x4f, 0x5a, 0xca, 0x13, 0xeb, 0x76, 0x7f, 0xaf, 0xa7, 0xdc, - 0xdd, 0xdc, 0x33, 0x41, 0x1f, 0x82, 0xa3, 0x0b, 0x54, 0x3d, 0xd1, 0xd2, 0x4b, 0xa8, + 0x04, 0x3b, 0x88, 0x46, 0x0e, 0xc9, 0x68, 0x7a, 0x5d, 0x0f, 0x3b, 0x4b, 0x3b, 0x13, 0xfc, 0xd2, 0x99, + 0xc2, 0xf6, 0xd5, 0x05, 0x1d, 0x00, 0x3e, 0xe4, 0x9c, 0x99, 0x24, 0xcf, 0x98, 0xf4, 0xf7, 0x80, 0xeb, + 0x20, 0xfd, 0x37, 0xc8, 0xd3, 0x58, 0x34, 0x7f, 0x5f, 0x87, 0xd0, 0x8c, 0x32, 0x13, 0xe5, 0x40, 0xaf, + 0x11, 0xba, 0xb9, 0x13, 0x7e, 0x49, 0x35, 0x4f, 0x0c, 0x5b, 0x63, 0x43, 0xde, 0x63, }; -extern const uint8_t sTestCert_Root01_PublicKey_Len = sizeof(sTestCert_Root01_PublicKey); +extern const size_t sTestCert_Root01_PublicKey_Len = sizeof(sTestCert_Root01_PublicKey); extern const uint8_t sTestCert_Root01_PrivateKey[] = { - 0x7d, 0x73, 0x5b, 0xef, 0xe9, 0x16, 0xa1, 0xc0, 0xca, 0x02, 0xf8, 0xca, 0x98, 0x81, 0xe4, 0x26, - 0x63, 0xaa, 0xaf, 0x9a, 0xb9, 0xc4, 0x33, 0xb2, 0x89, 0xbe, 0x26, 0x70, 0x10, 0x75, 0x74, 0x1a, + 0xfc, 0xdd, 0xfd, 0x91, 0x12, 0xb3, 0x0d, 0x24, 0x0f, 0x6a, 0xe6, 0xde, 0x27, 0xa2, 0x02, 0x9e, + 0x7b, 0xb6, 0xe7, 0x43, 0x77, 0xe3, 0xb7, 0x97, 0x5d, 0x76, 0xd2, 0x3d, 0xe3, 0xc3, 0x68, 0x14, }; -extern const uint8_t sTestCert_Root01_PrivateKey_Len = sizeof(sTestCert_Root01_PrivateKey); +extern const size_t sTestCert_Root01_PrivateKey_Len = sizeof(sTestCert_Root01_PrivateKey); extern const uint8_t sTestCert_Root01_SubjectKeyId[] = { - 0x13, 0xAF, 0x81, 0xAB, 0x37, 0x37, 0x4B, 0x2E, 0xD2, 0xA9, 0x64, 0x9B, 0x12, 0xB7, 0xA3, 0xA4, 0x28, 0x7E, 0x15, 0x1D, + 0xCC, 0x13, 0x08, 0xAF, 0x82, 0xCF, 0xEE, 0x50, 0x5E, 0xB2, 0x3B, 0x57, 0xBF, 0xE8, 0x6A, 0x31, 0x16, 0x65, 0x53, 0x5F, }; -extern const uint8_t sTestCert_Root01_SubjectKeyId_Len = sizeof(sTestCert_Root01_SubjectKeyId); +extern const size_t sTestCert_Root01_SubjectKeyId_Len = sizeof(sTestCert_Root01_SubjectKeyId); extern const uint8_t sTestCert_Root01_AuthorityKeyId[] = { - 0x13, 0xAF, 0x81, 0xAB, 0x37, 0x37, 0x4B, 0x2E, 0xD2, 0xA9, 0x64, 0x9B, 0x12, 0xB7, 0xA3, 0xA4, 0x28, 0x7E, 0x15, 0x1D, + 0xCC, 0x13, 0x08, 0xAF, 0x82, 0xCF, 0xEE, 0x50, 0x5E, 0xB2, 0x3B, 0x57, 0xBF, 0xE8, 0x6A, 0x31, 0x16, 0x65, 0x53, 0x5F, }; -extern const uint8_t sTestCert_Root01_AuthorityKeyId_Len = sizeof(sTestCert_Root01_AuthorityKeyId); +extern const size_t sTestCert_Root01_AuthorityKeyId_Len = sizeof(sTestCert_Root01_AuthorityKeyId); /************** Test Root02 Certificate ************** Certificate: Data: Version: 3 (0x2) - Serial Number: 5356538228357938904 (0x4a563f2377133ed8) + Serial Number: 6921238115407929496 (0x600d2d654ac8a098) Signature Algorithm: ecdsa-with-SHA256 Issuer: 1.3.6.1.4.1.37244.1.4 = CACACACA00000002, 1.3.6.1.4.1.37244.1.5 = FAB000000000001D Validity @@ -434,11 +440,11 @@ extern const uint8_t sTestCert_Root01_AuthorityKeyId_Len = sizeof(sTestCert_Root Public Key Algorithm: id-ecPublicKey Public-Key: (256 bit) pub: - 04:6e:96:30:68:98:89:f6:06:b2:54:4f:0e:00:21: - e4:be:70:36:0c:3f:77:d0:33:be:50:6d:bc:64:63: - 81:0f:9a:7a:1c:ef:d2:ed:e1:d0:06:56:ee:07:63: - aa:c5:03:e8:b2:40:ac:76:32:0c:75:35:c8:7f:dc: - f3:91:d7:21:32 + 04:27:50:0b:20:60:52:ce:33:77:6c:63:08:3f:1c: + f1:03:6e:a4:cc:7f:fd:61:7c:17:6d:4c:ad:f5:51: + bb:b4:b0:d9:97:ca:e5:55:db:f9:bc:a8:56:e4:cc: + 7a:8e:de:91:e0:a7:33:e1:67:c0:41:67:a6:c2:c9: + fa:48:f1:4f:0b ASN1 OID: prime256v1 NIST CURVE: P-256 X509v3 extensions: @@ -447,59 +453,59 @@ extern const uint8_t sTestCert_Root01_AuthorityKeyId_Len = sizeof(sTestCert_Root X509v3 Key Usage: critical Certificate Sign, CRL Sign X509v3 Subject Key Identifier: - B2:1B:EA:40:AB:F2:AB:A9:56:F9:82:E1:DA:D2:B6:06:92:06:90:E0 + 62:BE:B9:67:1C:91:C3:55:C8:6F:06:FA:6C:08:80:14:51:E1:A0:EA X509v3 Authority Key Identifier: - keyid:B2:1B:EA:40:AB:F2:AB:A9:56:F9:82:E1:DA:D2:B6:06:92:06:90:E0 + keyid:62:BE:B9:67:1C:91:C3:55:C8:6F:06:FA:6C:08:80:14:51:E1:A0:EA Signature Algorithm: ecdsa-with-SHA256 - 30:46:02:21:00:86:89:d7:3a:c2:e0:04:b7:0f:a4:05:91:ca: - b3:b9:79:47:c4:c6:92:cb:97:6c:53:9c:f3:76:06:53:a5:a4: - dd:02:21:00:87:cf:49:39:32:df:cd:49:8c:a0:bc:c4:93:9b: - b2:7d:76:ac:3d:de:67:2c:25:cb:34:7a:4f:de:9f:dc:f3:cb + 30:46:02:21:00:b7:e7:6c:d3:95:be:d1:21:51:2f:10:f7:2a: + 7a:b1:5a:91:60:b7:f0:38:6c:e8:19:36:d1:5a:cd:19:c8:c0: + 4a:02:21:00:d1:9d:3e:b5:c7:ea:f1:a5:cb:06:43:bb:67:68: + 54:02:e2:ff:1e:65:80:bc:c5:2c:2b:03:a3:b6:a4:92:00:5e -----BEGIN CERTIFICATE----- -MIIB5TCCAYqgAwIBAgIISlY/I3cTPtgwCgYIKoZIzj0EAwIwRDEgMB4GCisGAQQB +MIIB5TCCAYqgAwIBAgIIYA0tZUrIoJgwCgYIKoZIzj0EAwIwRDEgMB4GCisGAQQB gqJ8AQQMEENBQ0FDQUNBMDAwMDAwMDIxIDAeBgorBgEEAYKifAEFDBBGQUIwMDAw MDAwMDAwMDFEMB4XDTIwMTAxNTE0MjM0M1oXDTQwMTAxNTE0MjM0MlowRDEgMB4G CisGAQQBgqJ8AQQMEENBQ0FDQUNBMDAwMDAwMDIxIDAeBgorBgEEAYKifAEFDBBG -QUIwMDAwMDAwMDAwMDFEMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEbpYwaJiJ -9gayVE8OACHkvnA2DD930DO+UG28ZGOBD5p6HO/S7eHQBlbuB2OqxQPoskCsdjIM -dTXIf9zzkdchMqNmMGQwEgYDVR0TAQH/BAgwBgEB/wIBATAOBgNVHQ8BAf8EBAMC -AQYwHQYDVR0OBBYEFLIb6kCr8qupVvmC4drStgaSBpDgMB8GA1UdIwQYMBaAFLIb -6kCr8qupVvmC4drStgaSBpDgMAoGCCqGSM49BAMCA0kAMEYCIQCGidc6wuAEtw+k -BZHKs7l5R8TGksuXbFOc83YGU6Wk3QIhAIfPSTky381JjKC8xJObsn12rD3eZywl -yzR6T96f3PPL +QUIwMDAwMDAwMDAwMDFEMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEJ1ALIGBS +zjN3bGMIPxzxA26kzH/9YXwXbUyt9VG7tLDZl8rlVdv5vKhW5Mx6jt6R4Kcz4WfA +QWemwsn6SPFPC6NmMGQwEgYDVR0TAQH/BAgwBgEB/wIBATAOBgNVHQ8BAf8EBAMC +AQYwHQYDVR0OBBYEFGK+uWcckcNVyG8G+mwIgBRR4aDqMB8GA1UdIwQYMBaAFGK+ +uWcckcNVyG8G+mwIgBRR4aDqMAoGCCqGSM49BAMCA0kAMEYCIQC352zTlb7RIVEv +EPcqerFakWC38Dhs6Bk20VrNGcjASgIhANGdPrXH6vGlywZDu2doVALi/x5lgLzF +LCsDo7akkgBe -----END CERTIFICATE----- -----BEGIN EC PRIVATE KEY----- -MHcCAQEEIPZLkcRw3jaaTSEexd9ohQszl851s9gtPlaTqxwJdlUeoAoGCCqGSM49 -AwEHoUQDQgAEbpYwaJiJ9gayVE8OACHkvnA2DD930DO+UG28ZGOBD5p6HO/S7eHQ -BlbuB2OqxQPoskCsdjIMdTXIf9zzkdchMg== +MHcCAQEEIPm3IofWpI3VEJPEEuYbQ6/hIhUolnG/M5b/l/a2IbKsoAoGCCqGSM49 +AwEHoUQDQgAEJ1ALIGBSzjN3bGMIPxzxA26kzH/9YXwXbUyt9VG7tLDZl8rlVdv5 +vKhW5Mx6jt6R4Kcz4WfAQWemwsn6SPFPCw== -----END EC PRIVATE KEY----- */ extern const uint8_t sTestCert_Root02_Chip[] = { - 0x15, 0x30, 0x01, 0x08, 0x4a, 0x56, 0x3f, 0x23, 0x77, 0x13, 0x3e, 0xd8, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x02, + 0x15, 0x30, 0x01, 0x08, 0x60, 0x0d, 0x2d, 0x65, 0x4a, 0xc8, 0xa0, 0x98, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x02, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x14, 0x02, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, - 0x09, 0x41, 0x04, 0x6e, 0x96, 0x30, 0x68, 0x98, 0x89, 0xf6, 0x06, 0xb2, 0x54, 0x4f, 0x0e, 0x00, 0x21, 0xe4, 0xbe, 0x70, - 0x36, 0x0c, 0x3f, 0x77, 0xd0, 0x33, 0xbe, 0x50, 0x6d, 0xbc, 0x64, 0x63, 0x81, 0x0f, 0x9a, 0x7a, 0x1c, 0xef, 0xd2, 0xed, - 0xe1, 0xd0, 0x06, 0x56, 0xee, 0x07, 0x63, 0xaa, 0xc5, 0x03, 0xe8, 0xb2, 0x40, 0xac, 0x76, 0x32, 0x0c, 0x75, 0x35, 0xc8, - 0x7f, 0xdc, 0xf3, 0x91, 0xd7, 0x21, 0x32, 0x37, 0x0a, 0x35, 0x01, 0x29, 0x01, 0x24, 0x02, 0x01, 0x18, 0x24, 0x02, 0x60, - 0x30, 0x04, 0x14, 0xb2, 0x1b, 0xea, 0x40, 0xab, 0xf2, 0xab, 0xa9, 0x56, 0xf9, 0x82, 0xe1, 0xda, 0xd2, 0xb6, 0x06, 0x92, - 0x06, 0x90, 0xe0, 0x30, 0x05, 0x14, 0xb2, 0x1b, 0xea, 0x40, 0xab, 0xf2, 0xab, 0xa9, 0x56, 0xf9, 0x82, 0xe1, 0xda, 0xd2, - 0xb6, 0x06, 0x92, 0x06, 0x90, 0xe0, 0x18, 0x30, 0x0b, 0x40, 0x86, 0x89, 0xd7, 0x3a, 0xc2, 0xe0, 0x04, 0xb7, 0x0f, 0xa4, - 0x05, 0x91, 0xca, 0xb3, 0xb9, 0x79, 0x47, 0xc4, 0xc6, 0x92, 0xcb, 0x97, 0x6c, 0x53, 0x9c, 0xf3, 0x76, 0x06, 0x53, 0xa5, - 0xa4, 0xdd, 0x87, 0xcf, 0x49, 0x39, 0x32, 0xdf, 0xcd, 0x49, 0x8c, 0xa0, 0xbc, 0xc4, 0x93, 0x9b, 0xb2, 0x7d, 0x76, 0xac, - 0x3d, 0xde, 0x67, 0x2c, 0x25, 0xcb, 0x34, 0x7a, 0x4f, 0xde, 0x9f, 0xdc, 0xf3, 0xcb, 0x18, + 0x09, 0x41, 0x04, 0x27, 0x50, 0x0b, 0x20, 0x60, 0x52, 0xce, 0x33, 0x77, 0x6c, 0x63, 0x08, 0x3f, 0x1c, 0xf1, 0x03, 0x6e, + 0xa4, 0xcc, 0x7f, 0xfd, 0x61, 0x7c, 0x17, 0x6d, 0x4c, 0xad, 0xf5, 0x51, 0xbb, 0xb4, 0xb0, 0xd9, 0x97, 0xca, 0xe5, 0x55, + 0xdb, 0xf9, 0xbc, 0xa8, 0x56, 0xe4, 0xcc, 0x7a, 0x8e, 0xde, 0x91, 0xe0, 0xa7, 0x33, 0xe1, 0x67, 0xc0, 0x41, 0x67, 0xa6, + 0xc2, 0xc9, 0xfa, 0x48, 0xf1, 0x4f, 0x0b, 0x37, 0x0a, 0x35, 0x01, 0x29, 0x01, 0x24, 0x02, 0x01, 0x18, 0x24, 0x02, 0x60, + 0x30, 0x04, 0x14, 0x62, 0xbe, 0xb9, 0x67, 0x1c, 0x91, 0xc3, 0x55, 0xc8, 0x6f, 0x06, 0xfa, 0x6c, 0x08, 0x80, 0x14, 0x51, + 0xe1, 0xa0, 0xea, 0x30, 0x05, 0x14, 0x62, 0xbe, 0xb9, 0x67, 0x1c, 0x91, 0xc3, 0x55, 0xc8, 0x6f, 0x06, 0xfa, 0x6c, 0x08, + 0x80, 0x14, 0x51, 0xe1, 0xa0, 0xea, 0x18, 0x30, 0x0b, 0x40, 0xb7, 0xe7, 0x6c, 0xd3, 0x95, 0xbe, 0xd1, 0x21, 0x51, 0x2f, + 0x10, 0xf7, 0x2a, 0x7a, 0xb1, 0x5a, 0x91, 0x60, 0xb7, 0xf0, 0x38, 0x6c, 0xe8, 0x19, 0x36, 0xd1, 0x5a, 0xcd, 0x19, 0xc8, + 0xc0, 0x4a, 0xd1, 0x9d, 0x3e, 0xb5, 0xc7, 0xea, 0xf1, 0xa5, 0xcb, 0x06, 0x43, 0xbb, 0x67, 0x68, 0x54, 0x02, 0xe2, 0xff, + 0x1e, 0x65, 0x80, 0xbc, 0xc5, 0x2c, 0x2b, 0x03, 0xa3, 0xb6, 0xa4, 0x92, 0x00, 0x5e, 0x18, }; -extern const uint32_t sTestCert_Root02_Chip_Len = sizeof(sTestCert_Root02_Chip); +extern const size_t sTestCert_Root02_Chip_Len = sizeof(sTestCert_Root02_Chip); extern const uint8_t sTestCert_Root02_DER[] = { - 0x30, 0x82, 0x01, 0xe5, 0x30, 0x82, 0x01, 0x8a, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x4a, 0x56, 0x3f, 0x23, 0x77, 0x13, - 0x3e, 0xd8, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, + 0x30, 0x82, 0x01, 0xe5, 0x30, 0x82, 0x01, 0x8a, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x60, 0x0d, 0x2d, 0x65, 0x4a, 0xc8, + 0xa0, 0x98, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x05, 0x0c, 0x10, 0x46, 0x41, 0x42, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x44, @@ -509,56 +515,56 @@ extern const uint8_t sTestCert_Root02_DER[] = { 0x30, 0x30, 0x30, 0x30, 0x32, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x05, 0x0c, 0x10, 0x46, 0x41, 0x42, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x44, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, - 0x42, 0x00, 0x04, 0x6e, 0x96, 0x30, 0x68, 0x98, 0x89, 0xf6, 0x06, 0xb2, 0x54, 0x4f, 0x0e, 0x00, 0x21, 0xe4, 0xbe, 0x70, 0x36, - 0x0c, 0x3f, 0x77, 0xd0, 0x33, 0xbe, 0x50, 0x6d, 0xbc, 0x64, 0x63, 0x81, 0x0f, 0x9a, 0x7a, 0x1c, 0xef, 0xd2, 0xed, 0xe1, 0xd0, - 0x06, 0x56, 0xee, 0x07, 0x63, 0xaa, 0xc5, 0x03, 0xe8, 0xb2, 0x40, 0xac, 0x76, 0x32, 0x0c, 0x75, 0x35, 0xc8, 0x7f, 0xdc, 0xf3, - 0x91, 0xd7, 0x21, 0x32, 0xa3, 0x66, 0x30, 0x64, 0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x08, 0x30, + 0x42, 0x00, 0x04, 0x27, 0x50, 0x0b, 0x20, 0x60, 0x52, 0xce, 0x33, 0x77, 0x6c, 0x63, 0x08, 0x3f, 0x1c, 0xf1, 0x03, 0x6e, 0xa4, + 0xcc, 0x7f, 0xfd, 0x61, 0x7c, 0x17, 0x6d, 0x4c, 0xad, 0xf5, 0x51, 0xbb, 0xb4, 0xb0, 0xd9, 0x97, 0xca, 0xe5, 0x55, 0xdb, 0xf9, + 0xbc, 0xa8, 0x56, 0xe4, 0xcc, 0x7a, 0x8e, 0xde, 0x91, 0xe0, 0xa7, 0x33, 0xe1, 0x67, 0xc0, 0x41, 0x67, 0xa6, 0xc2, 0xc9, 0xfa, + 0x48, 0xf1, 0x4f, 0x0b, 0xa3, 0x66, 0x30, 0x64, 0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x08, 0x30, 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x01, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, - 0x01, 0x06, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xb2, 0x1b, 0xea, 0x40, 0xab, 0xf2, 0xab, 0xa9, - 0x56, 0xf9, 0x82, 0xe1, 0xda, 0xd2, 0xb6, 0x06, 0x92, 0x06, 0x90, 0xe0, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, - 0x30, 0x16, 0x80, 0x14, 0xb2, 0x1b, 0xea, 0x40, 0xab, 0xf2, 0xab, 0xa9, 0x56, 0xf9, 0x82, 0xe1, 0xda, 0xd2, 0xb6, 0x06, 0x92, - 0x06, 0x90, 0xe0, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x49, 0x00, 0x30, 0x46, 0x02, - 0x21, 0x00, 0x86, 0x89, 0xd7, 0x3a, 0xc2, 0xe0, 0x04, 0xb7, 0x0f, 0xa4, 0x05, 0x91, 0xca, 0xb3, 0xb9, 0x79, 0x47, 0xc4, 0xc6, - 0x92, 0xcb, 0x97, 0x6c, 0x53, 0x9c, 0xf3, 0x76, 0x06, 0x53, 0xa5, 0xa4, 0xdd, 0x02, 0x21, 0x00, 0x87, 0xcf, 0x49, 0x39, 0x32, - 0xdf, 0xcd, 0x49, 0x8c, 0xa0, 0xbc, 0xc4, 0x93, 0x9b, 0xb2, 0x7d, 0x76, 0xac, 0x3d, 0xde, 0x67, 0x2c, 0x25, 0xcb, 0x34, 0x7a, - 0x4f, 0xde, 0x9f, 0xdc, 0xf3, 0xcb, + 0x01, 0x06, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x62, 0xbe, 0xb9, 0x67, 0x1c, 0x91, 0xc3, 0x55, + 0xc8, 0x6f, 0x06, 0xfa, 0x6c, 0x08, 0x80, 0x14, 0x51, 0xe1, 0xa0, 0xea, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, + 0x30, 0x16, 0x80, 0x14, 0x62, 0xbe, 0xb9, 0x67, 0x1c, 0x91, 0xc3, 0x55, 0xc8, 0x6f, 0x06, 0xfa, 0x6c, 0x08, 0x80, 0x14, 0x51, + 0xe1, 0xa0, 0xea, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x49, 0x00, 0x30, 0x46, 0x02, + 0x21, 0x00, 0xb7, 0xe7, 0x6c, 0xd3, 0x95, 0xbe, 0xd1, 0x21, 0x51, 0x2f, 0x10, 0xf7, 0x2a, 0x7a, 0xb1, 0x5a, 0x91, 0x60, 0xb7, + 0xf0, 0x38, 0x6c, 0xe8, 0x19, 0x36, 0xd1, 0x5a, 0xcd, 0x19, 0xc8, 0xc0, 0x4a, 0x02, 0x21, 0x00, 0xd1, 0x9d, 0x3e, 0xb5, 0xc7, + 0xea, 0xf1, 0xa5, 0xcb, 0x06, 0x43, 0xbb, 0x67, 0x68, 0x54, 0x02, 0xe2, 0xff, 0x1e, 0x65, 0x80, 0xbc, 0xc5, 0x2c, 0x2b, 0x03, + 0xa3, 0xb6, 0xa4, 0x92, 0x00, 0x5e, }; -extern const uint32_t sTestCert_Root02_DER_Len = sizeof(sTestCert_Root02_DER); +extern const size_t sTestCert_Root02_DER_Len = sizeof(sTestCert_Root02_DER); extern const uint8_t sTestCert_Root02_PublicKey[] = { - 0x04, 0x6e, 0x96, 0x30, 0x68, 0x98, 0x89, 0xf6, 0x06, 0xb2, 0x54, 0x4f, 0x0e, 0x00, 0x21, 0xe4, 0xbe, - 0x70, 0x36, 0x0c, 0x3f, 0x77, 0xd0, 0x33, 0xbe, 0x50, 0x6d, 0xbc, 0x64, 0x63, 0x81, 0x0f, 0x9a, 0x7a, - 0x1c, 0xef, 0xd2, 0xed, 0xe1, 0xd0, 0x06, 0x56, 0xee, 0x07, 0x63, 0xaa, 0xc5, 0x03, 0xe8, 0xb2, 0x40, - 0xac, 0x76, 0x32, 0x0c, 0x75, 0x35, 0xc8, 0x7f, 0xdc, 0xf3, 0x91, 0xd7, 0x21, 0x32, + 0x04, 0x27, 0x50, 0x0b, 0x20, 0x60, 0x52, 0xce, 0x33, 0x77, 0x6c, 0x63, 0x08, 0x3f, 0x1c, 0xf1, 0x03, + 0x6e, 0xa4, 0xcc, 0x7f, 0xfd, 0x61, 0x7c, 0x17, 0x6d, 0x4c, 0xad, 0xf5, 0x51, 0xbb, 0xb4, 0xb0, 0xd9, + 0x97, 0xca, 0xe5, 0x55, 0xdb, 0xf9, 0xbc, 0xa8, 0x56, 0xe4, 0xcc, 0x7a, 0x8e, 0xde, 0x91, 0xe0, 0xa7, + 0x33, 0xe1, 0x67, 0xc0, 0x41, 0x67, 0xa6, 0xc2, 0xc9, 0xfa, 0x48, 0xf1, 0x4f, 0x0b, }; -extern const uint8_t sTestCert_Root02_PublicKey_Len = sizeof(sTestCert_Root02_PublicKey); +extern const size_t sTestCert_Root02_PublicKey_Len = sizeof(sTestCert_Root02_PublicKey); extern const uint8_t sTestCert_Root02_PrivateKey[] = { - 0xf6, 0x4b, 0x91, 0xc4, 0x70, 0xde, 0x36, 0x9a, 0x4d, 0x21, 0x1e, 0xc5, 0xdf, 0x68, 0x85, 0x0b, - 0x33, 0x97, 0xce, 0x75, 0xb3, 0xd8, 0x2d, 0x3e, 0x56, 0x93, 0xab, 0x1c, 0x09, 0x76, 0x55, 0x1e, + 0xf9, 0xb7, 0x22, 0x87, 0xd6, 0xa4, 0x8d, 0xd5, 0x10, 0x93, 0xc4, 0x12, 0xe6, 0x1b, 0x43, 0xaf, + 0xe1, 0x22, 0x15, 0x28, 0x96, 0x71, 0xbf, 0x33, 0x96, 0xff, 0x97, 0xf6, 0xb6, 0x21, 0xb2, 0xac, }; -extern const uint8_t sTestCert_Root02_PrivateKey_Len = sizeof(sTestCert_Root02_PrivateKey); +extern const size_t sTestCert_Root02_PrivateKey_Len = sizeof(sTestCert_Root02_PrivateKey); extern const uint8_t sTestCert_Root02_SubjectKeyId[] = { - 0xB2, 0x1B, 0xEA, 0x40, 0xAB, 0xF2, 0xAB, 0xA9, 0x56, 0xF9, 0x82, 0xE1, 0xDA, 0xD2, 0xB6, 0x06, 0x92, 0x06, 0x90, 0xE0, + 0x62, 0xBE, 0xB9, 0x67, 0x1C, 0x91, 0xC3, 0x55, 0xC8, 0x6F, 0x06, 0xFA, 0x6C, 0x08, 0x80, 0x14, 0x51, 0xE1, 0xA0, 0xEA, }; -extern const uint8_t sTestCert_Root02_SubjectKeyId_Len = sizeof(sTestCert_Root02_SubjectKeyId); +extern const size_t sTestCert_Root02_SubjectKeyId_Len = sizeof(sTestCert_Root02_SubjectKeyId); extern const uint8_t sTestCert_Root02_AuthorityKeyId[] = { - 0xB2, 0x1B, 0xEA, 0x40, 0xAB, 0xF2, 0xAB, 0xA9, 0x56, 0xF9, 0x82, 0xE1, 0xDA, 0xD2, 0xB6, 0x06, 0x92, 0x06, 0x90, 0xE0, + 0x62, 0xBE, 0xB9, 0x67, 0x1C, 0x91, 0xC3, 0x55, 0xC8, 0x6F, 0x06, 0xFA, 0x6C, 0x08, 0x80, 0x14, 0x51, 0xE1, 0xA0, 0xEA, }; -extern const uint8_t sTestCert_Root02_AuthorityKeyId_Len = sizeof(sTestCert_Root02_AuthorityKeyId); +extern const size_t sTestCert_Root02_AuthorityKeyId_Len = sizeof(sTestCert_Root02_AuthorityKeyId); /************** Test ICA01 Certificate ************** Certificate: Data: Version: 3 (0x2) - Serial Number: 3293332566983159519 (0x2db444855641aedf) + Serial Number: 7626963124938903389 (0x69d86a8d80fc8f5d) Signature Algorithm: ecdsa-with-SHA256 Issuer: 1.3.6.1.4.1.37244.1.4 = CACACACA00000001 Validity @@ -569,11 +575,11 @@ extern const uint8_t sTestCert_Root02_AuthorityKeyId_Len = sizeof(sTestCert_Root Public Key Algorithm: id-ecPublicKey Public-Key: (256 bit) pub: - 04:c5:d0:86:1b:b8:f9:0c:40:5c:12:31:4e:4c:5e: - be:ea:93:9f:72:77:4b:cc:33:23:9e:2f:59:f6:f4: - 6a:f8:dc:7d:46:82:a0:e3:cc:c6:46:e6:df:29:ea: - 86:bf:56:2a:e7:20:a8:98:33:7d:38:3f:32:c0:a0: - 9e:41:60:19:ea + 04:5f:94:f5:7e:0b:13:c9:cf:cf:96:df:e1:fc:e7: + 88:8d:56:4c:c2:09:c5:5c:45:08:e4:4d:cf:16:ba: + 2e:09:66:2f:9e:ec:f1:9f:40:b0:e8:8a:0b:28:15: + da:9e:e1:0a:3a:17:7c:25:1f:43:4f:5b:0f:26:3c: + e7:de:62:78:c6 ASN1 OID: prime256v1 NIST CURVE: P-256 X509v3 extensions: @@ -582,110 +588,110 @@ extern const uint8_t sTestCert_Root02_AuthorityKeyId_Len = sizeof(sTestCert_Root X509v3 Key Usage: critical Certificate Sign, CRL Sign X509v3 Subject Key Identifier: - 53:52:D7:05:9E:9C:15:A5:08:90:68:62:86:48:01:A2:9F:1F:41:D3 + 44:0C:C6:92:31:C4:CB:5B:37:94:24:26:F8:1B:BE:24:B7:EF:34:5C X509v3 Authority Key Identifier: - keyid:13:AF:81:AB:37:37:4B:2E:D2:A9:64:9B:12:B7:A3:A4:28:7E:15:1D + keyid:CC:13:08:AF:82:CF:EE:50:5E:B2:3B:57:BF:E8:6A:31:16:65:53:5F Signature Algorithm: ecdsa-with-SHA256 - 30:45:02:21:00:84:1a:06:d4:3b:5e:9f:ec:d2:4e:87:b1:24: - 4e:b5:1c:6a:2c:f2:0d:9b:5e:6b:a0:7f:11:e6:00:2f:7e:0c: - a3:02:20:4e:32:a6:02:c3:60:9d:00:92:d3:48:bd:bd:19:8a: - 11:46:46:bd:41:cf:10:37:83:64:1a:e2:5e:3f:23:fd:26 + 30:45:02:21:00:ad:b8:5b:5d:68:cb:fd:36:14:0d:8c:9d:12: + 90:14:c4:5f:a7:ca:19:1f:34:d9:af:24:1d:b7:17:36:e6:0f: + 44:02:20:19:9b:c0:7c:7f:79:5b:ed:81:a2:e7:7d:c5:34:25: + 76:f6:a0:d1:41:98:f4:6b:91:07:49:42:7c:2e:ed:65:9c -----BEGIN CERTIFICATE----- -MIIBnTCCAUOgAwIBAgIILbREhVZBrt8wCgYIKoZIzj0EAwIwIjEgMB4GCisGAQQB +MIIBnTCCAUOgAwIBAgIIadhqjYD8j10wCgYIKoZIzj0EAwIwIjEgMB4GCisGAQQB gqJ8AQQMEENBQ0FDQUNBMDAwMDAwMDEwHhcNMjAxMDE1MTQyMzQzWhcNNDAxMDE1 MTQyMzQyWjAiMSAwHgYKKwYBBAGConwBAwwQQ0FDQUNBQ0EwMDAwMDAwMzBZMBMG -ByqGSM49AgEGCCqGSM49AwEHA0IABMXQhhu4+QxAXBIxTkxevuqTn3J3S8wzI54v -Wfb0avjcfUaCoOPMxkbm3ynqhr9WKucgqJgzfTg/MsCgnkFgGeqjYzBhMA8GA1Ud -EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRTUtcFnpwVpQiQ -aGKGSAGinx9B0zAfBgNVHSMEGDAWgBQTr4GrNzdLLtKpZJsSt6OkKH4VHTAKBggq -hkjOPQQDAgNIADBFAiEAhBoG1Dten+zSToexJE61HGos8g2bXmugfxHmAC9+DKMC -IE4ypgLDYJ0AktNIvb0ZihFGRr1BzxA3g2Qa4l4/I/0m +ByqGSM49AgEGCCqGSM49AwEHA0IABF+U9X4LE8nPz5bf4fzniI1WTMIJxVxFCORN +zxa6LglmL57s8Z9AsOiKCygV2p7hCjoXfCUfQ09bDyY8595ieMajYzBhMA8GA1Ud +EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBREDMaSMcTLWzeU +JCb4G74kt+80XDAfBgNVHSMEGDAWgBTMEwivgs/uUF6yO1e/6GoxFmVTXzAKBggq +hkjOPQQDAgNIADBFAiEArbhbXWjL/TYUDYydEpAUxF+nyhkfNNmvJB23FzbmD0QC +IBmbwHx/eVvtgaLnfcU0JXb2oNFBmPRrkQdJQnwu7WWc -----END CERTIFICATE----- -----BEGIN EC PRIVATE KEY----- -MHcCAQEEIBGEO9zwrSBtsQJRpU2sWB11+ZL8tSJ1KiFs15xxdUapoAoGCCqGSM49 -AwEHoUQDQgAExdCGG7j5DEBcEjFOTF6+6pOfcndLzDMjni9Z9vRq+Nx9RoKg48zG -RubfKeqGv1Yq5yComDN9OD8ywKCeQWAZ6g== +MHcCAQEEIJ4WvYoXsvHCFCEPUWB+l5bLWWBBU1fTirhsxNWWIS6XoAoGCCqGSM49 +AwEHoUQDQgAEX5T1fgsTyc/Plt/h/OeIjVZMwgnFXEUI5E3PFrouCWYvnuzxn0Cw +6IoLKBXanuEKOhd8JR9DT1sPJjzn3mJ4xg== -----END EC PRIVATE KEY----- */ extern const uint8_t sTestCert_ICA01_Chip[] = { - 0x15, 0x30, 0x01, 0x08, 0x2d, 0xb4, 0x44, 0x85, 0x56, 0x41, 0xae, 0xdf, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, + 0x15, 0x30, 0x01, 0x08, 0x69, 0xd8, 0x6a, 0x8d, 0x80, 0xfc, 0x8f, 0x5d, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, - 0xc5, 0xd0, 0x86, 0x1b, 0xb8, 0xf9, 0x0c, 0x40, 0x5c, 0x12, 0x31, 0x4e, 0x4c, 0x5e, 0xbe, 0xea, 0x93, 0x9f, 0x72, 0x77, 0x4b, - 0xcc, 0x33, 0x23, 0x9e, 0x2f, 0x59, 0xf6, 0xf4, 0x6a, 0xf8, 0xdc, 0x7d, 0x46, 0x82, 0xa0, 0xe3, 0xcc, 0xc6, 0x46, 0xe6, 0xdf, - 0x29, 0xea, 0x86, 0xbf, 0x56, 0x2a, 0xe7, 0x20, 0xa8, 0x98, 0x33, 0x7d, 0x38, 0x3f, 0x32, 0xc0, 0xa0, 0x9e, 0x41, 0x60, 0x19, - 0xea, 0x37, 0x0a, 0x35, 0x01, 0x29, 0x01, 0x18, 0x24, 0x02, 0x60, 0x30, 0x04, 0x14, 0x53, 0x52, 0xd7, 0x05, 0x9e, 0x9c, 0x15, - 0xa5, 0x08, 0x90, 0x68, 0x62, 0x86, 0x48, 0x01, 0xa2, 0x9f, 0x1f, 0x41, 0xd3, 0x30, 0x05, 0x14, 0x13, 0xaf, 0x81, 0xab, 0x37, - 0x37, 0x4b, 0x2e, 0xd2, 0xa9, 0x64, 0x9b, 0x12, 0xb7, 0xa3, 0xa4, 0x28, 0x7e, 0x15, 0x1d, 0x18, 0x30, 0x0b, 0x40, 0x84, 0x1a, - 0x06, 0xd4, 0x3b, 0x5e, 0x9f, 0xec, 0xd2, 0x4e, 0x87, 0xb1, 0x24, 0x4e, 0xb5, 0x1c, 0x6a, 0x2c, 0xf2, 0x0d, 0x9b, 0x5e, 0x6b, - 0xa0, 0x7f, 0x11, 0xe6, 0x00, 0x2f, 0x7e, 0x0c, 0xa3, 0x4e, 0x32, 0xa6, 0x02, 0xc3, 0x60, 0x9d, 0x00, 0x92, 0xd3, 0x48, 0xbd, - 0xbd, 0x19, 0x8a, 0x11, 0x46, 0x46, 0xbd, 0x41, 0xcf, 0x10, 0x37, 0x83, 0x64, 0x1a, 0xe2, 0x5e, 0x3f, 0x23, 0xfd, 0x26, 0x18, + 0x5f, 0x94, 0xf5, 0x7e, 0x0b, 0x13, 0xc9, 0xcf, 0xcf, 0x96, 0xdf, 0xe1, 0xfc, 0xe7, 0x88, 0x8d, 0x56, 0x4c, 0xc2, 0x09, 0xc5, + 0x5c, 0x45, 0x08, 0xe4, 0x4d, 0xcf, 0x16, 0xba, 0x2e, 0x09, 0x66, 0x2f, 0x9e, 0xec, 0xf1, 0x9f, 0x40, 0xb0, 0xe8, 0x8a, 0x0b, + 0x28, 0x15, 0xda, 0x9e, 0xe1, 0x0a, 0x3a, 0x17, 0x7c, 0x25, 0x1f, 0x43, 0x4f, 0x5b, 0x0f, 0x26, 0x3c, 0xe7, 0xde, 0x62, 0x78, + 0xc6, 0x37, 0x0a, 0x35, 0x01, 0x29, 0x01, 0x18, 0x24, 0x02, 0x60, 0x30, 0x04, 0x14, 0x44, 0x0c, 0xc6, 0x92, 0x31, 0xc4, 0xcb, + 0x5b, 0x37, 0x94, 0x24, 0x26, 0xf8, 0x1b, 0xbe, 0x24, 0xb7, 0xef, 0x34, 0x5c, 0x30, 0x05, 0x14, 0xcc, 0x13, 0x08, 0xaf, 0x82, + 0xcf, 0xee, 0x50, 0x5e, 0xb2, 0x3b, 0x57, 0xbf, 0xe8, 0x6a, 0x31, 0x16, 0x65, 0x53, 0x5f, 0x18, 0x30, 0x0b, 0x40, 0xad, 0xb8, + 0x5b, 0x5d, 0x68, 0xcb, 0xfd, 0x36, 0x14, 0x0d, 0x8c, 0x9d, 0x12, 0x90, 0x14, 0xc4, 0x5f, 0xa7, 0xca, 0x19, 0x1f, 0x34, 0xd9, + 0xaf, 0x24, 0x1d, 0xb7, 0x17, 0x36, 0xe6, 0x0f, 0x44, 0x19, 0x9b, 0xc0, 0x7c, 0x7f, 0x79, 0x5b, 0xed, 0x81, 0xa2, 0xe7, 0x7d, + 0xc5, 0x34, 0x25, 0x76, 0xf6, 0xa0, 0xd1, 0x41, 0x98, 0xf4, 0x6b, 0x91, 0x07, 0x49, 0x42, 0x7c, 0x2e, 0xed, 0x65, 0x9c, 0x18, }; -extern const uint32_t sTestCert_ICA01_Chip_Len = sizeof(sTestCert_ICA01_Chip); +extern const size_t sTestCert_ICA01_Chip_Len = sizeof(sTestCert_ICA01_Chip); extern const uint8_t sTestCert_ICA01_DER[] = { - 0x30, 0x82, 0x01, 0x9d, 0x30, 0x82, 0x01, 0x43, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x2d, 0xb4, 0x44, 0x85, 0x56, 0x41, - 0xae, 0xdf, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, + 0x30, 0x82, 0x01, 0x9d, 0x30, 0x82, 0x01, 0x43, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x69, 0xd8, 0x6a, 0x8d, 0x80, 0xfc, + 0x8f, 0x5d, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x30, 0x1e, 0x17, 0x0d, 0x32, 0x30, 0x31, 0x30, 0x31, 0x35, 0x31, 0x34, 0x32, 0x33, 0x34, 0x33, 0x5a, 0x17, 0x0d, 0x34, 0x30, 0x31, 0x30, 0x31, 0x35, 0x31, 0x34, 0x32, 0x33, 0x34, 0x32, 0x5a, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, - 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0xc5, 0xd0, - 0x86, 0x1b, 0xb8, 0xf9, 0x0c, 0x40, 0x5c, 0x12, 0x31, 0x4e, 0x4c, 0x5e, 0xbe, 0xea, 0x93, 0x9f, 0x72, 0x77, 0x4b, 0xcc, 0x33, - 0x23, 0x9e, 0x2f, 0x59, 0xf6, 0xf4, 0x6a, 0xf8, 0xdc, 0x7d, 0x46, 0x82, 0xa0, 0xe3, 0xcc, 0xc6, 0x46, 0xe6, 0xdf, 0x29, 0xea, - 0x86, 0xbf, 0x56, 0x2a, 0xe7, 0x20, 0xa8, 0x98, 0x33, 0x7d, 0x38, 0x3f, 0x32, 0xc0, 0xa0, 0x9e, 0x41, 0x60, 0x19, 0xea, 0xa3, + 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x5f, 0x94, + 0xf5, 0x7e, 0x0b, 0x13, 0xc9, 0xcf, 0xcf, 0x96, 0xdf, 0xe1, 0xfc, 0xe7, 0x88, 0x8d, 0x56, 0x4c, 0xc2, 0x09, 0xc5, 0x5c, 0x45, + 0x08, 0xe4, 0x4d, 0xcf, 0x16, 0xba, 0x2e, 0x09, 0x66, 0x2f, 0x9e, 0xec, 0xf1, 0x9f, 0x40, 0xb0, 0xe8, 0x8a, 0x0b, 0x28, 0x15, + 0xda, 0x9e, 0xe1, 0x0a, 0x3a, 0x17, 0x7c, 0x25, 0x1f, 0x43, 0x4f, 0x5b, 0x0f, 0x26, 0x3c, 0xe7, 0xde, 0x62, 0x78, 0xc6, 0xa3, 0x63, 0x30, 0x61, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x01, 0x06, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, - 0x0e, 0x04, 0x16, 0x04, 0x14, 0x53, 0x52, 0xd7, 0x05, 0x9e, 0x9c, 0x15, 0xa5, 0x08, 0x90, 0x68, 0x62, 0x86, 0x48, 0x01, 0xa2, - 0x9f, 0x1f, 0x41, 0xd3, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x13, 0xaf, 0x81, 0xab, - 0x37, 0x37, 0x4b, 0x2e, 0xd2, 0xa9, 0x64, 0x9b, 0x12, 0xb7, 0xa3, 0xa4, 0x28, 0x7e, 0x15, 0x1d, 0x30, 0x0a, 0x06, 0x08, 0x2a, - 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, 0x45, 0x02, 0x21, 0x00, 0x84, 0x1a, 0x06, 0xd4, 0x3b, 0x5e, - 0x9f, 0xec, 0xd2, 0x4e, 0x87, 0xb1, 0x24, 0x4e, 0xb5, 0x1c, 0x6a, 0x2c, 0xf2, 0x0d, 0x9b, 0x5e, 0x6b, 0xa0, 0x7f, 0x11, 0xe6, - 0x00, 0x2f, 0x7e, 0x0c, 0xa3, 0x02, 0x20, 0x4e, 0x32, 0xa6, 0x02, 0xc3, 0x60, 0x9d, 0x00, 0x92, 0xd3, 0x48, 0xbd, 0xbd, 0x19, - 0x8a, 0x11, 0x46, 0x46, 0xbd, 0x41, 0xcf, 0x10, 0x37, 0x83, 0x64, 0x1a, 0xe2, 0x5e, 0x3f, 0x23, 0xfd, 0x26, + 0x0e, 0x04, 0x16, 0x04, 0x14, 0x44, 0x0c, 0xc6, 0x92, 0x31, 0xc4, 0xcb, 0x5b, 0x37, 0x94, 0x24, 0x26, 0xf8, 0x1b, 0xbe, 0x24, + 0xb7, 0xef, 0x34, 0x5c, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xcc, 0x13, 0x08, 0xaf, + 0x82, 0xcf, 0xee, 0x50, 0x5e, 0xb2, 0x3b, 0x57, 0xbf, 0xe8, 0x6a, 0x31, 0x16, 0x65, 0x53, 0x5f, 0x30, 0x0a, 0x06, 0x08, 0x2a, + 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, 0x45, 0x02, 0x21, 0x00, 0xad, 0xb8, 0x5b, 0x5d, 0x68, 0xcb, + 0xfd, 0x36, 0x14, 0x0d, 0x8c, 0x9d, 0x12, 0x90, 0x14, 0xc4, 0x5f, 0xa7, 0xca, 0x19, 0x1f, 0x34, 0xd9, 0xaf, 0x24, 0x1d, 0xb7, + 0x17, 0x36, 0xe6, 0x0f, 0x44, 0x02, 0x20, 0x19, 0x9b, 0xc0, 0x7c, 0x7f, 0x79, 0x5b, 0xed, 0x81, 0xa2, 0xe7, 0x7d, 0xc5, 0x34, + 0x25, 0x76, 0xf6, 0xa0, 0xd1, 0x41, 0x98, 0xf4, 0x6b, 0x91, 0x07, 0x49, 0x42, 0x7c, 0x2e, 0xed, 0x65, 0x9c, }; -extern const uint32_t sTestCert_ICA01_DER_Len = sizeof(sTestCert_ICA01_DER); +extern const size_t sTestCert_ICA01_DER_Len = sizeof(sTestCert_ICA01_DER); extern const uint8_t sTestCert_ICA01_PublicKey[] = { - 0x04, 0xc5, 0xd0, 0x86, 0x1b, 0xb8, 0xf9, 0x0c, 0x40, 0x5c, 0x12, 0x31, 0x4e, 0x4c, 0x5e, 0xbe, 0xea, - 0x93, 0x9f, 0x72, 0x77, 0x4b, 0xcc, 0x33, 0x23, 0x9e, 0x2f, 0x59, 0xf6, 0xf4, 0x6a, 0xf8, 0xdc, 0x7d, - 0x46, 0x82, 0xa0, 0xe3, 0xcc, 0xc6, 0x46, 0xe6, 0xdf, 0x29, 0xea, 0x86, 0xbf, 0x56, 0x2a, 0xe7, 0x20, - 0xa8, 0x98, 0x33, 0x7d, 0x38, 0x3f, 0x32, 0xc0, 0xa0, 0x9e, 0x41, 0x60, 0x19, 0xea, + 0x04, 0x5f, 0x94, 0xf5, 0x7e, 0x0b, 0x13, 0xc9, 0xcf, 0xcf, 0x96, 0xdf, 0xe1, 0xfc, 0xe7, 0x88, 0x8d, + 0x56, 0x4c, 0xc2, 0x09, 0xc5, 0x5c, 0x45, 0x08, 0xe4, 0x4d, 0xcf, 0x16, 0xba, 0x2e, 0x09, 0x66, 0x2f, + 0x9e, 0xec, 0xf1, 0x9f, 0x40, 0xb0, 0xe8, 0x8a, 0x0b, 0x28, 0x15, 0xda, 0x9e, 0xe1, 0x0a, 0x3a, 0x17, + 0x7c, 0x25, 0x1f, 0x43, 0x4f, 0x5b, 0x0f, 0x26, 0x3c, 0xe7, 0xde, 0x62, 0x78, 0xc6, }; -extern const uint8_t sTestCert_ICA01_PublicKey_Len = sizeof(sTestCert_ICA01_PublicKey); +extern const size_t sTestCert_ICA01_PublicKey_Len = sizeof(sTestCert_ICA01_PublicKey); extern const uint8_t sTestCert_ICA01_PrivateKey[] = { - 0x11, 0x84, 0x3b, 0xdc, 0xf0, 0xad, 0x20, 0x6d, 0xb1, 0x02, 0x51, 0xa5, 0x4d, 0xac, 0x58, 0x1d, - 0x75, 0xf9, 0x92, 0xfc, 0xb5, 0x22, 0x75, 0x2a, 0x21, 0x6c, 0xd7, 0x9c, 0x71, 0x75, 0x46, 0xa9, + 0x9e, 0x16, 0xbd, 0x8a, 0x17, 0xb2, 0xf1, 0xc2, 0x14, 0x21, 0x0f, 0x51, 0x60, 0x7e, 0x97, 0x96, + 0xcb, 0x59, 0x60, 0x41, 0x53, 0x57, 0xd3, 0x8a, 0xb8, 0x6c, 0xc4, 0xd5, 0x96, 0x21, 0x2e, 0x97, }; -extern const uint8_t sTestCert_ICA01_PrivateKey_Len = sizeof(sTestCert_ICA01_PrivateKey); +extern const size_t sTestCert_ICA01_PrivateKey_Len = sizeof(sTestCert_ICA01_PrivateKey); extern const uint8_t sTestCert_ICA01_SubjectKeyId[] = { - 0x53, 0x52, 0xD7, 0x05, 0x9E, 0x9C, 0x15, 0xA5, 0x08, 0x90, 0x68, 0x62, 0x86, 0x48, 0x01, 0xA2, 0x9F, 0x1F, 0x41, 0xD3, + 0x44, 0x0C, 0xC6, 0x92, 0x31, 0xC4, 0xCB, 0x5B, 0x37, 0x94, 0x24, 0x26, 0xF8, 0x1B, 0xBE, 0x24, 0xB7, 0xEF, 0x34, 0x5C, }; -extern const uint8_t sTestCert_ICA01_SubjectKeyId_Len = sizeof(sTestCert_ICA01_SubjectKeyId); +extern const size_t sTestCert_ICA01_SubjectKeyId_Len = sizeof(sTestCert_ICA01_SubjectKeyId); extern const uint8_t sTestCert_ICA01_AuthorityKeyId[] = { - 0x13, 0xAF, 0x81, 0xAB, 0x37, 0x37, 0x4B, 0x2E, 0xD2, 0xA9, 0x64, 0x9B, 0x12, 0xB7, 0xA3, 0xA4, 0x28, 0x7E, 0x15, 0x1D, + 0xCC, 0x13, 0x08, 0xAF, 0x82, 0xCF, 0xEE, 0x50, 0x5E, 0xB2, 0x3B, 0x57, 0xBF, 0xE8, 0x6A, 0x31, 0x16, 0x65, 0x53, 0x5F, }; -extern const uint8_t sTestCert_ICA01_AuthorityKeyId_Len = sizeof(sTestCert_ICA01_AuthorityKeyId); +extern const size_t sTestCert_ICA01_AuthorityKeyId_Len = sizeof(sTestCert_ICA01_AuthorityKeyId); /************** Test ICA02 Certificate ************** Certificate: Data: Version: 3 (0x2) - Serial Number: 4165248444559607814 (0x39cdef6453394806) + Serial Number: 2073221257978332490 (0x1cc58fbfee96454a) Signature Algorithm: ecdsa-with-SHA256 Issuer: 1.3.6.1.4.1.37244.1.4 = CACACACA00000002, 1.3.6.1.4.1.37244.1.5 = FAB000000000001D Validity @@ -696,11 +702,11 @@ extern const uint8_t sTestCert_ICA01_AuthorityKeyId_Len = sizeof(sTestCert_ICA01 Public Key Algorithm: id-ecPublicKey Public-Key: (256 bit) pub: - 04:fc:fe:1a:0f:49:7d:f8:c7:fa:de:82:42:ee:b4: - 09:e4:48:50:ee:52:bc:e0:2b:33:1e:ab:3e:af:90: - 0c:42:04:d9:ea:a3:17:38:e6:de:94:83:45:28:de: - 9c:35:3f:5e:5b:11:fb:92:dd:db:64:74:da:f6:0e: - 1f:fe:21:f4:d3 + 04:fa:9f:d2:8c:b7:6a:77:ef:0e:39:30:d5:9e:41: + 2b:d1:8e:b2:0e:ff:d5:19:7e:f4:71:39:37:93:90: + 37:8a:48:04:32:48:18:9c:c4:a9:74:17:75:7e:0e: + 7b:76:72:34:d9:cb:03:dc:75:28:9a:99:74:be:3d: + f7:61:a7:56:be ASN1 OID: prime256v1 NIST CURVE: P-256 X509v3 extensions: @@ -709,59 +715,59 @@ extern const uint8_t sTestCert_ICA01_AuthorityKeyId_Len = sizeof(sTestCert_ICA01 X509v3 Key Usage: critical Certificate Sign, CRL Sign X509v3 Subject Key Identifier: - CF:42:BC:F8:DF:48:09:D9:26:6F:23:15:5A:16:B0:7F:04:BB:3D:84 + E1:E7:6E:67:77:85:1D:D7:74:16:BD:DD:35:EC:3C:13:7C:47:29:DC X509v3 Authority Key Identifier: - keyid:B2:1B:EA:40:AB:F2:AB:A9:56:F9:82:E1:DA:D2:B6:06:92:06:90:E0 + keyid:62:BE:B9:67:1C:91:C3:55:C8:6F:06:FA:6C:08:80:14:51:E1:A0:EA Signature Algorithm: ecdsa-with-SHA256 - 30:45:02:20:58:1a:14:96:5d:9b:42:10:53:12:b3:9f:0c:aa: - 18:98:d5:63:dc:c1:d6:eb:04:86:c2:f8:89:2b:20:43:3e:61: - 02:21:00:b8:4d:cf:33:60:8d:d5:1c:93:e1:27:6c:92:37:ae: - 6f:e2:06:01:dc:3e:6e:9e:02:b1:dc:2b:d9:3e:d8:f5:4d + 30:45:02:20:6f:fa:73:c0:42:6c:9c:ab:2d:e6:20:76:eb:e2: + 4b:5e:79:e2:bb:98:f2:14:ab:6e:e8:f0:43:7c:55:7d:e7:43: + 02:21:00:c7:53:da:e7:dd:f3:b0:27:c2:f1:3e:23:ce:3a:3a: + b9:d4:34:fc:7e:a1:5b:b9:d6:77:c3:6c:9c:8b:55:15:42 -----BEGIN CERTIFICATE----- -MIIB5DCCAYqgAwIBAgIIOc3vZFM5SAYwCgYIKoZIzj0EAwIwRDEgMB4GCisGAQQB +MIIB5DCCAYqgAwIBAgIIHMWPv+6WRUowCgYIKoZIzj0EAwIwRDEgMB4GCisGAQQB gqJ8AQQMEENBQ0FDQUNBMDAwMDAwMDIxIDAeBgorBgEEAYKifAEFDBBGQUIwMDAw MDAwMDAwMDFEMB4XDTIwMTAxNTE0MjM0M1oXDTQwMTAxNTE0MjM0MlowRDEgMB4G CisGAQQBgqJ8AQMMEENBQ0FDQUNBMDAwMDAwMDQxIDAeBgorBgEEAYKifAEFDBBG -QUIwMDAwMDAwMDAwMDFEMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE/P4aD0l9 -+Mf63oJC7rQJ5EhQ7lK84CszHqs+r5AMQgTZ6qMXOObelINFKN6cNT9eWxH7kt3b -ZHTa9g4f/iH006NmMGQwEgYDVR0TAQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMC -AQYwHQYDVR0OBBYEFM9CvPjfSAnZJm8jFVoWsH8Euz2EMB8GA1UdIwQYMBaAFLIb -6kCr8qupVvmC4drStgaSBpDgMAoGCCqGSM49BAMCA0gAMEUCIFgaFJZdm0IQUxKz -nwyqGJjVY9zB1usEhsL4iSsgQz5hAiEAuE3PM2CN1RyT4Sdskjeub+IGAdw+bp4C -sdwr2T7Y9U0= +QUIwMDAwMDAwMDAwMDFEMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE+p/SjLdq +d+8OOTDVnkEr0Y6yDv/VGX70cTk3k5A3ikgEMkgYnMSpdBd1fg57dnI02csD3HUo +mpl0vj33YadWvqNmMGQwEgYDVR0TAQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMC +AQYwHQYDVR0OBBYEFOHnbmd3hR3XdBa93TXsPBN8RyncMB8GA1UdIwQYMBaAFGK+ +uWcckcNVyG8G+mwIgBRR4aDqMAoGCCqGSM49BAMCA0gAMEUCIG/6c8BCbJyrLeYg +duviS1554ruY8hSrbujwQ3xVfedDAiEAx1Pa593zsCfC8T4jzjo6udQ0/H6hW7nW +d8NsnItVFUI= -----END CERTIFICATE----- -----BEGIN EC PRIVATE KEY----- -MHcCAQEEICqDNVdDrwSjhcgPl3Le0DADVJYdhNw7MMKO5PvBdWf6oAoGCCqGSM49 -AwEHoUQDQgAE/P4aD0l9+Mf63oJC7rQJ5EhQ7lK84CszHqs+r5AMQgTZ6qMXOObe -lINFKN6cNT9eWxH7kt3bZHTa9g4f/iH00w== +MHcCAQEEILp2etVZ4xX7pwGY3Y/JdiCDBZT6Xrta8JD1jv8bnWCloAoGCCqGSM49 +AwEHoUQDQgAE+p/SjLdqd+8OOTDVnkEr0Y6yDv/VGX70cTk3k5A3ikgEMkgYnMSp +dBd1fg57dnI02csD3HUompl0vj33YadWvg== -----END EC PRIVATE KEY----- */ extern const uint8_t sTestCert_ICA02_Chip[] = { - 0x15, 0x30, 0x01, 0x08, 0x39, 0xcd, 0xef, 0x64, 0x53, 0x39, 0x48, 0x06, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x02, + 0x15, 0x30, 0x01, 0x08, 0x1c, 0xc5, 0x8f, 0xbf, 0xee, 0x96, 0x45, 0x4a, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x02, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, - 0x09, 0x41, 0x04, 0xfc, 0xfe, 0x1a, 0x0f, 0x49, 0x7d, 0xf8, 0xc7, 0xfa, 0xde, 0x82, 0x42, 0xee, 0xb4, 0x09, 0xe4, 0x48, - 0x50, 0xee, 0x52, 0xbc, 0xe0, 0x2b, 0x33, 0x1e, 0xab, 0x3e, 0xaf, 0x90, 0x0c, 0x42, 0x04, 0xd9, 0xea, 0xa3, 0x17, 0x38, - 0xe6, 0xde, 0x94, 0x83, 0x45, 0x28, 0xde, 0x9c, 0x35, 0x3f, 0x5e, 0x5b, 0x11, 0xfb, 0x92, 0xdd, 0xdb, 0x64, 0x74, 0xda, - 0xf6, 0x0e, 0x1f, 0xfe, 0x21, 0xf4, 0xd3, 0x37, 0x0a, 0x35, 0x01, 0x29, 0x01, 0x24, 0x02, 0x00, 0x18, 0x24, 0x02, 0x60, - 0x30, 0x04, 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, 0x26, 0x6f, 0x23, 0x15, 0x5a, 0x16, 0xb0, 0x7f, 0x04, - 0xbb, 0x3d, 0x84, 0x30, 0x05, 0x14, 0xb2, 0x1b, 0xea, 0x40, 0xab, 0xf2, 0xab, 0xa9, 0x56, 0xf9, 0x82, 0xe1, 0xda, 0xd2, - 0xb6, 0x06, 0x92, 0x06, 0x90, 0xe0, 0x18, 0x30, 0x0b, 0x40, 0x58, 0x1a, 0x14, 0x96, 0x5d, 0x9b, 0x42, 0x10, 0x53, 0x12, - 0xb3, 0x9f, 0x0c, 0xaa, 0x18, 0x98, 0xd5, 0x63, 0xdc, 0xc1, 0xd6, 0xeb, 0x04, 0x86, 0xc2, 0xf8, 0x89, 0x2b, 0x20, 0x43, - 0x3e, 0x61, 0xb8, 0x4d, 0xcf, 0x33, 0x60, 0x8d, 0xd5, 0x1c, 0x93, 0xe1, 0x27, 0x6c, 0x92, 0x37, 0xae, 0x6f, 0xe2, 0x06, - 0x01, 0xdc, 0x3e, 0x6e, 0x9e, 0x02, 0xb1, 0xdc, 0x2b, 0xd9, 0x3e, 0xd8, 0xf5, 0x4d, 0x18, + 0x09, 0x41, 0x04, 0xfa, 0x9f, 0xd2, 0x8c, 0xb7, 0x6a, 0x77, 0xef, 0x0e, 0x39, 0x30, 0xd5, 0x9e, 0x41, 0x2b, 0xd1, 0x8e, + 0xb2, 0x0e, 0xff, 0xd5, 0x19, 0x7e, 0xf4, 0x71, 0x39, 0x37, 0x93, 0x90, 0x37, 0x8a, 0x48, 0x04, 0x32, 0x48, 0x18, 0x9c, + 0xc4, 0xa9, 0x74, 0x17, 0x75, 0x7e, 0x0e, 0x7b, 0x76, 0x72, 0x34, 0xd9, 0xcb, 0x03, 0xdc, 0x75, 0x28, 0x9a, 0x99, 0x74, + 0xbe, 0x3d, 0xf7, 0x61, 0xa7, 0x56, 0xbe, 0x37, 0x0a, 0x35, 0x01, 0x29, 0x01, 0x24, 0x02, 0x00, 0x18, 0x24, 0x02, 0x60, + 0x30, 0x04, 0x14, 0xe1, 0xe7, 0x6e, 0x67, 0x77, 0x85, 0x1d, 0xd7, 0x74, 0x16, 0xbd, 0xdd, 0x35, 0xec, 0x3c, 0x13, 0x7c, + 0x47, 0x29, 0xdc, 0x30, 0x05, 0x14, 0x62, 0xbe, 0xb9, 0x67, 0x1c, 0x91, 0xc3, 0x55, 0xc8, 0x6f, 0x06, 0xfa, 0x6c, 0x08, + 0x80, 0x14, 0x51, 0xe1, 0xa0, 0xea, 0x18, 0x30, 0x0b, 0x40, 0x6f, 0xfa, 0x73, 0xc0, 0x42, 0x6c, 0x9c, 0xab, 0x2d, 0xe6, + 0x20, 0x76, 0xeb, 0xe2, 0x4b, 0x5e, 0x79, 0xe2, 0xbb, 0x98, 0xf2, 0x14, 0xab, 0x6e, 0xe8, 0xf0, 0x43, 0x7c, 0x55, 0x7d, + 0xe7, 0x43, 0xc7, 0x53, 0xda, 0xe7, 0xdd, 0xf3, 0xb0, 0x27, 0xc2, 0xf1, 0x3e, 0x23, 0xce, 0x3a, 0x3a, 0xb9, 0xd4, 0x34, + 0xfc, 0x7e, 0xa1, 0x5b, 0xb9, 0xd6, 0x77, 0xc3, 0x6c, 0x9c, 0x8b, 0x55, 0x15, 0x42, 0x18, }; -extern const uint32_t sTestCert_ICA02_Chip_Len = sizeof(sTestCert_ICA02_Chip); +extern const size_t sTestCert_ICA02_Chip_Len = sizeof(sTestCert_ICA02_Chip); extern const uint8_t sTestCert_ICA02_DER[] = { - 0x30, 0x82, 0x01, 0xe4, 0x30, 0x82, 0x01, 0x8a, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x39, 0xcd, 0xef, 0x64, 0x53, 0x39, - 0x48, 0x06, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, + 0x30, 0x82, 0x01, 0xe4, 0x30, 0x82, 0x01, 0x8a, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x1c, 0xc5, 0x8f, 0xbf, 0xee, 0x96, + 0x45, 0x4a, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x05, 0x0c, 0x10, 0x46, 0x41, 0x42, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x44, @@ -771,56 +777,56 @@ extern const uint8_t sTestCert_ICA02_DER[] = { 0x30, 0x30, 0x30, 0x30, 0x34, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x05, 0x0c, 0x10, 0x46, 0x41, 0x42, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x44, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, - 0x42, 0x00, 0x04, 0xfc, 0xfe, 0x1a, 0x0f, 0x49, 0x7d, 0xf8, 0xc7, 0xfa, 0xde, 0x82, 0x42, 0xee, 0xb4, 0x09, 0xe4, 0x48, 0x50, - 0xee, 0x52, 0xbc, 0xe0, 0x2b, 0x33, 0x1e, 0xab, 0x3e, 0xaf, 0x90, 0x0c, 0x42, 0x04, 0xd9, 0xea, 0xa3, 0x17, 0x38, 0xe6, 0xde, - 0x94, 0x83, 0x45, 0x28, 0xde, 0x9c, 0x35, 0x3f, 0x5e, 0x5b, 0x11, 0xfb, 0x92, 0xdd, 0xdb, 0x64, 0x74, 0xda, 0xf6, 0x0e, 0x1f, - 0xfe, 0x21, 0xf4, 0xd3, 0xa3, 0x66, 0x30, 0x64, 0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x08, 0x30, + 0x42, 0x00, 0x04, 0xfa, 0x9f, 0xd2, 0x8c, 0xb7, 0x6a, 0x77, 0xef, 0x0e, 0x39, 0x30, 0xd5, 0x9e, 0x41, 0x2b, 0xd1, 0x8e, 0xb2, + 0x0e, 0xff, 0xd5, 0x19, 0x7e, 0xf4, 0x71, 0x39, 0x37, 0x93, 0x90, 0x37, 0x8a, 0x48, 0x04, 0x32, 0x48, 0x18, 0x9c, 0xc4, 0xa9, + 0x74, 0x17, 0x75, 0x7e, 0x0e, 0x7b, 0x76, 0x72, 0x34, 0xd9, 0xcb, 0x03, 0xdc, 0x75, 0x28, 0x9a, 0x99, 0x74, 0xbe, 0x3d, 0xf7, + 0x61, 0xa7, 0x56, 0xbe, 0xa3, 0x66, 0x30, 0x64, 0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x08, 0x30, 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x00, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, - 0x01, 0x06, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, - 0x26, 0x6f, 0x23, 0x15, 0x5a, 0x16, 0xb0, 0x7f, 0x04, 0xbb, 0x3d, 0x84, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, - 0x30, 0x16, 0x80, 0x14, 0xb2, 0x1b, 0xea, 0x40, 0xab, 0xf2, 0xab, 0xa9, 0x56, 0xf9, 0x82, 0xe1, 0xda, 0xd2, 0xb6, 0x06, 0x92, - 0x06, 0x90, 0xe0, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, 0x45, 0x02, - 0x20, 0x58, 0x1a, 0x14, 0x96, 0x5d, 0x9b, 0x42, 0x10, 0x53, 0x12, 0xb3, 0x9f, 0x0c, 0xaa, 0x18, 0x98, 0xd5, 0x63, 0xdc, 0xc1, - 0xd6, 0xeb, 0x04, 0x86, 0xc2, 0xf8, 0x89, 0x2b, 0x20, 0x43, 0x3e, 0x61, 0x02, 0x21, 0x00, 0xb8, 0x4d, 0xcf, 0x33, 0x60, 0x8d, - 0xd5, 0x1c, 0x93, 0xe1, 0x27, 0x6c, 0x92, 0x37, 0xae, 0x6f, 0xe2, 0x06, 0x01, 0xdc, 0x3e, 0x6e, 0x9e, 0x02, 0xb1, 0xdc, 0x2b, - 0xd9, 0x3e, 0xd8, 0xf5, 0x4d, + 0x01, 0x06, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xe1, 0xe7, 0x6e, 0x67, 0x77, 0x85, 0x1d, 0xd7, + 0x74, 0x16, 0xbd, 0xdd, 0x35, 0xec, 0x3c, 0x13, 0x7c, 0x47, 0x29, 0xdc, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, + 0x30, 0x16, 0x80, 0x14, 0x62, 0xbe, 0xb9, 0x67, 0x1c, 0x91, 0xc3, 0x55, 0xc8, 0x6f, 0x06, 0xfa, 0x6c, 0x08, 0x80, 0x14, 0x51, + 0xe1, 0xa0, 0xea, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, 0x45, 0x02, + 0x20, 0x6f, 0xfa, 0x73, 0xc0, 0x42, 0x6c, 0x9c, 0xab, 0x2d, 0xe6, 0x20, 0x76, 0xeb, 0xe2, 0x4b, 0x5e, 0x79, 0xe2, 0xbb, 0x98, + 0xf2, 0x14, 0xab, 0x6e, 0xe8, 0xf0, 0x43, 0x7c, 0x55, 0x7d, 0xe7, 0x43, 0x02, 0x21, 0x00, 0xc7, 0x53, 0xda, 0xe7, 0xdd, 0xf3, + 0xb0, 0x27, 0xc2, 0xf1, 0x3e, 0x23, 0xce, 0x3a, 0x3a, 0xb9, 0xd4, 0x34, 0xfc, 0x7e, 0xa1, 0x5b, 0xb9, 0xd6, 0x77, 0xc3, 0x6c, + 0x9c, 0x8b, 0x55, 0x15, 0x42, }; -extern const uint32_t sTestCert_ICA02_DER_Len = sizeof(sTestCert_ICA02_DER); +extern const size_t sTestCert_ICA02_DER_Len = sizeof(sTestCert_ICA02_DER); extern const uint8_t sTestCert_ICA02_PublicKey[] = { - 0x04, 0xfc, 0xfe, 0x1a, 0x0f, 0x49, 0x7d, 0xf8, 0xc7, 0xfa, 0xde, 0x82, 0x42, 0xee, 0xb4, 0x09, 0xe4, - 0x48, 0x50, 0xee, 0x52, 0xbc, 0xe0, 0x2b, 0x33, 0x1e, 0xab, 0x3e, 0xaf, 0x90, 0x0c, 0x42, 0x04, 0xd9, - 0xea, 0xa3, 0x17, 0x38, 0xe6, 0xde, 0x94, 0x83, 0x45, 0x28, 0xde, 0x9c, 0x35, 0x3f, 0x5e, 0x5b, 0x11, - 0xfb, 0x92, 0xdd, 0xdb, 0x64, 0x74, 0xda, 0xf6, 0x0e, 0x1f, 0xfe, 0x21, 0xf4, 0xd3, + 0x04, 0xfa, 0x9f, 0xd2, 0x8c, 0xb7, 0x6a, 0x77, 0xef, 0x0e, 0x39, 0x30, 0xd5, 0x9e, 0x41, 0x2b, 0xd1, + 0x8e, 0xb2, 0x0e, 0xff, 0xd5, 0x19, 0x7e, 0xf4, 0x71, 0x39, 0x37, 0x93, 0x90, 0x37, 0x8a, 0x48, 0x04, + 0x32, 0x48, 0x18, 0x9c, 0xc4, 0xa9, 0x74, 0x17, 0x75, 0x7e, 0x0e, 0x7b, 0x76, 0x72, 0x34, 0xd9, 0xcb, + 0x03, 0xdc, 0x75, 0x28, 0x9a, 0x99, 0x74, 0xbe, 0x3d, 0xf7, 0x61, 0xa7, 0x56, 0xbe, }; -extern const uint8_t sTestCert_ICA02_PublicKey_Len = sizeof(sTestCert_ICA02_PublicKey); +extern const size_t sTestCert_ICA02_PublicKey_Len = sizeof(sTestCert_ICA02_PublicKey); extern const uint8_t sTestCert_ICA02_PrivateKey[] = { - 0x2a, 0x83, 0x35, 0x57, 0x43, 0xaf, 0x04, 0xa3, 0x85, 0xc8, 0x0f, 0x97, 0x72, 0xde, 0xd0, 0x30, - 0x03, 0x54, 0x96, 0x1d, 0x84, 0xdc, 0x3b, 0x30, 0xc2, 0x8e, 0xe4, 0xfb, 0xc1, 0x75, 0x67, 0xfa, + 0xba, 0x76, 0x7a, 0xd5, 0x59, 0xe3, 0x15, 0xfb, 0xa7, 0x01, 0x98, 0xdd, 0x8f, 0xc9, 0x76, 0x20, + 0x83, 0x05, 0x94, 0xfa, 0x5e, 0xbb, 0x5a, 0xf0, 0x90, 0xf5, 0x8e, 0xff, 0x1b, 0x9d, 0x60, 0xa5, }; -extern const uint8_t sTestCert_ICA02_PrivateKey_Len = sizeof(sTestCert_ICA02_PrivateKey); +extern const size_t sTestCert_ICA02_PrivateKey_Len = sizeof(sTestCert_ICA02_PrivateKey); extern const uint8_t sTestCert_ICA02_SubjectKeyId[] = { - 0xCF, 0x42, 0xBC, 0xF8, 0xDF, 0x48, 0x09, 0xD9, 0x26, 0x6F, 0x23, 0x15, 0x5A, 0x16, 0xB0, 0x7F, 0x04, 0xBB, 0x3D, 0x84, + 0xE1, 0xE7, 0x6E, 0x67, 0x77, 0x85, 0x1D, 0xD7, 0x74, 0x16, 0xBD, 0xDD, 0x35, 0xEC, 0x3C, 0x13, 0x7C, 0x47, 0x29, 0xDC, }; -extern const uint8_t sTestCert_ICA02_SubjectKeyId_Len = sizeof(sTestCert_ICA02_SubjectKeyId); +extern const size_t sTestCert_ICA02_SubjectKeyId_Len = sizeof(sTestCert_ICA02_SubjectKeyId); extern const uint8_t sTestCert_ICA02_AuthorityKeyId[] = { - 0xB2, 0x1B, 0xEA, 0x40, 0xAB, 0xF2, 0xAB, 0xA9, 0x56, 0xF9, 0x82, 0xE1, 0xDA, 0xD2, 0xB6, 0x06, 0x92, 0x06, 0x90, 0xE0, + 0x62, 0xBE, 0xB9, 0x67, 0x1C, 0x91, 0xC3, 0x55, 0xC8, 0x6F, 0x06, 0xFA, 0x6C, 0x08, 0x80, 0x14, 0x51, 0xE1, 0xA0, 0xEA, }; -extern const uint8_t sTestCert_ICA02_AuthorityKeyId_Len = sizeof(sTestCert_ICA02_AuthorityKeyId); +extern const size_t sTestCert_ICA02_AuthorityKeyId_Len = sizeof(sTestCert_ICA02_AuthorityKeyId); /************** Test ICA01_1 Certificate ************** Certificate: Data: Version: 3 (0x2) - Serial Number: 4944100787284197233 (0x449cf97897cdbf71) + Serial Number: 3957838079739582840 (0x36ed10c395645978) Signature Algorithm: ecdsa-with-SHA256 Issuer: 1.3.6.1.4.1.37244.1.4 = CACACACA00000001 Validity @@ -831,11 +837,11 @@ extern const uint8_t sTestCert_ICA02_AuthorityKeyId_Len = sizeof(sTestCert_ICA02 Public Key Algorithm: id-ecPublicKey Public-Key: (256 bit) pub: - 04:9b:54:14:20:29:26:1b:a1:22:95:62:72:4c:66: - 7f:6a:0b:82:5c:fc:80:18:d9:50:24:13:71:82:4d: - 73:52:59:51:88:2a:12:d4:48:d5:ef:28:1c:cc:73: - 90:e3:bc:c6:41:b3:db:27:2a:37:4a:d0:22:ec:c3: - 4e:3d:2c:8d:7a + 04:e1:d5:3a:9c:25:7a:e3:2b:ab:05:77:89:06:03: + 13:91:b5:8a:df:9f:8a:b2:69:38:ad:eb:f1:39:6c: + f1:2c:4a:41:45:ba:d8:5e:92:eb:7f:3b:37:d5:da: + 69:d0:cf:60:4c:41:c4:96:4f:ad:2d:70:45:68:d6: + be:8c:af:da:ee ASN1 OID: prime256v1 NIST CURVE: P-256 X509v3 extensions: @@ -844,110 +850,110 @@ extern const uint8_t sTestCert_ICA02_AuthorityKeyId_Len = sizeof(sTestCert_ICA02 X509v3 Key Usage: critical Certificate Sign, CRL Sign X509v3 Subject Key Identifier: - 93:88:3C:64:9F:C1:7E:C1:2A:6A:1D:77:CF:B9:97:2A:55:9C:1A:D8 + 50:6F:C3:FC:B7:94:15:88:EA:73:6C:20:65:2E:5F:1B:11:70:1C:6A X509v3 Authority Key Identifier: - keyid:13:AF:81:AB:37:37:4B:2E:D2:A9:64:9B:12:B7:A3:A4:28:7E:15:1D + keyid:CC:13:08:AF:82:CF:EE:50:5E:B2:3B:57:BF:E8:6A:31:16:65:53:5F Signature Algorithm: ecdsa-with-SHA256 - 30:46:02:21:00:f7:81:3c:ac:a8:23:82:ec:45:45:1e:ed:2e: - 16:2d:40:99:f9:d6:bf:43:a6:7a:0e:6d:a2:a0:a3:e3:c8:b5: - 50:02:21:00:bc:8a:e4:d3:cc:1c:d0:4f:f7:56:ed:d9:fe:b3: - aa:89:6f:3d:db:d7:1a:e0:54:12:aa:06:61:af:42:7e:cb:57 + 30:45:02:21:00:e9:3b:4d:4b:8e:e1:66:9f:49:85:97:04:83: + e4:00:00:9e:d0:46:b3:4e:dc:11:8a:cd:b4:ed:ea:b6:21:71: + be:02:20:7e:80:d5:c2:98:5d:6c:6a:b2:55:c3:c4:ad:55:4c: + 72:70:04:8c:26:d6:e6:d3:e9:c2:e7:1f:b2:0a:f2:f0:fe -----BEGIN CERTIFICATE----- -MIIBnjCCAUOgAwIBAgIIRJz5eJfNv3EwCgYIKoZIzj0EAwIwIjEgMB4GCisGAQQB +MIIBnTCCAUOgAwIBAgIINu0Qw5VkWXgwCgYIKoZIzj0EAwIwIjEgMB4GCisGAQQB gqJ8AQQMEENBQ0FDQUNBMDAwMDAwMDEwHhcNMjAxMDE1MTQyMzQzWhcNNDAxMDE1 MTQyMzQyWjAiMSAwHgYKKwYBBAGConwBAwwQQ0FDQUNBQ0EwMDAwMDAwNTBZMBMG -ByqGSM49AgEGCCqGSM49AwEHA0IABJtUFCApJhuhIpVickxmf2oLglz8gBjZUCQT -cYJNc1JZUYgqEtRI1e8oHMxzkOO8xkGz2ycqN0rQIuzDTj0sjXqjYzBhMA8GA1Ud -EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBSTiDxkn8F+wSpq -HXfPuZcqVZwa2DAfBgNVHSMEGDAWgBQTr4GrNzdLLtKpZJsSt6OkKH4VHTAKBggq -hkjOPQQDAgNJADBGAiEA94E8rKgjguxFRR7tLhYtQJn51r9DpnoObaKgo+PItVAC -IQC8iuTTzBzQT/dW7dn+s6qJbz3b1xrgVBKqBmGvQn7LVw== +ByqGSM49AgEGCCqGSM49AwEHA0IABOHVOpwleuMrqwV3iQYDE5G1it+firJpOK3r +8Tls8SxKQUW62F6S6387N9XaadDPYExBxJZPrS1wRWjWvoyv2u6jYzBhMA8GA1Ud +EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRQb8P8t5QViOpz +bCBlLl8bEXAcajAfBgNVHSMEGDAWgBTMEwivgs/uUF6yO1e/6GoxFmVTXzAKBggq +hkjOPQQDAgNIADBFAiEA6TtNS47hZp9JhZcEg+QAAJ7QRrNO3BGKzbTt6rYhcb4C +IH6A1cKYXWxqslXDxK1VTHJwBIwm1ubT6cLnH7IK8vD+ -----END CERTIFICATE----- -----BEGIN EC PRIVATE KEY----- -MHcCAQEEIH3ikExGQpvTymBLFf/9K8D4fLAj/EvRLZMPSw218YFXoAoGCCqGSM49 -AwEHoUQDQgAEm1QUICkmG6EilWJyTGZ/aguCXPyAGNlQJBNxgk1zUllRiCoS1EjV -7ygczHOQ47zGQbPbJyo3StAi7MNOPSyNeg== +MHcCAQEEIJPbzmpr+Ns8SpbdKC9MuPBrymFvuQCe1kpJD7Blg6+NoAoGCCqGSM49 +AwEHoUQDQgAE4dU6nCV64yurBXeJBgMTkbWK35+Ksmk4revxOWzxLEpBRbrYXpLr +fzs31dpp0M9gTEHElk+tLXBFaNa+jK/a7g== -----END EC PRIVATE KEY----- */ extern const uint8_t sTestCert_ICA01_1_Chip[] = { - 0x15, 0x30, 0x01, 0x08, 0x44, 0x9c, 0xf9, 0x78, 0x97, 0xcd, 0xbf, 0x71, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, + 0x15, 0x30, 0x01, 0x08, 0x36, 0xed, 0x10, 0xc3, 0x95, 0x64, 0x59, 0x78, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x05, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, - 0x9b, 0x54, 0x14, 0x20, 0x29, 0x26, 0x1b, 0xa1, 0x22, 0x95, 0x62, 0x72, 0x4c, 0x66, 0x7f, 0x6a, 0x0b, 0x82, 0x5c, 0xfc, 0x80, - 0x18, 0xd9, 0x50, 0x24, 0x13, 0x71, 0x82, 0x4d, 0x73, 0x52, 0x59, 0x51, 0x88, 0x2a, 0x12, 0xd4, 0x48, 0xd5, 0xef, 0x28, 0x1c, - 0xcc, 0x73, 0x90, 0xe3, 0xbc, 0xc6, 0x41, 0xb3, 0xdb, 0x27, 0x2a, 0x37, 0x4a, 0xd0, 0x22, 0xec, 0xc3, 0x4e, 0x3d, 0x2c, 0x8d, - 0x7a, 0x37, 0x0a, 0x35, 0x01, 0x29, 0x01, 0x18, 0x24, 0x02, 0x60, 0x30, 0x04, 0x14, 0x93, 0x88, 0x3c, 0x64, 0x9f, 0xc1, 0x7e, - 0xc1, 0x2a, 0x6a, 0x1d, 0x77, 0xcf, 0xb9, 0x97, 0x2a, 0x55, 0x9c, 0x1a, 0xd8, 0x30, 0x05, 0x14, 0x13, 0xaf, 0x81, 0xab, 0x37, - 0x37, 0x4b, 0x2e, 0xd2, 0xa9, 0x64, 0x9b, 0x12, 0xb7, 0xa3, 0xa4, 0x28, 0x7e, 0x15, 0x1d, 0x18, 0x30, 0x0b, 0x40, 0xf7, 0x81, - 0x3c, 0xac, 0xa8, 0x23, 0x82, 0xec, 0x45, 0x45, 0x1e, 0xed, 0x2e, 0x16, 0x2d, 0x40, 0x99, 0xf9, 0xd6, 0xbf, 0x43, 0xa6, 0x7a, - 0x0e, 0x6d, 0xa2, 0xa0, 0xa3, 0xe3, 0xc8, 0xb5, 0x50, 0xbc, 0x8a, 0xe4, 0xd3, 0xcc, 0x1c, 0xd0, 0x4f, 0xf7, 0x56, 0xed, 0xd9, - 0xfe, 0xb3, 0xaa, 0x89, 0x6f, 0x3d, 0xdb, 0xd7, 0x1a, 0xe0, 0x54, 0x12, 0xaa, 0x06, 0x61, 0xaf, 0x42, 0x7e, 0xcb, 0x57, 0x18, + 0xe1, 0xd5, 0x3a, 0x9c, 0x25, 0x7a, 0xe3, 0x2b, 0xab, 0x05, 0x77, 0x89, 0x06, 0x03, 0x13, 0x91, 0xb5, 0x8a, 0xdf, 0x9f, 0x8a, + 0xb2, 0x69, 0x38, 0xad, 0xeb, 0xf1, 0x39, 0x6c, 0xf1, 0x2c, 0x4a, 0x41, 0x45, 0xba, 0xd8, 0x5e, 0x92, 0xeb, 0x7f, 0x3b, 0x37, + 0xd5, 0xda, 0x69, 0xd0, 0xcf, 0x60, 0x4c, 0x41, 0xc4, 0x96, 0x4f, 0xad, 0x2d, 0x70, 0x45, 0x68, 0xd6, 0xbe, 0x8c, 0xaf, 0xda, + 0xee, 0x37, 0x0a, 0x35, 0x01, 0x29, 0x01, 0x18, 0x24, 0x02, 0x60, 0x30, 0x04, 0x14, 0x50, 0x6f, 0xc3, 0xfc, 0xb7, 0x94, 0x15, + 0x88, 0xea, 0x73, 0x6c, 0x20, 0x65, 0x2e, 0x5f, 0x1b, 0x11, 0x70, 0x1c, 0x6a, 0x30, 0x05, 0x14, 0xcc, 0x13, 0x08, 0xaf, 0x82, + 0xcf, 0xee, 0x50, 0x5e, 0xb2, 0x3b, 0x57, 0xbf, 0xe8, 0x6a, 0x31, 0x16, 0x65, 0x53, 0x5f, 0x18, 0x30, 0x0b, 0x40, 0xe9, 0x3b, + 0x4d, 0x4b, 0x8e, 0xe1, 0x66, 0x9f, 0x49, 0x85, 0x97, 0x04, 0x83, 0xe4, 0x00, 0x00, 0x9e, 0xd0, 0x46, 0xb3, 0x4e, 0xdc, 0x11, + 0x8a, 0xcd, 0xb4, 0xed, 0xea, 0xb6, 0x21, 0x71, 0xbe, 0x7e, 0x80, 0xd5, 0xc2, 0x98, 0x5d, 0x6c, 0x6a, 0xb2, 0x55, 0xc3, 0xc4, + 0xad, 0x55, 0x4c, 0x72, 0x70, 0x04, 0x8c, 0x26, 0xd6, 0xe6, 0xd3, 0xe9, 0xc2, 0xe7, 0x1f, 0xb2, 0x0a, 0xf2, 0xf0, 0xfe, 0x18, }; -extern const uint32_t sTestCert_ICA01_1_Chip_Len = sizeof(sTestCert_ICA01_1_Chip); +extern const size_t sTestCert_ICA01_1_Chip_Len = sizeof(sTestCert_ICA01_1_Chip); extern const uint8_t sTestCert_ICA01_1_DER[] = { - 0x30, 0x82, 0x01, 0x9e, 0x30, 0x82, 0x01, 0x43, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x44, 0x9c, 0xf9, 0x78, 0x97, 0xcd, - 0xbf, 0x71, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, + 0x30, 0x82, 0x01, 0x9d, 0x30, 0x82, 0x01, 0x43, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x36, 0xed, 0x10, 0xc3, 0x95, 0x64, + 0x59, 0x78, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x30, 0x1e, 0x17, 0x0d, 0x32, 0x30, 0x31, 0x30, 0x31, 0x35, 0x31, 0x34, 0x32, 0x33, 0x34, 0x33, 0x5a, 0x17, 0x0d, 0x34, 0x30, 0x31, 0x30, 0x31, 0x35, 0x31, 0x34, 0x32, 0x33, 0x34, 0x32, 0x5a, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x35, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, - 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x9b, 0x54, - 0x14, 0x20, 0x29, 0x26, 0x1b, 0xa1, 0x22, 0x95, 0x62, 0x72, 0x4c, 0x66, 0x7f, 0x6a, 0x0b, 0x82, 0x5c, 0xfc, 0x80, 0x18, 0xd9, - 0x50, 0x24, 0x13, 0x71, 0x82, 0x4d, 0x73, 0x52, 0x59, 0x51, 0x88, 0x2a, 0x12, 0xd4, 0x48, 0xd5, 0xef, 0x28, 0x1c, 0xcc, 0x73, - 0x90, 0xe3, 0xbc, 0xc6, 0x41, 0xb3, 0xdb, 0x27, 0x2a, 0x37, 0x4a, 0xd0, 0x22, 0xec, 0xc3, 0x4e, 0x3d, 0x2c, 0x8d, 0x7a, 0xa3, + 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0xe1, 0xd5, + 0x3a, 0x9c, 0x25, 0x7a, 0xe3, 0x2b, 0xab, 0x05, 0x77, 0x89, 0x06, 0x03, 0x13, 0x91, 0xb5, 0x8a, 0xdf, 0x9f, 0x8a, 0xb2, 0x69, + 0x38, 0xad, 0xeb, 0xf1, 0x39, 0x6c, 0xf1, 0x2c, 0x4a, 0x41, 0x45, 0xba, 0xd8, 0x5e, 0x92, 0xeb, 0x7f, 0x3b, 0x37, 0xd5, 0xda, + 0x69, 0xd0, 0xcf, 0x60, 0x4c, 0x41, 0xc4, 0x96, 0x4f, 0xad, 0x2d, 0x70, 0x45, 0x68, 0xd6, 0xbe, 0x8c, 0xaf, 0xda, 0xee, 0xa3, 0x63, 0x30, 0x61, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x01, 0x06, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, - 0x0e, 0x04, 0x16, 0x04, 0x14, 0x93, 0x88, 0x3c, 0x64, 0x9f, 0xc1, 0x7e, 0xc1, 0x2a, 0x6a, 0x1d, 0x77, 0xcf, 0xb9, 0x97, 0x2a, - 0x55, 0x9c, 0x1a, 0xd8, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x13, 0xaf, 0x81, 0xab, - 0x37, 0x37, 0x4b, 0x2e, 0xd2, 0xa9, 0x64, 0x9b, 0x12, 0xb7, 0xa3, 0xa4, 0x28, 0x7e, 0x15, 0x1d, 0x30, 0x0a, 0x06, 0x08, 0x2a, - 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x49, 0x00, 0x30, 0x46, 0x02, 0x21, 0x00, 0xf7, 0x81, 0x3c, 0xac, 0xa8, 0x23, - 0x82, 0xec, 0x45, 0x45, 0x1e, 0xed, 0x2e, 0x16, 0x2d, 0x40, 0x99, 0xf9, 0xd6, 0xbf, 0x43, 0xa6, 0x7a, 0x0e, 0x6d, 0xa2, 0xa0, - 0xa3, 0xe3, 0xc8, 0xb5, 0x50, 0x02, 0x21, 0x00, 0xbc, 0x8a, 0xe4, 0xd3, 0xcc, 0x1c, 0xd0, 0x4f, 0xf7, 0x56, 0xed, 0xd9, 0xfe, - 0xb3, 0xaa, 0x89, 0x6f, 0x3d, 0xdb, 0xd7, 0x1a, 0xe0, 0x54, 0x12, 0xaa, 0x06, 0x61, 0xaf, 0x42, 0x7e, 0xcb, 0x57, + 0x0e, 0x04, 0x16, 0x04, 0x14, 0x50, 0x6f, 0xc3, 0xfc, 0xb7, 0x94, 0x15, 0x88, 0xea, 0x73, 0x6c, 0x20, 0x65, 0x2e, 0x5f, 0x1b, + 0x11, 0x70, 0x1c, 0x6a, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xcc, 0x13, 0x08, 0xaf, + 0x82, 0xcf, 0xee, 0x50, 0x5e, 0xb2, 0x3b, 0x57, 0xbf, 0xe8, 0x6a, 0x31, 0x16, 0x65, 0x53, 0x5f, 0x30, 0x0a, 0x06, 0x08, 0x2a, + 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, 0x45, 0x02, 0x21, 0x00, 0xe9, 0x3b, 0x4d, 0x4b, 0x8e, 0xe1, + 0x66, 0x9f, 0x49, 0x85, 0x97, 0x04, 0x83, 0xe4, 0x00, 0x00, 0x9e, 0xd0, 0x46, 0xb3, 0x4e, 0xdc, 0x11, 0x8a, 0xcd, 0xb4, 0xed, + 0xea, 0xb6, 0x21, 0x71, 0xbe, 0x02, 0x20, 0x7e, 0x80, 0xd5, 0xc2, 0x98, 0x5d, 0x6c, 0x6a, 0xb2, 0x55, 0xc3, 0xc4, 0xad, 0x55, + 0x4c, 0x72, 0x70, 0x04, 0x8c, 0x26, 0xd6, 0xe6, 0xd3, 0xe9, 0xc2, 0xe7, 0x1f, 0xb2, 0x0a, 0xf2, 0xf0, 0xfe, }; -extern const uint32_t sTestCert_ICA01_1_DER_Len = sizeof(sTestCert_ICA01_1_DER); +extern const size_t sTestCert_ICA01_1_DER_Len = sizeof(sTestCert_ICA01_1_DER); extern const uint8_t sTestCert_ICA01_1_PublicKey[] = { - 0x04, 0x9b, 0x54, 0x14, 0x20, 0x29, 0x26, 0x1b, 0xa1, 0x22, 0x95, 0x62, 0x72, 0x4c, 0x66, 0x7f, 0x6a, - 0x0b, 0x82, 0x5c, 0xfc, 0x80, 0x18, 0xd9, 0x50, 0x24, 0x13, 0x71, 0x82, 0x4d, 0x73, 0x52, 0x59, 0x51, - 0x88, 0x2a, 0x12, 0xd4, 0x48, 0xd5, 0xef, 0x28, 0x1c, 0xcc, 0x73, 0x90, 0xe3, 0xbc, 0xc6, 0x41, 0xb3, - 0xdb, 0x27, 0x2a, 0x37, 0x4a, 0xd0, 0x22, 0xec, 0xc3, 0x4e, 0x3d, 0x2c, 0x8d, 0x7a, + 0x04, 0xe1, 0xd5, 0x3a, 0x9c, 0x25, 0x7a, 0xe3, 0x2b, 0xab, 0x05, 0x77, 0x89, 0x06, 0x03, 0x13, 0x91, + 0xb5, 0x8a, 0xdf, 0x9f, 0x8a, 0xb2, 0x69, 0x38, 0xad, 0xeb, 0xf1, 0x39, 0x6c, 0xf1, 0x2c, 0x4a, 0x41, + 0x45, 0xba, 0xd8, 0x5e, 0x92, 0xeb, 0x7f, 0x3b, 0x37, 0xd5, 0xda, 0x69, 0xd0, 0xcf, 0x60, 0x4c, 0x41, + 0xc4, 0x96, 0x4f, 0xad, 0x2d, 0x70, 0x45, 0x68, 0xd6, 0xbe, 0x8c, 0xaf, 0xda, 0xee, }; -extern const uint8_t sTestCert_ICA01_1_PublicKey_Len = sizeof(sTestCert_ICA01_1_PublicKey); +extern const size_t sTestCert_ICA01_1_PublicKey_Len = sizeof(sTestCert_ICA01_1_PublicKey); extern const uint8_t sTestCert_ICA01_1_PrivateKey[] = { - 0x7d, 0xe2, 0x90, 0x4c, 0x46, 0x42, 0x9b, 0xd3, 0xca, 0x60, 0x4b, 0x15, 0xff, 0xfd, 0x2b, 0xc0, - 0xf8, 0x7c, 0xb0, 0x23, 0xfc, 0x4b, 0xd1, 0x2d, 0x93, 0x0f, 0x4b, 0x0d, 0xb5, 0xf1, 0x81, 0x57, + 0x93, 0xdb, 0xce, 0x6a, 0x6b, 0xf8, 0xdb, 0x3c, 0x4a, 0x96, 0xdd, 0x28, 0x2f, 0x4c, 0xb8, 0xf0, + 0x6b, 0xca, 0x61, 0x6f, 0xb9, 0x00, 0x9e, 0xd6, 0x4a, 0x49, 0x0f, 0xb0, 0x65, 0x83, 0xaf, 0x8d, }; -extern const uint8_t sTestCert_ICA01_1_PrivateKey_Len = sizeof(sTestCert_ICA01_1_PrivateKey); +extern const size_t sTestCert_ICA01_1_PrivateKey_Len = sizeof(sTestCert_ICA01_1_PrivateKey); extern const uint8_t sTestCert_ICA01_1_SubjectKeyId[] = { - 0x93, 0x88, 0x3C, 0x64, 0x9F, 0xC1, 0x7E, 0xC1, 0x2A, 0x6A, 0x1D, 0x77, 0xCF, 0xB9, 0x97, 0x2A, 0x55, 0x9C, 0x1A, 0xD8, + 0x50, 0x6F, 0xC3, 0xFC, 0xB7, 0x94, 0x15, 0x88, 0xEA, 0x73, 0x6C, 0x20, 0x65, 0x2E, 0x5F, 0x1B, 0x11, 0x70, 0x1C, 0x6A, }; -extern const uint8_t sTestCert_ICA01_1_SubjectKeyId_Len = sizeof(sTestCert_ICA01_1_SubjectKeyId); +extern const size_t sTestCert_ICA01_1_SubjectKeyId_Len = sizeof(sTestCert_ICA01_1_SubjectKeyId); extern const uint8_t sTestCert_ICA01_1_AuthorityKeyId[] = { - 0x13, 0xAF, 0x81, 0xAB, 0x37, 0x37, 0x4B, 0x2E, 0xD2, 0xA9, 0x64, 0x9B, 0x12, 0xB7, 0xA3, 0xA4, 0x28, 0x7E, 0x15, 0x1D, + 0xCC, 0x13, 0x08, 0xAF, 0x82, 0xCF, 0xEE, 0x50, 0x5E, 0xB2, 0x3B, 0x57, 0xBF, 0xE8, 0x6A, 0x31, 0x16, 0x65, 0x53, 0x5F, }; -extern const uint8_t sTestCert_ICA01_1_AuthorityKeyId_Len = sizeof(sTestCert_ICA01_1_AuthorityKeyId); +extern const size_t sTestCert_ICA01_1_AuthorityKeyId_Len = sizeof(sTestCert_ICA01_1_AuthorityKeyId); /************** Test FWSign01 Certificate ************** Certificate: Data: Version: 3 (0x2) - Serial Number: 7114055507392117267 (0x62ba33cac684ba13) + Serial Number: 8818095388640854520 (0x7a602b092372c1f8) Signature Algorithm: ecdsa-with-SHA256 Issuer: 1.3.6.1.4.1.37244.1.3 = CACACACA00000005 Validity @@ -958,11 +964,11 @@ extern const uint8_t sTestCert_ICA01_1_AuthorityKeyId_Len = sizeof(sTestCert_ICA Public Key Algorithm: id-ecPublicKey Public-Key: (256 bit) pub: - 04:e1:81:d9:cf:f5:16:d6:e0:f6:e1:70:3c:40:4a: - ef:fe:96:09:64:87:9e:c8:4f:25:39:92:ce:db:2a: - e6:44:a8:63:05:31:6f:69:e2:c6:56:bd:cc:9b:10: - 29:68:3f:0b:af:97:28:2e:1c:ee:89:3b:cc:f3:56: - fb:86:e6:e3:64 + 04:fd:2a:e4:0a:74:7c:6d:5a:c6:c8:dc:79:61:2b: + 9a:85:3c:3e:0f:b4:1c:94:ff:08:5b:4e:1d:02:24: + 85:98:65:ea:6c:7d:67:bb:88:84:34:a6:0d:42:0f: + d2:b9:9e:94:2b:6a:f8:a5:0f:12:76:53:5c:4f:f0: + 32:61:79:dd:78 ASN1 OID: prime256v1 NIST CURVE: P-256 X509v3 extensions: @@ -973,58 +979,58 @@ extern const uint8_t sTestCert_ICA01_1_AuthorityKeyId_Len = sizeof(sTestCert_ICA X509v3 Extended Key Usage: critical Code Signing X509v3 Subject Key Identifier: - 91:5B:BB:66:70:1F:63:1B:86:5D:40:51:A4:E0:0E:CD:7C:06:B0:0C + 52:25:D5:83:FB:71:8A:7C:64:51:FD:AF:92:2A:CD:2D:36:10:05:C7 X509v3 Authority Key Identifier: - keyid:93:88:3C:64:9F:C1:7E:C1:2A:6A:1D:77:CF:B9:97:2A:55:9C:1A:D8 + keyid:50:6F:C3:FC:B7:94:15:88:EA:73:6C:20:65:2E:5F:1B:11:70:1C:6A Signature Algorithm: ecdsa-with-SHA256 - 30:44:02:20:28:1b:51:a9:11:5c:11:ce:ff:f2:e9:d7:58:d9: - 16:92:db:c3:1d:14:89:4c:a1:35:67:fe:30:75:c4:44:71:e9: - 02:20:5c:d3:9b:f9:5d:21:46:c0:99:5e:b0:e0:5c:14:a1:3c: - 69:5f:1d:f2:0f:2c:7a:7d:48:58:c5:f4:c7:1d:68:95 + 30:46:02:21:00:ed:3e:a4:16:ed:19:69:0d:e5:2b:38:66:6d: + 5a:7b:e6:e6:62:09:af:29:4e:a4:63:b4:95:1c:ad:d7:c4:6f: + 5a:02:21:00:a7:4a:4d:56:0f:89:7d:53:65:a8:9f:de:38:f3: + f9:11:72:48:39:1c:f5:bc:76:16:f6:99:08:59:33:d5:63:c9 -----BEGIN CERTIFICATE----- -MIIByzCCAXKgAwIBAgIIYrozysaEuhMwCgYIKoZIzj0EAwIwIjEgMB4GCisGAQQB +MIIBzTCCAXKgAwIBAgIIemArCSNywfgwCgYIKoZIzj0EAwIwIjEgMB4GCisGAQQB gqJ8AQMMEENBQ0FDQUNBMDAwMDAwMDUwHhcNMjAxMDE1MTQyMzQzWhcNNDAxMDE1 MTQyMzQyWjA8MSAwHgYKKwYBBAGConwBAgwQRkZGRkZGRkYwMDAwMDAwMTEYMBYG A1UEAwwPRlcgU0lHTiBDRVJUIDAxMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE -4YHZz/UW1uD24XA8QErv/pYJZIeeyE8lOZLO2yrmRKhjBTFvaeLGVr3MmxApaD8L -r5coLhzuiTvM81b7hubjZKN4MHYwDAYDVR0TAQH/BAIwADAOBgNVHQ8BAf8EBAMC -B4AwFgYDVR0lAQH/BAwwCgYIKwYBBQUHAwMwHQYDVR0OBBYEFJFbu2ZwH2Mbhl1A -UaTgDs18BrAMMB8GA1UdIwQYMBaAFJOIPGSfwX7BKmodd8+5lypVnBrYMAoGCCqG -SM49BAMCA0cAMEQCICgbUakRXBHO//Lp11jZFpLbwx0UiUyhNWf+MHXERHHpAiBc -05v5XSFGwJlesOBcFKE8aV8d8g8sen1IWMX0xx1olQ== +/SrkCnR8bVrGyNx5YSuahTw+D7QclP8IW04dAiSFmGXqbH1nu4iENKYNQg/SuZ6U +K2r4pQ8SdlNcT/AyYXndeKN4MHYwDAYDVR0TAQH/BAIwADAOBgNVHQ8BAf8EBAMC +B4AwFgYDVR0lAQH/BAwwCgYIKwYBBQUHAwMwHQYDVR0OBBYEFFIl1YP7cYp8ZFH9 +r5IqzS02EAXHMB8GA1UdIwQYMBaAFFBvw/y3lBWI6nNsIGUuXxsRcBxqMAoGCCqG +SM49BAMCA0kAMEYCIQDtPqQW7RlpDeUrOGZtWnvm5mIJrylOpGO0lRyt18RvWgIh +AKdKTVYPiX1TZaif3jjz+RFySDkc9bx2FvaZCFkz1WPJ -----END CERTIFICATE----- -----BEGIN EC PRIVATE KEY----- -MHcCAQEEII8chAINodENL5Z6hVn4oIsm+luGPuyHxc4v3h4kdjjyoAoGCCqGSM49 -AwEHoUQDQgAE4YHZz/UW1uD24XA8QErv/pYJZIeeyE8lOZLO2yrmRKhjBTFvaeLG -Vr3MmxApaD8Lr5coLhzuiTvM81b7hubjZA== +MHcCAQEEIGHzoGacIS0jn3F7zq4ipXOVSm+SFTejhUInbbswiS3goAoGCCqGSM49 +AwEHoUQDQgAE/SrkCnR8bVrGyNx5YSuahTw+D7QclP8IW04dAiSFmGXqbH1nu4iE +NKYNQg/SuZ6UK2r4pQ8SdlNcT/AyYXndeA== -----END EC PRIVATE KEY----- */ extern const uint8_t sTestCert_FWSign01_Chip[] = { - 0x15, 0x30, 0x01, 0x08, 0x62, 0xba, 0x33, 0xca, 0xc6, 0x84, 0xba, 0x13, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x05, + 0x15, 0x30, 0x01, 0x08, 0x7a, 0x60, 0x2b, 0x09, 0x23, 0x72, 0xc1, 0xf8, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x05, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x12, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x2c, 0x01, 0x0f, 0x46, 0x57, 0x20, 0x53, 0x49, 0x47, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x20, 0x30, 0x31, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, - 0x04, 0xe1, 0x81, 0xd9, 0xcf, 0xf5, 0x16, 0xd6, 0xe0, 0xf6, 0xe1, 0x70, 0x3c, 0x40, 0x4a, 0xef, 0xfe, 0x96, 0x09, 0x64, - 0x87, 0x9e, 0xc8, 0x4f, 0x25, 0x39, 0x92, 0xce, 0xdb, 0x2a, 0xe6, 0x44, 0xa8, 0x63, 0x05, 0x31, 0x6f, 0x69, 0xe2, 0xc6, - 0x56, 0xbd, 0xcc, 0x9b, 0x10, 0x29, 0x68, 0x3f, 0x0b, 0xaf, 0x97, 0x28, 0x2e, 0x1c, 0xee, 0x89, 0x3b, 0xcc, 0xf3, 0x56, - 0xfb, 0x86, 0xe6, 0xe3, 0x64, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x03, 0x18, - 0x30, 0x04, 0x14, 0x91, 0x5b, 0xbb, 0x66, 0x70, 0x1f, 0x63, 0x1b, 0x86, 0x5d, 0x40, 0x51, 0xa4, 0xe0, 0x0e, 0xcd, 0x7c, - 0x06, 0xb0, 0x0c, 0x30, 0x05, 0x14, 0x93, 0x88, 0x3c, 0x64, 0x9f, 0xc1, 0x7e, 0xc1, 0x2a, 0x6a, 0x1d, 0x77, 0xcf, 0xb9, - 0x97, 0x2a, 0x55, 0x9c, 0x1a, 0xd8, 0x18, 0x30, 0x0b, 0x40, 0x28, 0x1b, 0x51, 0xa9, 0x11, 0x5c, 0x11, 0xce, 0xff, 0xf2, - 0xe9, 0xd7, 0x58, 0xd9, 0x16, 0x92, 0xdb, 0xc3, 0x1d, 0x14, 0x89, 0x4c, 0xa1, 0x35, 0x67, 0xfe, 0x30, 0x75, 0xc4, 0x44, - 0x71, 0xe9, 0x5c, 0xd3, 0x9b, 0xf9, 0x5d, 0x21, 0x46, 0xc0, 0x99, 0x5e, 0xb0, 0xe0, 0x5c, 0x14, 0xa1, 0x3c, 0x69, 0x5f, - 0x1d, 0xf2, 0x0f, 0x2c, 0x7a, 0x7d, 0x48, 0x58, 0xc5, 0xf4, 0xc7, 0x1d, 0x68, 0x95, 0x18, + 0x04, 0xfd, 0x2a, 0xe4, 0x0a, 0x74, 0x7c, 0x6d, 0x5a, 0xc6, 0xc8, 0xdc, 0x79, 0x61, 0x2b, 0x9a, 0x85, 0x3c, 0x3e, 0x0f, + 0xb4, 0x1c, 0x94, 0xff, 0x08, 0x5b, 0x4e, 0x1d, 0x02, 0x24, 0x85, 0x98, 0x65, 0xea, 0x6c, 0x7d, 0x67, 0xbb, 0x88, 0x84, + 0x34, 0xa6, 0x0d, 0x42, 0x0f, 0xd2, 0xb9, 0x9e, 0x94, 0x2b, 0x6a, 0xf8, 0xa5, 0x0f, 0x12, 0x76, 0x53, 0x5c, 0x4f, 0xf0, + 0x32, 0x61, 0x79, 0xdd, 0x78, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x03, 0x18, + 0x30, 0x04, 0x14, 0x52, 0x25, 0xd5, 0x83, 0xfb, 0x71, 0x8a, 0x7c, 0x64, 0x51, 0xfd, 0xaf, 0x92, 0x2a, 0xcd, 0x2d, 0x36, + 0x10, 0x05, 0xc7, 0x30, 0x05, 0x14, 0x50, 0x6f, 0xc3, 0xfc, 0xb7, 0x94, 0x15, 0x88, 0xea, 0x73, 0x6c, 0x20, 0x65, 0x2e, + 0x5f, 0x1b, 0x11, 0x70, 0x1c, 0x6a, 0x18, 0x30, 0x0b, 0x40, 0xed, 0x3e, 0xa4, 0x16, 0xed, 0x19, 0x69, 0x0d, 0xe5, 0x2b, + 0x38, 0x66, 0x6d, 0x5a, 0x7b, 0xe6, 0xe6, 0x62, 0x09, 0xaf, 0x29, 0x4e, 0xa4, 0x63, 0xb4, 0x95, 0x1c, 0xad, 0xd7, 0xc4, + 0x6f, 0x5a, 0xa7, 0x4a, 0x4d, 0x56, 0x0f, 0x89, 0x7d, 0x53, 0x65, 0xa8, 0x9f, 0xde, 0x38, 0xf3, 0xf9, 0x11, 0x72, 0x48, + 0x39, 0x1c, 0xf5, 0xbc, 0x76, 0x16, 0xf6, 0x99, 0x08, 0x59, 0x33, 0xd5, 0x63, 0xc9, 0x18, }; -extern const uint32_t sTestCert_FWSign01_Chip_Len = sizeof(sTestCert_FWSign01_Chip); +extern const size_t sTestCert_FWSign01_Chip_Len = sizeof(sTestCert_FWSign01_Chip); extern const uint8_t sTestCert_FWSign01_DER[] = { - 0x30, 0x82, 0x01, 0xcb, 0x30, 0x82, 0x01, 0x72, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x62, 0xba, 0x33, 0xca, 0xc6, 0x84, - 0xba, 0x13, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, + 0x30, 0x82, 0x01, 0xcd, 0x30, 0x82, 0x01, 0x72, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x7a, 0x60, 0x2b, 0x09, 0x23, 0x72, + 0xc1, 0xf8, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x35, 0x30, 0x1e, 0x17, 0x0d, 0x32, 0x30, 0x31, 0x30, 0x31, 0x35, 0x31, 0x34, 0x32, 0x33, 0x34, 0x33, 0x5a, 0x17, 0x0d, 0x34, 0x30, 0x31, 0x30, 0x31, 0x35, 0x31, 0x34, 0x32, 0x33, 0x34, 0x32, 0x5a, 0x30, 0x3c, @@ -1032,57 +1038,57 @@ extern const uint8_t sTestCert_FWSign01_DER[] = { 0x46, 0x46, 0x46, 0x46, 0x46, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0f, 0x46, 0x57, 0x20, 0x53, 0x49, 0x47, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x20, 0x30, 0x31, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, - 0x42, 0x00, 0x04, 0xe1, 0x81, 0xd9, 0xcf, 0xf5, 0x16, 0xd6, 0xe0, 0xf6, 0xe1, 0x70, 0x3c, 0x40, 0x4a, 0xef, 0xfe, 0x96, 0x09, - 0x64, 0x87, 0x9e, 0xc8, 0x4f, 0x25, 0x39, 0x92, 0xce, 0xdb, 0x2a, 0xe6, 0x44, 0xa8, 0x63, 0x05, 0x31, 0x6f, 0x69, 0xe2, 0xc6, - 0x56, 0xbd, 0xcc, 0x9b, 0x10, 0x29, 0x68, 0x3f, 0x0b, 0xaf, 0x97, 0x28, 0x2e, 0x1c, 0xee, 0x89, 0x3b, 0xcc, 0xf3, 0x56, 0xfb, - 0x86, 0xe6, 0xe3, 0x64, 0xa3, 0x78, 0x30, 0x76, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x02, 0x30, + 0x42, 0x00, 0x04, 0xfd, 0x2a, 0xe4, 0x0a, 0x74, 0x7c, 0x6d, 0x5a, 0xc6, 0xc8, 0xdc, 0x79, 0x61, 0x2b, 0x9a, 0x85, 0x3c, 0x3e, + 0x0f, 0xb4, 0x1c, 0x94, 0xff, 0x08, 0x5b, 0x4e, 0x1d, 0x02, 0x24, 0x85, 0x98, 0x65, 0xea, 0x6c, 0x7d, 0x67, 0xbb, 0x88, 0x84, + 0x34, 0xa6, 0x0d, 0x42, 0x0f, 0xd2, 0xb9, 0x9e, 0x94, 0x2b, 0x6a, 0xf8, 0xa5, 0x0f, 0x12, 0x76, 0x53, 0x5c, 0x4f, 0xf0, 0x32, + 0x61, 0x79, 0xdd, 0x78, 0xa3, 0x78, 0x30, 0x76, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x07, 0x80, 0x30, 0x16, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x01, 0x01, 0xff, 0x04, 0x0c, 0x30, 0x0a, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x03, 0x30, - 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x91, 0x5b, 0xbb, 0x66, 0x70, 0x1f, 0x63, 0x1b, 0x86, 0x5d, 0x40, - 0x51, 0xa4, 0xe0, 0x0e, 0xcd, 0x7c, 0x06, 0xb0, 0x0c, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, - 0x14, 0x93, 0x88, 0x3c, 0x64, 0x9f, 0xc1, 0x7e, 0xc1, 0x2a, 0x6a, 0x1d, 0x77, 0xcf, 0xb9, 0x97, 0x2a, 0x55, 0x9c, 0x1a, 0xd8, - 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x47, 0x00, 0x30, 0x44, 0x02, 0x20, 0x28, 0x1b, - 0x51, 0xa9, 0x11, 0x5c, 0x11, 0xce, 0xff, 0xf2, 0xe9, 0xd7, 0x58, 0xd9, 0x16, 0x92, 0xdb, 0xc3, 0x1d, 0x14, 0x89, 0x4c, 0xa1, - 0x35, 0x67, 0xfe, 0x30, 0x75, 0xc4, 0x44, 0x71, 0xe9, 0x02, 0x20, 0x5c, 0xd3, 0x9b, 0xf9, 0x5d, 0x21, 0x46, 0xc0, 0x99, 0x5e, - 0xb0, 0xe0, 0x5c, 0x14, 0xa1, 0x3c, 0x69, 0x5f, 0x1d, 0xf2, 0x0f, 0x2c, 0x7a, 0x7d, 0x48, 0x58, 0xc5, 0xf4, 0xc7, 0x1d, 0x68, - 0x95, + 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x52, 0x25, 0xd5, 0x83, 0xfb, 0x71, 0x8a, 0x7c, 0x64, 0x51, 0xfd, + 0xaf, 0x92, 0x2a, 0xcd, 0x2d, 0x36, 0x10, 0x05, 0xc7, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, + 0x14, 0x50, 0x6f, 0xc3, 0xfc, 0xb7, 0x94, 0x15, 0x88, 0xea, 0x73, 0x6c, 0x20, 0x65, 0x2e, 0x5f, 0x1b, 0x11, 0x70, 0x1c, 0x6a, + 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x49, 0x00, 0x30, 0x46, 0x02, 0x21, 0x00, 0xed, + 0x3e, 0xa4, 0x16, 0xed, 0x19, 0x69, 0x0d, 0xe5, 0x2b, 0x38, 0x66, 0x6d, 0x5a, 0x7b, 0xe6, 0xe6, 0x62, 0x09, 0xaf, 0x29, 0x4e, + 0xa4, 0x63, 0xb4, 0x95, 0x1c, 0xad, 0xd7, 0xc4, 0x6f, 0x5a, 0x02, 0x21, 0x00, 0xa7, 0x4a, 0x4d, 0x56, 0x0f, 0x89, 0x7d, 0x53, + 0x65, 0xa8, 0x9f, 0xde, 0x38, 0xf3, 0xf9, 0x11, 0x72, 0x48, 0x39, 0x1c, 0xf5, 0xbc, 0x76, 0x16, 0xf6, 0x99, 0x08, 0x59, 0x33, + 0xd5, 0x63, 0xc9, }; -extern const uint32_t sTestCert_FWSign01_DER_Len = sizeof(sTestCert_FWSign01_DER); +extern const size_t sTestCert_FWSign01_DER_Len = sizeof(sTestCert_FWSign01_DER); extern const uint8_t sTestCert_FWSign01_PublicKey[] = { - 0x04, 0xe1, 0x81, 0xd9, 0xcf, 0xf5, 0x16, 0xd6, 0xe0, 0xf6, 0xe1, 0x70, 0x3c, 0x40, 0x4a, 0xef, 0xfe, - 0x96, 0x09, 0x64, 0x87, 0x9e, 0xc8, 0x4f, 0x25, 0x39, 0x92, 0xce, 0xdb, 0x2a, 0xe6, 0x44, 0xa8, 0x63, - 0x05, 0x31, 0x6f, 0x69, 0xe2, 0xc6, 0x56, 0xbd, 0xcc, 0x9b, 0x10, 0x29, 0x68, 0x3f, 0x0b, 0xaf, 0x97, - 0x28, 0x2e, 0x1c, 0xee, 0x89, 0x3b, 0xcc, 0xf3, 0x56, 0xfb, 0x86, 0xe6, 0xe3, 0x64, + 0x04, 0xfd, 0x2a, 0xe4, 0x0a, 0x74, 0x7c, 0x6d, 0x5a, 0xc6, 0xc8, 0xdc, 0x79, 0x61, 0x2b, 0x9a, 0x85, + 0x3c, 0x3e, 0x0f, 0xb4, 0x1c, 0x94, 0xff, 0x08, 0x5b, 0x4e, 0x1d, 0x02, 0x24, 0x85, 0x98, 0x65, 0xea, + 0x6c, 0x7d, 0x67, 0xbb, 0x88, 0x84, 0x34, 0xa6, 0x0d, 0x42, 0x0f, 0xd2, 0xb9, 0x9e, 0x94, 0x2b, 0x6a, + 0xf8, 0xa5, 0x0f, 0x12, 0x76, 0x53, 0x5c, 0x4f, 0xf0, 0x32, 0x61, 0x79, 0xdd, 0x78, }; -extern const uint8_t sTestCert_FWSign01_PublicKey_Len = sizeof(sTestCert_FWSign01_PublicKey); +extern const size_t sTestCert_FWSign01_PublicKey_Len = sizeof(sTestCert_FWSign01_PublicKey); extern const uint8_t sTestCert_FWSign01_PrivateKey[] = { - 0x8f, 0x1c, 0x84, 0x02, 0x0d, 0xa1, 0xd1, 0x0d, 0x2f, 0x96, 0x7a, 0x85, 0x59, 0xf8, 0xa0, 0x8b, - 0x26, 0xfa, 0x5b, 0x86, 0x3e, 0xec, 0x87, 0xc5, 0xce, 0x2f, 0xde, 0x1e, 0x24, 0x76, 0x38, 0xf2, + 0x61, 0xf3, 0xa0, 0x66, 0x9c, 0x21, 0x2d, 0x23, 0x9f, 0x71, 0x7b, 0xce, 0xae, 0x22, 0xa5, 0x73, + 0x95, 0x4a, 0x6f, 0x92, 0x15, 0x37, 0xa3, 0x85, 0x42, 0x27, 0x6d, 0xbb, 0x30, 0x89, 0x2d, 0xe0, }; -extern const uint8_t sTestCert_FWSign01_PrivateKey_Len = sizeof(sTestCert_FWSign01_PrivateKey); +extern const size_t sTestCert_FWSign01_PrivateKey_Len = sizeof(sTestCert_FWSign01_PrivateKey); extern const uint8_t sTestCert_FWSign01_SubjectKeyId[] = { - 0x91, 0x5B, 0xBB, 0x66, 0x70, 0x1F, 0x63, 0x1B, 0x86, 0x5D, 0x40, 0x51, 0xA4, 0xE0, 0x0E, 0xCD, 0x7C, 0x06, 0xB0, 0x0C, + 0x52, 0x25, 0xD5, 0x83, 0xFB, 0x71, 0x8A, 0x7C, 0x64, 0x51, 0xFD, 0xAF, 0x92, 0x2A, 0xCD, 0x2D, 0x36, 0x10, 0x05, 0xC7, }; -extern const uint8_t sTestCert_FWSign01_SubjectKeyId_Len = sizeof(sTestCert_FWSign01_SubjectKeyId); +extern const size_t sTestCert_FWSign01_SubjectKeyId_Len = sizeof(sTestCert_FWSign01_SubjectKeyId); extern const uint8_t sTestCert_FWSign01_AuthorityKeyId[] = { - 0x93, 0x88, 0x3C, 0x64, 0x9F, 0xC1, 0x7E, 0xC1, 0x2A, 0x6A, 0x1D, 0x77, 0xCF, 0xB9, 0x97, 0x2A, 0x55, 0x9C, 0x1A, 0xD8, + 0x50, 0x6F, 0xC3, 0xFC, 0xB7, 0x94, 0x15, 0x88, 0xEA, 0x73, 0x6C, 0x20, 0x65, 0x2E, 0x5F, 0x1B, 0x11, 0x70, 0x1C, 0x6A, }; -extern const uint8_t sTestCert_FWSign01_AuthorityKeyId_Len = sizeof(sTestCert_FWSign01_AuthorityKeyId); +extern const size_t sTestCert_FWSign01_AuthorityKeyId_Len = sizeof(sTestCert_FWSign01_AuthorityKeyId); /************** Test Node01_01 Certificate ************** Certificate: Data: Version: 3 (0x2) - Serial Number: 4538782998777667962 (0x3efcff1702b9a17a) + Serial Number: 1795082174304132643 (0x18e969ba0e089e23) Signature Algorithm: ecdsa-with-SHA256 Issuer: 1.3.6.1.4.1.37244.1.3 = CACACACA00000003 Validity @@ -1093,11 +1099,11 @@ extern const uint8_t sTestCert_FWSign01_AuthorityKeyId_Len = sizeof(sTestCert_FW Public Key Algorithm: id-ecPublicKey Public-Key: (256 bit) pub: - 04:9a:2a:21:6f:b3:9d:d6:b6:fa:21:1b:83:5c:89: - e3:e6:af:b6:6c:14:f7:58:31:95:4f:9f:f4:f7:a3: - f0:11:2c:8a:0d:8e:af:29:c6:53:29:4d:48:ee:e0: - 70:8a:03:2c:ca:39:39:3c:3a:7b:46:f1:81:ae:a0: - 78:fe:ad:83:83 + 04:bc:f6:58:0d:2d:71:e1:44:16:65:1f:7c:31:1b: + 5e:fc:f9:ae:c0:a8:c1:0a:f8:09:27:84:4c:24:0f: + 51:a8:eb:23:fa:07:44:13:88:87:ac:1e:73:cb:72: + a0:54:b6:a0:db:06:22:aa:80:70:71:01:63:13:b1: + 59:6c:85:52:cf ASN1 OID: prime256v1 NIST CURVE: P-256 X509v3 extensions: @@ -1108,80 +1114,80 @@ extern const uint8_t sTestCert_FWSign01_AuthorityKeyId_Len = sizeof(sTestCert_FW X509v3 Extended Key Usage: critical TLS Web Client Authentication, TLS Web Server Authentication X509v3 Subject Key Identifier: - 9F:55:A2:6B:7E:43:03:E6:08:83:E9:13:BF:94:F4:FB:5E:2A:61:61 + 69:67:C9:12:F8:A3:E6:89:55:6F:89:9B:65:D7:6F:53:FA:65:C7:B6 X509v3 Authority Key Identifier: - keyid:53:52:D7:05:9E:9C:15:A5:08:90:68:62:86:48:01:A2:9F:1F:41:D3 + keyid:44:0C:C6:92:31:C4:CB:5B:37:94:24:26:F8:1B:BE:24:B7:EF:34:5C Signature Algorithm: ecdsa-with-SHA256 - 30:45:02:20:79:55:c2:02:63:0b:4b:a4:d5:91:25:26:32:2f: - df:28:f8:9e:df:e5:af:9c:0e:57:2b:d8:a1:4a:aa:bb:4d:12: - 02:21:00:b8:3c:a1:7c:7b:05:fb:16:4b:77:d7:9c:52:96:13: - 31:6b:cf:d1:78:95:e4:b2:a4:f2:40:4b:98:17:32:71:59 + 30:46:02:21:00:ce:6e:f3:93:cb:bc:94:f8:0e:e2:90:cb:3c: + 3d:37:33:35:ba:b9:59:07:73:4d:99:d3:84:a6:2a:37:3b:84: + 84:02:21:00:e1:d4:1a:04:c3:14:0f:aa:19:e8:a2:b9:9b:0c: + 61:e3:3c:27:ea:91:39:73:e4:5b:5b:c6:e3:9c:27:0d:ac:53 -----BEGIN CERTIFICATE----- -MIIB4DCCAYagAwIBAgIIPvz/FwK5oXowCgYIKoZIzj0EAwIwIjEgMB4GCisGAQQB +MIIB4TCCAYagAwIBAgIIGOlpug4IniMwCgYIKoZIzj0EAwIwIjEgMB4GCisGAQQB gqJ8AQMMEENBQ0FDQUNBMDAwMDAwMDMwHhcNMjAxMDE1MTQyMzQzWhcNNDAxMDE1 MTQyMzQyWjBEMSAwHgYKKwYBBAGConwBAQwQREVERURFREUwMDAxMDAwMTEgMB4G CisGAQQBgqJ8AQUMEEZBQjAwMDAwMDAwMDAwMUQwWTATBgcqhkjOPQIBBggqhkjO -PQMBBwNCAASaKiFvs53WtvohG4NciePmr7ZsFPdYMZVPn/T3o/ARLIoNjq8pxlMp -TUju4HCKAyzKOTk8OntG8YGuoHj+rYODo4GDMIGAMAwGA1UdEwEB/wQCMAAwDgYD +PQMBBwNCAAS89lgNLXHhRBZlH3wxG178+a7AqMEK+AknhEwkD1Go6yP6B0QTiIes +HnPLcqBUtqDbBiKqgHBxAWMTsVlshVLPo4GDMIGAMAwGA1UdEwEB/wQCMAAwDgYD VR0PAQH/BAQDAgeAMCAGA1UdJQEB/wQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATAd -BgNVHQ4EFgQUn1Wia35DA+YIg+kTv5T0+14qYWEwHwYDVR0jBBgwFoAUU1LXBZ6c -FaUIkGhihkgBop8fQdMwCgYIKoZIzj0EAwIDSAAwRQIgeVXCAmMLS6TVkSUmMi/f -KPie3+WvnA5XK9ihSqq7TRICIQC4PKF8ewX7Fkt315xSlhMxa8/ReJXksqTyQEuY -FzJxWQ== +BgNVHQ4EFgQUaWfJEvij5olVb4mbZddvU/plx7YwHwYDVR0jBBgwFoAURAzGkjHE +y1s3lCQm+Bu+JLfvNFwwCgYIKoZIzj0EAwIDSQAwRgIhAM5u85PLvJT4DuKQyzw9 +NzM1urlZB3NNmdOEpio3O4SEAiEA4dQaBMMUD6oZ6KK5mwxh4zwn6pE5c+RbW8bj +nCcNrFM= -----END CERTIFICATE----- -----BEGIN EC PRIVATE KEY----- -MHcCAQEEIKVls/ooqO1qdPtvD/ik00DZ4a6Y8h36HwpZpOoCGhYnoAoGCCqGSM49 -AwEHoUQDQgAEmiohb7Od1rb6IRuDXInj5q+2bBT3WDGVT5/096PwESyKDY6vKcZT -KU1I7uBwigMsyjk5PDp7RvGBrqB4/q2Dgw== +MHcCAQEEIEkuf5eD7hX9qnGopnsfMfPI1Xt1CUpGE7m7PvRvpg2JoAoGCCqGSM49 +AwEHoUQDQgAEvPZYDS1x4UQWZR98MRte/PmuwKjBCvgJJ4RMJA9RqOsj+gdEE4iH +rB5zy3KgVLag2wYiqoBwcQFjE7FZbIVSzw== -----END EC PRIVATE KEY----- */ extern const uint8_t sTestCert_Node01_01_Chip[] = { - 0x15, 0x30, 0x01, 0x08, 0x3e, 0xfc, 0xff, 0x17, 0x02, 0xb9, 0xa1, 0x7a, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x03, 0x00, + 0x15, 0x30, 0x01, 0x08, 0x18, 0xe9, 0x69, 0xba, 0x0e, 0x08, 0x9e, 0x23, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, - 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0x9a, 0x2a, 0x21, 0x6f, 0xb3, 0x9d, 0xd6, 0xb6, 0xfa, 0x21, 0x1b, - 0x83, 0x5c, 0x89, 0xe3, 0xe6, 0xaf, 0xb6, 0x6c, 0x14, 0xf7, 0x58, 0x31, 0x95, 0x4f, 0x9f, 0xf4, 0xf7, 0xa3, 0xf0, 0x11, 0x2c, - 0x8a, 0x0d, 0x8e, 0xaf, 0x29, 0xc6, 0x53, 0x29, 0x4d, 0x48, 0xee, 0xe0, 0x70, 0x8a, 0x03, 0x2c, 0xca, 0x39, 0x39, 0x3c, 0x3a, - 0x7b, 0x46, 0xf1, 0x81, 0xae, 0xa0, 0x78, 0xfe, 0xad, 0x83, 0x83, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, - 0x36, 0x03, 0x04, 0x02, 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, 0x9f, 0x55, 0xa2, 0x6b, 0x7e, 0x43, 0x03, 0xe6, 0x08, 0x83, 0xe9, - 0x13, 0xbf, 0x94, 0xf4, 0xfb, 0x5e, 0x2a, 0x61, 0x61, 0x30, 0x05, 0x14, 0x53, 0x52, 0xd7, 0x05, 0x9e, 0x9c, 0x15, 0xa5, 0x08, - 0x90, 0x68, 0x62, 0x86, 0x48, 0x01, 0xa2, 0x9f, 0x1f, 0x41, 0xd3, 0x18, 0x30, 0x0b, 0x40, 0x79, 0x55, 0xc2, 0x02, 0x63, 0x0b, - 0x4b, 0xa4, 0xd5, 0x91, 0x25, 0x26, 0x32, 0x2f, 0xdf, 0x28, 0xf8, 0x9e, 0xdf, 0xe5, 0xaf, 0x9c, 0x0e, 0x57, 0x2b, 0xd8, 0xa1, - 0x4a, 0xaa, 0xbb, 0x4d, 0x12, 0xb8, 0x3c, 0xa1, 0x7c, 0x7b, 0x05, 0xfb, 0x16, 0x4b, 0x77, 0xd7, 0x9c, 0x52, 0x96, 0x13, 0x31, - 0x6b, 0xcf, 0xd1, 0x78, 0x95, 0xe4, 0xb2, 0xa4, 0xf2, 0x40, 0x4b, 0x98, 0x17, 0x32, 0x71, 0x59, 0x18, + 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0xbc, 0xf6, 0x58, 0x0d, 0x2d, 0x71, 0xe1, 0x44, 0x16, 0x65, 0x1f, + 0x7c, 0x31, 0x1b, 0x5e, 0xfc, 0xf9, 0xae, 0xc0, 0xa8, 0xc1, 0x0a, 0xf8, 0x09, 0x27, 0x84, 0x4c, 0x24, 0x0f, 0x51, 0xa8, 0xeb, + 0x23, 0xfa, 0x07, 0x44, 0x13, 0x88, 0x87, 0xac, 0x1e, 0x73, 0xcb, 0x72, 0xa0, 0x54, 0xb6, 0xa0, 0xdb, 0x06, 0x22, 0xaa, 0x80, + 0x70, 0x71, 0x01, 0x63, 0x13, 0xb1, 0x59, 0x6c, 0x85, 0x52, 0xcf, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, + 0x36, 0x03, 0x04, 0x02, 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, 0x69, 0x67, 0xc9, 0x12, 0xf8, 0xa3, 0xe6, 0x89, 0x55, 0x6f, 0x89, + 0x9b, 0x65, 0xd7, 0x6f, 0x53, 0xfa, 0x65, 0xc7, 0xb6, 0x30, 0x05, 0x14, 0x44, 0x0c, 0xc6, 0x92, 0x31, 0xc4, 0xcb, 0x5b, 0x37, + 0x94, 0x24, 0x26, 0xf8, 0x1b, 0xbe, 0x24, 0xb7, 0xef, 0x34, 0x5c, 0x18, 0x30, 0x0b, 0x40, 0xce, 0x6e, 0xf3, 0x93, 0xcb, 0xbc, + 0x94, 0xf8, 0x0e, 0xe2, 0x90, 0xcb, 0x3c, 0x3d, 0x37, 0x33, 0x35, 0xba, 0xb9, 0x59, 0x07, 0x73, 0x4d, 0x99, 0xd3, 0x84, 0xa6, + 0x2a, 0x37, 0x3b, 0x84, 0x84, 0xe1, 0xd4, 0x1a, 0x04, 0xc3, 0x14, 0x0f, 0xaa, 0x19, 0xe8, 0xa2, 0xb9, 0x9b, 0x0c, 0x61, 0xe3, + 0x3c, 0x27, 0xea, 0x91, 0x39, 0x73, 0xe4, 0x5b, 0x5b, 0xc6, 0xe3, 0x9c, 0x27, 0x0d, 0xac, 0x53, 0x18, }; -extern const uint32_t sTestCert_Node01_01_Chip_Len = sizeof(sTestCert_Node01_01_Chip); +extern const size_t sTestCert_Node01_01_Chip_Len = sizeof(sTestCert_Node01_01_Chip); // Error Testing 01: Manually updated Node01_01 CHIP TLV encoded certificate. // Updated Tag of the Subject Key Identifier Extension from ContextTag to CommonProfile_2Bytes: // 0x30, 0x04 --> 0x50, 0xee, 0x04 // The CHIP_ERROR_INVALID_TLV_TAG error is expected when this certificate is loaded/decoded extern const uint8_t sTestCert_Node01_01_Err01_Chip[] = { - 0x15, 0x30, 0x01, 0x08, 0x3e, 0xfc, 0xff, 0x17, 0x02, 0xb9, 0xa1, 0x7a, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x03, 0x00, + 0x15, 0x30, 0x01, 0x08, 0x18, 0xe9, 0x69, 0xba, 0x0e, 0x08, 0x9e, 0x23, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, - 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0x9a, 0x2a, 0x21, 0x6f, 0xb3, 0x9d, 0xd6, 0xb6, 0xfa, 0x21, 0x1b, - 0x83, 0x5c, 0x89, 0xe3, 0xe6, 0xaf, 0xb6, 0x6c, 0x14, 0xf7, 0x58, 0x31, 0x95, 0x4f, 0x9f, 0xf4, 0xf7, 0xa3, 0xf0, 0x11, 0x2c, - 0x8a, 0x0d, 0x8e, 0xaf, 0x29, 0xc6, 0x53, 0x29, 0x4d, 0x48, 0xee, 0xe0, 0x70, 0x8a, 0x03, 0x2c, 0xca, 0x39, 0x39, 0x3c, 0x3a, - 0x7b, 0x46, 0xf1, 0x81, 0xae, 0xa0, 0x78, 0xfe, 0xad, 0x83, 0x83, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, - 0x36, 0x03, 0x04, 0x02, 0x04, 0x01, 0x18, 0x50, 0xee, 0x04, 0x14, 0x9f, 0x55, 0xa2, 0x6b, 0x7e, 0x43, 0x03, 0xe6, 0x08, 0x83, - 0xe9, 0x13, 0xbf, 0x94, 0xf4, 0xfb, 0x5e, 0x2a, 0x61, 0x61, 0x30, 0x05, 0x14, 0x53, 0x52, 0xd7, 0x05, 0x9e, 0x9c, 0x15, 0xa5, - 0x08, 0x90, 0x68, 0x62, 0x86, 0x48, 0x01, 0xa2, 0x9f, 0x1f, 0x41, 0xd3, 0x18, 0x30, 0x0b, 0x40, 0x79, 0x55, 0xc2, 0x02, 0x63, - 0x0b, 0x4b, 0xa4, 0xd5, 0x91, 0x25, 0x26, 0x32, 0x2f, 0xdf, 0x28, 0xf8, 0x9e, 0xdf, 0xe5, 0xaf, 0x9c, 0x0e, 0x57, 0x2b, 0xd8, - 0xa1, 0x4a, 0xaa, 0xbb, 0x4d, 0x12, 0xb8, 0x3c, 0xa1, 0x7c, 0x7b, 0x05, 0xfb, 0x16, 0x4b, 0x77, 0xd7, 0x9c, 0x52, 0x96, 0x13, - 0x31, 0x6b, 0xcf, 0xd1, 0x78, 0x95, 0xe4, 0xb2, 0xa4, 0xf2, 0x40, 0x4b, 0x98, 0x17, 0x32, 0x71, 0x59, 0x18, + 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0xbc, 0xf6, 0x58, 0x0d, 0x2d, 0x71, 0xe1, 0x44, 0x16, 0x65, 0x1f, + 0x7c, 0x31, 0x1b, 0x5e, 0xfc, 0xf9, 0xae, 0xc0, 0xa8, 0xc1, 0x0a, 0xf8, 0x09, 0x27, 0x84, 0x4c, 0x24, 0x0f, 0x51, 0xa8, 0xeb, + 0x23, 0xfa, 0x07, 0x44, 0x13, 0x88, 0x87, 0xac, 0x1e, 0x73, 0xcb, 0x72, 0xa0, 0x54, 0xb6, 0xa0, 0xdb, 0x06, 0x22, 0xaa, 0x80, + 0x70, 0x71, 0x01, 0x63, 0x13, 0xb1, 0x59, 0x6c, 0x85, 0x52, 0xcf, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, + 0x36, 0x03, 0x04, 0x02, 0x04, 0x01, 0x18, 0x50, 0xee, 0x04, 0x14, 0x69, 0x67, 0xc9, 0x12, 0xf8, 0xa3, 0xe6, 0x89, 0x55, 0x6f, + 0x89, 0x9b, 0x65, 0xd7, 0x6f, 0x53, 0xfa, 0x65, 0xc7, 0xb6, 0x30, 0x05, 0x14, 0x44, 0x0c, 0xc6, 0x92, 0x31, 0xc4, 0xcb, 0x5b, + 0x37, 0x94, 0x24, 0x26, 0xf8, 0x1b, 0xbe, 0x24, 0xb7, 0xef, 0x34, 0x5c, 0x18, 0x30, 0x0b, 0x40, 0xce, 0x6e, 0xf3, 0x93, 0xcb, + 0xbc, 0x94, 0xf8, 0x0e, 0xe2, 0x90, 0xcb, 0x3c, 0x3d, 0x37, 0x33, 0x35, 0xba, 0xb9, 0x59, 0x07, 0x73, 0x4d, 0x99, 0xd3, 0x84, + 0xa6, 0x2a, 0x37, 0x3b, 0x84, 0x84, 0xe1, 0xd4, 0x1a, 0x04, 0xc3, 0x14, 0x0f, 0xaa, 0x19, 0xe8, 0xa2, 0xb9, 0x9b, 0x0c, 0x61, + 0xe3, 0x3c, 0x27, 0xea, 0x91, 0x39, 0x73, 0xe4, 0x5b, 0x5b, 0xc6, 0xe3, 0x9c, 0x27, 0x0d, 0xac, 0x53, 0x18, }; -extern const uint32_t sTestCert_Node01_01_Err01_Chip_Len = sizeof(sTestCert_Node01_01_Err01_Chip); +extern const size_t sTestCert_Node01_01_Err01_Chip_Len = sizeof(sTestCert_Node01_01_Err01_Chip); extern const uint8_t sTestCert_Node01_01_DER[] = { - 0x30, 0x82, 0x01, 0xe0, 0x30, 0x82, 0x01, 0x86, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x3e, 0xfc, 0xff, 0x17, 0x02, 0xb9, - 0xa1, 0x7a, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, + 0x30, 0x82, 0x01, 0xe1, 0x30, 0x82, 0x01, 0x86, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x18, 0xe9, 0x69, 0xba, 0x0e, 0x08, + 0x9e, 0x23, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x30, 0x1e, 0x17, 0x0d, 0x32, 0x30, 0x31, 0x30, 0x31, 0x35, 0x31, 0x34, 0x32, 0x33, 0x34, 0x33, 0x5a, 0x17, 0x0d, 0x34, 0x30, 0x31, 0x30, 0x31, 0x35, 0x31, 0x34, 0x32, 0x33, 0x34, 0x32, 0x5a, 0x30, 0x44, @@ -1189,58 +1195,58 @@ extern const uint8_t sTestCert_Node01_01_DER[] = { 0x45, 0x44, 0x45, 0x44, 0x45, 0x30, 0x30, 0x30, 0x31, 0x30, 0x30, 0x30, 0x31, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x05, 0x0c, 0x10, 0x46, 0x41, 0x42, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x44, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, - 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x9a, 0x2a, 0x21, 0x6f, 0xb3, 0x9d, 0xd6, 0xb6, 0xfa, 0x21, - 0x1b, 0x83, 0x5c, 0x89, 0xe3, 0xe6, 0xaf, 0xb6, 0x6c, 0x14, 0xf7, 0x58, 0x31, 0x95, 0x4f, 0x9f, 0xf4, 0xf7, 0xa3, 0xf0, 0x11, - 0x2c, 0x8a, 0x0d, 0x8e, 0xaf, 0x29, 0xc6, 0x53, 0x29, 0x4d, 0x48, 0xee, 0xe0, 0x70, 0x8a, 0x03, 0x2c, 0xca, 0x39, 0x39, 0x3c, - 0x3a, 0x7b, 0x46, 0xf1, 0x81, 0xae, 0xa0, 0x78, 0xfe, 0xad, 0x83, 0x83, 0xa3, 0x81, 0x83, 0x30, 0x81, 0x80, 0x30, 0x0c, 0x06, + 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0xbc, 0xf6, 0x58, 0x0d, 0x2d, 0x71, 0xe1, 0x44, 0x16, 0x65, + 0x1f, 0x7c, 0x31, 0x1b, 0x5e, 0xfc, 0xf9, 0xae, 0xc0, 0xa8, 0xc1, 0x0a, 0xf8, 0x09, 0x27, 0x84, 0x4c, 0x24, 0x0f, 0x51, 0xa8, + 0xeb, 0x23, 0xfa, 0x07, 0x44, 0x13, 0x88, 0x87, 0xac, 0x1e, 0x73, 0xcb, 0x72, 0xa0, 0x54, 0xb6, 0xa0, 0xdb, 0x06, 0x22, 0xaa, + 0x80, 0x70, 0x71, 0x01, 0x63, 0x13, 0xb1, 0x59, 0x6c, 0x85, 0x52, 0xcf, 0xa3, 0x81, 0x83, 0x30, 0x81, 0x80, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x07, 0x80, 0x30, 0x20, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x01, 0x01, 0xff, 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x30, 0x1d, - 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x9f, 0x55, 0xa2, 0x6b, 0x7e, 0x43, 0x03, 0xe6, 0x08, 0x83, 0xe9, 0x13, - 0xbf, 0x94, 0xf4, 0xfb, 0x5e, 0x2a, 0x61, 0x61, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, - 0x53, 0x52, 0xd7, 0x05, 0x9e, 0x9c, 0x15, 0xa5, 0x08, 0x90, 0x68, 0x62, 0x86, 0x48, 0x01, 0xa2, 0x9f, 0x1f, 0x41, 0xd3, 0x30, - 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, 0x45, 0x02, 0x20, 0x79, 0x55, 0xc2, - 0x02, 0x63, 0x0b, 0x4b, 0xa4, 0xd5, 0x91, 0x25, 0x26, 0x32, 0x2f, 0xdf, 0x28, 0xf8, 0x9e, 0xdf, 0xe5, 0xaf, 0x9c, 0x0e, 0x57, - 0x2b, 0xd8, 0xa1, 0x4a, 0xaa, 0xbb, 0x4d, 0x12, 0x02, 0x21, 0x00, 0xb8, 0x3c, 0xa1, 0x7c, 0x7b, 0x05, 0xfb, 0x16, 0x4b, 0x77, - 0xd7, 0x9c, 0x52, 0x96, 0x13, 0x31, 0x6b, 0xcf, 0xd1, 0x78, 0x95, 0xe4, 0xb2, 0xa4, 0xf2, 0x40, 0x4b, 0x98, 0x17, 0x32, 0x71, - 0x59, + 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x69, 0x67, 0xc9, 0x12, 0xf8, 0xa3, 0xe6, 0x89, 0x55, 0x6f, 0x89, 0x9b, + 0x65, 0xd7, 0x6f, 0x53, 0xfa, 0x65, 0xc7, 0xb6, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, + 0x44, 0x0c, 0xc6, 0x92, 0x31, 0xc4, 0xcb, 0x5b, 0x37, 0x94, 0x24, 0x26, 0xf8, 0x1b, 0xbe, 0x24, 0xb7, 0xef, 0x34, 0x5c, 0x30, + 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x49, 0x00, 0x30, 0x46, 0x02, 0x21, 0x00, 0xce, 0x6e, + 0xf3, 0x93, 0xcb, 0xbc, 0x94, 0xf8, 0x0e, 0xe2, 0x90, 0xcb, 0x3c, 0x3d, 0x37, 0x33, 0x35, 0xba, 0xb9, 0x59, 0x07, 0x73, 0x4d, + 0x99, 0xd3, 0x84, 0xa6, 0x2a, 0x37, 0x3b, 0x84, 0x84, 0x02, 0x21, 0x00, 0xe1, 0xd4, 0x1a, 0x04, 0xc3, 0x14, 0x0f, 0xaa, 0x19, + 0xe8, 0xa2, 0xb9, 0x9b, 0x0c, 0x61, 0xe3, 0x3c, 0x27, 0xea, 0x91, 0x39, 0x73, 0xe4, 0x5b, 0x5b, 0xc6, 0xe3, 0x9c, 0x27, 0x0d, + 0xac, 0x53, }; -extern const uint32_t sTestCert_Node01_01_DER_Len = sizeof(sTestCert_Node01_01_DER); +extern const size_t sTestCert_Node01_01_DER_Len = sizeof(sTestCert_Node01_01_DER); extern const uint8_t sTestCert_Node01_01_PublicKey[] = { - 0x04, 0x9a, 0x2a, 0x21, 0x6f, 0xb3, 0x9d, 0xd6, 0xb6, 0xfa, 0x21, 0x1b, 0x83, 0x5c, 0x89, 0xe3, 0xe6, - 0xaf, 0xb6, 0x6c, 0x14, 0xf7, 0x58, 0x31, 0x95, 0x4f, 0x9f, 0xf4, 0xf7, 0xa3, 0xf0, 0x11, 0x2c, 0x8a, - 0x0d, 0x8e, 0xaf, 0x29, 0xc6, 0x53, 0x29, 0x4d, 0x48, 0xee, 0xe0, 0x70, 0x8a, 0x03, 0x2c, 0xca, 0x39, - 0x39, 0x3c, 0x3a, 0x7b, 0x46, 0xf1, 0x81, 0xae, 0xa0, 0x78, 0xfe, 0xad, 0x83, 0x83, + 0x04, 0xbc, 0xf6, 0x58, 0x0d, 0x2d, 0x71, 0xe1, 0x44, 0x16, 0x65, 0x1f, 0x7c, 0x31, 0x1b, 0x5e, 0xfc, + 0xf9, 0xae, 0xc0, 0xa8, 0xc1, 0x0a, 0xf8, 0x09, 0x27, 0x84, 0x4c, 0x24, 0x0f, 0x51, 0xa8, 0xeb, 0x23, + 0xfa, 0x07, 0x44, 0x13, 0x88, 0x87, 0xac, 0x1e, 0x73, 0xcb, 0x72, 0xa0, 0x54, 0xb6, 0xa0, 0xdb, 0x06, + 0x22, 0xaa, 0x80, 0x70, 0x71, 0x01, 0x63, 0x13, 0xb1, 0x59, 0x6c, 0x85, 0x52, 0xcf, }; -extern const uint8_t sTestCert_Node01_01_PublicKey_Len = sizeof(sTestCert_Node01_01_PublicKey); +extern const size_t sTestCert_Node01_01_PublicKey_Len = sizeof(sTestCert_Node01_01_PublicKey); extern const uint8_t sTestCert_Node01_01_PrivateKey[] = { - 0xa5, 0x65, 0xb3, 0xfa, 0x28, 0xa8, 0xed, 0x6a, 0x74, 0xfb, 0x6f, 0x0f, 0xf8, 0xa4, 0xd3, 0x40, - 0xd9, 0xe1, 0xae, 0x98, 0xf2, 0x1d, 0xfa, 0x1f, 0x0a, 0x59, 0xa4, 0xea, 0x02, 0x1a, 0x16, 0x27, + 0x49, 0x2e, 0x7f, 0x97, 0x83, 0xee, 0x15, 0xfd, 0xaa, 0x71, 0xa8, 0xa6, 0x7b, 0x1f, 0x31, 0xf3, + 0xc8, 0xd5, 0x7b, 0x75, 0x09, 0x4a, 0x46, 0x13, 0xb9, 0xbb, 0x3e, 0xf4, 0x6f, 0xa6, 0x0d, 0x89, }; -extern const uint8_t sTestCert_Node01_01_PrivateKey_Len = sizeof(sTestCert_Node01_01_PrivateKey); +extern const size_t sTestCert_Node01_01_PrivateKey_Len = sizeof(sTestCert_Node01_01_PrivateKey); extern const uint8_t sTestCert_Node01_01_SubjectKeyId[] = { - 0x9F, 0x55, 0xA2, 0x6B, 0x7E, 0x43, 0x03, 0xE6, 0x08, 0x83, 0xE9, 0x13, 0xBF, 0x94, 0xF4, 0xFB, 0x5E, 0x2A, 0x61, 0x61, + 0x69, 0x67, 0xC9, 0x12, 0xF8, 0xA3, 0xE6, 0x89, 0x55, 0x6F, 0x89, 0x9B, 0x65, 0xD7, 0x6F, 0x53, 0xFA, 0x65, 0xC7, 0xB6, }; -extern const uint8_t sTestCert_Node01_01_SubjectKeyId_Len = sizeof(sTestCert_Node01_01_SubjectKeyId); +extern const size_t sTestCert_Node01_01_SubjectKeyId_Len = sizeof(sTestCert_Node01_01_SubjectKeyId); extern const uint8_t sTestCert_Node01_01_AuthorityKeyId[] = { - 0x53, 0x52, 0xD7, 0x05, 0x9E, 0x9C, 0x15, 0xA5, 0x08, 0x90, 0x68, 0x62, 0x86, 0x48, 0x01, 0xA2, 0x9F, 0x1F, 0x41, 0xD3, + 0x44, 0x0C, 0xC6, 0x92, 0x31, 0xC4, 0xCB, 0x5B, 0x37, 0x94, 0x24, 0x26, 0xF8, 0x1B, 0xBE, 0x24, 0xB7, 0xEF, 0x34, 0x5C, }; -extern const uint8_t sTestCert_Node01_01_AuthorityKeyId_Len = sizeof(sTestCert_Node01_01_AuthorityKeyId); +extern const size_t sTestCert_Node01_01_AuthorityKeyId_Len = sizeof(sTestCert_Node01_01_AuthorityKeyId); /************** Test Node01_02 Certificate ************** Certificate: Data: Version: 3 (0x2) - Serial Number: 7164621035228478523 (0x636dd8df2b15bc3b) + Serial Number: 977443105016929468 (0xd90935346b05cbc) Signature Algorithm: ecdsa-with-SHA256 Issuer: 1.3.6.1.4.1.37244.1.4 = CACACACA00000001 Validity @@ -1251,11 +1257,11 @@ extern const uint8_t sTestCert_Node01_01_AuthorityKeyId_Len = sizeof(sTestCert_N Public Key Algorithm: id-ecPublicKey Public-Key: (256 bit) pub: - 04:ca:44:a4:ce:f3:21:48:84:2e:4a:71:0e:c3:ee: - 01:17:75:5d:d0:f8:8f:59:21:52:30:27:9a:97:8c: - d9:59:1a:3f:e0:97:69:22:ef:3f:ce:e6:8c:87:14: - a6:de:cc:ee:d7:cd:83:80:35:0b:a5:3f:5c:cb:f4: - 2d:7c:6a:e8:de + 04:96:5f:78:c5:37:ec:e1:b8:c3:4a:7b:98:b9:aa: + 45:f1:35:63:a5:02:b1:97:9a:60:7b:d0:c4:19:88: + bd:d0:f0:bb:b8:98:16:c2:07:e3:b5:15:d9:26:41: + 59:f7:8b:d0:97:8e:32:d7:4c:6d:05:5a:14:9e:8e: + 9d:ba:40:19:bf ASN1 OID: prime256v1 NIST CURVE: P-256 X509v3 extensions: @@ -1266,58 +1272,58 @@ extern const uint8_t sTestCert_Node01_01_AuthorityKeyId_Len = sizeof(sTestCert_N X509v3 Extended Key Usage: critical TLS Web Client Authentication, TLS Web Server Authentication X509v3 Subject Key Identifier: - 56:43:EB:BD:A3:94:98:54:CF:2B:AD:BB:E0:03:9C:1B:6D:B8:84:A7 + 56:7B:4F:20:E4:B9:C7:BD:27:B2:9B:3D:CE:6A:76:F7:CD:8E:CC:B6 X509v3 Authority Key Identifier: - keyid:13:AF:81:AB:37:37:4B:2E:D2:A9:64:9B:12:B7:A3:A4:28:7E:15:1D + keyid:CC:13:08:AF:82:CF:EE:50:5E:B2:3B:57:BF:E8:6A:31:16:65:53:5F Signature Algorithm: ecdsa-with-SHA256 - 30:45:02:21:00:fe:ee:e2:ff:da:c6:8f:e0:37:02:54:91:fe: - 66:80:d9:be:d4:56:de:73:a8:5e:3d:83:7b:55:59:05:08:90: - 12:02:20:77:25:f5:51:71:eb:db:6a:27:69:6a:ca:87:6a:54: - b1:0a:20:95:e3:e7:cf:6e:cf:ee:b8:95:a6:56:1c:83:ed + 30:44:02:20:60:58:11:4b:a7:21:82:fc:f6:30:1f:7a:08:1b: + ca:5a:84:82:02:43:1a:52:fd:bf:f4:97:d8:dd:6f:9a:59:59: + 02:20:7b:ad:cc:d6:a5:6d:70:ef:d8:c9:7c:49:6e:ba:7e:28: + 01:d7:33:7d:cf:f7:4d:78:e4:6e:cd:3a:08:cc:ba:e3 -----BEGIN CERTIFICATE----- -MIIB4DCCAYagAwIBAgIIY23Y3ysVvDswCgYIKoZIzj0EAwIwIjEgMB4GCisGAQQB +MIIB3zCCAYagAwIBAgIIDZCTU0awXLwwCgYIKoZIzj0EAwIwIjEgMB4GCisGAQQB gqJ8AQQMEENBQ0FDQUNBMDAwMDAwMDEwHhcNMjAxMDE1MTQyMzQzWhcNNDAxMDE1 MTQyMzQyWjBEMSAwHgYKKwYBBAGConwBAQwQREVERURFREUwMDAxMDAwMjEgMB4G CisGAQQBgqJ8AQUMEEZBQjAwMDAwMDAwMDAwMUQwWTATBgcqhkjOPQIBBggqhkjO -PQMBBwNCAATKRKTO8yFIhC5KcQ7D7gEXdV3Q+I9ZIVIwJ5qXjNlZGj/gl2ki7z/O -5oyHFKbezO7XzYOANQulP1zL9C18aujeo4GDMIGAMAwGA1UdEwEB/wQCMAAwDgYD +PQMBBwNCAASWX3jFN+zhuMNKe5i5qkXxNWOlArGXmmB70MQZiL3Q8Lu4mBbCB+O1 +FdkmQVn3i9CXjjLXTG0FWhSejp26QBm/o4GDMIGAMAwGA1UdEwEB/wQCMAAwDgYD VR0PAQH/BAQDAgeAMCAGA1UdJQEB/wQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATAd -BgNVHQ4EFgQUVkPrvaOUmFTPK6274AOcG224hKcwHwYDVR0jBBgwFoAUE6+Bqzc3 -Sy7SqWSbErejpCh+FR0wCgYIKoZIzj0EAwIDSAAwRQIhAP7u4v/axo/gNwJUkf5m -gNm+1Fbec6hePYN7VVkFCJASAiB3JfVRcevbaidpasqHalSxCiCV4+fPbs/uuJWm -VhyD7Q== +BgNVHQ4EFgQUVntPIOS5x70nsps9zmp2982OzLYwHwYDVR0jBBgwFoAUzBMIr4LP +7lBesjtXv+hqMRZlU18wCgYIKoZIzj0EAwIDRwAwRAIgYFgRS6chgvz2MB96CBvK +WoSCAkMaUv2/9JfY3W+aWVkCIHutzNalbXDv2Ml8SW66figB1zN9z/dNeORuzToI +zLrj -----END CERTIFICATE----- -----BEGIN EC PRIVATE KEY----- -MHcCAQEEIMIxNtT3b91v9x2Ao0bnjr9KpUp6f5kVY6VXo5MqS+BToAoGCCqGSM49 -AwEHoUQDQgAEykSkzvMhSIQuSnEOw+4BF3Vd0PiPWSFSMCeal4zZWRo/4JdpIu8/ -zuaMhxSm3szu182DgDULpT9cy/QtfGro3g== +MHcCAQEEIBiymGFRQud62w0dw8UXgNN4yj5jqR/Y3KYL53easvcNoAoGCCqGSM49 +AwEHoUQDQgAEll94xTfs4bjDSnuYuapF8TVjpQKxl5pge9DEGYi90PC7uJgWwgfj +tRXZJkFZ94vQl44y10xtBVoUno6dukAZvw== -----END EC PRIVATE KEY----- */ extern const uint8_t sTestCert_Node01_02_Chip[] = { - 0x15, 0x30, 0x01, 0x08, 0x63, 0x6d, 0xd8, 0xdf, 0x2b, 0x15, 0xbc, 0x3b, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, + 0x15, 0x30, 0x01, 0x08, 0x0d, 0x90, 0x93, 0x53, 0x46, 0xb0, 0x5c, 0xbc, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x02, 0x00, 0x01, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, - 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0xca, 0x44, 0xa4, 0xce, 0xf3, 0x21, 0x48, 0x84, 0x2e, 0x4a, 0x71, - 0x0e, 0xc3, 0xee, 0x01, 0x17, 0x75, 0x5d, 0xd0, 0xf8, 0x8f, 0x59, 0x21, 0x52, 0x30, 0x27, 0x9a, 0x97, 0x8c, 0xd9, 0x59, 0x1a, - 0x3f, 0xe0, 0x97, 0x69, 0x22, 0xef, 0x3f, 0xce, 0xe6, 0x8c, 0x87, 0x14, 0xa6, 0xde, 0xcc, 0xee, 0xd7, 0xcd, 0x83, 0x80, 0x35, - 0x0b, 0xa5, 0x3f, 0x5c, 0xcb, 0xf4, 0x2d, 0x7c, 0x6a, 0xe8, 0xde, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, - 0x36, 0x03, 0x04, 0x02, 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, 0x56, 0x43, 0xeb, 0xbd, 0xa3, 0x94, 0x98, 0x54, 0xcf, 0x2b, 0xad, - 0xbb, 0xe0, 0x03, 0x9c, 0x1b, 0x6d, 0xb8, 0x84, 0xa7, 0x30, 0x05, 0x14, 0x13, 0xaf, 0x81, 0xab, 0x37, 0x37, 0x4b, 0x2e, 0xd2, - 0xa9, 0x64, 0x9b, 0x12, 0xb7, 0xa3, 0xa4, 0x28, 0x7e, 0x15, 0x1d, 0x18, 0x30, 0x0b, 0x40, 0xfe, 0xee, 0xe2, 0xff, 0xda, 0xc6, - 0x8f, 0xe0, 0x37, 0x02, 0x54, 0x91, 0xfe, 0x66, 0x80, 0xd9, 0xbe, 0xd4, 0x56, 0xde, 0x73, 0xa8, 0x5e, 0x3d, 0x83, 0x7b, 0x55, - 0x59, 0x05, 0x08, 0x90, 0x12, 0x77, 0x25, 0xf5, 0x51, 0x71, 0xeb, 0xdb, 0x6a, 0x27, 0x69, 0x6a, 0xca, 0x87, 0x6a, 0x54, 0xb1, - 0x0a, 0x20, 0x95, 0xe3, 0xe7, 0xcf, 0x6e, 0xcf, 0xee, 0xb8, 0x95, 0xa6, 0x56, 0x1c, 0x83, 0xed, 0x18, + 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0x96, 0x5f, 0x78, 0xc5, 0x37, 0xec, 0xe1, 0xb8, 0xc3, 0x4a, 0x7b, + 0x98, 0xb9, 0xaa, 0x45, 0xf1, 0x35, 0x63, 0xa5, 0x02, 0xb1, 0x97, 0x9a, 0x60, 0x7b, 0xd0, 0xc4, 0x19, 0x88, 0xbd, 0xd0, 0xf0, + 0xbb, 0xb8, 0x98, 0x16, 0xc2, 0x07, 0xe3, 0xb5, 0x15, 0xd9, 0x26, 0x41, 0x59, 0xf7, 0x8b, 0xd0, 0x97, 0x8e, 0x32, 0xd7, 0x4c, + 0x6d, 0x05, 0x5a, 0x14, 0x9e, 0x8e, 0x9d, 0xba, 0x40, 0x19, 0xbf, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, + 0x36, 0x03, 0x04, 0x02, 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, 0x56, 0x7b, 0x4f, 0x20, 0xe4, 0xb9, 0xc7, 0xbd, 0x27, 0xb2, 0x9b, + 0x3d, 0xce, 0x6a, 0x76, 0xf7, 0xcd, 0x8e, 0xcc, 0xb6, 0x30, 0x05, 0x14, 0xcc, 0x13, 0x08, 0xaf, 0x82, 0xcf, 0xee, 0x50, 0x5e, + 0xb2, 0x3b, 0x57, 0xbf, 0xe8, 0x6a, 0x31, 0x16, 0x65, 0x53, 0x5f, 0x18, 0x30, 0x0b, 0x40, 0x60, 0x58, 0x11, 0x4b, 0xa7, 0x21, + 0x82, 0xfc, 0xf6, 0x30, 0x1f, 0x7a, 0x08, 0x1b, 0xca, 0x5a, 0x84, 0x82, 0x02, 0x43, 0x1a, 0x52, 0xfd, 0xbf, 0xf4, 0x97, 0xd8, + 0xdd, 0x6f, 0x9a, 0x59, 0x59, 0x7b, 0xad, 0xcc, 0xd6, 0xa5, 0x6d, 0x70, 0xef, 0xd8, 0xc9, 0x7c, 0x49, 0x6e, 0xba, 0x7e, 0x28, + 0x01, 0xd7, 0x33, 0x7d, 0xcf, 0xf7, 0x4d, 0x78, 0xe4, 0x6e, 0xcd, 0x3a, 0x08, 0xcc, 0xba, 0xe3, 0x18, }; -extern const uint32_t sTestCert_Node01_02_Chip_Len = sizeof(sTestCert_Node01_02_Chip); +extern const size_t sTestCert_Node01_02_Chip_Len = sizeof(sTestCert_Node01_02_Chip); extern const uint8_t sTestCert_Node01_02_DER[] = { - 0x30, 0x82, 0x01, 0xe0, 0x30, 0x82, 0x01, 0x86, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x63, 0x6d, 0xd8, 0xdf, 0x2b, 0x15, - 0xbc, 0x3b, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, + 0x30, 0x82, 0x01, 0xdf, 0x30, 0x82, 0x01, 0x86, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x0d, 0x90, 0x93, 0x53, 0x46, 0xb0, + 0x5c, 0xbc, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x30, 0x1e, 0x17, 0x0d, 0x32, 0x30, 0x31, 0x30, 0x31, 0x35, 0x31, 0x34, 0x32, 0x33, 0x34, 0x33, 0x5a, 0x17, 0x0d, 0x34, 0x30, 0x31, 0x30, 0x31, 0x35, 0x31, 0x34, 0x32, 0x33, 0x34, 0x32, 0x5a, 0x30, 0x44, @@ -1325,58 +1331,57 @@ extern const uint8_t sTestCert_Node01_02_DER[] = { 0x45, 0x44, 0x45, 0x44, 0x45, 0x30, 0x30, 0x30, 0x31, 0x30, 0x30, 0x30, 0x32, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x05, 0x0c, 0x10, 0x46, 0x41, 0x42, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x44, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, - 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0xca, 0x44, 0xa4, 0xce, 0xf3, 0x21, 0x48, 0x84, 0x2e, 0x4a, - 0x71, 0x0e, 0xc3, 0xee, 0x01, 0x17, 0x75, 0x5d, 0xd0, 0xf8, 0x8f, 0x59, 0x21, 0x52, 0x30, 0x27, 0x9a, 0x97, 0x8c, 0xd9, 0x59, - 0x1a, 0x3f, 0xe0, 0x97, 0x69, 0x22, 0xef, 0x3f, 0xce, 0xe6, 0x8c, 0x87, 0x14, 0xa6, 0xde, 0xcc, 0xee, 0xd7, 0xcd, 0x83, 0x80, - 0x35, 0x0b, 0xa5, 0x3f, 0x5c, 0xcb, 0xf4, 0x2d, 0x7c, 0x6a, 0xe8, 0xde, 0xa3, 0x81, 0x83, 0x30, 0x81, 0x80, 0x30, 0x0c, 0x06, + 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x96, 0x5f, 0x78, 0xc5, 0x37, 0xec, 0xe1, 0xb8, 0xc3, 0x4a, + 0x7b, 0x98, 0xb9, 0xaa, 0x45, 0xf1, 0x35, 0x63, 0xa5, 0x02, 0xb1, 0x97, 0x9a, 0x60, 0x7b, 0xd0, 0xc4, 0x19, 0x88, 0xbd, 0xd0, + 0xf0, 0xbb, 0xb8, 0x98, 0x16, 0xc2, 0x07, 0xe3, 0xb5, 0x15, 0xd9, 0x26, 0x41, 0x59, 0xf7, 0x8b, 0xd0, 0x97, 0x8e, 0x32, 0xd7, + 0x4c, 0x6d, 0x05, 0x5a, 0x14, 0x9e, 0x8e, 0x9d, 0xba, 0x40, 0x19, 0xbf, 0xa3, 0x81, 0x83, 0x30, 0x81, 0x80, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x07, 0x80, 0x30, 0x20, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x01, 0x01, 0xff, 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x30, 0x1d, - 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x56, 0x43, 0xeb, 0xbd, 0xa3, 0x94, 0x98, 0x54, 0xcf, 0x2b, 0xad, 0xbb, - 0xe0, 0x03, 0x9c, 0x1b, 0x6d, 0xb8, 0x84, 0xa7, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, - 0x13, 0xaf, 0x81, 0xab, 0x37, 0x37, 0x4b, 0x2e, 0xd2, 0xa9, 0x64, 0x9b, 0x12, 0xb7, 0xa3, 0xa4, 0x28, 0x7e, 0x15, 0x1d, 0x30, - 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, 0x45, 0x02, 0x21, 0x00, 0xfe, 0xee, - 0xe2, 0xff, 0xda, 0xc6, 0x8f, 0xe0, 0x37, 0x02, 0x54, 0x91, 0xfe, 0x66, 0x80, 0xd9, 0xbe, 0xd4, 0x56, 0xde, 0x73, 0xa8, 0x5e, - 0x3d, 0x83, 0x7b, 0x55, 0x59, 0x05, 0x08, 0x90, 0x12, 0x02, 0x20, 0x77, 0x25, 0xf5, 0x51, 0x71, 0xeb, 0xdb, 0x6a, 0x27, 0x69, - 0x6a, 0xca, 0x87, 0x6a, 0x54, 0xb1, 0x0a, 0x20, 0x95, 0xe3, 0xe7, 0xcf, 0x6e, 0xcf, 0xee, 0xb8, 0x95, 0xa6, 0x56, 0x1c, 0x83, - 0xed, + 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x56, 0x7b, 0x4f, 0x20, 0xe4, 0xb9, 0xc7, 0xbd, 0x27, 0xb2, 0x9b, 0x3d, + 0xce, 0x6a, 0x76, 0xf7, 0xcd, 0x8e, 0xcc, 0xb6, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, + 0xcc, 0x13, 0x08, 0xaf, 0x82, 0xcf, 0xee, 0x50, 0x5e, 0xb2, 0x3b, 0x57, 0xbf, 0xe8, 0x6a, 0x31, 0x16, 0x65, 0x53, 0x5f, 0x30, + 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x47, 0x00, 0x30, 0x44, 0x02, 0x20, 0x60, 0x58, 0x11, + 0x4b, 0xa7, 0x21, 0x82, 0xfc, 0xf6, 0x30, 0x1f, 0x7a, 0x08, 0x1b, 0xca, 0x5a, 0x84, 0x82, 0x02, 0x43, 0x1a, 0x52, 0xfd, 0xbf, + 0xf4, 0x97, 0xd8, 0xdd, 0x6f, 0x9a, 0x59, 0x59, 0x02, 0x20, 0x7b, 0xad, 0xcc, 0xd6, 0xa5, 0x6d, 0x70, 0xef, 0xd8, 0xc9, 0x7c, + 0x49, 0x6e, 0xba, 0x7e, 0x28, 0x01, 0xd7, 0x33, 0x7d, 0xcf, 0xf7, 0x4d, 0x78, 0xe4, 0x6e, 0xcd, 0x3a, 0x08, 0xcc, 0xba, 0xe3, }; -extern const uint32_t sTestCert_Node01_02_DER_Len = sizeof(sTestCert_Node01_02_DER); +extern const size_t sTestCert_Node01_02_DER_Len = sizeof(sTestCert_Node01_02_DER); extern const uint8_t sTestCert_Node01_02_PublicKey[] = { - 0x04, 0xca, 0x44, 0xa4, 0xce, 0xf3, 0x21, 0x48, 0x84, 0x2e, 0x4a, 0x71, 0x0e, 0xc3, 0xee, 0x01, 0x17, - 0x75, 0x5d, 0xd0, 0xf8, 0x8f, 0x59, 0x21, 0x52, 0x30, 0x27, 0x9a, 0x97, 0x8c, 0xd9, 0x59, 0x1a, 0x3f, - 0xe0, 0x97, 0x69, 0x22, 0xef, 0x3f, 0xce, 0xe6, 0x8c, 0x87, 0x14, 0xa6, 0xde, 0xcc, 0xee, 0xd7, 0xcd, - 0x83, 0x80, 0x35, 0x0b, 0xa5, 0x3f, 0x5c, 0xcb, 0xf4, 0x2d, 0x7c, 0x6a, 0xe8, 0xde, + 0x04, 0x96, 0x5f, 0x78, 0xc5, 0x37, 0xec, 0xe1, 0xb8, 0xc3, 0x4a, 0x7b, 0x98, 0xb9, 0xaa, 0x45, 0xf1, + 0x35, 0x63, 0xa5, 0x02, 0xb1, 0x97, 0x9a, 0x60, 0x7b, 0xd0, 0xc4, 0x19, 0x88, 0xbd, 0xd0, 0xf0, 0xbb, + 0xb8, 0x98, 0x16, 0xc2, 0x07, 0xe3, 0xb5, 0x15, 0xd9, 0x26, 0x41, 0x59, 0xf7, 0x8b, 0xd0, 0x97, 0x8e, + 0x32, 0xd7, 0x4c, 0x6d, 0x05, 0x5a, 0x14, 0x9e, 0x8e, 0x9d, 0xba, 0x40, 0x19, 0xbf, }; -extern const uint8_t sTestCert_Node01_02_PublicKey_Len = sizeof(sTestCert_Node01_02_PublicKey); +extern const size_t sTestCert_Node01_02_PublicKey_Len = sizeof(sTestCert_Node01_02_PublicKey); extern const uint8_t sTestCert_Node01_02_PrivateKey[] = { - 0xc2, 0x31, 0x36, 0xd4, 0xf7, 0x6f, 0xdd, 0x6f, 0xf7, 0x1d, 0x80, 0xa3, 0x46, 0xe7, 0x8e, 0xbf, - 0x4a, 0xa5, 0x4a, 0x7a, 0x7f, 0x99, 0x15, 0x63, 0xa5, 0x57, 0xa3, 0x93, 0x2a, 0x4b, 0xe0, 0x53, + 0x18, 0xb2, 0x98, 0x61, 0x51, 0x42, 0xe7, 0x7a, 0xdb, 0x0d, 0x1d, 0xc3, 0xc5, 0x17, 0x80, 0xd3, + 0x78, 0xca, 0x3e, 0x63, 0xa9, 0x1f, 0xd8, 0xdc, 0xa6, 0x0b, 0xe7, 0x77, 0x9a, 0xb2, 0xf7, 0x0d, }; -extern const uint8_t sTestCert_Node01_02_PrivateKey_Len = sizeof(sTestCert_Node01_02_PrivateKey); +extern const size_t sTestCert_Node01_02_PrivateKey_Len = sizeof(sTestCert_Node01_02_PrivateKey); extern const uint8_t sTestCert_Node01_02_SubjectKeyId[] = { - 0x56, 0x43, 0xEB, 0xBD, 0xA3, 0x94, 0x98, 0x54, 0xCF, 0x2B, 0xAD, 0xBB, 0xE0, 0x03, 0x9C, 0x1B, 0x6D, 0xB8, 0x84, 0xA7, + 0x56, 0x7B, 0x4F, 0x20, 0xE4, 0xB9, 0xC7, 0xBD, 0x27, 0xB2, 0x9B, 0x3D, 0xCE, 0x6A, 0x76, 0xF7, 0xCD, 0x8E, 0xCC, 0xB6, }; -extern const uint8_t sTestCert_Node01_02_SubjectKeyId_Len = sizeof(sTestCert_Node01_02_SubjectKeyId); +extern const size_t sTestCert_Node01_02_SubjectKeyId_Len = sizeof(sTestCert_Node01_02_SubjectKeyId); extern const uint8_t sTestCert_Node01_02_AuthorityKeyId[] = { - 0x13, 0xAF, 0x81, 0xAB, 0x37, 0x37, 0x4B, 0x2E, 0xD2, 0xA9, 0x64, 0x9B, 0x12, 0xB7, 0xA3, 0xA4, 0x28, 0x7E, 0x15, 0x1D, + 0xCC, 0x13, 0x08, 0xAF, 0x82, 0xCF, 0xEE, 0x50, 0x5E, 0xB2, 0x3B, 0x57, 0xBF, 0xE8, 0x6A, 0x31, 0x16, 0x65, 0x53, 0x5F, }; -extern const uint8_t sTestCert_Node01_02_AuthorityKeyId_Len = sizeof(sTestCert_Node01_02_AuthorityKeyId); +extern const size_t sTestCert_Node01_02_AuthorityKeyId_Len = sizeof(sTestCert_Node01_02_AuthorityKeyId); /************** Test Node02_01 Certificate ************** Certificate: Data: Version: 3 (0x2) - Serial Number: 2697041106332792306 (0x256dd098bf97b5f2) + Serial Number: 280707040284312631 (0x3e54590de190437) Signature Algorithm: ecdsa-with-SHA256 Issuer: 1.3.6.1.4.1.37244.1.3 = CACACACA00000004, 1.3.6.1.4.1.37244.1.5 = FAB000000000001D Validity @@ -1387,11 +1392,11 @@ extern const uint8_t sTestCert_Node01_02_AuthorityKeyId_Len = sizeof(sTestCert_N Public Key Algorithm: id-ecPublicKey Public-Key: (256 bit) pub: - 04:ba:ba:8e:3e:18:ce:fc:b6:56:8a:f6:ce:32:cc: - 0d:df:62:5f:ed:a5:55:2a:ce:70:ed:f1:da:e9:2c: - a9:c0:47:de:23:e7:57:0b:25:ad:46:b8:86:fb:57: - f9:c2:ef:26:b5:ce:ed:f6:30:b8:f5:5a:94:5c:12: - 51:1a:4d:9b:9a + 04:a5:70:10:42:aa:69:14:20:f5:ce:f5:bb:65:2e: + de:d7:43:cc:4d:6f:00:0e:11:35:f0:ef:69:98:2e: + 52:8d:bf:9d:b2:2b:90:4d:97:05:9d:51:32:87:53: + 84:31:1a:f4:07:94:c3:55:75:39:b6:a0:da:de:78: + 8b:0c:1f:f6:49 ASN1 OID: prime256v1 NIST CURVE: P-256 X509v3 extensions: @@ -1402,59 +1407,59 @@ extern const uint8_t sTestCert_Node01_02_AuthorityKeyId_Len = sizeof(sTestCert_N X509v3 Extended Key Usage: critical TLS Web Client Authentication, TLS Web Server Authentication X509v3 Subject Key Identifier: - C2:92:42:54:44:76:84:14:9E:93:34:EF:5B:9D:A6:17:4C:33:8C:1C + B4:67:76:E1:CC:0A:F7:81:54:C6:2B:5A:17:98:42:64:BA:F5:50:86 X509v3 Authority Key Identifier: - keyid:CF:42:BC:F8:DF:48:09:D9:26:6F:23:15:5A:16:B0:7F:04:BB:3D:84 + keyid:E1:E7:6E:67:77:85:1D:D7:74:16:BD:DD:35:EC:3C:13:7C:47:29:DC Signature Algorithm: ecdsa-with-SHA256 - 30:44:02:20:01:4c:7e:e3:ec:5f:79:18:a4:70:87:64:b5:ff: - 44:23:50:52:fc:b0:e9:4e:e8:7a:1f:68:18:f3:97:09:b1:bd: - 02:20:46:7b:f3:e6:ac:29:23:e1:81:af:75:6e:93:ca:75:95: - a0:5c:6b:f5:09:b2:76:c0:35:a7:6a:1d:77:41:8f:00 + 30:45:02:20:26:46:9a:64:2d:9d:cd:c8:37:fb:ee:58:25:be: + 2f:f3:b9:6a:10:e9:b0:33:73:4a:d5:fd:19:98:6d:2c:90:9c: + 02:21:00:81:86:fc:9c:5b:3a:47:c3:35:ca:16:d0:ae:d1:aa: + c8:9a:20:37:08:50:b4:15:eb:62:3a:73:c3:38:19:33:74 -----BEGIN CERTIFICATE----- -MIICATCCAaigAwIBAgIIJW3QmL+XtfIwCgYIKoZIzj0EAwIwRDEgMB4GCisGAQQB +MIICAjCCAaigAwIBAgIIA+VFkN4ZBDcwCgYIKoZIzj0EAwIwRDEgMB4GCisGAQQB gqJ8AQMMEENBQ0FDQUNBMDAwMDAwMDQxIDAeBgorBgEEAYKifAEFDBBGQUIwMDAw MDAwMDAwMDFEMB4XDTIwMTAxNTE0MjM0M1oXDTQwMTAxNTE0MjM0MlowRDEgMB4G CisGAQQBgqJ8AQEMEERFREVERURFMDAwMjAwMDExIDAeBgorBgEEAYKifAEFDBBG -QUIwMDAwMDAwMDAwMDFEMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEurqOPhjO -/LZWivbOMswN32Jf7aVVKs5w7fHa6SypwEfeI+dXCyWtRriG+1f5wu8mtc7t9jC4 -9VqUXBJRGk2bmqOBgzCBgDAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB/wQEAwIHgDAg -BgNVHSUBAf8EFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEwHQYDVR0OBBYEFMKSQlRE -doQUnpM071udphdMM4wcMB8GA1UdIwQYMBaAFM9CvPjfSAnZJm8jFVoWsH8Euz2E -MAoGCCqGSM49BAMCA0cAMEQCIAFMfuPsX3kYpHCHZLX/RCNQUvyw6U7oeh9oGPOX -CbG9AiBGe/PmrCkj4YGvdW6TynWVoFxr9QmydsA1p2odd0GPAA== +QUIwMDAwMDAwMDAwMDFEMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEpXAQQqpp +FCD1zvW7ZS7e10PMTW8ADhE18O9pmC5Sjb+dsiuQTZcFnVEyh1OEMRr0B5TDVXU5 +tqDa3niLDB/2SaOBgzCBgDAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB/wQEAwIHgDAg +BgNVHSUBAf8EFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEwHQYDVR0OBBYEFLRnduHM +CveBVMYrWheYQmS69VCGMB8GA1UdIwQYMBaAFOHnbmd3hR3XdBa93TXsPBN8Rync +MAoGCCqGSM49BAMCA0gAMEUCICZGmmQtnc3IN/vuWCW+L/O5ahDpsDNzStX9GZht +LJCcAiEAgYb8nFs6R8M1yhbQrtGqyJogNwhQtBXrYjpzwzgZM3Q= -----END CERTIFICATE----- -----BEGIN EC PRIVATE KEY----- -MHcCAQEEIOuZ1sV6uFjXlH/QX31UCMW1x6L1r68xYJJ0IJq9IBmmoAoGCCqGSM49 -AwEHoUQDQgAEurqOPhjO/LZWivbOMswN32Jf7aVVKs5w7fHa6SypwEfeI+dXCyWt -RriG+1f5wu8mtc7t9jC49VqUXBJRGk2bmg== +MHcCAQEEILSfDjcknEjCW6MMevxMlE+IrDwDxbKhk2vYZxWte+kkoAoGCCqGSM49 +AwEHoUQDQgAEpXAQQqppFCD1zvW7ZS7e10PMTW8ADhE18O9pmC5Sjb+dsiuQTZcF +nVEyh1OEMRr0B5TDVXU5tqDa3niLDB/2SQ== -----END EC PRIVATE KEY----- */ extern const uint8_t sTestCert_Node02_01_Chip[] = { - 0x15, 0x30, 0x01, 0x08, 0x25, 0x6d, 0xd0, 0x98, 0xbf, 0x97, 0xb5, 0xf2, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, + 0x15, 0x30, 0x01, 0x08, 0x03, 0xe5, 0x45, 0x90, 0xde, 0x19, 0x04, 0x37, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x02, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, - 0x09, 0x41, 0x04, 0xba, 0xba, 0x8e, 0x3e, 0x18, 0xce, 0xfc, 0xb6, 0x56, 0x8a, 0xf6, 0xce, 0x32, 0xcc, 0x0d, 0xdf, 0x62, - 0x5f, 0xed, 0xa5, 0x55, 0x2a, 0xce, 0x70, 0xed, 0xf1, 0xda, 0xe9, 0x2c, 0xa9, 0xc0, 0x47, 0xde, 0x23, 0xe7, 0x57, 0x0b, - 0x25, 0xad, 0x46, 0xb8, 0x86, 0xfb, 0x57, 0xf9, 0xc2, 0xef, 0x26, 0xb5, 0xce, 0xed, 0xf6, 0x30, 0xb8, 0xf5, 0x5a, 0x94, - 0x5c, 0x12, 0x51, 0x1a, 0x4d, 0x9b, 0x9a, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, - 0x02, 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, 0xc2, 0x92, 0x42, 0x54, 0x44, 0x76, 0x84, 0x14, 0x9e, 0x93, 0x34, 0xef, 0x5b, - 0x9d, 0xa6, 0x17, 0x4c, 0x33, 0x8c, 0x1c, 0x30, 0x05, 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, 0x26, 0x6f, - 0x23, 0x15, 0x5a, 0x16, 0xb0, 0x7f, 0x04, 0xbb, 0x3d, 0x84, 0x18, 0x30, 0x0b, 0x40, 0x01, 0x4c, 0x7e, 0xe3, 0xec, 0x5f, - 0x79, 0x18, 0xa4, 0x70, 0x87, 0x64, 0xb5, 0xff, 0x44, 0x23, 0x50, 0x52, 0xfc, 0xb0, 0xe9, 0x4e, 0xe8, 0x7a, 0x1f, 0x68, - 0x18, 0xf3, 0x97, 0x09, 0xb1, 0xbd, 0x46, 0x7b, 0xf3, 0xe6, 0xac, 0x29, 0x23, 0xe1, 0x81, 0xaf, 0x75, 0x6e, 0x93, 0xca, - 0x75, 0x95, 0xa0, 0x5c, 0x6b, 0xf5, 0x09, 0xb2, 0x76, 0xc0, 0x35, 0xa7, 0x6a, 0x1d, 0x77, 0x41, 0x8f, 0x00, 0x18, + 0x09, 0x41, 0x04, 0xa5, 0x70, 0x10, 0x42, 0xaa, 0x69, 0x14, 0x20, 0xf5, 0xce, 0xf5, 0xbb, 0x65, 0x2e, 0xde, 0xd7, 0x43, + 0xcc, 0x4d, 0x6f, 0x00, 0x0e, 0x11, 0x35, 0xf0, 0xef, 0x69, 0x98, 0x2e, 0x52, 0x8d, 0xbf, 0x9d, 0xb2, 0x2b, 0x90, 0x4d, + 0x97, 0x05, 0x9d, 0x51, 0x32, 0x87, 0x53, 0x84, 0x31, 0x1a, 0xf4, 0x07, 0x94, 0xc3, 0x55, 0x75, 0x39, 0xb6, 0xa0, 0xda, + 0xde, 0x78, 0x8b, 0x0c, 0x1f, 0xf6, 0x49, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, + 0x02, 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, 0xb4, 0x67, 0x76, 0xe1, 0xcc, 0x0a, 0xf7, 0x81, 0x54, 0xc6, 0x2b, 0x5a, 0x17, + 0x98, 0x42, 0x64, 0xba, 0xf5, 0x50, 0x86, 0x30, 0x05, 0x14, 0xe1, 0xe7, 0x6e, 0x67, 0x77, 0x85, 0x1d, 0xd7, 0x74, 0x16, + 0xbd, 0xdd, 0x35, 0xec, 0x3c, 0x13, 0x7c, 0x47, 0x29, 0xdc, 0x18, 0x30, 0x0b, 0x40, 0x26, 0x46, 0x9a, 0x64, 0x2d, 0x9d, + 0xcd, 0xc8, 0x37, 0xfb, 0xee, 0x58, 0x25, 0xbe, 0x2f, 0xf3, 0xb9, 0x6a, 0x10, 0xe9, 0xb0, 0x33, 0x73, 0x4a, 0xd5, 0xfd, + 0x19, 0x98, 0x6d, 0x2c, 0x90, 0x9c, 0x81, 0x86, 0xfc, 0x9c, 0x5b, 0x3a, 0x47, 0xc3, 0x35, 0xca, 0x16, 0xd0, 0xae, 0xd1, + 0xaa, 0xc8, 0x9a, 0x20, 0x37, 0x08, 0x50, 0xb4, 0x15, 0xeb, 0x62, 0x3a, 0x73, 0xc3, 0x38, 0x19, 0x33, 0x74, 0x18, }; -extern const uint32_t sTestCert_Node02_01_Chip_Len = sizeof(sTestCert_Node02_01_Chip); +extern const size_t sTestCert_Node02_01_Chip_Len = sizeof(sTestCert_Node02_01_Chip); extern const uint8_t sTestCert_Node02_01_DER[] = { - 0x30, 0x82, 0x02, 0x01, 0x30, 0x82, 0x01, 0xa8, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x25, 0x6d, 0xd0, 0x98, 0xbf, 0x97, - 0xb5, 0xf2, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, + 0x30, 0x82, 0x02, 0x02, 0x30, 0x82, 0x01, 0xa8, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x03, 0xe5, 0x45, 0x90, 0xde, 0x19, + 0x04, 0x37, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x34, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x05, 0x0c, 0x10, 0x46, 0x41, 0x42, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x44, @@ -1464,57 +1469,57 @@ extern const uint8_t sTestCert_Node02_01_DER[] = { 0x32, 0x30, 0x30, 0x30, 0x31, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x05, 0x0c, 0x10, 0x46, 0x41, 0x42, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x44, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, - 0x42, 0x00, 0x04, 0xba, 0xba, 0x8e, 0x3e, 0x18, 0xce, 0xfc, 0xb6, 0x56, 0x8a, 0xf6, 0xce, 0x32, 0xcc, 0x0d, 0xdf, 0x62, 0x5f, - 0xed, 0xa5, 0x55, 0x2a, 0xce, 0x70, 0xed, 0xf1, 0xda, 0xe9, 0x2c, 0xa9, 0xc0, 0x47, 0xde, 0x23, 0xe7, 0x57, 0x0b, 0x25, 0xad, - 0x46, 0xb8, 0x86, 0xfb, 0x57, 0xf9, 0xc2, 0xef, 0x26, 0xb5, 0xce, 0xed, 0xf6, 0x30, 0xb8, 0xf5, 0x5a, 0x94, 0x5c, 0x12, 0x51, - 0x1a, 0x4d, 0x9b, 0x9a, 0xa3, 0x81, 0x83, 0x30, 0x81, 0x80, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, + 0x42, 0x00, 0x04, 0xa5, 0x70, 0x10, 0x42, 0xaa, 0x69, 0x14, 0x20, 0xf5, 0xce, 0xf5, 0xbb, 0x65, 0x2e, 0xde, 0xd7, 0x43, 0xcc, + 0x4d, 0x6f, 0x00, 0x0e, 0x11, 0x35, 0xf0, 0xef, 0x69, 0x98, 0x2e, 0x52, 0x8d, 0xbf, 0x9d, 0xb2, 0x2b, 0x90, 0x4d, 0x97, 0x05, + 0x9d, 0x51, 0x32, 0x87, 0x53, 0x84, 0x31, 0x1a, 0xf4, 0x07, 0x94, 0xc3, 0x55, 0x75, 0x39, 0xb6, 0xa0, 0xda, 0xde, 0x78, 0x8b, + 0x0c, 0x1f, 0xf6, 0x49, 0xa3, 0x81, 0x83, 0x30, 0x81, 0x80, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x07, 0x80, 0x30, 0x20, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x01, 0x01, 0xff, 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, - 0x14, 0xc2, 0x92, 0x42, 0x54, 0x44, 0x76, 0x84, 0x14, 0x9e, 0x93, 0x34, 0xef, 0x5b, 0x9d, 0xa6, 0x17, 0x4c, 0x33, 0x8c, 0x1c, - 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, - 0x26, 0x6f, 0x23, 0x15, 0x5a, 0x16, 0xb0, 0x7f, 0x04, 0xbb, 0x3d, 0x84, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, - 0x04, 0x03, 0x02, 0x03, 0x47, 0x00, 0x30, 0x44, 0x02, 0x20, 0x01, 0x4c, 0x7e, 0xe3, 0xec, 0x5f, 0x79, 0x18, 0xa4, 0x70, 0x87, - 0x64, 0xb5, 0xff, 0x44, 0x23, 0x50, 0x52, 0xfc, 0xb0, 0xe9, 0x4e, 0xe8, 0x7a, 0x1f, 0x68, 0x18, 0xf3, 0x97, 0x09, 0xb1, 0xbd, - 0x02, 0x20, 0x46, 0x7b, 0xf3, 0xe6, 0xac, 0x29, 0x23, 0xe1, 0x81, 0xaf, 0x75, 0x6e, 0x93, 0xca, 0x75, 0x95, 0xa0, 0x5c, 0x6b, - 0xf5, 0x09, 0xb2, 0x76, 0xc0, 0x35, 0xa7, 0x6a, 0x1d, 0x77, 0x41, 0x8f, 0x00, + 0x14, 0xb4, 0x67, 0x76, 0xe1, 0xcc, 0x0a, 0xf7, 0x81, 0x54, 0xc6, 0x2b, 0x5a, 0x17, 0x98, 0x42, 0x64, 0xba, 0xf5, 0x50, 0x86, + 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xe1, 0xe7, 0x6e, 0x67, 0x77, 0x85, 0x1d, 0xd7, + 0x74, 0x16, 0xbd, 0xdd, 0x35, 0xec, 0x3c, 0x13, 0x7c, 0x47, 0x29, 0xdc, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, + 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, 0x45, 0x02, 0x20, 0x26, 0x46, 0x9a, 0x64, 0x2d, 0x9d, 0xcd, 0xc8, 0x37, 0xfb, 0xee, + 0x58, 0x25, 0xbe, 0x2f, 0xf3, 0xb9, 0x6a, 0x10, 0xe9, 0xb0, 0x33, 0x73, 0x4a, 0xd5, 0xfd, 0x19, 0x98, 0x6d, 0x2c, 0x90, 0x9c, + 0x02, 0x21, 0x00, 0x81, 0x86, 0xfc, 0x9c, 0x5b, 0x3a, 0x47, 0xc3, 0x35, 0xca, 0x16, 0xd0, 0xae, 0xd1, 0xaa, 0xc8, 0x9a, 0x20, + 0x37, 0x08, 0x50, 0xb4, 0x15, 0xeb, 0x62, 0x3a, 0x73, 0xc3, 0x38, 0x19, 0x33, 0x74, }; -extern const uint32_t sTestCert_Node02_01_DER_Len = sizeof(sTestCert_Node02_01_DER); +extern const size_t sTestCert_Node02_01_DER_Len = sizeof(sTestCert_Node02_01_DER); extern const uint8_t sTestCert_Node02_01_PublicKey[] = { - 0x04, 0xba, 0xba, 0x8e, 0x3e, 0x18, 0xce, 0xfc, 0xb6, 0x56, 0x8a, 0xf6, 0xce, 0x32, 0xcc, 0x0d, 0xdf, - 0x62, 0x5f, 0xed, 0xa5, 0x55, 0x2a, 0xce, 0x70, 0xed, 0xf1, 0xda, 0xe9, 0x2c, 0xa9, 0xc0, 0x47, 0xde, - 0x23, 0xe7, 0x57, 0x0b, 0x25, 0xad, 0x46, 0xb8, 0x86, 0xfb, 0x57, 0xf9, 0xc2, 0xef, 0x26, 0xb5, 0xce, - 0xed, 0xf6, 0x30, 0xb8, 0xf5, 0x5a, 0x94, 0x5c, 0x12, 0x51, 0x1a, 0x4d, 0x9b, 0x9a, + 0x04, 0xa5, 0x70, 0x10, 0x42, 0xaa, 0x69, 0x14, 0x20, 0xf5, 0xce, 0xf5, 0xbb, 0x65, 0x2e, 0xde, 0xd7, + 0x43, 0xcc, 0x4d, 0x6f, 0x00, 0x0e, 0x11, 0x35, 0xf0, 0xef, 0x69, 0x98, 0x2e, 0x52, 0x8d, 0xbf, 0x9d, + 0xb2, 0x2b, 0x90, 0x4d, 0x97, 0x05, 0x9d, 0x51, 0x32, 0x87, 0x53, 0x84, 0x31, 0x1a, 0xf4, 0x07, 0x94, + 0xc3, 0x55, 0x75, 0x39, 0xb6, 0xa0, 0xda, 0xde, 0x78, 0x8b, 0x0c, 0x1f, 0xf6, 0x49, }; -extern const uint8_t sTestCert_Node02_01_PublicKey_Len = sizeof(sTestCert_Node02_01_PublicKey); +extern const size_t sTestCert_Node02_01_PublicKey_Len = sizeof(sTestCert_Node02_01_PublicKey); extern const uint8_t sTestCert_Node02_01_PrivateKey[] = { - 0xeb, 0x99, 0xd6, 0xc5, 0x7a, 0xb8, 0x58, 0xd7, 0x94, 0x7f, 0xd0, 0x5f, 0x7d, 0x54, 0x08, 0xc5, - 0xb5, 0xc7, 0xa2, 0xf5, 0xaf, 0xaf, 0x31, 0x60, 0x92, 0x74, 0x20, 0x9a, 0xbd, 0x20, 0x19, 0xa6, + 0xb4, 0x9f, 0x0e, 0x37, 0x24, 0x9c, 0x48, 0xc2, 0x5b, 0xa3, 0x0c, 0x7a, 0xfc, 0x4c, 0x94, 0x4f, + 0x88, 0xac, 0x3c, 0x03, 0xc5, 0xb2, 0xa1, 0x93, 0x6b, 0xd8, 0x67, 0x15, 0xad, 0x7b, 0xe9, 0x24, }; -extern const uint8_t sTestCert_Node02_01_PrivateKey_Len = sizeof(sTestCert_Node02_01_PrivateKey); +extern const size_t sTestCert_Node02_01_PrivateKey_Len = sizeof(sTestCert_Node02_01_PrivateKey); extern const uint8_t sTestCert_Node02_01_SubjectKeyId[] = { - 0xC2, 0x92, 0x42, 0x54, 0x44, 0x76, 0x84, 0x14, 0x9E, 0x93, 0x34, 0xEF, 0x5B, 0x9D, 0xA6, 0x17, 0x4C, 0x33, 0x8C, 0x1C, + 0xB4, 0x67, 0x76, 0xE1, 0xCC, 0x0A, 0xF7, 0x81, 0x54, 0xC6, 0x2B, 0x5A, 0x17, 0x98, 0x42, 0x64, 0xBA, 0xF5, 0x50, 0x86, }; -extern const uint8_t sTestCert_Node02_01_SubjectKeyId_Len = sizeof(sTestCert_Node02_01_SubjectKeyId); +extern const size_t sTestCert_Node02_01_SubjectKeyId_Len = sizeof(sTestCert_Node02_01_SubjectKeyId); extern const uint8_t sTestCert_Node02_01_AuthorityKeyId[] = { - 0xCF, 0x42, 0xBC, 0xF8, 0xDF, 0x48, 0x09, 0xD9, 0x26, 0x6F, 0x23, 0x15, 0x5A, 0x16, 0xB0, 0x7F, 0x04, 0xBB, 0x3D, 0x84, + 0xE1, 0xE7, 0x6E, 0x67, 0x77, 0x85, 0x1D, 0xD7, 0x74, 0x16, 0xBD, 0xDD, 0x35, 0xEC, 0x3C, 0x13, 0x7C, 0x47, 0x29, 0xDC, }; -extern const uint8_t sTestCert_Node02_01_AuthorityKeyId_Len = sizeof(sTestCert_Node02_01_AuthorityKeyId); +extern const size_t sTestCert_Node02_01_AuthorityKeyId_Len = sizeof(sTestCert_Node02_01_AuthorityKeyId); /************** Test Node02_02 Certificate ************** Certificate: Data: Version: 3 (0x2) - Serial Number: 6640147435493508949 (0x5c268ae95ccfc755) + Serial Number: 1052152040695922986 (0xe99feb4db62012a) Signature Algorithm: ecdsa-with-SHA256 Issuer: 1.3.6.1.4.1.37244.1.3 = CACACACA00000004, 1.3.6.1.4.1.37244.1.5 = FAB000000000001D Validity @@ -1522,11 +1527,11 @@ extern const uint8_t sTestCert_Node02_01_AuthorityKeyId_Len = sizeof(sTestCert_N Not After : Oct 15 14:23:42 2040 GMT Subject: 1.3.6.1.4.1.37244.1.1 = DEDEDEDE00020002, 1.3.6.1.4.1.37244.1.5 = FAB000000000001D, CN = TEST CERT COMMON NAME Attr for Node02_02 Subject Public Key Info: Public Key Algorithm: id-ecPublicKey Public-Key: (256 bit) pub: - 04:b2:87:29:92:2c:b1:c1:eb:3a:67:c1:8a:b3:1f: - f3:bf:27:f8:e8:8e:1f:1d:70:98:9b:30:10:90:d0: - e3:62:a4:6b:47:08:11:d1:70:85:cf:69:23:85:5e: - 7a:c7:23:61:c7:13:96:06:fc:a6:79:cf:91:65:97: - 10:cc:e7:df:78 + 04:f6:a0:95:8f:b8:fc:32:53:4a:7a:4d:44:87:4b: + 51:0f:30:9a:df:e6:51:42:2b:35:70:63:05:88:11: + b7:d5:bc:56:36:66:d5:48:db:2f:35:23:4d:d2:22: + 1b:e4:04:2f:ce:c4:74:0e:10:5e:08:b7:89:68:a7: + 94:a1:84:16:d7 ASN1 OID: prime256v1 NIST CURVE: P-256 X509v3 extensions: @@ -1537,62 +1542,62 @@ for Node02_02 Subject Public Key Info: Public Key Algorithm: id-ecPublicKey Publ X509v3 Extended Key Usage: critical TLS Web Client Authentication, TLS Web Server Authentication X509v3 Subject Key Identifier: - 40:90:A7:74:DA:49:53:CF:A8:46:66:7E:8D:7F:B7:4A:51:80:D0:EA + 21:F4:13:AA:28:D3:89:AF:4E:EE:25:71:1E:DF:A1:98:F7:71:88:85 X509v3 Authority Key Identifier: - keyid:CF:42:BC:F8:DF:48:09:D9:26:6F:23:15:5A:16:B0:7F:04:BB:3D:84 + keyid:E1:E7:6E:67:77:85:1D:D7:74:16:BD:DD:35:EC:3C:13:7C:47:29:DC Signature Algorithm: ecdsa-with-SHA256 - 30:45:02:20:46:56:be:52:4b:97:29:ff:9c:79:93:d2:86:0f: - 18:86:2d:05:93:77:10:aa:f0:50:61:3c:ab:66:57:d4:60:f1: - 02:21:00:fe:59:c2:1e:2b:2d:46:fc:b8:64:f5:f5:82:f5:45: - f9:99:33:67:db:41:84:44:10:79:7a:60:2a:3f:15:4f:e0 + 30:45:02:20:27:1b:0d:b2:11:95:14:d5:08:02:31:76:34:52: + 25:c4:a8:ca:9e:c2:10:f6:ae:dc:0a:e1:03:73:77:f6:f8:48: + 02:21:00:86:bb:6a:20:27:42:da:75:c9:2d:43:1d:f8:ed:ba: + cb:8c:30:73:b8:10:0a:a1:9d:46:9e:c8:e4:92:1e:b8:13 -----BEGIN CERTIFICATE----- -MIICNTCCAdugAwIBAgIIXCaK6VzPx1UwCgYIKoZIzj0EAwIwRDEgMB4GCisGAQQB +MIICNTCCAdugAwIBAgIIDpn+tNtiASowCgYIKoZIzj0EAwIwRDEgMB4GCisGAQQB gqJ8AQMMEENBQ0FDQUNBMDAwMDAwMDQxIDAeBgorBgEEAYKifAEFDBBGQUIwMDAw MDAwMDAwMDFEMB4XDTIwMTAxNTE0MjM0M1oXDTQwMTAxNTE0MjM0MlowdzEgMB4G CisGAQQBgqJ8AQEMEERFREVERURFMDAwMjAwMDIxIDAeBgorBgEEAYKifAEFDBBG QUIwMDAwMDAwMDAwMDFEMTEwLwYDVQQDDChURVNUIENFUlQgQ09NTU9OIE5BTUUg -QXR0ciBmb3IgTm9kZTAyXzAyMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEsocp -kiyxwes6Z8GKsx/zvyf46I4fHXCYmzAQkNDjYqRrRwgR0XCFz2kjhV56xyNhxxOW -Bvymec+RZZcQzOffeKOBgzCBgDAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB/wQEAwIH -gDAgBgNVHSUBAf8EFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEwHQYDVR0OBBYEFECQ -p3TaSVPPqEZmfo1/t0pRgNDqMB8GA1UdIwQYMBaAFM9CvPjfSAnZJm8jFVoWsH8E -uz2EMAoGCCqGSM49BAMCA0gAMEUCIEZWvlJLlyn/nHmT0oYPGIYtBZN3EKrwUGE8 -q2ZX1GDxAiEA/lnCHistRvy4ZPX1gvVF+ZkzZ9tBhEQQeXpgKj8VT+A= +QXR0ciBmb3IgTm9kZTAyXzAyMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE9qCV +j7j8MlNKek1Eh0tRDzCa3+ZRQis1cGMFiBG31bxWNmbVSNsvNSNN0iIb5AQvzsR0 +DhBeCLeJaKeUoYQW16OBgzCBgDAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB/wQEAwIH +gDAgBgNVHSUBAf8EFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEwHQYDVR0OBBYEFCH0 +E6oo04mvTu4lcR7foZj3cYiFMB8GA1UdIwQYMBaAFOHnbmd3hR3XdBa93TXsPBN8 +RyncMAoGCCqGSM49BAMCA0gAMEUCICcbDbIRlRTVCAIxdjRSJcSoyp7CEPau3Arh +A3N39vhIAiEAhrtqICdC2nXJLUMd+O26y4wwc7gQCqGdRp7I5JIeuBM= -----END CERTIFICATE----- -----BEGIN EC PRIVATE KEY----- -MHcCAQEEII9E84s+nWG26ZmAtXeJSWFbkr6fkBuPuTWiF8YmgEk0oAoGCCqGSM49 -AwEHoUQDQgAEsocpkiyxwes6Z8GKsx/zvyf46I4fHXCYmzAQkNDjYqRrRwgR0XCF -z2kjhV56xyNhxxOWBvymec+RZZcQzOffeA== +MHcCAQEEIOd1sYI17TVC8waIZL6dpiSIeqjoLCmMS1ogbQa1sIVzoAoGCCqGSM49 +AwEHoUQDQgAE9qCVj7j8MlNKek1Eh0tRDzCa3+ZRQis1cGMFiBG31bxWNmbVSNsv +NSNN0iIb5AQvzsR0DhBeCLeJaKeUoYQW1w== -----END EC PRIVATE KEY----- */ extern const uint8_t sTestCert_Node02_02_Chip[] = { - 0x15, 0x30, 0x01, 0x08, 0x5c, 0x26, 0x8a, 0xe9, 0x5c, 0xcf, 0xc7, 0x55, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, + 0x15, 0x30, 0x01, 0x08, 0x0e, 0x99, 0xfe, 0xb4, 0xdb, 0x62, 0x01, 0x2a, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x02, 0x00, 0x02, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x2c, 0x01, 0x28, 0x54, 0x45, 0x53, 0x54, 0x20, 0x43, 0x45, 0x52, 0x54, 0x20, 0x43, 0x4f, 0x4d, 0x4d, 0x4f, 0x4e, 0x20, 0x4e, 0x41, 0x4d, 0x45, 0x20, 0x41, 0x74, 0x74, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x30, 0x32, 0x5f, 0x30, 0x32, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, - 0xb2, 0x87, 0x29, 0x92, 0x2c, 0xb1, 0xc1, 0xeb, 0x3a, 0x67, 0xc1, 0x8a, 0xb3, 0x1f, 0xf3, 0xbf, 0x27, 0xf8, 0xe8, 0x8e, 0x1f, - 0x1d, 0x70, 0x98, 0x9b, 0x30, 0x10, 0x90, 0xd0, 0xe3, 0x62, 0xa4, 0x6b, 0x47, 0x08, 0x11, 0xd1, 0x70, 0x85, 0xcf, 0x69, 0x23, - 0x85, 0x5e, 0x7a, 0xc7, 0x23, 0x61, 0xc7, 0x13, 0x96, 0x06, 0xfc, 0xa6, 0x79, 0xcf, 0x91, 0x65, 0x97, 0x10, 0xcc, 0xe7, 0xdf, - 0x78, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, - 0x40, 0x90, 0xa7, 0x74, 0xda, 0x49, 0x53, 0xcf, 0xa8, 0x46, 0x66, 0x7e, 0x8d, 0x7f, 0xb7, 0x4a, 0x51, 0x80, 0xd0, 0xea, 0x30, - 0x05, 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, 0x26, 0x6f, 0x23, 0x15, 0x5a, 0x16, 0xb0, 0x7f, 0x04, 0xbb, 0x3d, - 0x84, 0x18, 0x30, 0x0b, 0x40, 0x46, 0x56, 0xbe, 0x52, 0x4b, 0x97, 0x29, 0xff, 0x9c, 0x79, 0x93, 0xd2, 0x86, 0x0f, 0x18, 0x86, - 0x2d, 0x05, 0x93, 0x77, 0x10, 0xaa, 0xf0, 0x50, 0x61, 0x3c, 0xab, 0x66, 0x57, 0xd4, 0x60, 0xf1, 0xfe, 0x59, 0xc2, 0x1e, 0x2b, - 0x2d, 0x46, 0xfc, 0xb8, 0x64, 0xf5, 0xf5, 0x82, 0xf5, 0x45, 0xf9, 0x99, 0x33, 0x67, 0xdb, 0x41, 0x84, 0x44, 0x10, 0x79, 0x7a, - 0x60, 0x2a, 0x3f, 0x15, 0x4f, 0xe0, 0x18, + 0xf6, 0xa0, 0x95, 0x8f, 0xb8, 0xfc, 0x32, 0x53, 0x4a, 0x7a, 0x4d, 0x44, 0x87, 0x4b, 0x51, 0x0f, 0x30, 0x9a, 0xdf, 0xe6, 0x51, + 0x42, 0x2b, 0x35, 0x70, 0x63, 0x05, 0x88, 0x11, 0xb7, 0xd5, 0xbc, 0x56, 0x36, 0x66, 0xd5, 0x48, 0xdb, 0x2f, 0x35, 0x23, 0x4d, + 0xd2, 0x22, 0x1b, 0xe4, 0x04, 0x2f, 0xce, 0xc4, 0x74, 0x0e, 0x10, 0x5e, 0x08, 0xb7, 0x89, 0x68, 0xa7, 0x94, 0xa1, 0x84, 0x16, + 0xd7, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, + 0x21, 0xf4, 0x13, 0xaa, 0x28, 0xd3, 0x89, 0xaf, 0x4e, 0xee, 0x25, 0x71, 0x1e, 0xdf, 0xa1, 0x98, 0xf7, 0x71, 0x88, 0x85, 0x30, + 0x05, 0x14, 0xe1, 0xe7, 0x6e, 0x67, 0x77, 0x85, 0x1d, 0xd7, 0x74, 0x16, 0xbd, 0xdd, 0x35, 0xec, 0x3c, 0x13, 0x7c, 0x47, 0x29, + 0xdc, 0x18, 0x30, 0x0b, 0x40, 0x27, 0x1b, 0x0d, 0xb2, 0x11, 0x95, 0x14, 0xd5, 0x08, 0x02, 0x31, 0x76, 0x34, 0x52, 0x25, 0xc4, + 0xa8, 0xca, 0x9e, 0xc2, 0x10, 0xf6, 0xae, 0xdc, 0x0a, 0xe1, 0x03, 0x73, 0x77, 0xf6, 0xf8, 0x48, 0x86, 0xbb, 0x6a, 0x20, 0x27, + 0x42, 0xda, 0x75, 0xc9, 0x2d, 0x43, 0x1d, 0xf8, 0xed, 0xba, 0xcb, 0x8c, 0x30, 0x73, 0xb8, 0x10, 0x0a, 0xa1, 0x9d, 0x46, 0x9e, + 0xc8, 0xe4, 0x92, 0x1e, 0xb8, 0x13, 0x18, }; -extern const uint32_t sTestCert_Node02_02_Chip_Len = sizeof(sTestCert_Node02_02_Chip); +extern const size_t sTestCert_Node02_02_Chip_Len = sizeof(sTestCert_Node02_02_Chip); extern const uint8_t sTestCert_Node02_02_DER[] = { - 0x30, 0x82, 0x02, 0x35, 0x30, 0x82, 0x01, 0xdb, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x5c, 0x26, 0x8a, 0xe9, 0x5c, 0xcf, - 0xc7, 0x55, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, + 0x30, 0x82, 0x02, 0x35, 0x30, 0x82, 0x01, 0xdb, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x0e, 0x99, 0xfe, 0xb4, 0xdb, 0x62, + 0x01, 0x2a, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x34, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x05, 0x0c, 0x10, 0x46, 0x41, 0x42, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x44, @@ -1604,70 +1609,71 @@ extern const uint8_t sTestCert_Node02_02_DER[] = { 0x2f, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x28, 0x54, 0x45, 0x53, 0x54, 0x20, 0x43, 0x45, 0x52, 0x54, 0x20, 0x43, 0x4f, 0x4d, 0x4d, 0x4f, 0x4e, 0x20, 0x4e, 0x41, 0x4d, 0x45, 0x20, 0x41, 0x74, 0x74, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x30, 0x32, 0x5f, 0x30, 0x32, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0xb2, 0x87, 0x29, 0x92, 0x2c, 0xb1, 0xc1, 0xeb, 0x3a, - 0x67, 0xc1, 0x8a, 0xb3, 0x1f, 0xf3, 0xbf, 0x27, 0xf8, 0xe8, 0x8e, 0x1f, 0x1d, 0x70, 0x98, 0x9b, 0x30, 0x10, 0x90, 0xd0, 0xe3, - 0x62, 0xa4, 0x6b, 0x47, 0x08, 0x11, 0xd1, 0x70, 0x85, 0xcf, 0x69, 0x23, 0x85, 0x5e, 0x7a, 0xc7, 0x23, 0x61, 0xc7, 0x13, 0x96, - 0x06, 0xfc, 0xa6, 0x79, 0xcf, 0x91, 0x65, 0x97, 0x10, 0xcc, 0xe7, 0xdf, 0x78, 0xa3, 0x81, 0x83, 0x30, 0x81, 0x80, 0x30, 0x0c, + 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0xf6, 0xa0, 0x95, 0x8f, 0xb8, 0xfc, 0x32, 0x53, 0x4a, + 0x7a, 0x4d, 0x44, 0x87, 0x4b, 0x51, 0x0f, 0x30, 0x9a, 0xdf, 0xe6, 0x51, 0x42, 0x2b, 0x35, 0x70, 0x63, 0x05, 0x88, 0x11, 0xb7, + 0xd5, 0xbc, 0x56, 0x36, 0x66, 0xd5, 0x48, 0xdb, 0x2f, 0x35, 0x23, 0x4d, 0xd2, 0x22, 0x1b, 0xe4, 0x04, 0x2f, 0xce, 0xc4, 0x74, + 0x0e, 0x10, 0x5e, 0x08, 0xb7, 0x89, 0x68, 0xa7, 0x94, 0xa1, 0x84, 0x16, 0xd7, 0xa3, 0x81, 0x83, 0x30, 0x81, 0x80, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x07, 0x80, 0x30, 0x20, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x01, 0x01, 0xff, 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x30, - 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x40, 0x90, 0xa7, 0x74, 0xda, 0x49, 0x53, 0xcf, 0xa8, 0x46, 0x66, - 0x7e, 0x8d, 0x7f, 0xb7, 0x4a, 0x51, 0x80, 0xd0, 0xea, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, - 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, 0x26, 0x6f, 0x23, 0x15, 0x5a, 0x16, 0xb0, 0x7f, 0x04, 0xbb, 0x3d, 0x84, - 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, 0x45, 0x02, 0x20, 0x46, 0x56, - 0xbe, 0x52, 0x4b, 0x97, 0x29, 0xff, 0x9c, 0x79, 0x93, 0xd2, 0x86, 0x0f, 0x18, 0x86, 0x2d, 0x05, 0x93, 0x77, 0x10, 0xaa, 0xf0, - 0x50, 0x61, 0x3c, 0xab, 0x66, 0x57, 0xd4, 0x60, 0xf1, 0x02, 0x21, 0x00, 0xfe, 0x59, 0xc2, 0x1e, 0x2b, 0x2d, 0x46, 0xfc, 0xb8, - 0x64, 0xf5, 0xf5, 0x82, 0xf5, 0x45, 0xf9, 0x99, 0x33, 0x67, 0xdb, 0x41, 0x84, 0x44, 0x10, 0x79, 0x7a, 0x60, 0x2a, 0x3f, 0x15, - 0x4f, 0xe0, + 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x21, 0xf4, 0x13, 0xaa, 0x28, 0xd3, 0x89, 0xaf, 0x4e, 0xee, 0x25, + 0x71, 0x1e, 0xdf, 0xa1, 0x98, 0xf7, 0x71, 0x88, 0x85, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, + 0x14, 0xe1, 0xe7, 0x6e, 0x67, 0x77, 0x85, 0x1d, 0xd7, 0x74, 0x16, 0xbd, 0xdd, 0x35, 0xec, 0x3c, 0x13, 0x7c, 0x47, 0x29, 0xdc, + 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, 0x45, 0x02, 0x20, 0x27, 0x1b, + 0x0d, 0xb2, 0x11, 0x95, 0x14, 0xd5, 0x08, 0x02, 0x31, 0x76, 0x34, 0x52, 0x25, 0xc4, 0xa8, 0xca, 0x9e, 0xc2, 0x10, 0xf6, 0xae, + 0xdc, 0x0a, 0xe1, 0x03, 0x73, 0x77, 0xf6, 0xf8, 0x48, 0x02, 0x21, 0x00, 0x86, 0xbb, 0x6a, 0x20, 0x27, 0x42, 0xda, 0x75, 0xc9, + 0x2d, 0x43, 0x1d, 0xf8, 0xed, 0xba, 0xcb, 0x8c, 0x30, 0x73, 0xb8, 0x10, 0x0a, 0xa1, 0x9d, 0x46, 0x9e, 0xc8, 0xe4, 0x92, 0x1e, + 0xb8, 0x13, }; -extern const uint32_t sTestCert_Node02_02_DER_Len = sizeof(sTestCert_Node02_02_DER); +extern const size_t sTestCert_Node02_02_DER_Len = sizeof(sTestCert_Node02_02_DER); extern const uint8_t sTestCert_Node02_02_PublicKey[] = { - 0x04, 0xb2, 0x87, 0x29, 0x92, 0x2c, 0xb1, 0xc1, 0xeb, 0x3a, 0x67, 0xc1, 0x8a, 0xb3, 0x1f, 0xf3, 0xbf, - 0x27, 0xf8, 0xe8, 0x8e, 0x1f, 0x1d, 0x70, 0x98, 0x9b, 0x30, 0x10, 0x90, 0xd0, 0xe3, 0x62, 0xa4, 0x6b, - 0x47, 0x08, 0x11, 0xd1, 0x70, 0x85, 0xcf, 0x69, 0x23, 0x85, 0x5e, 0x7a, 0xc7, 0x23, 0x61, 0xc7, 0x13, - 0x96, 0x06, 0xfc, 0xa6, 0x79, 0xcf, 0x91, 0x65, 0x97, 0x10, 0xcc, 0xe7, 0xdf, 0x78, + 0x04, 0xf6, 0xa0, 0x95, 0x8f, 0xb8, 0xfc, 0x32, 0x53, 0x4a, 0x7a, 0x4d, 0x44, 0x87, 0x4b, 0x51, 0x0f, + 0x30, 0x9a, 0xdf, 0xe6, 0x51, 0x42, 0x2b, 0x35, 0x70, 0x63, 0x05, 0x88, 0x11, 0xb7, 0xd5, 0xbc, 0x56, + 0x36, 0x66, 0xd5, 0x48, 0xdb, 0x2f, 0x35, 0x23, 0x4d, 0xd2, 0x22, 0x1b, 0xe4, 0x04, 0x2f, 0xce, 0xc4, + 0x74, 0x0e, 0x10, 0x5e, 0x08, 0xb7, 0x89, 0x68, 0xa7, 0x94, 0xa1, 0x84, 0x16, 0xd7, }; -extern const uint8_t sTestCert_Node02_02_PublicKey_Len = sizeof(sTestCert_Node02_02_PublicKey); +extern const size_t sTestCert_Node02_02_PublicKey_Len = sizeof(sTestCert_Node02_02_PublicKey); extern const uint8_t sTestCert_Node02_02_PrivateKey[] = { - 0x8f, 0x44, 0xf3, 0x8b, 0x3e, 0x9d, 0x61, 0xb6, 0xe9, 0x99, 0x80, 0xb5, 0x77, 0x89, 0x49, 0x61, - 0x5b, 0x92, 0xbe, 0x9f, 0x90, 0x1b, 0x8f, 0xb9, 0x35, 0xa2, 0x17, 0xc6, 0x26, 0x80, 0x49, 0x34, + 0xe7, 0x75, 0xb1, 0x82, 0x35, 0xed, 0x35, 0x42, 0xf3, 0x06, 0x88, 0x64, 0xbe, 0x9d, 0xa6, 0x24, + 0x88, 0x7a, 0xa8, 0xe8, 0x2c, 0x29, 0x8c, 0x4b, 0x5a, 0x20, 0x6d, 0x06, 0xb5, 0xb0, 0x85, 0x73, }; -extern const uint8_t sTestCert_Node02_02_PrivateKey_Len = sizeof(sTestCert_Node02_02_PrivateKey); +extern const size_t sTestCert_Node02_02_PrivateKey_Len = sizeof(sTestCert_Node02_02_PrivateKey); extern const uint8_t sTestCert_Node02_02_SubjectKeyId[] = { - 0x40, 0x90, 0xA7, 0x74, 0xDA, 0x49, 0x53, 0xCF, 0xA8, 0x46, 0x66, 0x7E, 0x8D, 0x7F, 0xB7, 0x4A, 0x51, 0x80, 0xD0, 0xEA, + 0x21, 0xF4, 0x13, 0xAA, 0x28, 0xD3, 0x89, 0xAF, 0x4E, 0xEE, 0x25, 0x71, 0x1E, 0xDF, 0xA1, 0x98, 0xF7, 0x71, 0x88, 0x85, }; -extern const uint8_t sTestCert_Node02_02_SubjectKeyId_Len = sizeof(sTestCert_Node02_02_SubjectKeyId); +extern const size_t sTestCert_Node02_02_SubjectKeyId_Len = sizeof(sTestCert_Node02_02_SubjectKeyId); extern const uint8_t sTestCert_Node02_02_AuthorityKeyId[] = { - 0xCF, 0x42, 0xBC, 0xF8, 0xDF, 0x48, 0x09, 0xD9, 0x26, 0x6F, 0x23, 0x15, 0x5A, 0x16, 0xB0, 0x7F, 0x04, 0xBB, 0x3D, 0x84, + 0xE1, 0xE7, 0x6E, 0x67, 0x77, 0x85, 0x1D, 0xD7, 0x74, 0x16, 0xBD, 0xDD, 0x35, 0xEC, 0x3C, 0x13, 0x7C, 0x47, 0x29, 0xDC, }; -extern const uint8_t sTestCert_Node02_02_AuthorityKeyId_Len = sizeof(sTestCert_Node02_02_AuthorityKeyId); +extern const size_t sTestCert_Node02_02_AuthorityKeyId_Len = sizeof(sTestCert_Node02_02_AuthorityKeyId); /************** Test Node02_03 Certificate ************** Certificate: Data: Version: 3 (0x2) - Serial Number: 7412840857549301709 (0x66dfb37c2aba67cd) + Serial Number: 1067793285220423275 (0xed19055e31c566b) Signature Algorithm: ecdsa-with-SHA256 Issuer: 1.3.6.1.4.1.37244.1.3 = CACACACA00000004, 1.3.6.1.4.1.37244.1.5 = FAB000000000001D Validity Not Before: Oct 15 14:23:43 2020 GMT Not After : Oct 15 14:23:42 2040 GMT Subject: 1.3.6.1.4.1.37244.1.1 = DEDEDEDE00020003, 1.3.6.1.4.1.37244.1.5 = FAB000000000001D, CN = -TestCert02_03, 1.3.6.1.4.1.37244.1.6 = A001B001, 1.3.6.1.4.1.37244.1.7 = A001B002 Subject Public Key Info: Public Key Algorithm: -id-ecPublicKey Public-Key: (256 bit) pub: 04:43:cd:fa:bc:f2:f4:8c:10:6f:5f:d8:90:87:29: - ee:fd:6e:ea:92:b6:49:0e:10:53:6d:1b:0b:b0:c9: - 7a:28:83:57:21:69:1b:2a:4e:d2:a6:52:b0:dc:19: - d5:2a:30:ea:2d:58:6b:b1:22:0b:69:cd:d6:eb:0a: - 3e:e2:f2:5f:61 +TestCert02_03, 1.3.6.1.4.1.37244.1.6 = ABCD0001 Subject Public Key Info: Public Key Algorithm: id-ecPublicKey Public-Key: (256 bit) + pub: + 04:ab:9b:9c:a9:e1:93:76:c4:f5:7d:de:c4:38:6a: + 00:fc:3e:8a:4b:38:8c:d1:8a:b4:ff:cc:da:45:62: + 08:0c:08:b5:e7:16:e6:b2:ce:c5:7d:22:d6:01:87: + a9:20:fb:a0:b4:57:b9:ac:8c:29:e1:9a:36:7e:2f: + f0:1b:5c:7a:59 ASN1 OID: prime256v1 NIST CURVE: P-256 X509v3 extensions: @@ -1678,138 +1684,136 @@ id-ecPublicKey Public-Key: (256 bit) pub: 04:43:cd:fa:bc:f2:f4:8c:10:6f:5f:d8:90 X509v3 Extended Key Usage: critical TLS Web Client Authentication, TLS Web Server Authentication X509v3 Subject Key Identifier: - 31:1F:1B:10:15:5C:E5:4F:F0:C8:FC:F4:6E:F5:28:B9:B7:B0:0B:0A + E5:7F:7A:B3:74:B0:2F:53:EF:A0:A5:B6:52:F2:21:1C:1A:AF:05:CF X509v3 Authority Key Identifier: - keyid:CF:42:BC:F8:DF:48:09:D9:26:6F:23:15:5A:16:B0:7F:04:BB:3D:84 + keyid:E1:E7:6E:67:77:85:1D:D7:74:16:BD:DD:35:EC:3C:13:7C:47:29:DC Signature Algorithm: ecdsa-with-SHA256 - 30:45:02:21:00:e1:f6:61:61:0e:c6:8a:42:e9:00:73:67:d0: - 74:f7:1a:60:80:a0:a4:4d:a6:bd:d7:d2:0f:8b:15:ec:2f:aa: - c4:02:20:65:a5:19:47:72:e9:fd:57:66:00:3d:ce:7c:a0:c0: - 1d:66:fb:a7:2d:9b:e4:7c:ec:41:ff:29:00:3c:16:43:5d + 30:46:02:21:00:8f:32:e6:83:2d:dd:ed:55:3e:02:02:d2:61: + 86:db:08:86:6e:2e:ac:3b:ec:3d:1f:11:d1:74:00:97:ee:5d: + ea:02:21:00:cc:22:75:f7:00:0c:a1:e5:e4:9b:ab:45:19:c6: + 70:f7:c2:50:9c:ce:18:97:ce:95:8a:e8:f4:a9:49:9f:33:ea -----BEGIN CERTIFICATE----- -MIICTzCCAfWgAwIBAgIIZt+zfCq6Z80wCgYIKoZIzj0EAwIwRDEgMB4GCisGAQQB +MIICNTCCAdqgAwIBAgIIDtGQVeMcVmswCgYIKoZIzj0EAwIwRDEgMB4GCisGAQQB gqJ8AQMMEENBQ0FDQUNBMDAwMDAwMDQxIDAeBgorBgEEAYKifAEFDBBGQUIwMDAw -MDAwMDAwMDFEMB4XDTIwMTAxNTE0MjM0M1oXDTQwMTAxNTE0MjM0MlowgZAxIDAe -BgorBgEEAYKifAEBDBBERURFREVERTAwMDIwMDAzMSAwHgYKKwYBBAGConwBBQwQ -RkFCMDAwMDAwMDAwMDAxRDEWMBQGA1UEAwwNVGVzdENlcnQwMl8wMzEYMBYGCisG -AQQBgqJ8AQYMCEEwMDFCMDAxMRgwFgYKKwYBBAGConwBBwwIQTAwMUIwMDIwWTAT -BgcqhkjOPQIBBggqhkjOPQMBBwNCAARDzfq88vSMEG9f2JCHKe79buqStkkOEFNt -GwuwyXoog1chaRsqTtKmUrDcGdUqMOotWGuxIgtpzdbrCj7i8l9ho4GDMIGAMAwG -A1UdEwEB/wQCMAAwDgYDVR0PAQH/BAQDAgeAMCAGA1UdJQEB/wQWMBQGCCsGAQUF -BwMCBggrBgEFBQcDATAdBgNVHQ4EFgQUMR8bEBVc5U/wyPz0bvUoubewCwowHwYD -VR0jBBgwFoAUz0K8+N9ICdkmbyMVWhawfwS7PYQwCgYIKoZIzj0EAwIDSAAwRQIh -AOH2YWEOxopC6QBzZ9B09xpggKCkTaa919IPixXsL6rEAiBlpRlHcun9V2YAPc58 -oMAdZvunLZvkfOxB/ykAPBZDXQ== +MDAwMDAwMDFEMB4XDTIwMTAxNTE0MjM0M1oXDTQwMTAxNTE0MjM0MlowdjEgMB4G +CisGAQQBgqJ8AQEMEERFREVERURFMDAwMjAwMDMxIDAeBgorBgEEAYKifAEFDBBG +QUIwMDAwMDAwMDAwMDFEMRYwFAYDVQQDDA1UZXN0Q2VydDAyXzAzMRgwFgYKKwYB +BAGConwBBgwIQUJDRDAwMDEwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAASrm5yp +4ZN2xPV93sQ4agD8PopLOIzRirT/zNpFYggMCLXnFuayzsV9ItYBh6kg+6C0V7ms +jCnhmjZ+L/AbXHpZo4GDMIGAMAwGA1UdEwEB/wQCMAAwDgYDVR0PAQH/BAQDAgeA +MCAGA1UdJQEB/wQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATAdBgNVHQ4EFgQU5X96 +s3SwL1PvoKW2UvIhHBqvBc8wHwYDVR0jBBgwFoAU4eduZ3eFHdd0Fr3dNew8E3xH +KdwwCgYIKoZIzj0EAwIDSQAwRgIhAI8y5oMt3e1VPgIC0mGG2wiGbi6sO+w9HxHR +dACX7l3qAiEAzCJ19wAMoeXkm6tFGcZw98JQnM4Yl86Viuj0qUmfM+o= -----END CERTIFICATE----- -----BEGIN EC PRIVATE KEY----- -MHcCAQEEIDYTSAUOkPD9dKZt+VVyWHqWM4CwpFEW8UP2RJGtRZgboAoGCCqGSM49 -AwEHoUQDQgAEQ836vPL0jBBvX9iQhynu/W7qkrZJDhBTbRsLsMl6KINXIWkbKk7S -plKw3BnVKjDqLVhrsSILac3W6wo+4vJfYQ== +MHcCAQEEIAoS9pwV9C8RDuP063f4r+8FDAl18wZiFOWKMEP7IN66oAoGCCqGSM49 +AwEHoUQDQgAEq5ucqeGTdsT1fd7EOGoA/D6KSziM0Yq0/8zaRWIIDAi15xbmss7F +fSLWAYepIPugtFe5rIwp4Zo2fi/wG1x6WQ== -----END EC PRIVATE KEY----- */ extern const uint8_t sTestCert_Node02_03_Chip[] = { - 0x15, 0x30, 0x01, 0x08, 0x66, 0xdf, 0xb3, 0x7c, 0x2a, 0xba, 0x67, 0xcd, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, + 0x15, 0x30, 0x01, 0x08, 0x0e, 0xd1, 0x90, 0x55, 0xe3, 0x1c, 0x56, 0x6b, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x03, 0x00, 0x02, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x2c, 0x01, 0x0d, 0x54, 0x65, 0x73, 0x74, 0x43, 0x65, 0x72, 0x74, 0x30, - 0x32, 0x5f, 0x30, 0x33, 0x26, 0x16, 0x01, 0xb0, 0x01, 0xa0, 0x26, 0x17, 0x02, 0xb0, 0x01, 0xa0, 0x18, 0x24, 0x07, 0x01, 0x24, - 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0x43, 0xcd, 0xfa, 0xbc, 0xf2, 0xf4, 0x8c, 0x10, 0x6f, 0x5f, 0xd8, 0x90, 0x87, 0x29, 0xee, - 0xfd, 0x6e, 0xea, 0x92, 0xb6, 0x49, 0x0e, 0x10, 0x53, 0x6d, 0x1b, 0x0b, 0xb0, 0xc9, 0x7a, 0x28, 0x83, 0x57, 0x21, 0x69, 0x1b, - 0x2a, 0x4e, 0xd2, 0xa6, 0x52, 0xb0, 0xdc, 0x19, 0xd5, 0x2a, 0x30, 0xea, 0x2d, 0x58, 0x6b, 0xb1, 0x22, 0x0b, 0x69, 0xcd, 0xd6, - 0xeb, 0x0a, 0x3e, 0xe2, 0xf2, 0x5f, 0x61, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, - 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, 0x31, 0x1f, 0x1b, 0x10, 0x15, 0x5c, 0xe5, 0x4f, 0xf0, 0xc8, 0xfc, 0xf4, 0x6e, 0xf5, 0x28, - 0xb9, 0xb7, 0xb0, 0x0b, 0x0a, 0x30, 0x05, 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, 0x26, 0x6f, 0x23, 0x15, 0x5a, - 0x16, 0xb0, 0x7f, 0x04, 0xbb, 0x3d, 0x84, 0x18, 0x30, 0x0b, 0x40, 0xe1, 0xf6, 0x61, 0x61, 0x0e, 0xc6, 0x8a, 0x42, 0xe9, 0x00, - 0x73, 0x67, 0xd0, 0x74, 0xf7, 0x1a, 0x60, 0x80, 0xa0, 0xa4, 0x4d, 0xa6, 0xbd, 0xd7, 0xd2, 0x0f, 0x8b, 0x15, 0xec, 0x2f, 0xaa, - 0xc4, 0x65, 0xa5, 0x19, 0x47, 0x72, 0xe9, 0xfd, 0x57, 0x66, 0x00, 0x3d, 0xce, 0x7c, 0xa0, 0xc0, 0x1d, 0x66, 0xfb, 0xa7, 0x2d, - 0x9b, 0xe4, 0x7c, 0xec, 0x41, 0xff, 0x29, 0x00, 0x3c, 0x16, 0x43, 0x5d, 0x18, + 0x32, 0x5f, 0x30, 0x33, 0x26, 0x16, 0x01, 0x00, 0xcd, 0xab, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, + 0xab, 0x9b, 0x9c, 0xa9, 0xe1, 0x93, 0x76, 0xc4, 0xf5, 0x7d, 0xde, 0xc4, 0x38, 0x6a, 0x00, 0xfc, 0x3e, 0x8a, 0x4b, 0x38, 0x8c, + 0xd1, 0x8a, 0xb4, 0xff, 0xcc, 0xda, 0x45, 0x62, 0x08, 0x0c, 0x08, 0xb5, 0xe7, 0x16, 0xe6, 0xb2, 0xce, 0xc5, 0x7d, 0x22, 0xd6, + 0x01, 0x87, 0xa9, 0x20, 0xfb, 0xa0, 0xb4, 0x57, 0xb9, 0xac, 0x8c, 0x29, 0xe1, 0x9a, 0x36, 0x7e, 0x2f, 0xf0, 0x1b, 0x5c, 0x7a, + 0x59, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, + 0xe5, 0x7f, 0x7a, 0xb3, 0x74, 0xb0, 0x2f, 0x53, 0xef, 0xa0, 0xa5, 0xb6, 0x52, 0xf2, 0x21, 0x1c, 0x1a, 0xaf, 0x05, 0xcf, 0x30, + 0x05, 0x14, 0xe1, 0xe7, 0x6e, 0x67, 0x77, 0x85, 0x1d, 0xd7, 0x74, 0x16, 0xbd, 0xdd, 0x35, 0xec, 0x3c, 0x13, 0x7c, 0x47, 0x29, + 0xdc, 0x18, 0x30, 0x0b, 0x40, 0x8f, 0x32, 0xe6, 0x83, 0x2d, 0xdd, 0xed, 0x55, 0x3e, 0x02, 0x02, 0xd2, 0x61, 0x86, 0xdb, 0x08, + 0x86, 0x6e, 0x2e, 0xac, 0x3b, 0xec, 0x3d, 0x1f, 0x11, 0xd1, 0x74, 0x00, 0x97, 0xee, 0x5d, 0xea, 0xcc, 0x22, 0x75, 0xf7, 0x00, + 0x0c, 0xa1, 0xe5, 0xe4, 0x9b, 0xab, 0x45, 0x19, 0xc6, 0x70, 0xf7, 0xc2, 0x50, 0x9c, 0xce, 0x18, 0x97, 0xce, 0x95, 0x8a, 0xe8, + 0xf4, 0xa9, 0x49, 0x9f, 0x33, 0xea, 0x18, }; -extern const uint32_t sTestCert_Node02_03_Chip_Len = sizeof(sTestCert_Node02_03_Chip); +extern const size_t sTestCert_Node02_03_Chip_Len = sizeof(sTestCert_Node02_03_Chip); extern const uint8_t sTestCert_Node02_03_DER[] = { - 0x30, 0x82, 0x02, 0x4f, 0x30, 0x82, 0x01, 0xf5, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x66, 0xdf, 0xb3, 0x7c, 0x2a, 0xba, - 0x67, 0xcd, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, + 0x30, 0x82, 0x02, 0x35, 0x30, 0x82, 0x01, 0xda, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x0e, 0xd1, 0x90, 0x55, 0xe3, 0x1c, + 0x56, 0x6b, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x34, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x05, 0x0c, 0x10, 0x46, 0x41, 0x42, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x44, 0x30, 0x1e, 0x17, 0x0d, 0x32, 0x30, 0x31, 0x30, 0x31, 0x35, 0x31, 0x34, 0x32, 0x33, 0x34, 0x33, 0x5a, 0x17, 0x0d, 0x34, 0x30, - 0x31, 0x30, 0x31, 0x35, 0x31, 0x34, 0x32, 0x33, 0x34, 0x32, 0x5a, 0x30, 0x81, 0x90, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, - 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x01, 0x0c, 0x10, 0x44, 0x45, 0x44, 0x45, 0x44, 0x45, 0x44, 0x45, 0x30, 0x30, - 0x30, 0x32, 0x30, 0x30, 0x30, 0x33, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, - 0x05, 0x0c, 0x10, 0x46, 0x41, 0x42, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x44, 0x31, 0x16, - 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0d, 0x54, 0x65, 0x73, 0x74, 0x43, 0x65, 0x72, 0x74, 0x30, 0x32, 0x5f, 0x30, - 0x33, 0x31, 0x18, 0x30, 0x16, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x06, 0x0c, 0x08, 0x41, 0x30, - 0x30, 0x31, 0x42, 0x30, 0x30, 0x31, 0x31, 0x18, 0x30, 0x16, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, - 0x07, 0x0c, 0x08, 0x41, 0x30, 0x30, 0x31, 0x42, 0x30, 0x30, 0x32, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, - 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x43, 0xcd, 0xfa, 0xbc, - 0xf2, 0xf4, 0x8c, 0x10, 0x6f, 0x5f, 0xd8, 0x90, 0x87, 0x29, 0xee, 0xfd, 0x6e, 0xea, 0x92, 0xb6, 0x49, 0x0e, 0x10, 0x53, 0x6d, - 0x1b, 0x0b, 0xb0, 0xc9, 0x7a, 0x28, 0x83, 0x57, 0x21, 0x69, 0x1b, 0x2a, 0x4e, 0xd2, 0xa6, 0x52, 0xb0, 0xdc, 0x19, 0xd5, 0x2a, - 0x30, 0xea, 0x2d, 0x58, 0x6b, 0xb1, 0x22, 0x0b, 0x69, 0xcd, 0xd6, 0xeb, 0x0a, 0x3e, 0xe2, 0xf2, 0x5f, 0x61, 0xa3, 0x81, 0x83, - 0x30, 0x81, 0x80, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0e, 0x06, 0x03, - 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x07, 0x80, 0x30, 0x20, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x01, 0x01, - 0xff, 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, - 0x05, 0x07, 0x03, 0x01, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x31, 0x1f, 0x1b, 0x10, 0x15, 0x5c, - 0xe5, 0x4f, 0xf0, 0xc8, 0xfc, 0xf4, 0x6e, 0xf5, 0x28, 0xb9, 0xb7, 0xb0, 0x0b, 0x0a, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, - 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, 0x26, 0x6f, 0x23, 0x15, 0x5a, 0x16, 0xb0, - 0x7f, 0x04, 0xbb, 0x3d, 0x84, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, - 0x45, 0x02, 0x21, 0x00, 0xe1, 0xf6, 0x61, 0x61, 0x0e, 0xc6, 0x8a, 0x42, 0xe9, 0x00, 0x73, 0x67, 0xd0, 0x74, 0xf7, 0x1a, 0x60, - 0x80, 0xa0, 0xa4, 0x4d, 0xa6, 0xbd, 0xd7, 0xd2, 0x0f, 0x8b, 0x15, 0xec, 0x2f, 0xaa, 0xc4, 0x02, 0x20, 0x65, 0xa5, 0x19, 0x47, - 0x72, 0xe9, 0xfd, 0x57, 0x66, 0x00, 0x3d, 0xce, 0x7c, 0xa0, 0xc0, 0x1d, 0x66, 0xfb, 0xa7, 0x2d, 0x9b, 0xe4, 0x7c, 0xec, 0x41, - 0xff, 0x29, 0x00, 0x3c, 0x16, 0x43, 0x5d, + 0x31, 0x30, 0x31, 0x35, 0x31, 0x34, 0x32, 0x33, 0x34, 0x32, 0x5a, 0x30, 0x76, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, + 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x01, 0x0c, 0x10, 0x44, 0x45, 0x44, 0x45, 0x44, 0x45, 0x44, 0x45, 0x30, 0x30, 0x30, + 0x32, 0x30, 0x30, 0x30, 0x33, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x05, + 0x0c, 0x10, 0x46, 0x41, 0x42, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x44, 0x31, 0x16, 0x30, + 0x14, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0d, 0x54, 0x65, 0x73, 0x74, 0x43, 0x65, 0x72, 0x74, 0x30, 0x32, 0x5f, 0x30, 0x33, + 0x31, 0x18, 0x30, 0x16, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x06, 0x0c, 0x08, 0x41, 0x42, 0x43, + 0x44, 0x30, 0x30, 0x30, 0x31, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, + 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0xab, 0x9b, 0x9c, 0xa9, 0xe1, 0x93, 0x76, 0xc4, 0xf5, 0x7d, + 0xde, 0xc4, 0x38, 0x6a, 0x00, 0xfc, 0x3e, 0x8a, 0x4b, 0x38, 0x8c, 0xd1, 0x8a, 0xb4, 0xff, 0xcc, 0xda, 0x45, 0x62, 0x08, 0x0c, + 0x08, 0xb5, 0xe7, 0x16, 0xe6, 0xb2, 0xce, 0xc5, 0x7d, 0x22, 0xd6, 0x01, 0x87, 0xa9, 0x20, 0xfb, 0xa0, 0xb4, 0x57, 0xb9, 0xac, + 0x8c, 0x29, 0xe1, 0x9a, 0x36, 0x7e, 0x2f, 0xf0, 0x1b, 0x5c, 0x7a, 0x59, 0xa3, 0x81, 0x83, 0x30, 0x81, 0x80, 0x30, 0x0c, 0x06, + 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, + 0x04, 0x04, 0x03, 0x02, 0x07, 0x80, 0x30, 0x20, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x01, 0x01, 0xff, 0x04, 0x16, 0x30, 0x14, 0x06, + 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x30, 0x1d, + 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xe5, 0x7f, 0x7a, 0xb3, 0x74, 0xb0, 0x2f, 0x53, 0xef, 0xa0, 0xa5, 0xb6, + 0x52, 0xf2, 0x21, 0x1c, 0x1a, 0xaf, 0x05, 0xcf, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, + 0xe1, 0xe7, 0x6e, 0x67, 0x77, 0x85, 0x1d, 0xd7, 0x74, 0x16, 0xbd, 0xdd, 0x35, 0xec, 0x3c, 0x13, 0x7c, 0x47, 0x29, 0xdc, 0x30, + 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x49, 0x00, 0x30, 0x46, 0x02, 0x21, 0x00, 0x8f, 0x32, + 0xe6, 0x83, 0x2d, 0xdd, 0xed, 0x55, 0x3e, 0x02, 0x02, 0xd2, 0x61, 0x86, 0xdb, 0x08, 0x86, 0x6e, 0x2e, 0xac, 0x3b, 0xec, 0x3d, + 0x1f, 0x11, 0xd1, 0x74, 0x00, 0x97, 0xee, 0x5d, 0xea, 0x02, 0x21, 0x00, 0xcc, 0x22, 0x75, 0xf7, 0x00, 0x0c, 0xa1, 0xe5, 0xe4, + 0x9b, 0xab, 0x45, 0x19, 0xc6, 0x70, 0xf7, 0xc2, 0x50, 0x9c, 0xce, 0x18, 0x97, 0xce, 0x95, 0x8a, 0xe8, 0xf4, 0xa9, 0x49, 0x9f, + 0x33, 0xea, }; -extern const uint32_t sTestCert_Node02_03_DER_Len = sizeof(sTestCert_Node02_03_DER); +extern const size_t sTestCert_Node02_03_DER_Len = sizeof(sTestCert_Node02_03_DER); extern const uint8_t sTestCert_Node02_03_PublicKey[] = { - 0x04, 0x43, 0xcd, 0xfa, 0xbc, 0xf2, 0xf4, 0x8c, 0x10, 0x6f, 0x5f, 0xd8, 0x90, 0x87, 0x29, 0xee, 0xfd, - 0x6e, 0xea, 0x92, 0xb6, 0x49, 0x0e, 0x10, 0x53, 0x6d, 0x1b, 0x0b, 0xb0, 0xc9, 0x7a, 0x28, 0x83, 0x57, - 0x21, 0x69, 0x1b, 0x2a, 0x4e, 0xd2, 0xa6, 0x52, 0xb0, 0xdc, 0x19, 0xd5, 0x2a, 0x30, 0xea, 0x2d, 0x58, - 0x6b, 0xb1, 0x22, 0x0b, 0x69, 0xcd, 0xd6, 0xeb, 0x0a, 0x3e, 0xe2, 0xf2, 0x5f, 0x61, + 0x04, 0xab, 0x9b, 0x9c, 0xa9, 0xe1, 0x93, 0x76, 0xc4, 0xf5, 0x7d, 0xde, 0xc4, 0x38, 0x6a, 0x00, 0xfc, + 0x3e, 0x8a, 0x4b, 0x38, 0x8c, 0xd1, 0x8a, 0xb4, 0xff, 0xcc, 0xda, 0x45, 0x62, 0x08, 0x0c, 0x08, 0xb5, + 0xe7, 0x16, 0xe6, 0xb2, 0xce, 0xc5, 0x7d, 0x22, 0xd6, 0x01, 0x87, 0xa9, 0x20, 0xfb, 0xa0, 0xb4, 0x57, + 0xb9, 0xac, 0x8c, 0x29, 0xe1, 0x9a, 0x36, 0x7e, 0x2f, 0xf0, 0x1b, 0x5c, 0x7a, 0x59, }; -extern const uint8_t sTestCert_Node02_03_PublicKey_Len = sizeof(sTestCert_Node02_03_PublicKey); +extern const size_t sTestCert_Node02_03_PublicKey_Len = sizeof(sTestCert_Node02_03_PublicKey); extern const uint8_t sTestCert_Node02_03_PrivateKey[] = { - 0x36, 0x13, 0x48, 0x05, 0x0e, 0x90, 0xf0, 0xfd, 0x74, 0xa6, 0x6d, 0xf9, 0x55, 0x72, 0x58, 0x7a, - 0x96, 0x33, 0x80, 0xb0, 0xa4, 0x51, 0x16, 0xf1, 0x43, 0xf6, 0x44, 0x91, 0xad, 0x45, 0x98, 0x1b, + 0x0a, 0x12, 0xf6, 0x9c, 0x15, 0xf4, 0x2f, 0x11, 0x0e, 0xe3, 0xf4, 0xeb, 0x77, 0xf8, 0xaf, 0xef, + 0x05, 0x0c, 0x09, 0x75, 0xf3, 0x06, 0x62, 0x14, 0xe5, 0x8a, 0x30, 0x43, 0xfb, 0x20, 0xde, 0xba, }; -extern const uint8_t sTestCert_Node02_03_PrivateKey_Len = sizeof(sTestCert_Node02_03_PrivateKey); +extern const size_t sTestCert_Node02_03_PrivateKey_Len = sizeof(sTestCert_Node02_03_PrivateKey); extern const uint8_t sTestCert_Node02_03_SubjectKeyId[] = { - 0x31, 0x1F, 0x1B, 0x10, 0x15, 0x5C, 0xE5, 0x4F, 0xF0, 0xC8, 0xFC, 0xF4, 0x6E, 0xF5, 0x28, 0xB9, 0xB7, 0xB0, 0x0B, 0x0A, + 0xE5, 0x7F, 0x7A, 0xB3, 0x74, 0xB0, 0x2F, 0x53, 0xEF, 0xA0, 0xA5, 0xB6, 0x52, 0xF2, 0x21, 0x1C, 0x1A, 0xAF, 0x05, 0xCF, }; -extern const uint8_t sTestCert_Node02_03_SubjectKeyId_Len = sizeof(sTestCert_Node02_03_SubjectKeyId); +extern const size_t sTestCert_Node02_03_SubjectKeyId_Len = sizeof(sTestCert_Node02_03_SubjectKeyId); extern const uint8_t sTestCert_Node02_03_AuthorityKeyId[] = { - 0xCF, 0x42, 0xBC, 0xF8, 0xDF, 0x48, 0x09, 0xD9, 0x26, 0x6F, 0x23, 0x15, 0x5A, 0x16, 0xB0, 0x7F, 0x04, 0xBB, 0x3D, 0x84, + 0xE1, 0xE7, 0x6E, 0x67, 0x77, 0x85, 0x1D, 0xD7, 0x74, 0x16, 0xBD, 0xDD, 0x35, 0xEC, 0x3C, 0x13, 0x7C, 0x47, 0x29, 0xDC, }; -extern const uint8_t sTestCert_Node02_03_AuthorityKeyId_Len = sizeof(sTestCert_Node02_03_AuthorityKeyId); +extern const size_t sTestCert_Node02_03_AuthorityKeyId_Len = sizeof(sTestCert_Node02_03_AuthorityKeyId); /************** Test Node02_04 Certificate ************** Certificate: Data: Version: 3 (0x2) - Serial Number: 494219895904038480 (0x6dbd260784a6e50) + Serial Number: 8650176850154750578 (0x780b9a03bdc80272) Signature Algorithm: ecdsa-with-SHA256 Issuer: 1.3.6.1.4.1.37244.1.3 = CACACACA00000004, 1.3.6.1.4.1.37244.1.5 = FAB000000000001D Validity Not Before: Oct 15 14:23:43 2020 GMT Not After : Oct 15 14:23:42 2040 GMT - Subject: 1.3.6.1.4.1.37244.1.6 = A001B001, CN = TestCert02_04, 1.3.6.1.4.1.37244.1.5 = -FAB000000000001D, 1.3.6.1.4.1.37244.1.7 = A001B002, 1.3.6.1.4.1.37244.1.1 = DEDEDEDE00020004 Subject Public Key Info: Public Key -Algorithm: id-ecPublicKey Public-Key: (256 bit) pub: 04:58:eb:6f:a0:34:4a:08:45:af:cf:d6:cf:31:fe: - 5e:92:27:4e:b6:31:ea:ad:ab:a3:4b:84:ee:8d:01: - 6e:e2:57:d5:37:4f:be:a8:04:86:d3:d9:3f:15:1c: - 3f:ea:24:25:a6:f4:57:b1:b7:87:79:9f:4b:a8:24: - 01:00:99:f8:8c + Subject: 1.3.6.1.4.1.37244.1.6 = ABCE1002, CN = TestCert02_04, 1.3.6.1.4.1.37244.1.5 = +FAB000000000001D, 1.3.6.1.4.1.37244.1.6 = ABCD0003, 1.3.6.1.4.1.37244.1.1 = DEDEDEDE00020004 Subject Public Key Info: Public Key +Algorithm: id-ecPublicKey Public-Key: (256 bit) pub: 04:ef:70:00:d0:0e:73:2e:02:9e:e6:c1:15:9a:b6: + 6c:a0:a2:e6:13:74:c9:2b:6f:45:b7:99:89:66:15: + 49:2b:7d:d5:aa:9d:87:fc:56:df:90:f8:0d:88:4b: + 3f:9f:79:3e:5b:a8:50:0c:be:85:87:a4:41:c2:21: + 5b:87:d7:1e:4a ASN1 OID: prime256v1 NIST CURVE: P-256 X509v3 extensions: @@ -1820,137 +1824,137 @@ Algorithm: id-ecPublicKey Public-Key: (256 bit) pub: 04:58:eb:6f:a0:34:4a:08:45: X509v3 Extended Key Usage: critical TLS Web Client Authentication, TLS Web Server Authentication X509v3 Subject Key Identifier: - 44:FA:8C:5F:32:EE:1F:FC:9D:98:1F:90:AB:2E:CC:D0:65:AC:ED:05 + B4:49:16:80:10:4F:C3:8D:9C:FA:DA:69:EA:30:85:14:4C:92:7D:2A X509v3 Authority Key Identifier: - keyid:CF:42:BC:F8:DF:48:09:D9:26:6F:23:15:5A:16:B0:7F:04:BB:3D:84 + keyid:E1:E7:6E:67:77:85:1D:D7:74:16:BD:DD:35:EC:3C:13:7C:47:29:DC Signature Algorithm: ecdsa-with-SHA256 - 30:45:02:20:58:80:e4:98:79:04:6e:c1:08:51:38:fd:42:c7: - 48:8d:fc:a1:aa:aa:81:d8:37:87:a2:ee:2a:65:d9:f2:4f:09: - 02:21:00:91:85:9a:9d:2d:08:0d:9b:0b:14:a2:28:99:f1:fb: - c2:52:cf:52:94:a0:be:8f:3c:e5:bb:22:58:7b:9a:c2:b4 + 30:45:02:20:2d:13:c2:ac:58:01:83:77:58:4b:a6:2d:0d:d1: + cf:bc:d1:a0:da:20:ff:e7:61:79:e5:f2:f6:83:9a:50:90:70: + 02:21:00:c7:5b:07:89:74:26:73:f7:e5:02:64:cc:9c:ed:c0: + 01:c9:3c:9e:9c:05:02:90:3f:d7:3d:25:e3:1e:42:ad:24 -----BEGIN CERTIFICATE----- -MIICTzCCAfWgAwIBAgIIBtvSYHhKblAwCgYIKoZIzj0EAwIwRDEgMB4GCisGAQQB +MIICTzCCAfWgAwIBAgIIeAuaA73IAnIwCgYIKoZIzj0EAwIwRDEgMB4GCisGAQQB gqJ8AQMMEENBQ0FDQUNBMDAwMDAwMDQxIDAeBgorBgEEAYKifAEFDBBGQUIwMDAw MDAwMDAwMDFEMB4XDTIwMTAxNTE0MjM0M1oXDTQwMTAxNTE0MjM0MlowgZAxGDAW -BgorBgEEAYKifAEGDAhBMDAxQjAwMTEWMBQGA1UEAwwNVGVzdENlcnQwMl8wNDEg -MB4GCisGAQQBgqJ8AQUMEEZBQjAwMDAwMDAwMDAwMUQxGDAWBgorBgEEAYKifAEH -DAhBMDAxQjAwMjEgMB4GCisGAQQBgqJ8AQEMEERFREVERURFMDAwMjAwMDQwWTAT -BgcqhkjOPQIBBggqhkjOPQMBBwNCAARY62+gNEoIRa/P1s8x/l6SJ062Meqtq6NL -hO6NAW7iV9U3T76oBIbT2T8VHD/qJCWm9Fext4d5n0uoJAEAmfiMo4GDMIGAMAwG +BgorBgEEAYKifAEGDAhBQkNFMTAwMjEWMBQGA1UEAwwNVGVzdENlcnQwMl8wNDEg +MB4GCisGAQQBgqJ8AQUMEEZBQjAwMDAwMDAwMDAwMUQxGDAWBgorBgEEAYKifAEG +DAhBQkNEMDAwMzEgMB4GCisGAQQBgqJ8AQEMEERFREVERURFMDAwMjAwMDQwWTAT +BgcqhkjOPQIBBggqhkjOPQMBBwNCAATvcADQDnMuAp7mwRWatmygouYTdMkrb0W3 +mYlmFUkrfdWqnYf8Vt+Q+A2ISz+feT5bqFAMvoWHpEHCIVuH1x5Ko4GDMIGAMAwG A1UdEwEB/wQCMAAwDgYDVR0PAQH/BAQDAgeAMCAGA1UdJQEB/wQWMBQGCCsGAQUF -BwMCBggrBgEFBQcDATAdBgNVHQ4EFgQURPqMXzLuH/ydmB+Qqy7M0GWs7QUwHwYD -VR0jBBgwFoAUz0K8+N9ICdkmbyMVWhawfwS7PYQwCgYIKoZIzj0EAwIDSAAwRQIg -WIDkmHkEbsEIUTj9QsdIjfyhqqqB2DeHou4qZdnyTwkCIQCRhZqdLQgNmwsUoiiZ -8fvCUs9SlKC+jzzluyJYe5rCtA== +BwMCBggrBgEFBQcDATAdBgNVHQ4EFgQUtEkWgBBPw42c+tpp6jCFFEySfSowHwYD +VR0jBBgwFoAU4eduZ3eFHdd0Fr3dNew8E3xHKdwwCgYIKoZIzj0EAwIDSAAwRQIg +LRPCrFgBg3dYS6YtDdHPvNGg2iD/52F55fL2g5pQkHACIQDHWweJdCZz9+UCZMyc +7cAByTyenAUCkD/XPSXjHkKtJA== -----END CERTIFICATE----- -----BEGIN EC PRIVATE KEY----- -MHcCAQEEIEdIYYYWspTUN8CnTXQcKX+bIDQD7ns+orUuJdrxaC9woAoGCCqGSM49 -AwEHoUQDQgAEWOtvoDRKCEWvz9bPMf5ekidOtjHqraujS4TujQFu4lfVN0++qASG -09k/FRw/6iQlpvRXsbeHeZ9LqCQBAJn4jA== +MHcCAQEEIOGVhbY4gyNL3AJ8VJzNemfINBwBcuAW7MJd9uuchFq2oAoGCCqGSM49 +AwEHoUQDQgAE73AA0A5zLgKe5sEVmrZsoKLmE3TJK29Ft5mJZhVJK33Vqp2H/Fbf +kPgNiEs/n3k+W6hQDL6Fh6RBwiFbh9ceSg== -----END EC PRIVATE KEY----- */ extern const uint8_t sTestCert_Node02_04_Chip[] = { - 0x15, 0x30, 0x01, 0x08, 0x06, 0xdb, 0xd2, 0x60, 0x78, 0x4a, 0x6e, 0x50, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, + 0x15, 0x30, 0x01, 0x08, 0x78, 0x0b, 0x9a, 0x03, 0xbd, 0xc8, 0x02, 0x72, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, - 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x26, 0x16, 0x01, 0xb0, 0x01, 0xa0, 0x2c, 0x01, 0x0d, 0x54, 0x65, + 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x26, 0x16, 0x02, 0x10, 0xce, 0xab, 0x2c, 0x01, 0x0d, 0x54, 0x65, 0x73, 0x74, 0x43, 0x65, 0x72, 0x74, 0x30, 0x32, 0x5f, 0x30, 0x34, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, - 0x26, 0x17, 0x02, 0xb0, 0x01, 0xa0, 0x27, 0x11, 0x04, 0x00, 0x02, 0x00, 0xde, 0xde, 0xde, 0xde, 0x18, 0x24, 0x07, 0x01, 0x24, - 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0x58, 0xeb, 0x6f, 0xa0, 0x34, 0x4a, 0x08, 0x45, 0xaf, 0xcf, 0xd6, 0xcf, 0x31, 0xfe, 0x5e, - 0x92, 0x27, 0x4e, 0xb6, 0x31, 0xea, 0xad, 0xab, 0xa3, 0x4b, 0x84, 0xee, 0x8d, 0x01, 0x6e, 0xe2, 0x57, 0xd5, 0x37, 0x4f, 0xbe, - 0xa8, 0x04, 0x86, 0xd3, 0xd9, 0x3f, 0x15, 0x1c, 0x3f, 0xea, 0x24, 0x25, 0xa6, 0xf4, 0x57, 0xb1, 0xb7, 0x87, 0x79, 0x9f, 0x4b, - 0xa8, 0x24, 0x01, 0x00, 0x99, 0xf8, 0x8c, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, - 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, 0x44, 0xfa, 0x8c, 0x5f, 0x32, 0xee, 0x1f, 0xfc, 0x9d, 0x98, 0x1f, 0x90, 0xab, 0x2e, 0xcc, - 0xd0, 0x65, 0xac, 0xed, 0x05, 0x30, 0x05, 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, 0x26, 0x6f, 0x23, 0x15, 0x5a, - 0x16, 0xb0, 0x7f, 0x04, 0xbb, 0x3d, 0x84, 0x18, 0x30, 0x0b, 0x40, 0x58, 0x80, 0xe4, 0x98, 0x79, 0x04, 0x6e, 0xc1, 0x08, 0x51, - 0x38, 0xfd, 0x42, 0xc7, 0x48, 0x8d, 0xfc, 0xa1, 0xaa, 0xaa, 0x81, 0xd8, 0x37, 0x87, 0xa2, 0xee, 0x2a, 0x65, 0xd9, 0xf2, 0x4f, - 0x09, 0x91, 0x85, 0x9a, 0x9d, 0x2d, 0x08, 0x0d, 0x9b, 0x0b, 0x14, 0xa2, 0x28, 0x99, 0xf1, 0xfb, 0xc2, 0x52, 0xcf, 0x52, 0x94, - 0xa0, 0xbe, 0x8f, 0x3c, 0xe5, 0xbb, 0x22, 0x58, 0x7b, 0x9a, 0xc2, 0xb4, 0x18, + 0x26, 0x16, 0x03, 0x00, 0xcd, 0xab, 0x27, 0x11, 0x04, 0x00, 0x02, 0x00, 0xde, 0xde, 0xde, 0xde, 0x18, 0x24, 0x07, 0x01, 0x24, + 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0xef, 0x70, 0x00, 0xd0, 0x0e, 0x73, 0x2e, 0x02, 0x9e, 0xe6, 0xc1, 0x15, 0x9a, 0xb6, 0x6c, + 0xa0, 0xa2, 0xe6, 0x13, 0x74, 0xc9, 0x2b, 0x6f, 0x45, 0xb7, 0x99, 0x89, 0x66, 0x15, 0x49, 0x2b, 0x7d, 0xd5, 0xaa, 0x9d, 0x87, + 0xfc, 0x56, 0xdf, 0x90, 0xf8, 0x0d, 0x88, 0x4b, 0x3f, 0x9f, 0x79, 0x3e, 0x5b, 0xa8, 0x50, 0x0c, 0xbe, 0x85, 0x87, 0xa4, 0x41, + 0xc2, 0x21, 0x5b, 0x87, 0xd7, 0x1e, 0x4a, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, + 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, 0xb4, 0x49, 0x16, 0x80, 0x10, 0x4f, 0xc3, 0x8d, 0x9c, 0xfa, 0xda, 0x69, 0xea, 0x30, 0x85, + 0x14, 0x4c, 0x92, 0x7d, 0x2a, 0x30, 0x05, 0x14, 0xe1, 0xe7, 0x6e, 0x67, 0x77, 0x85, 0x1d, 0xd7, 0x74, 0x16, 0xbd, 0xdd, 0x35, + 0xec, 0x3c, 0x13, 0x7c, 0x47, 0x29, 0xdc, 0x18, 0x30, 0x0b, 0x40, 0x2d, 0x13, 0xc2, 0xac, 0x58, 0x01, 0x83, 0x77, 0x58, 0x4b, + 0xa6, 0x2d, 0x0d, 0xd1, 0xcf, 0xbc, 0xd1, 0xa0, 0xda, 0x20, 0xff, 0xe7, 0x61, 0x79, 0xe5, 0xf2, 0xf6, 0x83, 0x9a, 0x50, 0x90, + 0x70, 0xc7, 0x5b, 0x07, 0x89, 0x74, 0x26, 0x73, 0xf7, 0xe5, 0x02, 0x64, 0xcc, 0x9c, 0xed, 0xc0, 0x01, 0xc9, 0x3c, 0x9e, 0x9c, + 0x05, 0x02, 0x90, 0x3f, 0xd7, 0x3d, 0x25, 0xe3, 0x1e, 0x42, 0xad, 0x24, 0x18, }; -extern const uint32_t sTestCert_Node02_04_Chip_Len = sizeof(sTestCert_Node02_04_Chip); +extern const size_t sTestCert_Node02_04_Chip_Len = sizeof(sTestCert_Node02_04_Chip); extern const uint8_t sTestCert_Node02_04_DER[] = { - 0x30, 0x82, 0x02, 0x4f, 0x30, 0x82, 0x01, 0xf5, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x06, 0xdb, 0xd2, 0x60, 0x78, 0x4a, - 0x6e, 0x50, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, + 0x30, 0x82, 0x02, 0x4f, 0x30, 0x82, 0x01, 0xf5, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x78, 0x0b, 0x9a, 0x03, 0xbd, 0xc8, + 0x02, 0x72, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x34, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x05, 0x0c, 0x10, 0x46, 0x41, 0x42, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x44, 0x30, 0x1e, 0x17, 0x0d, 0x32, 0x30, 0x31, 0x30, 0x31, 0x35, 0x31, 0x34, 0x32, 0x33, 0x34, 0x33, 0x5a, 0x17, 0x0d, 0x34, 0x30, 0x31, 0x30, 0x31, 0x35, 0x31, 0x34, 0x32, 0x33, 0x34, 0x32, 0x5a, 0x30, 0x81, 0x90, 0x31, 0x18, 0x30, 0x16, 0x06, 0x0a, 0x2b, - 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x06, 0x0c, 0x08, 0x41, 0x30, 0x30, 0x31, 0x42, 0x30, 0x30, 0x31, 0x31, 0x16, + 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x06, 0x0c, 0x08, 0x41, 0x42, 0x43, 0x45, 0x31, 0x30, 0x30, 0x32, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0d, 0x54, 0x65, 0x73, 0x74, 0x43, 0x65, 0x72, 0x74, 0x30, 0x32, 0x5f, 0x30, 0x34, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x05, 0x0c, 0x10, 0x46, 0x41, 0x42, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x44, 0x31, 0x18, 0x30, 0x16, 0x06, 0x0a, 0x2b, - 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x07, 0x0c, 0x08, 0x41, 0x30, 0x30, 0x31, 0x42, 0x30, 0x30, 0x32, 0x31, 0x20, + 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x06, 0x0c, 0x08, 0x41, 0x42, 0x43, 0x44, 0x30, 0x30, 0x30, 0x33, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x01, 0x0c, 0x10, 0x44, 0x45, 0x44, 0x45, 0x44, 0x45, 0x44, 0x45, 0x30, 0x30, 0x30, 0x32, 0x30, 0x30, 0x30, 0x34, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, - 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x58, 0xeb, 0x6f, 0xa0, - 0x34, 0x4a, 0x08, 0x45, 0xaf, 0xcf, 0xd6, 0xcf, 0x31, 0xfe, 0x5e, 0x92, 0x27, 0x4e, 0xb6, 0x31, 0xea, 0xad, 0xab, 0xa3, 0x4b, - 0x84, 0xee, 0x8d, 0x01, 0x6e, 0xe2, 0x57, 0xd5, 0x37, 0x4f, 0xbe, 0xa8, 0x04, 0x86, 0xd3, 0xd9, 0x3f, 0x15, 0x1c, 0x3f, 0xea, - 0x24, 0x25, 0xa6, 0xf4, 0x57, 0xb1, 0xb7, 0x87, 0x79, 0x9f, 0x4b, 0xa8, 0x24, 0x01, 0x00, 0x99, 0xf8, 0x8c, 0xa3, 0x81, 0x83, + 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0xef, 0x70, 0x00, 0xd0, + 0x0e, 0x73, 0x2e, 0x02, 0x9e, 0xe6, 0xc1, 0x15, 0x9a, 0xb6, 0x6c, 0xa0, 0xa2, 0xe6, 0x13, 0x74, 0xc9, 0x2b, 0x6f, 0x45, 0xb7, + 0x99, 0x89, 0x66, 0x15, 0x49, 0x2b, 0x7d, 0xd5, 0xaa, 0x9d, 0x87, 0xfc, 0x56, 0xdf, 0x90, 0xf8, 0x0d, 0x88, 0x4b, 0x3f, 0x9f, + 0x79, 0x3e, 0x5b, 0xa8, 0x50, 0x0c, 0xbe, 0x85, 0x87, 0xa4, 0x41, 0xc2, 0x21, 0x5b, 0x87, 0xd7, 0x1e, 0x4a, 0xa3, 0x81, 0x83, 0x30, 0x81, 0x80, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x07, 0x80, 0x30, 0x20, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x01, 0x01, 0xff, 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, - 0x05, 0x07, 0x03, 0x01, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x44, 0xfa, 0x8c, 0x5f, 0x32, 0xee, - 0x1f, 0xfc, 0x9d, 0x98, 0x1f, 0x90, 0xab, 0x2e, 0xcc, 0xd0, 0x65, 0xac, 0xed, 0x05, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, - 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, 0x26, 0x6f, 0x23, 0x15, 0x5a, 0x16, 0xb0, - 0x7f, 0x04, 0xbb, 0x3d, 0x84, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, - 0x45, 0x02, 0x20, 0x58, 0x80, 0xe4, 0x98, 0x79, 0x04, 0x6e, 0xc1, 0x08, 0x51, 0x38, 0xfd, 0x42, 0xc7, 0x48, 0x8d, 0xfc, 0xa1, - 0xaa, 0xaa, 0x81, 0xd8, 0x37, 0x87, 0xa2, 0xee, 0x2a, 0x65, 0xd9, 0xf2, 0x4f, 0x09, 0x02, 0x21, 0x00, 0x91, 0x85, 0x9a, 0x9d, - 0x2d, 0x08, 0x0d, 0x9b, 0x0b, 0x14, 0xa2, 0x28, 0x99, 0xf1, 0xfb, 0xc2, 0x52, 0xcf, 0x52, 0x94, 0xa0, 0xbe, 0x8f, 0x3c, 0xe5, - 0xbb, 0x22, 0x58, 0x7b, 0x9a, 0xc2, 0xb4, + 0x05, 0x07, 0x03, 0x01, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xb4, 0x49, 0x16, 0x80, 0x10, 0x4f, + 0xc3, 0x8d, 0x9c, 0xfa, 0xda, 0x69, 0xea, 0x30, 0x85, 0x14, 0x4c, 0x92, 0x7d, 0x2a, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, + 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xe1, 0xe7, 0x6e, 0x67, 0x77, 0x85, 0x1d, 0xd7, 0x74, 0x16, 0xbd, 0xdd, 0x35, 0xec, 0x3c, + 0x13, 0x7c, 0x47, 0x29, 0xdc, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, + 0x45, 0x02, 0x20, 0x2d, 0x13, 0xc2, 0xac, 0x58, 0x01, 0x83, 0x77, 0x58, 0x4b, 0xa6, 0x2d, 0x0d, 0xd1, 0xcf, 0xbc, 0xd1, 0xa0, + 0xda, 0x20, 0xff, 0xe7, 0x61, 0x79, 0xe5, 0xf2, 0xf6, 0x83, 0x9a, 0x50, 0x90, 0x70, 0x02, 0x21, 0x00, 0xc7, 0x5b, 0x07, 0x89, + 0x74, 0x26, 0x73, 0xf7, 0xe5, 0x02, 0x64, 0xcc, 0x9c, 0xed, 0xc0, 0x01, 0xc9, 0x3c, 0x9e, 0x9c, 0x05, 0x02, 0x90, 0x3f, 0xd7, + 0x3d, 0x25, 0xe3, 0x1e, 0x42, 0xad, 0x24, }; -extern const uint32_t sTestCert_Node02_04_DER_Len = sizeof(sTestCert_Node02_04_DER); +extern const size_t sTestCert_Node02_04_DER_Len = sizeof(sTestCert_Node02_04_DER); extern const uint8_t sTestCert_Node02_04_PublicKey[] = { - 0x04, 0x58, 0xeb, 0x6f, 0xa0, 0x34, 0x4a, 0x08, 0x45, 0xaf, 0xcf, 0xd6, 0xcf, 0x31, 0xfe, 0x5e, 0x92, - 0x27, 0x4e, 0xb6, 0x31, 0xea, 0xad, 0xab, 0xa3, 0x4b, 0x84, 0xee, 0x8d, 0x01, 0x6e, 0xe2, 0x57, 0xd5, - 0x37, 0x4f, 0xbe, 0xa8, 0x04, 0x86, 0xd3, 0xd9, 0x3f, 0x15, 0x1c, 0x3f, 0xea, 0x24, 0x25, 0xa6, 0xf4, - 0x57, 0xb1, 0xb7, 0x87, 0x79, 0x9f, 0x4b, 0xa8, 0x24, 0x01, 0x00, 0x99, 0xf8, 0x8c, + 0x04, 0xef, 0x70, 0x00, 0xd0, 0x0e, 0x73, 0x2e, 0x02, 0x9e, 0xe6, 0xc1, 0x15, 0x9a, 0xb6, 0x6c, 0xa0, + 0xa2, 0xe6, 0x13, 0x74, 0xc9, 0x2b, 0x6f, 0x45, 0xb7, 0x99, 0x89, 0x66, 0x15, 0x49, 0x2b, 0x7d, 0xd5, + 0xaa, 0x9d, 0x87, 0xfc, 0x56, 0xdf, 0x90, 0xf8, 0x0d, 0x88, 0x4b, 0x3f, 0x9f, 0x79, 0x3e, 0x5b, 0xa8, + 0x50, 0x0c, 0xbe, 0x85, 0x87, 0xa4, 0x41, 0xc2, 0x21, 0x5b, 0x87, 0xd7, 0x1e, 0x4a, }; -extern const uint8_t sTestCert_Node02_04_PublicKey_Len = sizeof(sTestCert_Node02_04_PublicKey); +extern const size_t sTestCert_Node02_04_PublicKey_Len = sizeof(sTestCert_Node02_04_PublicKey); extern const uint8_t sTestCert_Node02_04_PrivateKey[] = { - 0x47, 0x48, 0x61, 0x86, 0x16, 0xb2, 0x94, 0xd4, 0x37, 0xc0, 0xa7, 0x4d, 0x74, 0x1c, 0x29, 0x7f, - 0x9b, 0x20, 0x34, 0x03, 0xee, 0x7b, 0x3e, 0xa2, 0xb5, 0x2e, 0x25, 0xda, 0xf1, 0x68, 0x2f, 0x70, + 0xe1, 0x95, 0x85, 0xb6, 0x38, 0x83, 0x23, 0x4b, 0xdc, 0x02, 0x7c, 0x54, 0x9c, 0xcd, 0x7a, 0x67, + 0xc8, 0x34, 0x1c, 0x01, 0x72, 0xe0, 0x16, 0xec, 0xc2, 0x5d, 0xf6, 0xeb, 0x9c, 0x84, 0x5a, 0xb6, }; -extern const uint8_t sTestCert_Node02_04_PrivateKey_Len = sizeof(sTestCert_Node02_04_PrivateKey); +extern const size_t sTestCert_Node02_04_PrivateKey_Len = sizeof(sTestCert_Node02_04_PrivateKey); extern const uint8_t sTestCert_Node02_04_SubjectKeyId[] = { - 0x44, 0xFA, 0x8C, 0x5F, 0x32, 0xEE, 0x1F, 0xFC, 0x9D, 0x98, 0x1F, 0x90, 0xAB, 0x2E, 0xCC, 0xD0, 0x65, 0xAC, 0xED, 0x05, + 0xB4, 0x49, 0x16, 0x80, 0x10, 0x4F, 0xC3, 0x8D, 0x9C, 0xFA, 0xDA, 0x69, 0xEA, 0x30, 0x85, 0x14, 0x4C, 0x92, 0x7D, 0x2A, }; -extern const uint8_t sTestCert_Node02_04_SubjectKeyId_Len = sizeof(sTestCert_Node02_04_SubjectKeyId); +extern const size_t sTestCert_Node02_04_SubjectKeyId_Len = sizeof(sTestCert_Node02_04_SubjectKeyId); extern const uint8_t sTestCert_Node02_04_AuthorityKeyId[] = { - 0xCF, 0x42, 0xBC, 0xF8, 0xDF, 0x48, 0x09, 0xD9, 0x26, 0x6F, 0x23, 0x15, 0x5A, 0x16, 0xB0, 0x7F, 0x04, 0xBB, 0x3D, 0x84, + 0xE1, 0xE7, 0x6E, 0x67, 0x77, 0x85, 0x1D, 0xD7, 0x74, 0x16, 0xBD, 0xDD, 0x35, 0xEC, 0x3C, 0x13, 0x7C, 0x47, 0x29, 0xDC, }; -extern const uint8_t sTestCert_Node02_04_AuthorityKeyId_Len = sizeof(sTestCert_Node02_04_AuthorityKeyId); +extern const size_t sTestCert_Node02_04_AuthorityKeyId_Len = sizeof(sTestCert_Node02_04_AuthorityKeyId); /************** Test Node02_05 Certificate ************** Certificate: Data: Version: 3 (0x2) - Serial Number: 3019599144066184987 (0x29e7c56c4a23771b) + Serial Number: 7874366387595048762 (0x6d475e8263e0f73a) Signature Algorithm: ecdsa-with-SHA256 Issuer: 1.3.6.1.4.1.37244.1.3 = CACACACA00000004, 1.3.6.1.4.1.37244.1.5 = FAB000000000001D Validity Not Before: Oct 15 14:23:43 2020 GMT Not After : Oct 15 14:23:42 2040 GMT - Subject: 1.3.6.1.4.1.37244.1.6 = A001B001, 1.3.6.1.4.1.37244.1.5 = FAB000000000001D, 1.3.6.1.4.1.37244.1.7 = -A001B002, 1.3.6.1.4.1.37244.1.1 = DEDEDEDE00020005 Subject Public Key Info: Public Key Algorithm: id-ecPublicKey Public-Key: (256 -bit) pub: 04:c3:85:f5:b5:79:09:ea:91:d2:08:45:f8:1b:e1: 01:10:36:93:60:f7:dc:25:80:22:91:6d:0e:55:39: - b2:47:78:2d:fa:f0:1c:61:f8:eb:1b:f4:90:3f:81: - 47:e0:a4:2f:a7:0f:46:6e:c9:52:7f:99:95:02:94: - 7a:44:9d:eb:f7 + Subject: 1.3.6.1.4.1.37244.1.6 = ABCD0010, 1.3.6.1.4.1.37244.1.5 = FAB000000000001D, 1.3.6.1.4.1.37244.1.6 = +ABCE1008, 1.3.6.1.4.1.37244.1.1 = DEDEDEDE00020005 Subject Public Key Info: Public Key Algorithm: id-ecPublicKey Public-Key: (256 +bit) pub: 04:fc:8a:ff:06:3a:d0:e0:bf:df:24:dd:9d:84:13: 0f:74:49:3c:95:a4:0d:b3:f4:0a:af:42:cf:2c:b1: + 15:8b:a1:aa:1d:61:de:38:3c:9b:51:03:ca:f7:96: + 43:1e:0a:4e:9c:5a:c2:d7:f0:e9:1c:c7:0e:7d:f0: + 9d:b3:2c:f8:63 ASN1 OID: prime256v1 NIST CURVE: P-256 X509v3 extensions: @@ -1961,129 +1965,129 @@ bit) pub: 04:c3:85:f5:b5:79:09:ea:91:d2:08:45:f8:1b:e1: 01:10:36:93:60:f7:dc:25: X509v3 Extended Key Usage: critical TLS Web Client Authentication, TLS Web Server Authentication X509v3 Subject Key Identifier: - CB:8E:1D:22:39:40:B9:B6:01:0B:A7:58:96:E1:1D:7A:3E:09:6A:72 + 4B:46:42:9C:69:3D:0E:28:79:8C:8F:76:26:A5:01:20:05:96:AD:2D X509v3 Authority Key Identifier: - keyid:CF:42:BC:F8:DF:48:09:D9:26:6F:23:15:5A:16:B0:7F:04:BB:3D:84 + keyid:E1:E7:6E:67:77:85:1D:D7:74:16:BD:DD:35:EC:3C:13:7C:47:29:DC X509v3 Subject Alternative Name: email:test@chip.org Signature Algorithm: ecdsa-with-SHA256 - 30:44:02:20:5a:8f:f8:2a:9c:a9:24:24:89:0d:5d:71:4a:1d: - ab:05:94:cb:8d:6a:b0:36:55:c8:cb:d5:1d:68:29:8c:d8:09: - 02:20:15:71:fb:40:95:5a:22:64:b9:ad:86:d8:94:b4:06:a0: - 46:ef:80:b8:c2:c5:8d:a9:b0:17:20:0f:68:b0:6f:14 + 30:46:02:21:00:ff:06:6b:df:4a:4a:93:0c:3b:a8:ef:82:8c: + 5f:93:fe:7e:bb:dd:5b:b4:ec:54:45:bd:d7:78:62:d5:a2:1d: + 43:02:21:00:9e:3c:3b:ec:bc:b3:f1:aa:bd:97:86:10:19:a2: + e9:45:c9:94:d2:73:60:4f:60:f0:2d:ed:3b:6a:c5:be:07:5d -----BEGIN CERTIFICATE----- -MIICTzCCAfagAwIBAgIIKefFbEojdxswCgYIKoZIzj0EAwIwRDEgMB4GCisGAQQB +MIICUTCCAfagAwIBAgIIbUdegmPg9zowCgYIKoZIzj0EAwIwRDEgMB4GCisGAQQB gqJ8AQMMEENBQ0FDQUNBMDAwMDAwMDQxIDAeBgorBgEEAYKifAEFDBBGQUIwMDAw MDAwMDAwMDFEMB4XDTIwMTAxNTE0MjM0M1oXDTQwMTAxNTE0MjM0MloweDEYMBYG -CisGAQQBgqJ8AQYMCEEwMDFCMDAxMSAwHgYKKwYBBAGConwBBQwQRkFCMDAwMDAw -MDAwMDAxRDEYMBYGCisGAQQBgqJ8AQcMCEEwMDFCMDAyMSAwHgYKKwYBBAGConwB -AQwQREVERURFREUwMDAyMDAwNTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABMOF -9bV5CeqR0ghF+BvhARA2k2D33CWAIpFtDlU5skd4LfrwHGH46xv0kD+BR+CkL6cP -Rm7JUn+ZlQKUekSd6/ejgZ0wgZowDAYDVR0TAQH/BAIwADAOBgNVHQ8BAf8EBAMC -B4AwIAYDVR0lAQH/BBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMBMB0GA1UdDgQWBBTL -jh0iOUC5tgELp1iW4R16PglqcjAfBgNVHSMEGDAWgBTPQrz430gJ2SZvIxVaFrB/ -BLs9hDAYBgNVHREEETAPgQ10ZXN0QGNoaXAub3JnMAoGCCqGSM49BAMCA0cAMEQC -IFqP+CqcqSQkiQ1dcUodqwWUy41qsDZVyMvVHWgpjNgJAiAVcftAlVoiZLmthtiU -tAagRu+AuMLFjamwFyAPaLBvFA== +CisGAQQBgqJ8AQYMCEFCQ0QwMDEwMSAwHgYKKwYBBAGConwBBQwQRkFCMDAwMDAw +MDAwMDAxRDEYMBYGCisGAQQBgqJ8AQYMCEFCQ0UxMDA4MSAwHgYKKwYBBAGConwB +AQwQREVERURFREUwMDAyMDAwNTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABPyK +/wY60OC/3yTdnYQTD3RJPJWkDbP0Cq9CzyyxFYuhqh1h3jg8m1EDyveWQx4KTpxa +wtfw6RzHDn3wnbMs+GOjgZ0wgZowDAYDVR0TAQH/BAIwADAOBgNVHQ8BAf8EBAMC +B4AwIAYDVR0lAQH/BBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMBMB0GA1UdDgQWBBRL +RkKcaT0OKHmMj3YmpQEgBZatLTAfBgNVHSMEGDAWgBTh525nd4Ud13QWvd017DwT +fEcp3DAYBgNVHREEETAPgQ10ZXN0QGNoaXAub3JnMAoGCCqGSM49BAMCA0kAMEYC +IQD/BmvfSkqTDDuo74KMX5P+frvdW7TsVEW913hi1aIdQwIhAJ48O+y8s/GqvZeG +EBmi6UXJlNJzYE9g8C3tO2rFvgdd -----END CERTIFICATE----- -----BEGIN EC PRIVATE KEY----- -MHcCAQEEIAEEHAsipLqjBG+pRUt2CHzOTKFWjf5JwJtpj9GA+HstoAoGCCqGSM49 -AwEHoUQDQgAEw4X1tXkJ6pHSCEX4G+EBEDaTYPfcJYAikW0OVTmyR3gt+vAcYfjr -G/SQP4FH4KQvpw9GbslSf5mVApR6RJ3r9w== +MHcCAQEEIGbQQJBxdmC6r8zcRkdtqR2tZuitOSg9sX0HedrQzWXCoAoGCCqGSM49 +AwEHoUQDQgAE/Ir/BjrQ4L/fJN2dhBMPdEk8laQNs/QKr0LPLLEVi6GqHWHeODyb +UQPK95ZDHgpOnFrC1/DpHMcOffCdsyz4Yw== -----END EC PRIVATE KEY----- */ extern const uint8_t sTestCert_Node02_05_Chip[] = { - 0x15, 0x30, 0x01, 0x08, 0x29, 0xe7, 0xc5, 0x6c, 0x4a, 0x23, 0x77, 0x1b, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, + 0x15, 0x30, 0x01, 0x08, 0x6d, 0x47, 0x5e, 0x82, 0x63, 0xe0, 0xf7, 0x3a, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, - 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x26, 0x16, 0x01, 0xb0, 0x01, 0xa0, 0x27, 0x15, - 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x26, 0x17, 0x02, 0xb0, 0x01, 0xa0, 0x27, 0x11, 0x05, 0x00, 0x02, 0x00, - 0xde, 0xde, 0xde, 0xde, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0xc3, 0x85, 0xf5, 0xb5, 0x79, - 0x09, 0xea, 0x91, 0xd2, 0x08, 0x45, 0xf8, 0x1b, 0xe1, 0x01, 0x10, 0x36, 0x93, 0x60, 0xf7, 0xdc, 0x25, 0x80, 0x22, 0x91, - 0x6d, 0x0e, 0x55, 0x39, 0xb2, 0x47, 0x78, 0x2d, 0xfa, 0xf0, 0x1c, 0x61, 0xf8, 0xeb, 0x1b, 0xf4, 0x90, 0x3f, 0x81, 0x47, - 0xe0, 0xa4, 0x2f, 0xa7, 0x0f, 0x46, 0x6e, 0xc9, 0x52, 0x7f, 0x99, 0x95, 0x02, 0x94, 0x7a, 0x44, 0x9d, 0xeb, 0xf7, 0x37, - 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, 0xcb, - 0x8e, 0x1d, 0x22, 0x39, 0x40, 0xb9, 0xb6, 0x01, 0x0b, 0xa7, 0x58, 0x96, 0xe1, 0x1d, 0x7a, 0x3e, 0x09, 0x6a, 0x72, 0x30, - 0x05, 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, 0x26, 0x6f, 0x23, 0x15, 0x5a, 0x16, 0xb0, 0x7f, 0x04, 0xbb, - 0x3d, 0x84, 0x30, 0x06, 0x1a, 0x30, 0x18, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x04, 0x11, 0x30, 0x0f, 0x81, 0x0d, 0x74, 0x65, - 0x73, 0x74, 0x40, 0x63, 0x68, 0x69, 0x70, 0x2e, 0x6f, 0x72, 0x67, 0x18, 0x30, 0x0b, 0x40, 0x5a, 0x8f, 0xf8, 0x2a, 0x9c, - 0xa9, 0x24, 0x24, 0x89, 0x0d, 0x5d, 0x71, 0x4a, 0x1d, 0xab, 0x05, 0x94, 0xcb, 0x8d, 0x6a, 0xb0, 0x36, 0x55, 0xc8, 0xcb, - 0xd5, 0x1d, 0x68, 0x29, 0x8c, 0xd8, 0x09, 0x15, 0x71, 0xfb, 0x40, 0x95, 0x5a, 0x22, 0x64, 0xb9, 0xad, 0x86, 0xd8, 0x94, - 0xb4, 0x06, 0xa0, 0x46, 0xef, 0x80, 0xb8, 0xc2, 0xc5, 0x8d, 0xa9, 0xb0, 0x17, 0x20, 0x0f, 0x68, 0xb0, 0x6f, 0x14, 0x18, -}; - -extern const uint32_t sTestCert_Node02_05_Chip_Len = sizeof(sTestCert_Node02_05_Chip); + 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x26, 0x16, 0x10, 0x00, 0xcd, 0xab, 0x27, 0x15, + 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x26, 0x16, 0x08, 0x10, 0xce, 0xab, 0x27, 0x11, 0x05, 0x00, 0x02, 0x00, + 0xde, 0xde, 0xde, 0xde, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0xfc, 0x8a, 0xff, 0x06, 0x3a, + 0xd0, 0xe0, 0xbf, 0xdf, 0x24, 0xdd, 0x9d, 0x84, 0x13, 0x0f, 0x74, 0x49, 0x3c, 0x95, 0xa4, 0x0d, 0xb3, 0xf4, 0x0a, 0xaf, + 0x42, 0xcf, 0x2c, 0xb1, 0x15, 0x8b, 0xa1, 0xaa, 0x1d, 0x61, 0xde, 0x38, 0x3c, 0x9b, 0x51, 0x03, 0xca, 0xf7, 0x96, 0x43, + 0x1e, 0x0a, 0x4e, 0x9c, 0x5a, 0xc2, 0xd7, 0xf0, 0xe9, 0x1c, 0xc7, 0x0e, 0x7d, 0xf0, 0x9d, 0xb3, 0x2c, 0xf8, 0x63, 0x37, + 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, 0x4b, + 0x46, 0x42, 0x9c, 0x69, 0x3d, 0x0e, 0x28, 0x79, 0x8c, 0x8f, 0x76, 0x26, 0xa5, 0x01, 0x20, 0x05, 0x96, 0xad, 0x2d, 0x30, + 0x05, 0x14, 0xe1, 0xe7, 0x6e, 0x67, 0x77, 0x85, 0x1d, 0xd7, 0x74, 0x16, 0xbd, 0xdd, 0x35, 0xec, 0x3c, 0x13, 0x7c, 0x47, + 0x29, 0xdc, 0x30, 0x06, 0x1a, 0x30, 0x18, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x04, 0x11, 0x30, 0x0f, 0x81, 0x0d, 0x74, 0x65, + 0x73, 0x74, 0x40, 0x63, 0x68, 0x69, 0x70, 0x2e, 0x6f, 0x72, 0x67, 0x18, 0x30, 0x0b, 0x40, 0xff, 0x06, 0x6b, 0xdf, 0x4a, + 0x4a, 0x93, 0x0c, 0x3b, 0xa8, 0xef, 0x82, 0x8c, 0x5f, 0x93, 0xfe, 0x7e, 0xbb, 0xdd, 0x5b, 0xb4, 0xec, 0x54, 0x45, 0xbd, + 0xd7, 0x78, 0x62, 0xd5, 0xa2, 0x1d, 0x43, 0x9e, 0x3c, 0x3b, 0xec, 0xbc, 0xb3, 0xf1, 0xaa, 0xbd, 0x97, 0x86, 0x10, 0x19, + 0xa2, 0xe9, 0x45, 0xc9, 0x94, 0xd2, 0x73, 0x60, 0x4f, 0x60, 0xf0, 0x2d, 0xed, 0x3b, 0x6a, 0xc5, 0xbe, 0x07, 0x5d, 0x18, +}; + +extern const size_t sTestCert_Node02_05_Chip_Len = sizeof(sTestCert_Node02_05_Chip); extern const uint8_t sTestCert_Node02_05_DER[] = { - 0x30, 0x82, 0x02, 0x4f, 0x30, 0x82, 0x01, 0xf6, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x29, 0xe7, 0xc5, 0x6c, 0x4a, 0x23, - 0x77, 0x1b, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, + 0x30, 0x82, 0x02, 0x51, 0x30, 0x82, 0x01, 0xf6, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x6d, 0x47, 0x5e, 0x82, 0x63, 0xe0, + 0xf7, 0x3a, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x34, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x05, 0x0c, 0x10, 0x46, 0x41, 0x42, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x44, 0x30, 0x1e, 0x17, 0x0d, 0x32, 0x30, 0x31, 0x30, 0x31, 0x35, 0x31, 0x34, 0x32, 0x33, 0x34, 0x33, 0x5a, 0x17, 0x0d, 0x34, 0x30, 0x31, 0x30, 0x31, 0x35, 0x31, 0x34, 0x32, 0x33, 0x34, 0x32, 0x5a, 0x30, 0x78, 0x31, 0x18, 0x30, 0x16, 0x06, 0x0a, 0x2b, 0x06, - 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x06, 0x0c, 0x08, 0x41, 0x30, 0x30, 0x31, 0x42, 0x30, 0x30, 0x31, 0x31, 0x20, 0x30, + 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x06, 0x0c, 0x08, 0x41, 0x42, 0x43, 0x44, 0x30, 0x30, 0x31, 0x30, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x05, 0x0c, 0x10, 0x46, 0x41, 0x42, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x44, 0x31, 0x18, 0x30, 0x16, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, - 0x82, 0xa2, 0x7c, 0x01, 0x07, 0x0c, 0x08, 0x41, 0x30, 0x30, 0x31, 0x42, 0x30, 0x30, 0x32, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, + 0x82, 0xa2, 0x7c, 0x01, 0x06, 0x0c, 0x08, 0x41, 0x42, 0x43, 0x45, 0x31, 0x30, 0x30, 0x38, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x01, 0x0c, 0x10, 0x44, 0x45, 0x44, 0x45, 0x44, 0x45, 0x44, 0x45, 0x30, 0x30, 0x30, 0x32, 0x30, 0x30, 0x30, 0x35, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, - 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0xc3, 0x85, 0xf5, 0xb5, 0x79, 0x09, 0xea, 0x91, - 0xd2, 0x08, 0x45, 0xf8, 0x1b, 0xe1, 0x01, 0x10, 0x36, 0x93, 0x60, 0xf7, 0xdc, 0x25, 0x80, 0x22, 0x91, 0x6d, 0x0e, 0x55, 0x39, - 0xb2, 0x47, 0x78, 0x2d, 0xfa, 0xf0, 0x1c, 0x61, 0xf8, 0xeb, 0x1b, 0xf4, 0x90, 0x3f, 0x81, 0x47, 0xe0, 0xa4, 0x2f, 0xa7, 0x0f, - 0x46, 0x6e, 0xc9, 0x52, 0x7f, 0x99, 0x95, 0x02, 0x94, 0x7a, 0x44, 0x9d, 0xeb, 0xf7, 0xa3, 0x81, 0x9d, 0x30, 0x81, 0x9a, 0x30, + 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0xfc, 0x8a, 0xff, 0x06, 0x3a, 0xd0, 0xe0, 0xbf, + 0xdf, 0x24, 0xdd, 0x9d, 0x84, 0x13, 0x0f, 0x74, 0x49, 0x3c, 0x95, 0xa4, 0x0d, 0xb3, 0xf4, 0x0a, 0xaf, 0x42, 0xcf, 0x2c, 0xb1, + 0x15, 0x8b, 0xa1, 0xaa, 0x1d, 0x61, 0xde, 0x38, 0x3c, 0x9b, 0x51, 0x03, 0xca, 0xf7, 0x96, 0x43, 0x1e, 0x0a, 0x4e, 0x9c, 0x5a, + 0xc2, 0xd7, 0xf0, 0xe9, 0x1c, 0xc7, 0x0e, 0x7d, 0xf0, 0x9d, 0xb3, 0x2c, 0xf8, 0x63, 0xa3, 0x81, 0x9d, 0x30, 0x81, 0x9a, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x07, 0x80, 0x30, 0x20, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x01, 0x01, 0xff, 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, - 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xcb, 0x8e, 0x1d, 0x22, 0x39, 0x40, 0xb9, 0xb6, 0x01, 0x0b, - 0xa7, 0x58, 0x96, 0xe1, 0x1d, 0x7a, 0x3e, 0x09, 0x6a, 0x72, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, - 0x80, 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, 0x26, 0x6f, 0x23, 0x15, 0x5a, 0x16, 0xb0, 0x7f, 0x04, 0xbb, 0x3d, - 0x84, 0x30, 0x18, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x04, 0x11, 0x30, 0x0f, 0x81, 0x0d, 0x74, 0x65, 0x73, 0x74, 0x40, 0x63, 0x68, - 0x69, 0x70, 0x2e, 0x6f, 0x72, 0x67, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x47, 0x00, - 0x30, 0x44, 0x02, 0x20, 0x5a, 0x8f, 0xf8, 0x2a, 0x9c, 0xa9, 0x24, 0x24, 0x89, 0x0d, 0x5d, 0x71, 0x4a, 0x1d, 0xab, 0x05, 0x94, - 0xcb, 0x8d, 0x6a, 0xb0, 0x36, 0x55, 0xc8, 0xcb, 0xd5, 0x1d, 0x68, 0x29, 0x8c, 0xd8, 0x09, 0x02, 0x20, 0x15, 0x71, 0xfb, 0x40, - 0x95, 0x5a, 0x22, 0x64, 0xb9, 0xad, 0x86, 0xd8, 0x94, 0xb4, 0x06, 0xa0, 0x46, 0xef, 0x80, 0xb8, 0xc2, 0xc5, 0x8d, 0xa9, 0xb0, - 0x17, 0x20, 0x0f, 0x68, 0xb0, 0x6f, 0x14, + 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x4b, 0x46, 0x42, 0x9c, 0x69, 0x3d, 0x0e, 0x28, 0x79, 0x8c, + 0x8f, 0x76, 0x26, 0xa5, 0x01, 0x20, 0x05, 0x96, 0xad, 0x2d, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, + 0x80, 0x14, 0xe1, 0xe7, 0x6e, 0x67, 0x77, 0x85, 0x1d, 0xd7, 0x74, 0x16, 0xbd, 0xdd, 0x35, 0xec, 0x3c, 0x13, 0x7c, 0x47, 0x29, + 0xdc, 0x30, 0x18, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x04, 0x11, 0x30, 0x0f, 0x81, 0x0d, 0x74, 0x65, 0x73, 0x74, 0x40, 0x63, 0x68, + 0x69, 0x70, 0x2e, 0x6f, 0x72, 0x67, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x49, 0x00, + 0x30, 0x46, 0x02, 0x21, 0x00, 0xff, 0x06, 0x6b, 0xdf, 0x4a, 0x4a, 0x93, 0x0c, 0x3b, 0xa8, 0xef, 0x82, 0x8c, 0x5f, 0x93, 0xfe, + 0x7e, 0xbb, 0xdd, 0x5b, 0xb4, 0xec, 0x54, 0x45, 0xbd, 0xd7, 0x78, 0x62, 0xd5, 0xa2, 0x1d, 0x43, 0x02, 0x21, 0x00, 0x9e, 0x3c, + 0x3b, 0xec, 0xbc, 0xb3, 0xf1, 0xaa, 0xbd, 0x97, 0x86, 0x10, 0x19, 0xa2, 0xe9, 0x45, 0xc9, 0x94, 0xd2, 0x73, 0x60, 0x4f, 0x60, + 0xf0, 0x2d, 0xed, 0x3b, 0x6a, 0xc5, 0xbe, 0x07, 0x5d, }; -extern const uint32_t sTestCert_Node02_05_DER_Len = sizeof(sTestCert_Node02_05_DER); +extern const size_t sTestCert_Node02_05_DER_Len = sizeof(sTestCert_Node02_05_DER); extern const uint8_t sTestCert_Node02_05_PublicKey[] = { - 0x04, 0xc3, 0x85, 0xf5, 0xb5, 0x79, 0x09, 0xea, 0x91, 0xd2, 0x08, 0x45, 0xf8, 0x1b, 0xe1, 0x01, 0x10, - 0x36, 0x93, 0x60, 0xf7, 0xdc, 0x25, 0x80, 0x22, 0x91, 0x6d, 0x0e, 0x55, 0x39, 0xb2, 0x47, 0x78, 0x2d, - 0xfa, 0xf0, 0x1c, 0x61, 0xf8, 0xeb, 0x1b, 0xf4, 0x90, 0x3f, 0x81, 0x47, 0xe0, 0xa4, 0x2f, 0xa7, 0x0f, - 0x46, 0x6e, 0xc9, 0x52, 0x7f, 0x99, 0x95, 0x02, 0x94, 0x7a, 0x44, 0x9d, 0xeb, 0xf7, + 0x04, 0xfc, 0x8a, 0xff, 0x06, 0x3a, 0xd0, 0xe0, 0xbf, 0xdf, 0x24, 0xdd, 0x9d, 0x84, 0x13, 0x0f, 0x74, + 0x49, 0x3c, 0x95, 0xa4, 0x0d, 0xb3, 0xf4, 0x0a, 0xaf, 0x42, 0xcf, 0x2c, 0xb1, 0x15, 0x8b, 0xa1, 0xaa, + 0x1d, 0x61, 0xde, 0x38, 0x3c, 0x9b, 0x51, 0x03, 0xca, 0xf7, 0x96, 0x43, 0x1e, 0x0a, 0x4e, 0x9c, 0x5a, + 0xc2, 0xd7, 0xf0, 0xe9, 0x1c, 0xc7, 0x0e, 0x7d, 0xf0, 0x9d, 0xb3, 0x2c, 0xf8, 0x63, }; -extern const uint8_t sTestCert_Node02_05_PublicKey_Len = sizeof(sTestCert_Node02_05_PublicKey); +extern const size_t sTestCert_Node02_05_PublicKey_Len = sizeof(sTestCert_Node02_05_PublicKey); extern const uint8_t sTestCert_Node02_05_PrivateKey[] = { - 0x01, 0x04, 0x1c, 0x0b, 0x22, 0xa4, 0xba, 0xa3, 0x04, 0x6f, 0xa9, 0x45, 0x4b, 0x76, 0x08, 0x7c, - 0xce, 0x4c, 0xa1, 0x56, 0x8d, 0xfe, 0x49, 0xc0, 0x9b, 0x69, 0x8f, 0xd1, 0x80, 0xf8, 0x7b, 0x2d, + 0x66, 0xd0, 0x40, 0x90, 0x71, 0x76, 0x60, 0xba, 0xaf, 0xcc, 0xdc, 0x46, 0x47, 0x6d, 0xa9, 0x1d, + 0xad, 0x66, 0xe8, 0xad, 0x39, 0x28, 0x3d, 0xb1, 0x7d, 0x07, 0x79, 0xda, 0xd0, 0xcd, 0x65, 0xc2, }; -extern const uint8_t sTestCert_Node02_05_PrivateKey_Len = sizeof(sTestCert_Node02_05_PrivateKey); +extern const size_t sTestCert_Node02_05_PrivateKey_Len = sizeof(sTestCert_Node02_05_PrivateKey); extern const uint8_t sTestCert_Node02_05_SubjectKeyId[] = { - 0xCB, 0x8E, 0x1D, 0x22, 0x39, 0x40, 0xB9, 0xB6, 0x01, 0x0B, 0xA7, 0x58, 0x96, 0xE1, 0x1D, 0x7A, 0x3E, 0x09, 0x6A, 0x72, + 0x4B, 0x46, 0x42, 0x9C, 0x69, 0x3D, 0x0E, 0x28, 0x79, 0x8C, 0x8F, 0x76, 0x26, 0xA5, 0x01, 0x20, 0x05, 0x96, 0xAD, 0x2D, }; -extern const uint8_t sTestCert_Node02_05_SubjectKeyId_Len = sizeof(sTestCert_Node02_05_SubjectKeyId); +extern const size_t sTestCert_Node02_05_SubjectKeyId_Len = sizeof(sTestCert_Node02_05_SubjectKeyId); extern const uint8_t sTestCert_Node02_05_AuthorityKeyId[] = { - 0xCF, 0x42, 0xBC, 0xF8, 0xDF, 0x48, 0x09, 0xD9, 0x26, 0x6F, 0x23, 0x15, 0x5A, 0x16, 0xB0, 0x7F, 0x04, 0xBB, 0x3D, 0x84, + 0xE1, 0xE7, 0x6E, 0x67, 0x77, 0x85, 0x1D, 0xD7, 0x74, 0x16, 0xBD, 0xDD, 0x35, 0xEC, 0x3C, 0x13, 0x7C, 0x47, 0x29, 0xDC, }; -extern const uint8_t sTestCert_Node02_05_AuthorityKeyId_Len = sizeof(sTestCert_Node02_05_AuthorityKeyId); +extern const size_t sTestCert_Node02_05_AuthorityKeyId_Len = sizeof(sTestCert_Node02_05_AuthorityKeyId); /************** Test Node02_06 Certificate ************** Certificate: Data: Version: 3 (0x2) - Serial Number: 7516176295543836038 (0x684ed284b51a0d86) + Serial Number: 1159553127949419850 (0x10178f6d219e454a) Signature Algorithm: ecdsa-with-SHA256 Issuer: 1.3.6.1.4.1.37244.1.3 = CACACACA00000004, 1.3.6.1.4.1.37244.1.5 = FAB000000000001D Validity @@ -2094,11 +2098,11 @@ extern const uint8_t sTestCert_Node02_05_AuthorityKeyId_Len = sizeof(sTestCert_N Public Key Algorithm: id-ecPublicKey Public-Key: (256 bit) pub: - 04:9f:7b:6e:a3:42:a5:02:10:da:1d:fa:ff:ba:ca: - 6b:70:11:c0:2a:7f:ac:39:73:bd:d3:06:24:c9:c7: - 09:6c:cb:97:fa:26:cb:50:ff:83:4e:f2:4a:d8:9e: - 80:45:94:5f:dd:d0:40:0b:45:98:17:3f:d7:5b:a0: - b2:f4:43:27:32 + 04:bb:a4:15:69:52:63:e1:d9:dc:17:cc:32:2d:39: + 5e:32:0d:a6:f1:7d:56:f2:02:18:16:0c:68:53:e6: + 21:0f:41:d0:10:19:63:fe:e3:91:5b:9a:8c:71:76: + 24:df:34:2d:13:86:6d:dd:17:5b:42:8b:c3:8d:21: + 3d:6b:f5:c7:d3 ASN1 OID: prime256v1 NIST CURVE: P-256 X509v3 extensions: @@ -2109,9 +2113,9 @@ extern const uint8_t sTestCert_Node02_05_AuthorityKeyId_Len = sizeof(sTestCert_N X509v3 Extended Key Usage: critical TLS Web Client Authentication, TLS Web Server Authentication X509v3 Subject Key Identifier: - AB:89:94:81:DD:06:D6:22:A0:13:C8:BA:7D:95:C4:8D:B9:7E:5B:2F + 4B:04:1B:79:7E:B8:1B:32:61:9A:AD:60:0F:6C:FD:78:CE:04:74:28 X509v3 Authority Key Identifier: - keyid:CF:42:BC:F8:DF:48:09:D9:26:6F:23:15:5A:16:B0:7F:04:BB:3D:84 + keyid:E1:E7:6E:67:77:85:1D:D7:74:16:BD:DD:35:EC:3C:13:7C:47:29:DC X509v3 Subject Alternative Name: email:test@chip.org @@ -2119,59 +2123,59 @@ extern const uint8_t sTestCert_Node02_05_AuthorityKeyId_Len = sizeof(sTestCert_N OCSP - URI:test Signature Algorithm: ecdsa-with-SHA256 - 30:46:02:21:00:e2:9a:0e:bd:45:be:4f:52:bd:83:ca:06:97: - 15:ed:08:37:f6:25:82:c0:02:26:28:57:b2:f2:2f:9d:b1:e1: - 24:02:21:00:d9:0a:da:e9:11:80:79:72:f2:f3:74:4e:29:95: - d4:f8:bf:19:f9:d4:3f:cd:a6:3d:28:56:6f:87:ce:3d:af:b4 + 30:45:02:20:1f:e0:bd:fd:10:8b:88:3d:1a:70:12:9e:31:85: + a3:7a:9e:96:01:df:62:63:f2:0a:0a:8c:fe:e3:14:04:f6:79: + 02:21:00:d1:85:b0:21:dd:f2:b7:a1:6c:d6:af:6c:38:ee:92: + 04:03:ec:b4:d6:16:05:f3:c2:f7:f1:7b:d6:16:78:42:93 -----BEGIN CERTIFICATE----- -MIICPzCCAeSgAwIBAgIIaE7ShLUaDYYwCgYIKoZIzj0EAwIwRDEgMB4GCisGAQQB +MIICPjCCAeSgAwIBAgIIEBePbSGeRUowCgYIKoZIzj0EAwIwRDEgMB4GCisGAQQB gqJ8AQMMEENBQ0FDQUNBMDAwMDAwMDQxIDAeBgorBgEEAYKifAEFDBBGQUIwMDAw MDAwMDAwMDFEMB4XDTIwMTAxNTE0MjM0M1oXDTQwMTAxNTE0MjM0MlowRDEgMB4G CisGAQQBgqJ8AQEMEERFREVERURFMDAwMjAwMDYxIDAeBgorBgEEAYKifAEFDBBG -QUIwMDAwMDAwMDAwMDFEMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEn3tuo0Kl -AhDaHfr/usprcBHAKn+sOXO90wYkyccJbMuX+ibLUP+DTvJK2J6ARZRf3dBAC0WY -Fz/XW6Cy9EMnMqOBvzCBvDAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB/wQEAwIHgDAg -BgNVHSUBAf8EFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEwHQYDVR0OBBYEFKuJlIHd -BtYioBPIun2VxI25flsvMB8GA1UdIwQYMBaAFM9CvPjfSAnZJm8jFVoWsH8Euz2E +QUIwMDAwMDAwMDAwMDFEMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEu6QVaVJj +4dncF8wyLTleMg2m8X1W8gIYFgxoU+YhD0HQEBlj/uORW5qMcXYk3zQtE4Zt3Rdb +QovDjSE9a/XH06OBvzCBvDAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB/wQEAwIHgDAg +BgNVHSUBAf8EFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEwHQYDVR0OBBYEFEsEG3l+ +uBsyYZqtYA9s/XjOBHQoMB8GA1UdIwQYMBaAFOHnbmd3hR3XdBa93TXsPBN8Rync MBgGA1UdEQQRMA+BDXRlc3RAY2hpcC5vcmcwIAYIKwYBBQUHAQEEFDASMBAGCCsG -AQUFBzABhgR0ZXN0MAoGCCqGSM49BAMCA0kAMEYCIQDimg69Rb5PUr2DygaXFe0I -N/YlgsACJihXsvIvnbHhJAIhANkK2ukRgHly8vN0TimV1Pi/GfnUP82mPShWb4fO -Pa+0 +AQUFBzABhgR0ZXN0MAoGCCqGSM49BAMCA0gAMEUCIB/gvf0Qi4g9GnASnjGFo3qe +lgHfYmPyCgqM/uMUBPZ5AiEA0YWwId3yt6Fs1q9sOO6SBAPstNYWBfPC9/F71hZ4 +QpM= -----END CERTIFICATE----- -----BEGIN EC PRIVATE KEY----- -MHcCAQEEIPFqxUaZp1qy8/ksS24zQxPx+CpB4mOkSyQEeX9auRcUoAoGCCqGSM49 -AwEHoUQDQgAEn3tuo0KlAhDaHfr/usprcBHAKn+sOXO90wYkyccJbMuX+ibLUP+D -TvJK2J6ARZRf3dBAC0WYFz/XW6Cy9EMnMg== +MHcCAQEEIMCX/fl2O3KOkYpURsST8zO/HW8zpqgDrxHagcX17lWOoAoGCCqGSM49 +AwEHoUQDQgAEu6QVaVJj4dncF8wyLTleMg2m8X1W8gIYFgxoU+YhD0HQEBlj/uOR +W5qMcXYk3zQtE4Zt3RdbQovDjSE9a/XH0w== -----END EC PRIVATE KEY----- */ extern const uint8_t sTestCert_Node02_06_Chip[] = { - 0x15, 0x30, 0x01, 0x08, 0x68, 0x4e, 0xd2, 0x84, 0xb5, 0x1a, 0x0d, 0x86, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, + 0x15, 0x30, 0x01, 0x08, 0x10, 0x17, 0x8f, 0x6d, 0x21, 0x9e, 0x45, 0x4a, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x06, 0x00, 0x02, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, - 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0x9f, - 0x7b, 0x6e, 0xa3, 0x42, 0xa5, 0x02, 0x10, 0xda, 0x1d, 0xfa, 0xff, 0xba, 0xca, 0x6b, 0x70, 0x11, 0xc0, 0x2a, 0x7f, 0xac, 0x39, - 0x73, 0xbd, 0xd3, 0x06, 0x24, 0xc9, 0xc7, 0x09, 0x6c, 0xcb, 0x97, 0xfa, 0x26, 0xcb, 0x50, 0xff, 0x83, 0x4e, 0xf2, 0x4a, 0xd8, - 0x9e, 0x80, 0x45, 0x94, 0x5f, 0xdd, 0xd0, 0x40, 0x0b, 0x45, 0x98, 0x17, 0x3f, 0xd7, 0x5b, 0xa0, 0xb2, 0xf4, 0x43, 0x27, 0x32, - 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, 0xab, - 0x89, 0x94, 0x81, 0xdd, 0x06, 0xd6, 0x22, 0xa0, 0x13, 0xc8, 0xba, 0x7d, 0x95, 0xc4, 0x8d, 0xb9, 0x7e, 0x5b, 0x2f, 0x30, 0x05, - 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, 0x26, 0x6f, 0x23, 0x15, 0x5a, 0x16, 0xb0, 0x7f, 0x04, 0xbb, 0x3d, 0x84, + 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0xbb, + 0xa4, 0x15, 0x69, 0x52, 0x63, 0xe1, 0xd9, 0xdc, 0x17, 0xcc, 0x32, 0x2d, 0x39, 0x5e, 0x32, 0x0d, 0xa6, 0xf1, 0x7d, 0x56, 0xf2, + 0x02, 0x18, 0x16, 0x0c, 0x68, 0x53, 0xe6, 0x21, 0x0f, 0x41, 0xd0, 0x10, 0x19, 0x63, 0xfe, 0xe3, 0x91, 0x5b, 0x9a, 0x8c, 0x71, + 0x76, 0x24, 0xdf, 0x34, 0x2d, 0x13, 0x86, 0x6d, 0xdd, 0x17, 0x5b, 0x42, 0x8b, 0xc3, 0x8d, 0x21, 0x3d, 0x6b, 0xf5, 0xc7, 0xd3, + 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, 0x4b, + 0x04, 0x1b, 0x79, 0x7e, 0xb8, 0x1b, 0x32, 0x61, 0x9a, 0xad, 0x60, 0x0f, 0x6c, 0xfd, 0x78, 0xce, 0x04, 0x74, 0x28, 0x30, 0x05, + 0x14, 0xe1, 0xe7, 0x6e, 0x67, 0x77, 0x85, 0x1d, 0xd7, 0x74, 0x16, 0xbd, 0xdd, 0x35, 0xec, 0x3c, 0x13, 0x7c, 0x47, 0x29, 0xdc, 0x30, 0x06, 0x1a, 0x30, 0x18, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x04, 0x11, 0x30, 0x0f, 0x81, 0x0d, 0x74, 0x65, 0x73, 0x74, 0x40, 0x63, 0x68, 0x69, 0x70, 0x2e, 0x6f, 0x72, 0x67, 0x30, 0x06, 0x22, 0x30, 0x20, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x01, 0x04, 0x14, 0x30, 0x12, 0x30, 0x10, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x86, 0x04, 0x74, - 0x65, 0x73, 0x74, 0x18, 0x30, 0x0b, 0x40, 0xe2, 0x9a, 0x0e, 0xbd, 0x45, 0xbe, 0x4f, 0x52, 0xbd, 0x83, 0xca, 0x06, 0x97, 0x15, - 0xed, 0x08, 0x37, 0xf6, 0x25, 0x82, 0xc0, 0x02, 0x26, 0x28, 0x57, 0xb2, 0xf2, 0x2f, 0x9d, 0xb1, 0xe1, 0x24, 0xd9, 0x0a, 0xda, - 0xe9, 0x11, 0x80, 0x79, 0x72, 0xf2, 0xf3, 0x74, 0x4e, 0x29, 0x95, 0xd4, 0xf8, 0xbf, 0x19, 0xf9, 0xd4, 0x3f, 0xcd, 0xa6, 0x3d, - 0x28, 0x56, 0x6f, 0x87, 0xce, 0x3d, 0xaf, 0xb4, 0x18, + 0x65, 0x73, 0x74, 0x18, 0x30, 0x0b, 0x40, 0x1f, 0xe0, 0xbd, 0xfd, 0x10, 0x8b, 0x88, 0x3d, 0x1a, 0x70, 0x12, 0x9e, 0x31, 0x85, + 0xa3, 0x7a, 0x9e, 0x96, 0x01, 0xdf, 0x62, 0x63, 0xf2, 0x0a, 0x0a, 0x8c, 0xfe, 0xe3, 0x14, 0x04, 0xf6, 0x79, 0xd1, 0x85, 0xb0, + 0x21, 0xdd, 0xf2, 0xb7, 0xa1, 0x6c, 0xd6, 0xaf, 0x6c, 0x38, 0xee, 0x92, 0x04, 0x03, 0xec, 0xb4, 0xd6, 0x16, 0x05, 0xf3, 0xc2, + 0xf7, 0xf1, 0x7b, 0xd6, 0x16, 0x78, 0x42, 0x93, 0x18, }; -extern const uint32_t sTestCert_Node02_06_Chip_Len = sizeof(sTestCert_Node02_06_Chip); +extern const size_t sTestCert_Node02_06_Chip_Len = sizeof(sTestCert_Node02_06_Chip); extern const uint8_t sTestCert_Node02_06_DER[] = { - 0x30, 0x82, 0x02, 0x3f, 0x30, 0x82, 0x01, 0xe4, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x68, 0x4e, 0xd2, 0x84, 0xb5, 0x1a, - 0x0d, 0x86, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, + 0x30, 0x82, 0x02, 0x3e, 0x30, 0x82, 0x01, 0xe4, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x10, 0x17, 0x8f, 0x6d, 0x21, 0x9e, + 0x45, 0x4a, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x34, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x05, 0x0c, 0x10, 0x46, 0x41, 0x42, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x44, @@ -2181,60 +2185,60 @@ extern const uint8_t sTestCert_Node02_06_DER[] = { 0x32, 0x30, 0x30, 0x30, 0x36, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x05, 0x0c, 0x10, 0x46, 0x41, 0x42, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x44, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, - 0x42, 0x00, 0x04, 0x9f, 0x7b, 0x6e, 0xa3, 0x42, 0xa5, 0x02, 0x10, 0xda, 0x1d, 0xfa, 0xff, 0xba, 0xca, 0x6b, 0x70, 0x11, 0xc0, - 0x2a, 0x7f, 0xac, 0x39, 0x73, 0xbd, 0xd3, 0x06, 0x24, 0xc9, 0xc7, 0x09, 0x6c, 0xcb, 0x97, 0xfa, 0x26, 0xcb, 0x50, 0xff, 0x83, - 0x4e, 0xf2, 0x4a, 0xd8, 0x9e, 0x80, 0x45, 0x94, 0x5f, 0xdd, 0xd0, 0x40, 0x0b, 0x45, 0x98, 0x17, 0x3f, 0xd7, 0x5b, 0xa0, 0xb2, - 0xf4, 0x43, 0x27, 0x32, 0xa3, 0x81, 0xbf, 0x30, 0x81, 0xbc, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, + 0x42, 0x00, 0x04, 0xbb, 0xa4, 0x15, 0x69, 0x52, 0x63, 0xe1, 0xd9, 0xdc, 0x17, 0xcc, 0x32, 0x2d, 0x39, 0x5e, 0x32, 0x0d, 0xa6, + 0xf1, 0x7d, 0x56, 0xf2, 0x02, 0x18, 0x16, 0x0c, 0x68, 0x53, 0xe6, 0x21, 0x0f, 0x41, 0xd0, 0x10, 0x19, 0x63, 0xfe, 0xe3, 0x91, + 0x5b, 0x9a, 0x8c, 0x71, 0x76, 0x24, 0xdf, 0x34, 0x2d, 0x13, 0x86, 0x6d, 0xdd, 0x17, 0x5b, 0x42, 0x8b, 0xc3, 0x8d, 0x21, 0x3d, + 0x6b, 0xf5, 0xc7, 0xd3, 0xa3, 0x81, 0xbf, 0x30, 0x81, 0xbc, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x07, 0x80, 0x30, 0x20, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x01, 0x01, 0xff, 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, - 0x14, 0xab, 0x89, 0x94, 0x81, 0xdd, 0x06, 0xd6, 0x22, 0xa0, 0x13, 0xc8, 0xba, 0x7d, 0x95, 0xc4, 0x8d, 0xb9, 0x7e, 0x5b, 0x2f, - 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, - 0x26, 0x6f, 0x23, 0x15, 0x5a, 0x16, 0xb0, 0x7f, 0x04, 0xbb, 0x3d, 0x84, 0x30, 0x18, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x04, 0x11, + 0x14, 0x4b, 0x04, 0x1b, 0x79, 0x7e, 0xb8, 0x1b, 0x32, 0x61, 0x9a, 0xad, 0x60, 0x0f, 0x6c, 0xfd, 0x78, 0xce, 0x04, 0x74, 0x28, + 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xe1, 0xe7, 0x6e, 0x67, 0x77, 0x85, 0x1d, 0xd7, + 0x74, 0x16, 0xbd, 0xdd, 0x35, 0xec, 0x3c, 0x13, 0x7c, 0x47, 0x29, 0xdc, 0x30, 0x18, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x04, 0x11, 0x30, 0x0f, 0x81, 0x0d, 0x74, 0x65, 0x73, 0x74, 0x40, 0x63, 0x68, 0x69, 0x70, 0x2e, 0x6f, 0x72, 0x67, 0x30, 0x20, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x01, 0x04, 0x14, 0x30, 0x12, 0x30, 0x10, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x86, 0x04, 0x74, 0x65, 0x73, 0x74, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, - 0x03, 0x49, 0x00, 0x30, 0x46, 0x02, 0x21, 0x00, 0xe2, 0x9a, 0x0e, 0xbd, 0x45, 0xbe, 0x4f, 0x52, 0xbd, 0x83, 0xca, 0x06, 0x97, - 0x15, 0xed, 0x08, 0x37, 0xf6, 0x25, 0x82, 0xc0, 0x02, 0x26, 0x28, 0x57, 0xb2, 0xf2, 0x2f, 0x9d, 0xb1, 0xe1, 0x24, 0x02, 0x21, - 0x00, 0xd9, 0x0a, 0xda, 0xe9, 0x11, 0x80, 0x79, 0x72, 0xf2, 0xf3, 0x74, 0x4e, 0x29, 0x95, 0xd4, 0xf8, 0xbf, 0x19, 0xf9, 0xd4, - 0x3f, 0xcd, 0xa6, 0x3d, 0x28, 0x56, 0x6f, 0x87, 0xce, 0x3d, 0xaf, 0xb4, + 0x03, 0x48, 0x00, 0x30, 0x45, 0x02, 0x20, 0x1f, 0xe0, 0xbd, 0xfd, 0x10, 0x8b, 0x88, 0x3d, 0x1a, 0x70, 0x12, 0x9e, 0x31, 0x85, + 0xa3, 0x7a, 0x9e, 0x96, 0x01, 0xdf, 0x62, 0x63, 0xf2, 0x0a, 0x0a, 0x8c, 0xfe, 0xe3, 0x14, 0x04, 0xf6, 0x79, 0x02, 0x21, 0x00, + 0xd1, 0x85, 0xb0, 0x21, 0xdd, 0xf2, 0xb7, 0xa1, 0x6c, 0xd6, 0xaf, 0x6c, 0x38, 0xee, 0x92, 0x04, 0x03, 0xec, 0xb4, 0xd6, 0x16, + 0x05, 0xf3, 0xc2, 0xf7, 0xf1, 0x7b, 0xd6, 0x16, 0x78, 0x42, 0x93, }; -extern const uint32_t sTestCert_Node02_06_DER_Len = sizeof(sTestCert_Node02_06_DER); +extern const size_t sTestCert_Node02_06_DER_Len = sizeof(sTestCert_Node02_06_DER); extern const uint8_t sTestCert_Node02_06_PublicKey[] = { - 0x04, 0x9f, 0x7b, 0x6e, 0xa3, 0x42, 0xa5, 0x02, 0x10, 0xda, 0x1d, 0xfa, 0xff, 0xba, 0xca, 0x6b, 0x70, - 0x11, 0xc0, 0x2a, 0x7f, 0xac, 0x39, 0x73, 0xbd, 0xd3, 0x06, 0x24, 0xc9, 0xc7, 0x09, 0x6c, 0xcb, 0x97, - 0xfa, 0x26, 0xcb, 0x50, 0xff, 0x83, 0x4e, 0xf2, 0x4a, 0xd8, 0x9e, 0x80, 0x45, 0x94, 0x5f, 0xdd, 0xd0, - 0x40, 0x0b, 0x45, 0x98, 0x17, 0x3f, 0xd7, 0x5b, 0xa0, 0xb2, 0xf4, 0x43, 0x27, 0x32, + 0x04, 0xbb, 0xa4, 0x15, 0x69, 0x52, 0x63, 0xe1, 0xd9, 0xdc, 0x17, 0xcc, 0x32, 0x2d, 0x39, 0x5e, 0x32, + 0x0d, 0xa6, 0xf1, 0x7d, 0x56, 0xf2, 0x02, 0x18, 0x16, 0x0c, 0x68, 0x53, 0xe6, 0x21, 0x0f, 0x41, 0xd0, + 0x10, 0x19, 0x63, 0xfe, 0xe3, 0x91, 0x5b, 0x9a, 0x8c, 0x71, 0x76, 0x24, 0xdf, 0x34, 0x2d, 0x13, 0x86, + 0x6d, 0xdd, 0x17, 0x5b, 0x42, 0x8b, 0xc3, 0x8d, 0x21, 0x3d, 0x6b, 0xf5, 0xc7, 0xd3, }; -extern const uint8_t sTestCert_Node02_06_PublicKey_Len = sizeof(sTestCert_Node02_06_PublicKey); +extern const size_t sTestCert_Node02_06_PublicKey_Len = sizeof(sTestCert_Node02_06_PublicKey); extern const uint8_t sTestCert_Node02_06_PrivateKey[] = { - 0xf1, 0x6a, 0xc5, 0x46, 0x99, 0xa7, 0x5a, 0xb2, 0xf3, 0xf9, 0x2c, 0x4b, 0x6e, 0x33, 0x43, 0x13, - 0xf1, 0xf8, 0x2a, 0x41, 0xe2, 0x63, 0xa4, 0x4b, 0x24, 0x04, 0x79, 0x7f, 0x5a, 0xb9, 0x17, 0x14, + 0xc0, 0x97, 0xfd, 0xf9, 0x76, 0x3b, 0x72, 0x8e, 0x91, 0x8a, 0x54, 0x46, 0xc4, 0x93, 0xf3, 0x33, + 0xbf, 0x1d, 0x6f, 0x33, 0xa6, 0xa8, 0x03, 0xaf, 0x11, 0xda, 0x81, 0xc5, 0xf5, 0xee, 0x55, 0x8e, }; -extern const uint8_t sTestCert_Node02_06_PrivateKey_Len = sizeof(sTestCert_Node02_06_PrivateKey); +extern const size_t sTestCert_Node02_06_PrivateKey_Len = sizeof(sTestCert_Node02_06_PrivateKey); extern const uint8_t sTestCert_Node02_06_SubjectKeyId[] = { - 0xAB, 0x89, 0x94, 0x81, 0xDD, 0x06, 0xD6, 0x22, 0xA0, 0x13, 0xC8, 0xBA, 0x7D, 0x95, 0xC4, 0x8D, 0xB9, 0x7E, 0x5B, 0x2F, + 0x4B, 0x04, 0x1B, 0x79, 0x7E, 0xB8, 0x1B, 0x32, 0x61, 0x9A, 0xAD, 0x60, 0x0F, 0x6C, 0xFD, 0x78, 0xCE, 0x04, 0x74, 0x28, }; -extern const uint8_t sTestCert_Node02_06_SubjectKeyId_Len = sizeof(sTestCert_Node02_06_SubjectKeyId); +extern const size_t sTestCert_Node02_06_SubjectKeyId_Len = sizeof(sTestCert_Node02_06_SubjectKeyId); extern const uint8_t sTestCert_Node02_06_AuthorityKeyId[] = { - 0xCF, 0x42, 0xBC, 0xF8, 0xDF, 0x48, 0x09, 0xD9, 0x26, 0x6F, 0x23, 0x15, 0x5A, 0x16, 0xB0, 0x7F, 0x04, 0xBB, 0x3D, 0x84, + 0xE1, 0xE7, 0x6E, 0x67, 0x77, 0x85, 0x1D, 0xD7, 0x74, 0x16, 0xBD, 0xDD, 0x35, 0xEC, 0x3C, 0x13, 0x7C, 0x47, 0x29, 0xDC, }; -extern const uint8_t sTestCert_Node02_06_AuthorityKeyId_Len = sizeof(sTestCert_Node02_06_AuthorityKeyId); +extern const size_t sTestCert_Node02_06_AuthorityKeyId_Len = sizeof(sTestCert_Node02_06_AuthorityKeyId); /************** Test Node02_07 Certificate ************** Certificate: Data: Version: 3 (0x2) - Serial Number: 3033058160902015167 (0x2a179653d7aa08bf) + Serial Number: 6951342034215031142 (0x607820c015a0d166) Signature Algorithm: ecdsa-with-SHA256 Issuer: 1.3.6.1.4.1.37244.1.3 = CACACACA00000004, 1.3.6.1.4.1.37244.1.5 = FAB000000000001D Validity @@ -2245,11 +2249,11 @@ extern const uint8_t sTestCert_Node02_06_AuthorityKeyId_Len = sizeof(sTestCert_N Public Key Algorithm: id-ecPublicKey Public-Key: (256 bit) pub: - 04:f1:1b:05:37:f3:73:5c:dc:fa:c5:86:15:dd:1b: - 13:4a:83:85:a4:75:15:58:fb:d1:fe:d2:55:93:35: - d0:c2:42:6f:60:08:f6:05:01:f6:44:a2:0a:8c:f9: - c4:1e:82:8c:38:a5:6f:56:88:d1:fa:af:d2:8b:21: - 87:a8:f4:2e:74 + 04:f7:3c:7f:e5:75:d8:b9:06:d4:75:ff:f7:91:2e: + e0:e1:b3:cd:23:6c:32:46:cf:2d:85:3d:e3:39:84: + c1:f4:18:17:b1:c5:b5:28:01:8f:90:e6:26:16:ea: + a1:87:7f:47:14:b9:6f:c8:78:6f:91:b3:03:e4:46: + a9:65:09:d3:61 ASN1 OID: prime256v1 NIST CURVE: P-256 X509v3 extensions: @@ -2260,9 +2264,9 @@ extern const uint8_t sTestCert_Node02_06_AuthorityKeyId_Len = sizeof(sTestCert_N X509v3 Extended Key Usage: critical TLS Web Client Authentication, TLS Web Server Authentication X509v3 Subject Key Identifier: - CB:58:71:E3:AD:6D:AB:0D:BF:29:A5:3C:AA:5B:99:1E:10:BE:71:98 + 77:7C:77:B6:35:65:DC:51:F3:02:04:59:63:C5:CE:FC:E7:09:2A:1E X509v3 Authority Key Identifier: - keyid:CF:42:BC:F8:DF:48:09:D9:26:6F:23:15:5A:16:B0:7F:04:BB:3D:84 + keyid:E1:E7:6E:67:77:85:1D:D7:74:16:BD:DD:35:EC:3C:13:7C:47:29:DC X509v3 Subject Alternative Name: critical email:test@chip.org @@ -2270,59 +2274,59 @@ extern const uint8_t sTestCert_Node02_06_AuthorityKeyId_Len = sizeof(sTestCert_N OCSP - URI:test Signature Algorithm: ecdsa-with-SHA256 - 30:46:02:21:00:f1:10:28:aa:62:e4:e9:cd:ab:ab:c5:6c:79: - c4:5c:4f:04:ad:c8:03:37:68:4c:ec:78:dc:86:0c:1b:e8:95: - d2:02:21:00:8c:3b:50:55:63:ef:99:b2:98:2f:7b:ea:03:f3: - 21:56:ec:98:d0:e5:b8:bf:d1:45:52:04:52:c6:2a:63:c9:b2 + 30:45:02:21:00:a7:c5:93:9d:db:18:9c:d8:4c:1e:85:48:bc: + 40:c2:c3:af:cd:98:19:54:8c:f8:e5:c2:49:d2:7d:aa:5e:d8: + 86:02:20:19:70:46:95:b7:10:50:fe:70:1a:5a:67:5a:49:55: + 98:1c:28:7f:25:f6:73:93:8b:43:e7:71:73:54:f6:c8:2e -----BEGIN CERTIFICATE----- -MIICQjCCAeegAwIBAgIIKheWU9eqCL8wCgYIKoZIzj0EAwIwRDEgMB4GCisGAQQB +MIICQTCCAeegAwIBAgIIYHggwBWg0WYwCgYIKoZIzj0EAwIwRDEgMB4GCisGAQQB gqJ8AQMMEENBQ0FDQUNBMDAwMDAwMDQxIDAeBgorBgEEAYKifAEFDBBGQUIwMDAw MDAwMDAwMDFEMB4XDTIwMTAxNTE0MjM0M1oXDTQwMTAxNTE0MjM0MlowRDEgMB4G CisGAQQBgqJ8AQEMEERFREVERURFMDAwMjAwMDcxIDAeBgorBgEEAYKifAEFDBBG -QUIwMDAwMDAwMDAwMDFEMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE8RsFN/Nz -XNz6xYYV3RsTSoOFpHUVWPvR/tJVkzXQwkJvYAj2BQH2RKIKjPnEHoKMOKVvVojR -+q/SiyGHqPQudKOBwjCBvzAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB/wQEAwIHgDAg -BgNVHSUBAf8EFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEwHQYDVR0OBBYEFMtYceOt -basNvymlPKpbmR4QvnGYMB8GA1UdIwQYMBaAFM9CvPjfSAnZJm8jFVoWsH8Euz2E +QUIwMDAwMDAwMDAwMDFEMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE9zx/5XXY +uQbUdf/3kS7g4bPNI2wyRs8thT3jOYTB9BgXscW1KAGPkOYmFuqhh39HFLlvyHhv +kbMD5EapZQnTYaOBwjCBvzAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB/wQEAwIHgDAg +BgNVHSUBAf8EFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEwHQYDVR0OBBYEFHd8d7Y1 +ZdxR8wIEWWPFzvznCSoeMB8GA1UdIwQYMBaAFOHnbmd3hR3XdBa93TXsPBN8Rync MBsGA1UdEQEB/wQRMA+BDXRlc3RAY2hpcC5vcmcwIAYIKwYBBQUHAQEEFDASMBAG -CCsGAQUFBzABhgR0ZXN0MAoGCCqGSM49BAMCA0kAMEYCIQDxECiqYuTpzaurxWx5 -xFxPBK3IAzdoTOx43IYMG+iV0gIhAIw7UFVj75mymC976gPzIVbsmNDluL/RRVIE -UsYqY8my +CCsGAQUFBzABhgR0ZXN0MAoGCCqGSM49BAMCA0gAMEUCIQCnxZOd2xic2EwehUi8 +QMLDr82YGVSM+OXCSdJ9ql7YhgIgGXBGlbcQUP5wGlpnWklVmBwofyX2c5OLQ+dx +c1T2yC4= -----END CERTIFICATE----- -----BEGIN EC PRIVATE KEY----- -MHcCAQEEIE2vFHuUml5s0sbXqnSmilEwpV/8aVmc04PA6K3ZpgfKoAoGCCqGSM49 -AwEHoUQDQgAE8RsFN/NzXNz6xYYV3RsTSoOFpHUVWPvR/tJVkzXQwkJvYAj2BQH2 -RKIKjPnEHoKMOKVvVojR+q/SiyGHqPQudA== +MHcCAQEEIJWoN3/bUlY4BMAQbRFLUnQFaTeczcj1doNHPb28RSVAoAoGCCqGSM49 +AwEHoUQDQgAE9zx/5XXYuQbUdf/3kS7g4bPNI2wyRs8thT3jOYTB9BgXscW1KAGP +kOYmFuqhh39HFLlvyHhvkbMD5EapZQnTYQ== -----END EC PRIVATE KEY----- */ extern const uint8_t sTestCert_Node02_07_Chip[] = { - 0x15, 0x30, 0x01, 0x08, 0x2a, 0x17, 0x96, 0x53, 0xd7, 0xaa, 0x08, 0xbf, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, + 0x15, 0x30, 0x01, 0x08, 0x60, 0x78, 0x20, 0xc0, 0x15, 0xa0, 0xd1, 0x66, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x07, 0x00, 0x02, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, - 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0xf1, - 0x1b, 0x05, 0x37, 0xf3, 0x73, 0x5c, 0xdc, 0xfa, 0xc5, 0x86, 0x15, 0xdd, 0x1b, 0x13, 0x4a, 0x83, 0x85, 0xa4, 0x75, 0x15, 0x58, - 0xfb, 0xd1, 0xfe, 0xd2, 0x55, 0x93, 0x35, 0xd0, 0xc2, 0x42, 0x6f, 0x60, 0x08, 0xf6, 0x05, 0x01, 0xf6, 0x44, 0xa2, 0x0a, 0x8c, - 0xf9, 0xc4, 0x1e, 0x82, 0x8c, 0x38, 0xa5, 0x6f, 0x56, 0x88, 0xd1, 0xfa, 0xaf, 0xd2, 0x8b, 0x21, 0x87, 0xa8, 0xf4, 0x2e, 0x74, - 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, 0xcb, - 0x58, 0x71, 0xe3, 0xad, 0x6d, 0xab, 0x0d, 0xbf, 0x29, 0xa5, 0x3c, 0xaa, 0x5b, 0x99, 0x1e, 0x10, 0xbe, 0x71, 0x98, 0x30, 0x05, - 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, 0x26, 0x6f, 0x23, 0x15, 0x5a, 0x16, 0xb0, 0x7f, 0x04, 0xbb, 0x3d, 0x84, + 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0xf7, + 0x3c, 0x7f, 0xe5, 0x75, 0xd8, 0xb9, 0x06, 0xd4, 0x75, 0xff, 0xf7, 0x91, 0x2e, 0xe0, 0xe1, 0xb3, 0xcd, 0x23, 0x6c, 0x32, 0x46, + 0xcf, 0x2d, 0x85, 0x3d, 0xe3, 0x39, 0x84, 0xc1, 0xf4, 0x18, 0x17, 0xb1, 0xc5, 0xb5, 0x28, 0x01, 0x8f, 0x90, 0xe6, 0x26, 0x16, + 0xea, 0xa1, 0x87, 0x7f, 0x47, 0x14, 0xb9, 0x6f, 0xc8, 0x78, 0x6f, 0x91, 0xb3, 0x03, 0xe4, 0x46, 0xa9, 0x65, 0x09, 0xd3, 0x61, + 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, 0x04, 0x01, 0x18, 0x30, 0x04, 0x14, 0x77, + 0x7c, 0x77, 0xb6, 0x35, 0x65, 0xdc, 0x51, 0xf3, 0x02, 0x04, 0x59, 0x63, 0xc5, 0xce, 0xfc, 0xe7, 0x09, 0x2a, 0x1e, 0x30, 0x05, + 0x14, 0xe1, 0xe7, 0x6e, 0x67, 0x77, 0x85, 0x1d, 0xd7, 0x74, 0x16, 0xbd, 0xdd, 0x35, 0xec, 0x3c, 0x13, 0x7c, 0x47, 0x29, 0xdc, 0x30, 0x06, 0x1d, 0x30, 0x1b, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x01, 0x01, 0xff, 0x04, 0x11, 0x30, 0x0f, 0x81, 0x0d, 0x74, 0x65, 0x73, 0x74, 0x40, 0x63, 0x68, 0x69, 0x70, 0x2e, 0x6f, 0x72, 0x67, 0x30, 0x06, 0x22, 0x30, 0x20, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x01, 0x04, 0x14, 0x30, 0x12, 0x30, 0x10, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, - 0x86, 0x04, 0x74, 0x65, 0x73, 0x74, 0x18, 0x30, 0x0b, 0x40, 0xf1, 0x10, 0x28, 0xaa, 0x62, 0xe4, 0xe9, 0xcd, 0xab, 0xab, 0xc5, - 0x6c, 0x79, 0xc4, 0x5c, 0x4f, 0x04, 0xad, 0xc8, 0x03, 0x37, 0x68, 0x4c, 0xec, 0x78, 0xdc, 0x86, 0x0c, 0x1b, 0xe8, 0x95, 0xd2, - 0x8c, 0x3b, 0x50, 0x55, 0x63, 0xef, 0x99, 0xb2, 0x98, 0x2f, 0x7b, 0xea, 0x03, 0xf3, 0x21, 0x56, 0xec, 0x98, 0xd0, 0xe5, 0xb8, - 0xbf, 0xd1, 0x45, 0x52, 0x04, 0x52, 0xc6, 0x2a, 0x63, 0xc9, 0xb2, 0x18, + 0x86, 0x04, 0x74, 0x65, 0x73, 0x74, 0x18, 0x30, 0x0b, 0x40, 0xa7, 0xc5, 0x93, 0x9d, 0xdb, 0x18, 0x9c, 0xd8, 0x4c, 0x1e, 0x85, + 0x48, 0xbc, 0x40, 0xc2, 0xc3, 0xaf, 0xcd, 0x98, 0x19, 0x54, 0x8c, 0xf8, 0xe5, 0xc2, 0x49, 0xd2, 0x7d, 0xaa, 0x5e, 0xd8, 0x86, + 0x19, 0x70, 0x46, 0x95, 0xb7, 0x10, 0x50, 0xfe, 0x70, 0x1a, 0x5a, 0x67, 0x5a, 0x49, 0x55, 0x98, 0x1c, 0x28, 0x7f, 0x25, 0xf6, + 0x73, 0x93, 0x8b, 0x43, 0xe7, 0x71, 0x73, 0x54, 0xf6, 0xc8, 0x2e, 0x18, }; -extern const uint32_t sTestCert_Node02_07_Chip_Len = sizeof(sTestCert_Node02_07_Chip); +extern const size_t sTestCert_Node02_07_Chip_Len = sizeof(sTestCert_Node02_07_Chip); extern const uint8_t sTestCert_Node02_07_DER[] = { - 0x30, 0x82, 0x02, 0x42, 0x30, 0x82, 0x01, 0xe7, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x2a, 0x17, 0x96, 0x53, 0xd7, 0xaa, - 0x08, 0xbf, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, + 0x30, 0x82, 0x02, 0x41, 0x30, 0x82, 0x01, 0xe7, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x60, 0x78, 0x20, 0xc0, 0x15, 0xa0, + 0xd1, 0x66, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x34, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x05, 0x0c, 0x10, 0x46, 0x41, 0x42, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x44, @@ -2332,54 +2336,196 @@ extern const uint8_t sTestCert_Node02_07_DER[] = { 0x32, 0x30, 0x30, 0x30, 0x37, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x05, 0x0c, 0x10, 0x46, 0x41, 0x42, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x44, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, - 0x42, 0x00, 0x04, 0xf1, 0x1b, 0x05, 0x37, 0xf3, 0x73, 0x5c, 0xdc, 0xfa, 0xc5, 0x86, 0x15, 0xdd, 0x1b, 0x13, 0x4a, 0x83, 0x85, - 0xa4, 0x75, 0x15, 0x58, 0xfb, 0xd1, 0xfe, 0xd2, 0x55, 0x93, 0x35, 0xd0, 0xc2, 0x42, 0x6f, 0x60, 0x08, 0xf6, 0x05, 0x01, 0xf6, - 0x44, 0xa2, 0x0a, 0x8c, 0xf9, 0xc4, 0x1e, 0x82, 0x8c, 0x38, 0xa5, 0x6f, 0x56, 0x88, 0xd1, 0xfa, 0xaf, 0xd2, 0x8b, 0x21, 0x87, - 0xa8, 0xf4, 0x2e, 0x74, 0xa3, 0x81, 0xc2, 0x30, 0x81, 0xbf, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, + 0x42, 0x00, 0x04, 0xf7, 0x3c, 0x7f, 0xe5, 0x75, 0xd8, 0xb9, 0x06, 0xd4, 0x75, 0xff, 0xf7, 0x91, 0x2e, 0xe0, 0xe1, 0xb3, 0xcd, + 0x23, 0x6c, 0x32, 0x46, 0xcf, 0x2d, 0x85, 0x3d, 0xe3, 0x39, 0x84, 0xc1, 0xf4, 0x18, 0x17, 0xb1, 0xc5, 0xb5, 0x28, 0x01, 0x8f, + 0x90, 0xe6, 0x26, 0x16, 0xea, 0xa1, 0x87, 0x7f, 0x47, 0x14, 0xb9, 0x6f, 0xc8, 0x78, 0x6f, 0x91, 0xb3, 0x03, 0xe4, 0x46, 0xa9, + 0x65, 0x09, 0xd3, 0x61, 0xa3, 0x81, 0xc2, 0x30, 0x81, 0xbf, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x07, 0x80, 0x30, 0x20, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x01, 0x01, 0xff, 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, - 0x14, 0xcb, 0x58, 0x71, 0xe3, 0xad, 0x6d, 0xab, 0x0d, 0xbf, 0x29, 0xa5, 0x3c, 0xaa, 0x5b, 0x99, 0x1e, 0x10, 0xbe, 0x71, 0x98, - 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xcf, 0x42, 0xbc, 0xf8, 0xdf, 0x48, 0x09, 0xd9, - 0x26, 0x6f, 0x23, 0x15, 0x5a, 0x16, 0xb0, 0x7f, 0x04, 0xbb, 0x3d, 0x84, 0x30, 0x1b, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x01, 0x01, + 0x14, 0x77, 0x7c, 0x77, 0xb6, 0x35, 0x65, 0xdc, 0x51, 0xf3, 0x02, 0x04, 0x59, 0x63, 0xc5, 0xce, 0xfc, 0xe7, 0x09, 0x2a, 0x1e, + 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xe1, 0xe7, 0x6e, 0x67, 0x77, 0x85, 0x1d, 0xd7, + 0x74, 0x16, 0xbd, 0xdd, 0x35, 0xec, 0x3c, 0x13, 0x7c, 0x47, 0x29, 0xdc, 0x30, 0x1b, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x01, 0x01, 0xff, 0x04, 0x11, 0x30, 0x0f, 0x81, 0x0d, 0x74, 0x65, 0x73, 0x74, 0x40, 0x63, 0x68, 0x69, 0x70, 0x2e, 0x6f, 0x72, 0x67, 0x30, 0x20, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x01, 0x04, 0x14, 0x30, 0x12, 0x30, 0x10, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x86, 0x04, 0x74, 0x65, 0x73, 0x74, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, - 0x04, 0x03, 0x02, 0x03, 0x49, 0x00, 0x30, 0x46, 0x02, 0x21, 0x00, 0xf1, 0x10, 0x28, 0xaa, 0x62, 0xe4, 0xe9, 0xcd, 0xab, 0xab, - 0xc5, 0x6c, 0x79, 0xc4, 0x5c, 0x4f, 0x04, 0xad, 0xc8, 0x03, 0x37, 0x68, 0x4c, 0xec, 0x78, 0xdc, 0x86, 0x0c, 0x1b, 0xe8, 0x95, - 0xd2, 0x02, 0x21, 0x00, 0x8c, 0x3b, 0x50, 0x55, 0x63, 0xef, 0x99, 0xb2, 0x98, 0x2f, 0x7b, 0xea, 0x03, 0xf3, 0x21, 0x56, 0xec, - 0x98, 0xd0, 0xe5, 0xb8, 0xbf, 0xd1, 0x45, 0x52, 0x04, 0x52, 0xc6, 0x2a, 0x63, 0xc9, 0xb2, + 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, 0x45, 0x02, 0x21, 0x00, 0xa7, 0xc5, 0x93, 0x9d, 0xdb, 0x18, 0x9c, 0xd8, 0x4c, 0x1e, + 0x85, 0x48, 0xbc, 0x40, 0xc2, 0xc3, 0xaf, 0xcd, 0x98, 0x19, 0x54, 0x8c, 0xf8, 0xe5, 0xc2, 0x49, 0xd2, 0x7d, 0xaa, 0x5e, 0xd8, + 0x86, 0x02, 0x20, 0x19, 0x70, 0x46, 0x95, 0xb7, 0x10, 0x50, 0xfe, 0x70, 0x1a, 0x5a, 0x67, 0x5a, 0x49, 0x55, 0x98, 0x1c, 0x28, + 0x7f, 0x25, 0xf6, 0x73, 0x93, 0x8b, 0x43, 0xe7, 0x71, 0x73, 0x54, 0xf6, 0xc8, 0x2e, }; -extern const uint32_t sTestCert_Node02_07_DER_Len = sizeof(sTestCert_Node02_07_DER); +extern const size_t sTestCert_Node02_07_DER_Len = sizeof(sTestCert_Node02_07_DER); extern const uint8_t sTestCert_Node02_07_PublicKey[] = { - 0x04, 0xf1, 0x1b, 0x05, 0x37, 0xf3, 0x73, 0x5c, 0xdc, 0xfa, 0xc5, 0x86, 0x15, 0xdd, 0x1b, 0x13, 0x4a, - 0x83, 0x85, 0xa4, 0x75, 0x15, 0x58, 0xfb, 0xd1, 0xfe, 0xd2, 0x55, 0x93, 0x35, 0xd0, 0xc2, 0x42, 0x6f, - 0x60, 0x08, 0xf6, 0x05, 0x01, 0xf6, 0x44, 0xa2, 0x0a, 0x8c, 0xf9, 0xc4, 0x1e, 0x82, 0x8c, 0x38, 0xa5, - 0x6f, 0x56, 0x88, 0xd1, 0xfa, 0xaf, 0xd2, 0x8b, 0x21, 0x87, 0xa8, 0xf4, 0x2e, 0x74, + 0x04, 0xf7, 0x3c, 0x7f, 0xe5, 0x75, 0xd8, 0xb9, 0x06, 0xd4, 0x75, 0xff, 0xf7, 0x91, 0x2e, 0xe0, 0xe1, + 0xb3, 0xcd, 0x23, 0x6c, 0x32, 0x46, 0xcf, 0x2d, 0x85, 0x3d, 0xe3, 0x39, 0x84, 0xc1, 0xf4, 0x18, 0x17, + 0xb1, 0xc5, 0xb5, 0x28, 0x01, 0x8f, 0x90, 0xe6, 0x26, 0x16, 0xea, 0xa1, 0x87, 0x7f, 0x47, 0x14, 0xb9, + 0x6f, 0xc8, 0x78, 0x6f, 0x91, 0xb3, 0x03, 0xe4, 0x46, 0xa9, 0x65, 0x09, 0xd3, 0x61, }; -extern const uint8_t sTestCert_Node02_07_PublicKey_Len = sizeof(sTestCert_Node02_07_PublicKey); +extern const size_t sTestCert_Node02_07_PublicKey_Len = sizeof(sTestCert_Node02_07_PublicKey); extern const uint8_t sTestCert_Node02_07_PrivateKey[] = { - 0x4d, 0xaf, 0x14, 0x7b, 0x94, 0x9a, 0x5e, 0x6c, 0xd2, 0xc6, 0xd7, 0xaa, 0x74, 0xa6, 0x8a, 0x51, - 0x30, 0xa5, 0x5f, 0xfc, 0x69, 0x59, 0x9c, 0xd3, 0x83, 0xc0, 0xe8, 0xad, 0xd9, 0xa6, 0x07, 0xca, + 0x95, 0xa8, 0x37, 0x7f, 0xdb, 0x52, 0x56, 0x38, 0x04, 0xc0, 0x10, 0x6d, 0x11, 0x4b, 0x52, 0x74, + 0x05, 0x69, 0x37, 0x9c, 0xcd, 0xc8, 0xf5, 0x76, 0x83, 0x47, 0x3d, 0xbd, 0xbc, 0x45, 0x25, 0x40, }; -extern const uint8_t sTestCert_Node02_07_PrivateKey_Len = sizeof(sTestCert_Node02_07_PrivateKey); +extern const size_t sTestCert_Node02_07_PrivateKey_Len = sizeof(sTestCert_Node02_07_PrivateKey); extern const uint8_t sTestCert_Node02_07_SubjectKeyId[] = { - 0xCB, 0x58, 0x71, 0xE3, 0xAD, 0x6D, 0xAB, 0x0D, 0xBF, 0x29, 0xA5, 0x3C, 0xAA, 0x5B, 0x99, 0x1E, 0x10, 0xBE, 0x71, 0x98, + 0x77, 0x7C, 0x77, 0xB6, 0x35, 0x65, 0xDC, 0x51, 0xF3, 0x02, 0x04, 0x59, 0x63, 0xC5, 0xCE, 0xFC, 0xE7, 0x09, 0x2A, 0x1E, }; -extern const uint8_t sTestCert_Node02_07_SubjectKeyId_Len = sizeof(sTestCert_Node02_07_SubjectKeyId); +extern const size_t sTestCert_Node02_07_SubjectKeyId_Len = sizeof(sTestCert_Node02_07_SubjectKeyId); extern const uint8_t sTestCert_Node02_07_AuthorityKeyId[] = { - 0xCF, 0x42, 0xBC, 0xF8, 0xDF, 0x48, 0x09, 0xD9, 0x26, 0x6F, 0x23, 0x15, 0x5A, 0x16, 0xB0, 0x7F, 0x04, 0xBB, 0x3D, 0x84, + 0xE1, 0xE7, 0x6E, 0x67, 0x77, 0x85, 0x1D, 0xD7, 0x74, 0x16, 0xBD, 0xDD, 0x35, 0xEC, 0x3C, 0x13, 0x7C, 0x47, 0x29, 0xDC, +}; + +extern const size_t sTestCert_Node02_07_AuthorityKeyId_Len = sizeof(sTestCert_Node02_07_AuthorityKeyId); + +/************** Test Node02_08 Certificate ************** +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4496725963772311573 (0x3e6794707aecb815) + Signature Algorithm: ecdsa-with-SHA256 + Issuer: 1.3.6.1.4.1.37244.1.3 = CACACACA00000004, 1.3.6.1.4.1.37244.1.5 = FAB000000000001D + Validity + Not Before: Oct 15 14:23:43 2020 GMT + Not After : Oct 15 14:23:42 2040 GMT + Subject: 1.3.6.1.4.1.37244.1.6 = ABCF00A0, 1.3.6.1.4.1.37244.1.1 = DEDEDEDE00020008, 1.3.6.1.4.1.37244.1.6 = +ABCD0020, 1.3.6.1.4.1.37244.1.5 = FAB000000000001D, 1.3.6.1.4.1.37244.1.6 = ABCE0100 Subject Public Key Info: Public Key Algorithm: +id-ecPublicKey Public-Key: (256 bit) pub: 04:98:ca:97:34:da:af:f7:33:98:33:6d:c0:a4:de: + 89:2d:e6:2a:1f:96:90:23:e0:33:70:86:00:85:dc: + dc:07:2b:23:72:60:79:37:ba:3a:34:4d:94:55:46: + b4:14:f2:23:d2:72:31:c9:a8:3d:71:b3:97:b4:32: + 06:62:c0:f5:cb + ASN1 OID: prime256v1 + NIST CURVE: P-256 + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:FALSE + X509v3 Key Usage: critical + Digital Signature + X509v3 Extended Key Usage: critical + TLS Web Client Authentication, TLS Web Server Authentication + X509v3 Subject Key Identifier: + A9:C5:FD:6C:BD:38:BB:18:37:0F:8E:80:64:16:6A:FB:1E:C8:39:73 + X509v3 Authority Key Identifier: + keyid:E1:E7:6E:67:77:85:1D:D7:74:16:BD:DD:35:EC:3C:13:7C:47:29:DC + + Signature Algorithm: ecdsa-with-SHA256 + 30:46:02:21:00:bc:e8:c9:50:5a:b1:e4:b4:d1:d8:f2:c5:e5: + 26:37:a5:3e:f4:05:4a:9f:18:ef:45:94:3d:3d:23:58:fd:7e: + b9:02:21:00:cb:12:15:04:a3:dc:1d:e4:2d:c0:ae:e4:f5:11: + c0:05:67:7c:11:18:8b:44:98:78:bd:7d:69:3e:37:82:2c:47 + +-----BEGIN CERTIFICATE----- +MIICUjCCAfegAwIBAgIIPmeUcHrsuBUwCgYIKoZIzj0EAwIwRDEgMB4GCisGAQQB +gqJ8AQMMEENBQ0FDQUNBMDAwMDAwMDQxIDAeBgorBgEEAYKifAEFDBBGQUIwMDAw +MDAwMDAwMDFEMB4XDTIwMTAxNTE0MjM0M1oXDTQwMTAxNTE0MjM0MlowgZIxGDAW +BgorBgEEAYKifAEGDAhBQkNGMDBBMDEgMB4GCisGAQQBgqJ8AQEMEERFREVERURF +MDAwMjAwMDgxGDAWBgorBgEEAYKifAEGDAhBQkNEMDAyMDEgMB4GCisGAQQBgqJ8 +AQUMEEZBQjAwMDAwMDAwMDAwMUQxGDAWBgorBgEEAYKifAEGDAhBQkNFMDEwMDBZ +MBMGByqGSM49AgEGCCqGSM49AwEHA0IABJjKlzTar/czmDNtwKTeiS3mKh+WkCPg +M3CGAIXc3AcrI3JgeTe6OjRNlFVGtBTyI9JyMcmoPXGzl7QyBmLA9cujgYMwgYAw +DAYDVR0TAQH/BAIwADAOBgNVHQ8BAf8EBAMCB4AwIAYDVR0lAQH/BBYwFAYIKwYB +BQUHAwIGCCsGAQUFBwMBMB0GA1UdDgQWBBSpxf1svTi7GDcPjoBkFmr7Hsg5czAf +BgNVHSMEGDAWgBTh525nd4Ud13QWvd017DwTfEcp3DAKBggqhkjOPQQDAgNJADBG +AiEAvOjJUFqx5LTR2PLF5SY3pT70BUqfGO9FlD09I1j9frkCIQDLEhUEo9wd5C3A +ruT1EcAFZ3wRGItEmHi9fWk+N4IsRw== +-----END CERTIFICATE----- + +-----BEGIN EC PRIVATE KEY----- +MHcCAQEEIN+LEDQYW7Dtm8w5ta/A7JvVb0p2XemfaZuwmvbPOvdvoAoGCCqGSM49 +AwEHoUQDQgAEmMqXNNqv9zOYM23ApN6JLeYqH5aQI+AzcIYAhdzcBysjcmB5N7o6 +NE2UVUa0FPIj0nIxyag9cbOXtDIGYsD1yw== +-----END EC PRIVATE KEY----- +*/ + +extern const uint8_t sTestCert_Node02_08_Chip[] = { + 0x15, 0x30, 0x01, 0x08, 0x3e, 0x67, 0x94, 0x70, 0x7a, 0xec, 0xb8, 0x15, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, + 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, + 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x26, 0x16, 0xa0, 0x00, 0xcf, 0xab, 0x27, 0x11, + 0x08, 0x00, 0x02, 0x00, 0xde, 0xde, 0xde, 0xde, 0x26, 0x16, 0x20, 0x00, 0xcd, 0xab, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xb0, 0xfa, 0x26, 0x16, 0x00, 0x01, 0xce, 0xab, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, + 0x04, 0x98, 0xca, 0x97, 0x34, 0xda, 0xaf, 0xf7, 0x33, 0x98, 0x33, 0x6d, 0xc0, 0xa4, 0xde, 0x89, 0x2d, 0xe6, 0x2a, 0x1f, + 0x96, 0x90, 0x23, 0xe0, 0x33, 0x70, 0x86, 0x00, 0x85, 0xdc, 0xdc, 0x07, 0x2b, 0x23, 0x72, 0x60, 0x79, 0x37, 0xba, 0x3a, + 0x34, 0x4d, 0x94, 0x55, 0x46, 0xb4, 0x14, 0xf2, 0x23, 0xd2, 0x72, 0x31, 0xc9, 0xa8, 0x3d, 0x71, 0xb3, 0x97, 0xb4, 0x32, + 0x06, 0x62, 0xc0, 0xf5, 0xcb, 0x37, 0x0a, 0x35, 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, 0x04, + 0x01, 0x18, 0x30, 0x04, 0x14, 0xa9, 0xc5, 0xfd, 0x6c, 0xbd, 0x38, 0xbb, 0x18, 0x37, 0x0f, 0x8e, 0x80, 0x64, 0x16, 0x6a, + 0xfb, 0x1e, 0xc8, 0x39, 0x73, 0x30, 0x05, 0x14, 0xe1, 0xe7, 0x6e, 0x67, 0x77, 0x85, 0x1d, 0xd7, 0x74, 0x16, 0xbd, 0xdd, + 0x35, 0xec, 0x3c, 0x13, 0x7c, 0x47, 0x29, 0xdc, 0x18, 0x30, 0x0b, 0x40, 0xbc, 0xe8, 0xc9, 0x50, 0x5a, 0xb1, 0xe4, 0xb4, + 0xd1, 0xd8, 0xf2, 0xc5, 0xe5, 0x26, 0x37, 0xa5, 0x3e, 0xf4, 0x05, 0x4a, 0x9f, 0x18, 0xef, 0x45, 0x94, 0x3d, 0x3d, 0x23, + 0x58, 0xfd, 0x7e, 0xb9, 0xcb, 0x12, 0x15, 0x04, 0xa3, 0xdc, 0x1d, 0xe4, 0x2d, 0xc0, 0xae, 0xe4, 0xf5, 0x11, 0xc0, 0x05, + 0x67, 0x7c, 0x11, 0x18, 0x8b, 0x44, 0x98, 0x78, 0xbd, 0x7d, 0x69, 0x3e, 0x37, 0x82, 0x2c, 0x47, 0x18, +}; + +extern const size_t sTestCert_Node02_08_Chip_Len = sizeof(sTestCert_Node02_08_Chip); + +extern const uint8_t sTestCert_Node02_08_DER[] = { + 0x30, 0x82, 0x02, 0x52, 0x30, 0x82, 0x01, 0xf7, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x3e, 0x67, 0x94, 0x70, 0x7a, 0xec, + 0xb8, 0x15, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, + 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x34, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, + 0x7c, 0x01, 0x05, 0x0c, 0x10, 0x46, 0x41, 0x42, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x44, + 0x30, 0x1e, 0x17, 0x0d, 0x32, 0x30, 0x31, 0x30, 0x31, 0x35, 0x31, 0x34, 0x32, 0x33, 0x34, 0x33, 0x5a, 0x17, 0x0d, 0x34, 0x30, + 0x31, 0x30, 0x31, 0x35, 0x31, 0x34, 0x32, 0x33, 0x34, 0x32, 0x5a, 0x30, 0x81, 0x92, 0x31, 0x18, 0x30, 0x16, 0x06, 0x0a, 0x2b, + 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x06, 0x0c, 0x08, 0x41, 0x42, 0x43, 0x46, 0x30, 0x30, 0x41, 0x30, 0x31, 0x20, + 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x01, 0x0c, 0x10, 0x44, 0x45, 0x44, 0x45, 0x44, + 0x45, 0x44, 0x45, 0x30, 0x30, 0x30, 0x32, 0x30, 0x30, 0x30, 0x38, 0x31, 0x18, 0x30, 0x16, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, + 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x06, 0x0c, 0x08, 0x41, 0x42, 0x43, 0x44, 0x30, 0x30, 0x32, 0x30, 0x31, 0x20, 0x30, 0x1e, 0x06, + 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x05, 0x0c, 0x10, 0x46, 0x41, 0x42, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x44, 0x31, 0x18, 0x30, 0x16, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, + 0x7c, 0x01, 0x06, 0x0c, 0x08, 0x41, 0x42, 0x43, 0x45, 0x30, 0x31, 0x30, 0x30, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, + 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x98, 0xca, + 0x97, 0x34, 0xda, 0xaf, 0xf7, 0x33, 0x98, 0x33, 0x6d, 0xc0, 0xa4, 0xde, 0x89, 0x2d, 0xe6, 0x2a, 0x1f, 0x96, 0x90, 0x23, 0xe0, + 0x33, 0x70, 0x86, 0x00, 0x85, 0xdc, 0xdc, 0x07, 0x2b, 0x23, 0x72, 0x60, 0x79, 0x37, 0xba, 0x3a, 0x34, 0x4d, 0x94, 0x55, 0x46, + 0xb4, 0x14, 0xf2, 0x23, 0xd2, 0x72, 0x31, 0xc9, 0xa8, 0x3d, 0x71, 0xb3, 0x97, 0xb4, 0x32, 0x06, 0x62, 0xc0, 0xf5, 0xcb, 0xa3, + 0x81, 0x83, 0x30, 0x81, 0x80, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0e, + 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x07, 0x80, 0x30, 0x20, 0x06, 0x03, 0x55, 0x1d, 0x25, + 0x01, 0x01, 0xff, 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x06, 0x08, 0x2b, 0x06, + 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xa9, 0xc5, 0xfd, 0x6c, + 0xbd, 0x38, 0xbb, 0x18, 0x37, 0x0f, 0x8e, 0x80, 0x64, 0x16, 0x6a, 0xfb, 0x1e, 0xc8, 0x39, 0x73, 0x30, 0x1f, 0x06, 0x03, 0x55, + 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xe1, 0xe7, 0x6e, 0x67, 0x77, 0x85, 0x1d, 0xd7, 0x74, 0x16, 0xbd, 0xdd, 0x35, + 0xec, 0x3c, 0x13, 0x7c, 0x47, 0x29, 0xdc, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x49, + 0x00, 0x30, 0x46, 0x02, 0x21, 0x00, 0xbc, 0xe8, 0xc9, 0x50, 0x5a, 0xb1, 0xe4, 0xb4, 0xd1, 0xd8, 0xf2, 0xc5, 0xe5, 0x26, 0x37, + 0xa5, 0x3e, 0xf4, 0x05, 0x4a, 0x9f, 0x18, 0xef, 0x45, 0x94, 0x3d, 0x3d, 0x23, 0x58, 0xfd, 0x7e, 0xb9, 0x02, 0x21, 0x00, 0xcb, + 0x12, 0x15, 0x04, 0xa3, 0xdc, 0x1d, 0xe4, 0x2d, 0xc0, 0xae, 0xe4, 0xf5, 0x11, 0xc0, 0x05, 0x67, 0x7c, 0x11, 0x18, 0x8b, 0x44, + 0x98, 0x78, 0xbd, 0x7d, 0x69, 0x3e, 0x37, 0x82, 0x2c, 0x47, +}; + +extern const size_t sTestCert_Node02_08_DER_Len = sizeof(sTestCert_Node02_08_DER); + +extern const uint8_t sTestCert_Node02_08_PublicKey[] = { + 0x04, 0x98, 0xca, 0x97, 0x34, 0xda, 0xaf, 0xf7, 0x33, 0x98, 0x33, 0x6d, 0xc0, 0xa4, 0xde, 0x89, 0x2d, + 0xe6, 0x2a, 0x1f, 0x96, 0x90, 0x23, 0xe0, 0x33, 0x70, 0x86, 0x00, 0x85, 0xdc, 0xdc, 0x07, 0x2b, 0x23, + 0x72, 0x60, 0x79, 0x37, 0xba, 0x3a, 0x34, 0x4d, 0x94, 0x55, 0x46, 0xb4, 0x14, 0xf2, 0x23, 0xd2, 0x72, + 0x31, 0xc9, 0xa8, 0x3d, 0x71, 0xb3, 0x97, 0xb4, 0x32, 0x06, 0x62, 0xc0, 0xf5, 0xcb, +}; + +extern const size_t sTestCert_Node02_08_PublicKey_Len = sizeof(sTestCert_Node02_08_PublicKey); + +extern const uint8_t sTestCert_Node02_08_PrivateKey[] = { + 0xdf, 0x8b, 0x10, 0x34, 0x18, 0x5b, 0xb0, 0xed, 0x9b, 0xcc, 0x39, 0xb5, 0xaf, 0xc0, 0xec, 0x9b, + 0xd5, 0x6f, 0x4a, 0x76, 0x5d, 0xe9, 0x9f, 0x69, 0x9b, 0xb0, 0x9a, 0xf6, 0xcf, 0x3a, 0xf7, 0x6f, +}; + +extern const size_t sTestCert_Node02_08_PrivateKey_Len = sizeof(sTestCert_Node02_08_PrivateKey); + +extern const uint8_t sTestCert_Node02_08_SubjectKeyId[] = { + 0xA9, 0xC5, 0xFD, 0x6C, 0xBD, 0x38, 0xBB, 0x18, 0x37, 0x0F, 0x8E, 0x80, 0x64, 0x16, 0x6A, 0xFB, 0x1E, 0xC8, 0x39, 0x73, +}; + +extern const size_t sTestCert_Node02_08_SubjectKeyId_Len = sizeof(sTestCert_Node02_08_SubjectKeyId); + +extern const uint8_t sTestCert_Node02_08_AuthorityKeyId[] = { + 0xE1, 0xE7, 0x6E, 0x67, 0x77, 0x85, 0x1D, 0xD7, 0x74, 0x16, 0xBD, 0xDD, 0x35, 0xEC, 0x3C, 0x13, 0x7C, 0x47, 0x29, 0xDC, }; -extern const uint8_t sTestCert_Node02_07_AuthorityKeyId_Len = sizeof(sTestCert_Node02_07_AuthorityKeyId); +extern const size_t sTestCert_Node02_08_AuthorityKeyId_Len = sizeof(sTestCert_Node02_08_AuthorityKeyId); } // namespace TestCerts } // namespace chip diff --git a/src/credentials/tests/CHIPCert_test_vectors.h b/src/credentials/tests/CHIPCert_test_vectors.h index 03208e89200607..a226ddde841bac 100644 --- a/src/credentials/tests/CHIPCert_test_vectors.h +++ b/src/credentials/tests/CHIPCert_test_vectors.h @@ -54,6 +54,7 @@ enum TestCert kNode02_05 = 13, kNode02_06 = 14, kNode02_07 = 15, + kNode02_08 = 16, }; // Special flags to alter how certificates are fetched/loaded. @@ -81,202 +82,215 @@ extern const size_t gNumTestCerts; // ------------------------------ DECLARATIONS ---------------------------------------- extern const uint8_t sTestCert_Root01_Chip[]; -extern const uint32_t sTestCert_Root01_Chip_Len; +extern const size_t sTestCert_Root01_Chip_Len; extern const uint8_t sTestCert_Root01_DER[]; -extern const uint32_t sTestCert_Root01_DER_Len; +extern const size_t sTestCert_Root01_DER_Len; extern const uint8_t sTestCert_Root01_PublicKey[]; -extern const uint8_t sTestCert_Root01_PublicKey_Len; +extern const size_t sTestCert_Root01_PublicKey_Len; extern const uint8_t sTestCert_Root01_PrivateKey[]; -extern const uint8_t sTestCert_Root01_PrivateKey_Len; +extern const size_t sTestCert_Root01_PrivateKey_Len; extern const uint8_t sTestCert_Root01_SubjectKeyId[]; -extern const uint8_t sTestCert_Root01_SubjectKeyId_Len; +extern const size_t sTestCert_Root01_SubjectKeyId_Len; extern const uint8_t sTestCert_Root01_AuthorityKeyId[]; -extern const uint8_t sTestCert_Root01_AuthorityKeyId_Len; +extern const size_t sTestCert_Root01_AuthorityKeyId_Len; extern const uint8_t sTestCert_Root02_Chip[]; -extern const uint32_t sTestCert_Root02_Chip_Len; +extern const size_t sTestCert_Root02_Chip_Len; extern const uint8_t sTestCert_Root02_DER[]; -extern const uint32_t sTestCert_Root02_DER_Len; +extern const size_t sTestCert_Root02_DER_Len; extern const uint8_t sTestCert_Root02_PublicKey[]; -extern const uint8_t sTestCert_Root02_PublicKey_Len; +extern const size_t sTestCert_Root02_PublicKey_Len; extern const uint8_t sTestCert_Root02_PrivateKey[]; -extern const uint8_t sTestCert_Root02_PrivateKey_Len; +extern const size_t sTestCert_Root02_PrivateKey_Len; extern const uint8_t sTestCert_Root02_SubjectKeyId[]; -extern const uint8_t sTestCert_Root02_SubjectKeyId_Len; +extern const size_t sTestCert_Root02_SubjectKeyId_Len; extern const uint8_t sTestCert_Root02_AuthorityKeyId[]; -extern const uint8_t sTestCert_Root02_AuthorityKeyId_Len; +extern const size_t sTestCert_Root02_AuthorityKeyId_Len; extern const uint8_t sTestCert_ICA01_Chip[]; -extern const uint32_t sTestCert_ICA01_Chip_Len; +extern const size_t sTestCert_ICA01_Chip_Len; extern const uint8_t sTestCert_ICA01_DER[]; -extern const uint32_t sTestCert_ICA01_DER_Len; +extern const size_t sTestCert_ICA01_DER_Len; extern const uint8_t sTestCert_ICA01_PublicKey[]; -extern const uint8_t sTestCert_ICA01_PublicKey_Len; +extern const size_t sTestCert_ICA01_PublicKey_Len; extern const uint8_t sTestCert_ICA01_PrivateKey[]; -extern const uint8_t sTestCert_ICA01_PrivateKey_Len; +extern const size_t sTestCert_ICA01_PrivateKey_Len; extern const uint8_t sTestCert_ICA01_SubjectKeyId[]; -extern const uint8_t sTestCert_ICA01_SubjectKeyId_Len; +extern const size_t sTestCert_ICA01_SubjectKeyId_Len; extern const uint8_t sTestCert_ICA01_AuthorityKeyId[]; -extern const uint8_t sTestCert_ICA01_AuthorityKeyId_Len; +extern const size_t sTestCert_ICA01_AuthorityKeyId_Len; extern const uint8_t sTestCert_ICA02_Chip[]; -extern const uint32_t sTestCert_ICA02_Chip_Len; +extern const size_t sTestCert_ICA02_Chip_Len; extern const uint8_t sTestCert_ICA02_DER[]; -extern const uint32_t sTestCert_ICA02_DER_Len; +extern const size_t sTestCert_ICA02_DER_Len; extern const uint8_t sTestCert_ICA02_PublicKey[]; -extern const uint8_t sTestCert_ICA02_PublicKey_Len; +extern const size_t sTestCert_ICA02_PublicKey_Len; extern const uint8_t sTestCert_ICA02_PrivateKey[]; -extern const uint8_t sTestCert_ICA02_PrivateKey_Len; +extern const size_t sTestCert_ICA02_PrivateKey_Len; extern const uint8_t sTestCert_ICA02_SubjectKeyId[]; -extern const uint8_t sTestCert_ICA02_SubjectKeyId_Len; +extern const size_t sTestCert_ICA02_SubjectKeyId_Len; extern const uint8_t sTestCert_ICA02_AuthorityKeyId[]; -extern const uint8_t sTestCert_ICA02_AuthorityKeyId_Len; +extern const size_t sTestCert_ICA02_AuthorityKeyId_Len; extern const uint8_t sTestCert_ICA01_1_Chip[]; -extern const uint32_t sTestCert_ICA01_1_Chip_Len; +extern const size_t sTestCert_ICA01_1_Chip_Len; extern const uint8_t sTestCert_ICA01_1_DER[]; -extern const uint32_t sTestCert_ICA01_1_DER_Len; +extern const size_t sTestCert_ICA01_1_DER_Len; extern const uint8_t sTestCert_ICA01_1_PublicKey[]; -extern const uint8_t sTestCert_ICA01_1_PublicKey_Len; +extern const size_t sTestCert_ICA01_1_PublicKey_Len; extern const uint8_t sTestCert_ICA01_1_PrivateKey[]; -extern const uint8_t sTestCert_ICA01_1_PrivateKey_Len; +extern const size_t sTestCert_ICA01_1_PrivateKey_Len; extern const uint8_t sTestCert_ICA01_1_SubjectKeyId[]; -extern const uint8_t sTestCert_ICA01_1_SubjectKeyId_Len; +extern const size_t sTestCert_ICA01_1_SubjectKeyId_Len; extern const uint8_t sTestCert_ICA01_1_AuthorityKeyId[]; -extern const uint8_t sTestCert_ICA01_1_AuthorityKeyId_Len; +extern const size_t sTestCert_ICA01_1_AuthorityKeyId_Len; extern const uint8_t sTestCert_FWSign01_Chip[]; -extern const uint32_t sTestCert_FWSign01_Chip_Len; +extern const size_t sTestCert_FWSign01_Chip_Len; extern const uint8_t sTestCert_FWSign01_DER[]; -extern const uint32_t sTestCert_FWSign01_DER_Len; +extern const size_t sTestCert_FWSign01_DER_Len; extern const uint8_t sTestCert_FWSign01_PublicKey[]; -extern const uint8_t sTestCert_FWSign01_PublicKey_Len; +extern const size_t sTestCert_FWSign01_PublicKey_Len; extern const uint8_t sTestCert_FWSign01_PrivateKey[]; -extern const uint8_t sTestCert_FWSign01_PrivateKey_Len; +extern const size_t sTestCert_FWSign01_PrivateKey_Len; extern const uint8_t sTestCert_FWSign01_SubjectKeyId[]; -extern const uint8_t sTestCert_FWSign01_SubjectKeyId_Len; +extern const size_t sTestCert_FWSign01_SubjectKeyId_Len; extern const uint8_t sTestCert_FWSign01_AuthorityKeyId[]; -extern const uint8_t sTestCert_FWSign01_AuthorityKeyId_Len; +extern const size_t sTestCert_FWSign01_AuthorityKeyId_Len; extern const uint8_t sTestCert_Node01_01_Chip[]; -extern const uint32_t sTestCert_Node01_01_Chip_Len; +extern const size_t sTestCert_Node01_01_Chip_Len; extern const uint8_t sTestCert_Node01_01_DER[]; -extern const uint32_t sTestCert_Node01_01_DER_Len; +extern const size_t sTestCert_Node01_01_DER_Len; extern const uint8_t sTestCert_Node01_01_PublicKey[]; -extern const uint8_t sTestCert_Node01_01_PublicKey_Len; +extern const size_t sTestCert_Node01_01_PublicKey_Len; extern const uint8_t sTestCert_Node01_01_PrivateKey[]; -extern const uint8_t sTestCert_Node01_01_PrivateKey_Len; +extern const size_t sTestCert_Node01_01_PrivateKey_Len; extern const uint8_t sTestCert_Node01_01_SubjectKeyId[]; -extern const uint8_t sTestCert_Node01_01_SubjectKeyId_Len; +extern const size_t sTestCert_Node01_01_SubjectKeyId_Len; extern const uint8_t sTestCert_Node01_01_AuthorityKeyId[]; -extern const uint8_t sTestCert_Node01_01_AuthorityKeyId_Len; +extern const size_t sTestCert_Node01_01_AuthorityKeyId_Len; extern const uint8_t sTestCert_Node01_01_Err01_Chip[]; -extern const uint32_t sTestCert_Node01_01_Err01_Chip_Len; +extern const size_t sTestCert_Node01_01_Err01_Chip_Len; extern const uint8_t sTestCert_Node01_02_Chip[]; -extern const uint32_t sTestCert_Node01_02_Chip_Len; +extern const size_t sTestCert_Node01_02_Chip_Len; extern const uint8_t sTestCert_Node01_02_DER[]; -extern const uint32_t sTestCert_Node01_02_DER_Len; +extern const size_t sTestCert_Node01_02_DER_Len; extern const uint8_t sTestCert_Node01_02_PublicKey[]; -extern const uint8_t sTestCert_Node01_02_PublicKey_Len; +extern const size_t sTestCert_Node01_02_PublicKey_Len; extern const uint8_t sTestCert_Node01_02_PrivateKey[]; -extern const uint8_t sTestCert_Node01_02_PrivateKey_Len; +extern const size_t sTestCert_Node01_02_PrivateKey_Len; extern const uint8_t sTestCert_Node01_02_SubjectKeyId[]; -extern const uint8_t sTestCert_Node01_02_SubjectKeyId_Len; +extern const size_t sTestCert_Node01_02_SubjectKeyId_Len; extern const uint8_t sTestCert_Node01_02_AuthorityKeyId[]; -extern const uint8_t sTestCert_Node01_02_AuthorityKeyId_Len; +extern const size_t sTestCert_Node01_02_AuthorityKeyId_Len; extern const uint8_t sTestCert_Node02_01_Chip[]; -extern const uint32_t sTestCert_Node02_01_Chip_Len; +extern const size_t sTestCert_Node02_01_Chip_Len; extern const uint8_t sTestCert_Node02_01_DER[]; -extern const uint32_t sTestCert_Node02_01_DER_Len; +extern const size_t sTestCert_Node02_01_DER_Len; extern const uint8_t sTestCert_Node02_01_PublicKey[]; -extern const uint8_t sTestCert_Node02_01_PublicKey_Len; +extern const size_t sTestCert_Node02_01_PublicKey_Len; extern const uint8_t sTestCert_Node02_01_PrivateKey[]; -extern const uint8_t sTestCert_Node02_01_PrivateKey_Len; +extern const size_t sTestCert_Node02_01_PrivateKey_Len; extern const uint8_t sTestCert_Node02_01_SubjectKeyId[]; -extern const uint8_t sTestCert_Node02_01_SubjectKeyId_Len; +extern const size_t sTestCert_Node02_01_SubjectKeyId_Len; extern const uint8_t sTestCert_Node02_01_AuthorityKeyId[]; -extern const uint8_t sTestCert_Node02_01_AuthorityKeyId_Len; +extern const size_t sTestCert_Node02_01_AuthorityKeyId_Len; extern const uint8_t sTestCert_Node02_02_Chip[]; -extern const uint32_t sTestCert_Node02_02_Chip_Len; +extern const size_t sTestCert_Node02_02_Chip_Len; extern const uint8_t sTestCert_Node02_02_DER[]; -extern const uint32_t sTestCert_Node02_02_DER_Len; +extern const size_t sTestCert_Node02_02_DER_Len; extern const uint8_t sTestCert_Node02_02_PublicKey[]; -extern const uint8_t sTestCert_Node02_02_PublicKey_Len; +extern const size_t sTestCert_Node02_02_PublicKey_Len; extern const uint8_t sTestCert_Node02_02_PrivateKey[]; -extern const uint8_t sTestCert_Node02_02_PrivateKey_Len; +extern const size_t sTestCert_Node02_02_PrivateKey_Len; extern const uint8_t sTestCert_Node02_02_SubjectKeyId[]; -extern const uint8_t sTestCert_Node02_02_SubjectKeyId_Len; +extern const size_t sTestCert_Node02_02_SubjectKeyId_Len; extern const uint8_t sTestCert_Node02_02_AuthorityKeyId[]; -extern const uint8_t sTestCert_Node02_02_AuthorityKeyId_Len; +extern const size_t sTestCert_Node02_02_AuthorityKeyId_Len; extern const uint8_t sTestCert_Node02_03_Chip[]; -extern const uint32_t sTestCert_Node02_03_Chip_Len; +extern const size_t sTestCert_Node02_03_Chip_Len; extern const uint8_t sTestCert_Node02_03_DER[]; -extern const uint32_t sTestCert_Node02_03_DER_Len; +extern const size_t sTestCert_Node02_03_DER_Len; extern const uint8_t sTestCert_Node02_03_PublicKey[]; -extern const uint8_t sTestCert_Node02_03_PublicKey_Len; +extern const size_t sTestCert_Node02_03_PublicKey_Len; extern const uint8_t sTestCert_Node02_03_PrivateKey[]; -extern const uint8_t sTestCert_Node02_03_PrivateKey_Len; +extern const size_t sTestCert_Node02_03_PrivateKey_Len; extern const uint8_t sTestCert_Node02_03_SubjectKeyId[]; -extern const uint8_t sTestCert_Node02_03_SubjectKeyId_Len; +extern const size_t sTestCert_Node02_03_SubjectKeyId_Len; extern const uint8_t sTestCert_Node02_03_AuthorityKeyId[]; -extern const uint8_t sTestCert_Node02_03_AuthorityKeyId_Len; +extern const size_t sTestCert_Node02_03_AuthorityKeyId_Len; extern const uint8_t sTestCert_Node02_04_Chip[]; -extern const uint32_t sTestCert_Node02_04_Chip_Len; +extern const size_t sTestCert_Node02_04_Chip_Len; extern const uint8_t sTestCert_Node02_04_DER[]; -extern const uint32_t sTestCert_Node02_04_DER_Len; +extern const size_t sTestCert_Node02_04_DER_Len; extern const uint8_t sTestCert_Node02_04_PublicKey[]; -extern const uint8_t sTestCert_Node02_04_PublicKey_Len; +extern const size_t sTestCert_Node02_04_PublicKey_Len; extern const uint8_t sTestCert_Node02_04_PrivateKey[]; -extern const uint8_t sTestCert_Node02_04_PrivateKey_Len; +extern const size_t sTestCert_Node02_04_PrivateKey_Len; extern const uint8_t sTestCert_Node02_04_SubjectKeyId[]; -extern const uint8_t sTestCert_Node02_04_SubjectKeyId_Len; +extern const size_t sTestCert_Node02_04_SubjectKeyId_Len; extern const uint8_t sTestCert_Node02_04_AuthorityKeyId[]; -extern const uint8_t sTestCert_Node02_04_AuthorityKeyId_Len; +extern const size_t sTestCert_Node02_04_AuthorityKeyId_Len; extern const uint8_t sTestCert_Node02_05_Chip[]; -extern const uint32_t sTestCert_Node02_05_Chip_Len; +extern const size_t sTestCert_Node02_05_Chip_Len; extern const uint8_t sTestCert_Node02_05_DER[]; -extern const uint32_t sTestCert_Node02_05_DER_Len; +extern const size_t sTestCert_Node02_05_DER_Len; extern const uint8_t sTestCert_Node02_05_PublicKey[]; -extern const uint8_t sTestCert_Node02_05_PublicKey_Len; +extern const size_t sTestCert_Node02_05_PublicKey_Len; extern const uint8_t sTestCert_Node02_05_PrivateKey[]; -extern const uint8_t sTestCert_Node02_05_PrivateKey_Len; +extern const size_t sTestCert_Node02_05_PrivateKey_Len; extern const uint8_t sTestCert_Node02_05_SubjectKeyId[]; -extern const uint8_t sTestCert_Node02_05_SubjectKeyId_Len; +extern const size_t sTestCert_Node02_05_SubjectKeyId_Len; extern const uint8_t sTestCert_Node02_05_AuthorityKeyId[]; -extern const uint8_t sTestCert_Node02_05_AuthorityKeyId_Len; +extern const size_t sTestCert_Node02_05_AuthorityKeyId_Len; extern const uint8_t sTestCert_Node02_06_Chip[]; -extern const uint32_t sTestCert_Node02_06_Chip_Len; +extern const size_t sTestCert_Node02_06_Chip_Len; extern const uint8_t sTestCert_Node02_06_DER[]; -extern const uint32_t sTestCert_Node02_06_DER_Len; +extern const size_t sTestCert_Node02_06_DER_Len; extern const uint8_t sTestCert_Node02_06_PublicKey[]; -extern const uint8_t sTestCert_Node02_06_PublicKey_Len; +extern const size_t sTestCert_Node02_06_PublicKey_Len; extern const uint8_t sTestCert_Node02_06_PrivateKey[]; -extern const uint8_t sTestCert_Node02_06_PrivateKey_Len; +extern const size_t sTestCert_Node02_06_PrivateKey_Len; extern const uint8_t sTestCert_Node02_06_SubjectKeyId[]; -extern const uint8_t sTestCert_Node02_06_SubjectKeyId_Len; +extern const size_t sTestCert_Node02_06_SubjectKeyId_Len; extern const uint8_t sTestCert_Node02_06_AuthorityKeyId[]; -extern const uint8_t sTestCert_Node02_06_AuthorityKeyId_Len; +extern const size_t sTestCert_Node02_06_AuthorityKeyId_Len; extern const uint8_t sTestCert_Node02_07_Chip[]; -extern const uint32_t sTestCert_Node02_07_Chip_Len; +extern const size_t sTestCert_Node02_07_Chip_Len; extern const uint8_t sTestCert_Node02_07_DER[]; -extern const uint32_t sTestCert_Node02_07_DER_Len; +extern const size_t sTestCert_Node02_07_DER_Len; extern const uint8_t sTestCert_Node02_07_PublicKey[]; -extern const uint8_t sTestCert_Node02_07_PublicKey_Len; +extern const size_t sTestCert_Node02_07_PublicKey_Len; extern const uint8_t sTestCert_Node02_07_PrivateKey[]; -extern const uint8_t sTestCert_Node02_07_PrivateKey_Len; +extern const size_t sTestCert_Node02_07_PrivateKey_Len; extern const uint8_t sTestCert_Node02_07_SubjectKeyId[]; -extern const uint8_t sTestCert_Node02_07_SubjectKeyId_Len; +extern const size_t sTestCert_Node02_07_SubjectKeyId_Len; extern const uint8_t sTestCert_Node02_07_AuthorityKeyId[]; -extern const uint8_t sTestCert_Node02_07_AuthorityKeyId_Len; +extern const size_t sTestCert_Node02_07_AuthorityKeyId_Len; + +extern const uint8_t sTestCert_Node02_08_Chip[]; +extern const size_t sTestCert_Node02_08_Chip_Len; +extern const uint8_t sTestCert_Node02_08_DER[]; +extern const size_t sTestCert_Node02_08_DER_Len; +extern const uint8_t sTestCert_Node02_08_PublicKey[]; +extern const size_t sTestCert_Node02_08_PublicKey_Len; +extern const uint8_t sTestCert_Node02_08_PrivateKey[]; +extern const size_t sTestCert_Node02_08_PrivateKey_Len; +extern const uint8_t sTestCert_Node02_08_SubjectKeyId[]; +extern const size_t sTestCert_Node02_08_SubjectKeyId_Len; +extern const uint8_t sTestCert_Node02_08_AuthorityKeyId[]; +extern const size_t sTestCert_Node02_08_AuthorityKeyId_Len; } // namespace TestCerts } // namespace chip diff --git a/src/credentials/tests/TestChipCert.cpp b/src/credentials/tests/TestChipCert.cpp index 2d3f166ed31f8a..034db14064336c 100644 --- a/src/credentials/tests/TestChipCert.cpp +++ b/src/credentials/tests/TestChipCert.cpp @@ -1039,6 +1039,7 @@ static void TestChipCert_ExtractPeerId(nlTestSuite * inSuite, void * inContext) { TestCert::kNode02_05, TestCert::kICA02, 0xDEDEDEDE00020005, 0xFAB000000000001D }, { TestCert::kNode02_06, TestCert::kICA02, 0xDEDEDEDE00020006, 0xFAB000000000001D }, { TestCert::kNode02_07, TestCert::kICA02, 0xDEDEDEDE00020007, 0xFAB000000000001D }, + { TestCert::kNode02_08, TestCert::kICA02, 0xDEDEDEDE00020008, 0xFAB000000000001D }, }; // clang-format on @@ -1107,6 +1108,80 @@ static void TestChipCert_ExtractPeerId(nlTestSuite * inSuite, void * inContext) } } +static void TestChipCert_ExtractCATsFromOpCert(nlTestSuite * inSuite, void * inContext) +{ + struct TestCase + { + uint8_t Cert; + uint32_t ExpectedCAT[kMaxSubjectCATAttributeCount]; + }; + + // clang-format off + static constexpr TestCase sTestCases[] = { + // Cert CATs + // ============================================================= + { TestCert::kNode01_01, { 0, 0, 0 } }, + { TestCert::kNode01_02, { 0, 0, 0 } }, + { TestCert::kNode02_01, { 0, 0, 0 } }, + { TestCert::kNode02_02, { 0, 0, 0 } }, + { TestCert::kNode02_03, { 0xABCD0001, 0, 0 } }, + { TestCert::kNode02_04, { 0xABCE1002, 0xABCD0003, 0 } }, + { TestCert::kNode02_05, { 0xABCD0010, 0xABCE1008, 0 } }, + { TestCert::kNode02_06, { 0, 0, 0 } }, + { TestCert::kNode02_07, { 0, 0, 0 } }, + { TestCert::kNode02_08, { 0xABCF00A0, 0xABCD0020, 0xABCE0100 } }, + }; + // clang-format on + + // Test extraction from the raw ByteSpan form. + ChipCertificateSet certSet; + for (auto & testCase : sTestCases) + { + CHIP_ERROR err = certSet.Init(1); + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + + err = LoadTestCert(certSet, testCase.Cert, sNullLoadFlag, sNullDecodeFlag); + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + + uint32_t cats[kMaxSubjectCATAttributeCount]; + err = ExtractCATsFromOpCert(certSet.GetCertSet()[0], cats, ArraySize(cats)); + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + NL_TEST_ASSERT(inSuite, memcmp(cats, testCase.ExpectedCAT, sizeof(cats)) == 0); + + certSet.Release(); + } + + // Error case: trying to extract CAT from Root Cert. + { + CHIP_ERROR err = certSet.Init(1); + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + + err = LoadTestCert(certSet, TestCert::kRoot01, sNullLoadFlag, sNullDecodeFlag); + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + + uint32_t cats[kMaxSubjectCATAttributeCount]; + err = ExtractCATsFromOpCert(certSet.GetCertSet()[0], cats, ArraySize(cats)); + NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INVALID_ARGUMENT); + + certSet.Release(); + } + + // Error case: CAT array is too small. + { + CHIP_ERROR err = certSet.Init(1); + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + + err = LoadTestCert(certSet, TestCert::kNode02_08, sNullLoadFlag, sNullDecodeFlag); + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + + uint32_t cats[kMaxSubjectCATAttributeCount - 1]; + err = ExtractCATsFromOpCert(certSet.GetCertSet()[0], cats, ArraySize(cats)); + NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_BUFFER_TOO_SMALL); + + certSet.Release(); + } +} + static void TestChipCert_ExtractPublicKeyAndSKID(nlTestSuite * inSuite, void * inContext) { struct TestCase @@ -1134,6 +1209,7 @@ static void TestChipCert_ExtractPublicKeyAndSKID(nlTestSuite * inSuite, void * i { TestCert::kNode02_05, sTestCert_Node02_05_PublicKey, sTestCert_Node02_05_SubjectKeyId }, { TestCert::kNode02_06, sTestCert_Node02_06_PublicKey, sTestCert_Node02_06_SubjectKeyId }, { TestCert::kNode02_07, sTestCert_Node02_07_PublicKey, sTestCert_Node02_07_SubjectKeyId }, + { TestCert::kNode02_08, sTestCert_Node02_08_PublicKey, sTestCert_Node02_08_SubjectKeyId }, }; // clang-format on @@ -1200,6 +1276,7 @@ static const nlTest sTests[] = { NL_TEST_DEF("Test CHIP Verify Generated Cert Chain", TestChipCert_VerifyGeneratedCerts), NL_TEST_DEF("Test CHIP Verify Generated Cert Chain No ICA", TestChipCert_VerifyGeneratedCertsNoICA), NL_TEST_DEF("Test extracting PeerId from node certificate", TestChipCert_ExtractPeerId), + NL_TEST_DEF("Test extracting CAST Authenticated Tags from node certificate", TestChipCert_ExtractCATsFromOpCert), NL_TEST_DEF("Test extracting PublicKey and SKID from chip certificate", TestChipCert_ExtractPublicKeyAndSKID), NL_TEST_SENTINEL() }; diff --git a/src/credentials/tests/TestDeviceAttestationConstruction.cpp b/src/credentials/tests/TestDeviceAttestationConstruction.cpp index 3254de47d005c4..f75a183ce316b1 100644 --- a/src/credentials/tests/TestDeviceAttestationConstruction.cpp +++ b/src/credentials/tests/TestDeviceAttestationConstruction.cpp @@ -16,12 +16,14 @@ * limitations under the License. */ #include +#include #include #include #include #include #include +#include #include using namespace chip; @@ -33,54 +35,56 @@ static void TestAttestationElements_Roundtrip(nlTestSuite * inSuite, void * inCo chip::Platform::ScopedMemoryBuffer attestationElements; size_t attestationElementsLen; - uint8_t certificationDeclaration[] = { 0xd2, 0x84, 0x4b, 0xa2, 0x01, 0x26, 0x04, 0x46, 0x63, 0x73, 0x61, 0x63, 0x64, 0x30, - 0xa0, 0x58, 0x1d, 0x15, 0x25, 0x01, 0x88, 0x99, 0x25, 0x02, 0xfe, 0xff, 0x25, 0x03, - 0xd2, 0x04, 0x25, 0x04, 0x2e, 0x16, 0x24, 0x05, 0xaa, 0x25, 0x06, 0xde, 0xc0, 0x25, - 0x07, 0x94, 0x26, 0x18, 0x58, 0x40, 0x96, 0x57, 0x2d, 0xd6, 0x3c, 0x03, 0x64, 0x0b, - 0x28, 0x67, 0x02, 0xbd, 0x6b, 0xba, 0x48, 0xac, 0x7c, 0x83, 0x54, 0x9b, 0x68, 0x73, - 0x29, 0x47, 0x48, 0xb9, 0x51, 0xd5, 0xab, 0x66, 0x62, 0x2e, 0x9d, 0x26, 0x10, 0x41, - 0xf8, 0x0e, 0x97, 0x49, 0xfe, 0xff, 0x78, 0x10, 0x02, 0x49, 0x67, 0xae, 0xdf, 0x41, - 0x38, 0x36, 0x5b, 0x0a, 0x22, 0x57, 0x14, 0x9c, 0x9a, 0x12, 0x3e, 0x0d, 0x30, 0xaa }; - uint8_t attestationNonce[] = { 0xe0, 0x42, 0x1b, 0x91, 0xc6, 0xfd, 0xcd, 0xb4, 0x0e, 0x2a, 0x4d, 0x2c, 0xf3, 0x1d, 0xb2, 0xb4, - 0xe1, 0x8b, 0x41, 0x1b, 0x1d, 0x3a, 0xd4, 0xd1, 0x2a, 0x9d, 0x90, 0xaa, 0x8e, 0x52, 0xfa, 0xe2 }; - uint32_t timestamp = 677103357; - uint8_t vendorReserved1[] = { 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x64, 0x6f, - 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x31 }; - uint8_t vendorReserved3[] = { 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x64, 0x33, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65 }; - ByteSpan vendorReservedArray[] = { ByteSpan(vendorReserved1), ByteSpan(vendorReserved3) }; - uint16_t vendorId = 0xbeef; - uint16_t profileNum = 0xdead; + static constexpr uint8_t certificationDeclaration[] = { + 0xd2, 0x84, 0x4b, 0xa2, 0x01, 0x26, 0x04, 0x46, 0x63, 0x73, 0x61, 0x63, 0x64, 0x30, 0xa0, 0x58, 0x1d, 0x15, 0x25, + 0x01, 0x88, 0x99, 0x25, 0x02, 0xfe, 0xff, 0x25, 0x03, 0xd2, 0x04, 0x25, 0x04, 0x2e, 0x16, 0x24, 0x05, 0xaa, 0x25, + 0x06, 0xde, 0xc0, 0x25, 0x07, 0x94, 0x26, 0x18, 0x58, 0x40, 0x96, 0x57, 0x2d, 0xd6, 0x3c, 0x03, 0x64, 0x0b, 0x28, + 0x67, 0x02, 0xbd, 0x6b, 0xba, 0x48, 0xac, 0x7c, 0x83, 0x54, 0x9b, 0x68, 0x73, 0x29, 0x47, 0x48, 0xb9, 0x51, 0xd5, + 0xab, 0x66, 0x62, 0x2e, 0x9d, 0x26, 0x10, 0x41, 0xf8, 0x0e, 0x97, 0x49, 0xfe, 0xff, 0x78, 0x10, 0x02, 0x49, 0x67, + 0xae, 0xdf, 0x41, 0x38, 0x36, 0x5b, 0x0a, 0x22, 0x57, 0x14, 0x9c, 0x9a, 0x12, 0x3e, 0x0d, 0x30, 0xaa + }; + static constexpr uint8_t attestationNonce[] = { 0xe0, 0x42, 0x1b, 0x91, 0xc6, 0xfd, 0xcd, 0xb4, 0x0e, 0x2a, 0x4d, + 0x2c, 0xf3, 0x1d, 0xb2, 0xb4, 0xe1, 0x8b, 0x41, 0x1b, 0x1d, 0x3a, + 0xd4, 0xd1, 0x2a, 0x9d, 0x90, 0xaa, 0x8e, 0x52, 0xfa, 0xe2 }; + static constexpr uint32_t timestamp = 677103357; + static constexpr uint8_t vendorReserved1[] = { 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x64, 0x6f, + 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x31 }; + static constexpr uint8_t vendorReserved3[] = { 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x64, 0x33, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65 }; + static constexpr uint16_t vendorId = 0xbeef; + static constexpr uint16_t profileNum = 0xdead; + VendorReservedElement vendorReservedArray[2]; + DeviceAttestationVendorReservedConstructor vendorReservedConstructor(vendorReservedArray, 2); attestationElementsLen = sizeof(certificationDeclaration) + sizeof(attestationNonce) + sizeof(timestamp) + sizeof(vendorReserved1) + sizeof(vendorReserved3) + sizeof(uint64_t) * 5; attestationElements.Alloc(attestationElementsLen); + vendorReservedConstructor.addVendorReservedElement(vendorId, profileNum, 1, ByteSpan(vendorReserved1)); + vendorReservedConstructor.addVendorReservedElement(vendorId, profileNum, 3, ByteSpan(vendorReserved3)); NL_TEST_ASSERT(inSuite, attestationElements); { MutableByteSpan attestationElementsSpan(attestationElements.Get(), attestationElementsLen); // Test wrong size nonce - err = ConstructAttestationElements( - ByteSpan(certificationDeclaration), ByteSpan(attestationNonce, sizeof(attestationNonce) - 1), timestamp, ByteSpan(), - vendorReservedArray, ArraySize(vendorReservedArray), vendorId, profileNum, attestationElementsSpan); + err = ConstructAttestationElements(ByteSpan(certificationDeclaration), + ByteSpan(attestationNonce, sizeof(attestationNonce) - 1), timestamp, ByteSpan(), + vendorReservedConstructor, attestationElementsSpan); NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INVALID_ARGUMENT); // Test with missing mandatory TLV entries - err = ConstructAttestationElements(ByteSpan(), ByteSpan(attestationNonce), timestamp, ByteSpan(), vendorReservedArray, - ArraySize(vendorReservedArray), vendorId, profileNum, attestationElementsSpan); + err = ConstructAttestationElements(ByteSpan(), ByteSpan(attestationNonce), timestamp, ByteSpan(), vendorReservedConstructor, + attestationElementsSpan); NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INVALID_ARGUMENT); // Test with missing mandatory TLV entries - err = - ConstructAttestationElements(ByteSpan(certificationDeclaration), ByteSpan(), timestamp, ByteSpan(), vendorReservedArray, - ArraySize(vendorReservedArray), vendorId, profileNum, attestationElementsSpan); + err = ConstructAttestationElements(ByteSpan(certificationDeclaration), ByteSpan(), timestamp, ByteSpan(), + vendorReservedConstructor, attestationElementsSpan); NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INVALID_ARGUMENT); // Test for success with entirely valid arguments err = ConstructAttestationElements(ByteSpan(certificationDeclaration), ByteSpan(attestationNonce), timestamp, ByteSpan(), - vendorReservedArray, ArraySize(vendorReservedArray), vendorId, profileNum, - attestationElementsSpan); + vendorReservedConstructor, attestationElementsSpan); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); attestationElementsLen = attestationElementsSpan.size(); } @@ -89,28 +93,29 @@ static void TestAttestationElements_Roundtrip(nlTestSuite * inSuite, void * inCo ByteSpan attestationNonceSpan; uint32_t timestampDeconstructed; ByteSpan firmwareInfoSpan; - ByteSpan vendorReservedDeconstructed[2]; - size_t vendorReservedDeconstructedSize = ArraySize(vendorReservedDeconstructed); - uint16_t vendorIdDeconstructed; - uint16_t profileNumDeconstructed; + DeviceAttestationVendorReservedDeconstructor vendorReservedDeconstructor; err = DeconstructAttestationElements(ByteSpan(attestationElements.Get(), attestationElementsLen), certificationDeclarationSpan, - attestationNonceSpan, timestampDeconstructed, firmwareInfoSpan, vendorReservedDeconstructed, - vendorReservedDeconstructedSize, vendorIdDeconstructed, profileNumDeconstructed); + attestationNonceSpan, timestampDeconstructed, firmwareInfoSpan, vendorReservedDeconstructor); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, certificationDeclarationSpan.data_equal(ByteSpan(certificationDeclaration))); NL_TEST_ASSERT(inSuite, attestationNonceSpan.data_equal(ByteSpan(attestationNonce))); NL_TEST_ASSERT(inSuite, timestamp == timestampDeconstructed); NL_TEST_ASSERT(inSuite, firmwareInfoSpan.empty()); - NL_TEST_ASSERT(inSuite, ArraySize(vendorReservedArray) == ArraySize(vendorReservedDeconstructed)); - for (size_t i = 0; i < ArraySize(vendorReservedArray); ++i) + + NL_TEST_ASSERT(inSuite, vendorReservedConstructor.GetNumberOfElements() == vendorReservedDeconstructor.GetNumberOfElements()); + + const VendorReservedElement * constructionElement = vendorReservedConstructor.cbegin(); + VendorReservedElement deconstructionElement; + + while ((constructionElement = vendorReservedConstructor.Next()) != nullptr && + vendorReservedDeconstructor.GetNextVendorReservedElement(deconstructionElement) == CHIP_NO_ERROR) { - NL_TEST_ASSERT(inSuite, vendorReservedArray[i].data_equal(vendorReservedDeconstructed[i])); + NL_TEST_ASSERT(inSuite, constructionElement->vendorId == deconstructionElement.vendorId); + NL_TEST_ASSERT(inSuite, constructionElement->profileNum == deconstructionElement.profileNum); + NL_TEST_ASSERT(inSuite, constructionElement->vendorReservedData.data_equal(deconstructionElement.vendorReservedData)); } - NL_TEST_ASSERT(inSuite, vendorIdDeconstructed == vendorId); - NL_TEST_ASSERT(inSuite, profileNumDeconstructed == profileNum); } static void TestAttestationElements_Construction(nlTestSuite * inSuite, void * inContext) @@ -119,7 +124,7 @@ static void TestAttestationElements_Construction(nlTestSuite * inSuite, void * i Platform::ScopedMemoryBuffer attestationElements; size_t attestationElementsLen; - uint8_t attestationElementsTestVector[] = { + static constexpr uint8_t attestationElementsTestVector[] = { 0x15, 0x30, 0x01, 0x70, 0xd2, 0x84, 0x4b, 0xa2, 0x01, 0x26, 0x04, 0x46, 0x63, 0x73, 0x61, 0x63, 0x64, 0x30, 0xa0, 0x58, 0x1d, 0x15, 0x25, 0x01, 0x88, 0x99, 0x25, 0x02, 0xfe, 0xff, 0x25, 0x03, 0xd2, 0x04, 0x25, 0x04, 0x2e, 0x16, 0x24, 0x05, 0xaa, 0x25, 0x06, 0xde, 0xc0, 0x25, 0x07, 0x94, 0x26, 0x18, 0x58, 0x40, 0x96, 0x57, 0x2d, 0xd6, 0x3c, @@ -133,24 +138,28 @@ static void TestAttestationElements_Construction(nlTestSuite * inSuite, void * i 0xff, 0x3e, 0x00, 0x03, 0x00, 0x18, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x33, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18 }; - uint8_t certificationDeclaration[] = { 0xd2, 0x84, 0x4b, 0xa2, 0x01, 0x26, 0x04, 0x46, 0x63, 0x73, 0x61, 0x63, 0x64, 0x30, - 0xa0, 0x58, 0x1d, 0x15, 0x25, 0x01, 0x88, 0x99, 0x25, 0x02, 0xfe, 0xff, 0x25, 0x03, - 0xd2, 0x04, 0x25, 0x04, 0x2e, 0x16, 0x24, 0x05, 0xaa, 0x25, 0x06, 0xde, 0xc0, 0x25, - 0x07, 0x94, 0x26, 0x18, 0x58, 0x40, 0x96, 0x57, 0x2d, 0xd6, 0x3c, 0x03, 0x64, 0x0b, - 0x28, 0x67, 0x02, 0xbd, 0x6b, 0xba, 0x48, 0xac, 0x7c, 0x83, 0x54, 0x9b, 0x68, 0x73, - 0x29, 0x47, 0x48, 0xb9, 0x51, 0xd5, 0xab, 0x66, 0x62, 0x2e, 0x9d, 0x26, 0x10, 0x41, - 0xf8, 0x0e, 0x97, 0x49, 0xfe, 0xff, 0x78, 0x10, 0x02, 0x49, 0x67, 0xae, 0xdf, 0x41, - 0x38, 0x36, 0x5b, 0x0a, 0x22, 0x57, 0x14, 0x9c, 0x9a, 0x12, 0x3e, 0x0d, 0x30, 0xaa }; - uint8_t attestationNonce[] = { 0xe0, 0x42, 0x1b, 0x91, 0xc6, 0xfd, 0xcd, 0xb4, 0x0e, 0x2a, 0x4d, 0x2c, 0xf3, 0x1d, 0xb2, 0xb4, - 0xe1, 0x8b, 0x41, 0x1b, 0x1d, 0x3a, 0xd4, 0xd1, 0x2a, 0x9d, 0x90, 0xaa, 0x8e, 0x52, 0xfa, 0xe2 }; - uint32_t timestamp = 677103357; - uint8_t vendorReserved1[] = { 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x64, 0x6f, - 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x31 }; - uint8_t vendorReserved3[] = { 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x64, 0x33, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65 }; - ByteSpan vendorReservedArray[] = { ByteSpan(vendorReserved1), ByteSpan(), ByteSpan(vendorReserved3) }; - uint16_t vendorId = 0xFFF1; - uint16_t profileNum = 0x003E; + static constexpr uint8_t certificationDeclaration[] = { + 0xd2, 0x84, 0x4b, 0xa2, 0x01, 0x26, 0x04, 0x46, 0x63, 0x73, 0x61, 0x63, 0x64, 0x30, 0xa0, 0x58, 0x1d, 0x15, 0x25, + 0x01, 0x88, 0x99, 0x25, 0x02, 0xfe, 0xff, 0x25, 0x03, 0xd2, 0x04, 0x25, 0x04, 0x2e, 0x16, 0x24, 0x05, 0xaa, 0x25, + 0x06, 0xde, 0xc0, 0x25, 0x07, 0x94, 0x26, 0x18, 0x58, 0x40, 0x96, 0x57, 0x2d, 0xd6, 0x3c, 0x03, 0x64, 0x0b, 0x28, + 0x67, 0x02, 0xbd, 0x6b, 0xba, 0x48, 0xac, 0x7c, 0x83, 0x54, 0x9b, 0x68, 0x73, 0x29, 0x47, 0x48, 0xb9, 0x51, 0xd5, + 0xab, 0x66, 0x62, 0x2e, 0x9d, 0x26, 0x10, 0x41, 0xf8, 0x0e, 0x97, 0x49, 0xfe, 0xff, 0x78, 0x10, 0x02, 0x49, 0x67, + 0xae, 0xdf, 0x41, 0x38, 0x36, 0x5b, 0x0a, 0x22, 0x57, 0x14, 0x9c, 0x9a, 0x12, 0x3e, 0x0d, 0x30, 0xaa + }; + static constexpr uint8_t attestationNonce[] = { 0xe0, 0x42, 0x1b, 0x91, 0xc6, 0xfd, 0xcd, 0xb4, 0x0e, 0x2a, 0x4d, + 0x2c, 0xf3, 0x1d, 0xb2, 0xb4, 0xe1, 0x8b, 0x41, 0x1b, 0x1d, 0x3a, + 0xd4, 0xd1, 0x2a, 0x9d, 0x90, 0xaa, 0x8e, 0x52, 0xfa, 0xe2 }; + static constexpr uint32_t timestamp = 677103357; + static constexpr uint8_t vendorReserved1[] = { 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x64, 0x6f, + 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x31 }; + static constexpr uint8_t vendorReserved3[] = { 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x64, 0x33, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65 }; + static constexpr uint16_t vendorId = 0xFFF1; + static constexpr uint16_t profileNum = 0x003E; + VendorReservedElement vendorReservedArray[2]; + DeviceAttestationVendorReservedConstructor vendorReserved(vendorReservedArray, 2); + vendorReserved.addVendorReservedElement(vendorId, profileNum, 1, ByteSpan(vendorReserved1)); + vendorReserved.addVendorReservedElement(vendorId, profileNum, 3, ByteSpan(vendorReserved3)); attestationElementsLen = sizeof(certificationDeclaration) + sizeof(attestationNonce) + sizeof(timestamp) + sizeof(vendorReserved1) + sizeof(vendorReserved3) + sizeof(uint64_t) * 5; @@ -161,8 +170,7 @@ static void TestAttestationElements_Construction(nlTestSuite * inSuite, void * i MutableByteSpan attestationElementsSpan(attestationElements.Get(), attestationElementsLen); err = ConstructAttestationElements(ByteSpan(certificationDeclaration), ByteSpan(attestationNonce), timestamp, ByteSpan(), - vendorReservedArray, ArraySize(vendorReservedArray), vendorId, profileNum, - attestationElementsSpan); + vendorReserved, attestationElementsSpan); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); attestationElementsLen = attestationElementsSpan.size(); @@ -174,7 +182,7 @@ static void TestAttestationElements_Deconstruction(nlTestSuite * inSuite, void * { CHIP_ERROR err = CHIP_NO_ERROR; - uint8_t attestationElementsTestVector[] = { + static constexpr uint8_t attestationElementsTestVector[] = { 0x15, 0x30, 0x01, 0x70, 0xd2, 0x84, 0x4b, 0xa2, 0x01, 0x26, 0x04, 0x46, 0x63, 0x73, 0x61, 0x63, 0x64, 0x30, 0xa0, 0x58, 0x1d, 0x15, 0x25, 0x01, 0x88, 0x99, 0x25, 0x02, 0xfe, 0xff, 0x25, 0x03, 0xd2, 0x04, 0x25, 0x04, 0x2e, 0x16, 0x24, 0x05, 0xaa, 0x25, 0x06, 0xde, 0xc0, 0x25, 0x07, 0x94, 0x26, 0x18, 0x58, 0x40, 0x96, 0x57, 0x2d, 0xd6, 0x3c, @@ -188,7 +196,7 @@ static void TestAttestationElements_Deconstruction(nlTestSuite * inSuite, void * 0xff, 0x3e, 0x00, 0x03, 0x00, 0x18, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x33, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18 }; - uint8_t certificationDeclarationTestVector[] = { + static constexpr uint8_t certificationDeclarationTestVector[] = { 0xd2, 0x84, 0x4b, 0xa2, 0x01, 0x26, 0x04, 0x46, 0x63, 0x73, 0x61, 0x63, 0x64, 0x30, 0xa0, 0x58, 0x1d, 0x15, 0x25, 0x01, 0x88, 0x99, 0x25, 0x02, 0xfe, 0xff, 0x25, 0x03, 0xd2, 0x04, 0x25, 0x04, 0x2e, 0x16, 0x24, 0x05, 0xaa, 0x25, 0x06, 0xde, 0xc0, 0x25, 0x07, 0x94, 0x26, 0x18, 0x58, 0x40, 0x96, 0x57, 0x2d, 0xd6, 0x3c, 0x03, 0x64, 0x0b, 0x28, @@ -196,51 +204,107 @@ static void TestAttestationElements_Deconstruction(nlTestSuite * inSuite, void * 0xab, 0x66, 0x62, 0x2e, 0x9d, 0x26, 0x10, 0x41, 0xf8, 0x0e, 0x97, 0x49, 0xfe, 0xff, 0x78, 0x10, 0x02, 0x49, 0x67, 0xae, 0xdf, 0x41, 0x38, 0x36, 0x5b, 0x0a, 0x22, 0x57, 0x14, 0x9c, 0x9a, 0x12, 0x3e, 0x0d, 0x30, 0xaa }; - uint8_t attestationNonceTestVector[] = { 0xe0, 0x42, 0x1b, 0x91, 0xc6, 0xfd, 0xcd, 0xb4, 0x0e, 0x2a, 0x4d, - 0x2c, 0xf3, 0x1d, 0xb2, 0xb4, 0xe1, 0x8b, 0x41, 0x1b, 0x1d, 0x3a, - 0xd4, 0xd1, 0x2a, 0x9d, 0x90, 0xaa, 0x8e, 0x52, 0xfa, 0xe2 }; - uint32_t timestampTestVector = 677103357; - uint8_t vendorReserved1TestVector[] = { 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x64, 0x6f, - 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x31 }; - uint8_t vendorReserved3TestVector[] = { 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x64, 0x33, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65 }; - ByteSpan vendorReservedArrayTestVector[] = { ByteSpan(vendorReserved1TestVector), ByteSpan(vendorReserved3TestVector) }; - uint16_t vendorIdTestVector = 0xFFF1; - uint16_t profileNumTestVector = 0x003E; + static constexpr uint8_t attestationNonceTestVector[] = { 0xe0, 0x42, 0x1b, 0x91, 0xc6, 0xfd, 0xcd, 0xb4, 0x0e, 0x2a, 0x4d, + 0x2c, 0xf3, 0x1d, 0xb2, 0xb4, 0xe1, 0x8b, 0x41, 0x1b, 0x1d, 0x3a, + 0xd4, 0xd1, 0x2a, 0x9d, 0x90, 0xaa, 0x8e, 0x52, 0xfa, 0xe2 }; + static constexpr uint32_t timestampTestVector = 677103357; + static constexpr uint8_t vendorReserved1TestVector[] = { 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x64, 0x6f, + 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x31 }; + static constexpr uint8_t vendorReserved3TestVector[] = { + 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x64, 0x33, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65 + }; + static constexpr ByteSpan vendorReservedArrayTestVector[] = { ByteSpan(vendorReserved1TestVector), + ByteSpan(vendorReserved3TestVector) }; + static constexpr uint16_t vendorIdTestVector = 0xFFF1; + static constexpr uint16_t profileNumTestVector = 0x003E; ByteSpan certificationDeclarationDeconstructed; ByteSpan attestationNonceDeconstructed; uint32_t timestampDeconstructed; ByteSpan firmwareInfoDeconstructed; - ByteSpan vendorReservedDeconstructed[3]; - size_t vendorReservedDeconstructedSize = ArraySize(vendorReservedDeconstructed); - uint16_t vendorIdDeconstructed; - uint16_t profileNumDeconstructed; + DeviceAttestationVendorReservedDeconstructor vendorReserved; err = DeconstructAttestationElements(ByteSpan(attestationElementsTestVector), certificationDeclarationDeconstructed, attestationNonceDeconstructed, timestampDeconstructed, firmwareInfoDeconstructed, - vendorReservedDeconstructed, vendorReservedDeconstructedSize, vendorIdDeconstructed, - profileNumDeconstructed); + vendorReserved); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, certificationDeclarationDeconstructed.data_equal(ByteSpan(certificationDeclarationTestVector))); NL_TEST_ASSERT(inSuite, attestationNonceDeconstructed.data_equal(ByteSpan(attestationNonceTestVector))); NL_TEST_ASSERT(inSuite, timestampTestVector == timestampDeconstructed); NL_TEST_ASSERT(inSuite, firmwareInfoDeconstructed.empty()); - NL_TEST_ASSERT(inSuite, ArraySize(vendorReservedArrayTestVector) == vendorReservedDeconstructedSize); - for (size_t i = 0; i < ArraySize(vendorReservedArrayTestVector); ++i) + NL_TEST_ASSERT(inSuite, ArraySize(vendorReservedArrayTestVector) == vendorReserved.GetNumberOfElements()); + struct VendorReservedElement element; + + while (vendorReserved.GetNextVendorReservedElement(element) == CHIP_NO_ERROR) { - NL_TEST_ASSERT(inSuite, vendorReservedArrayTestVector[i].data_equal(vendorReservedDeconstructed[i])); + NL_TEST_ASSERT(inSuite, vendorIdTestVector == element.vendorId); + NL_TEST_ASSERT(inSuite, profileNumTestVector == element.profileNum); + switch (element.tagNum) + { + case 1: + NL_TEST_ASSERT(inSuite, element.vendorReservedData.data_equal(vendorReservedArrayTestVector[0])); + break; + case 3: + NL_TEST_ASSERT(inSuite, element.vendorReservedData.data_equal(vendorReservedArrayTestVector[1])); + break; + default: + NL_TEST_ASSERT(inSuite, 0); + break; + } } - NL_TEST_ASSERT(inSuite, vendorIdDeconstructed == vendorIdTestVector); - NL_TEST_ASSERT(inSuite, profileNumDeconstructed == profileNumTestVector); +} + +static void TestVendorReservedData(nlTestSuite * inSuite, void * inContext) +{ + + struct VendorReservedElement inputArray[] = { { 3000, 100, 10 }, { 2999, 99, 10 }, { 10, 20, 100 }, + { 100, 50, 200 }, { 3000, 100, 11 }, { 3000, 100, 9 } }; + + VendorReservedElement vendorReservedArray[6]; + DeviceAttestationVendorReservedConstructor vendorReserved(vendorReservedArray, 6); + size_t i; + uint8_t strings[6][50]; + for (i = 0; i < ArraySize(inputArray); i++) + { + snprintf(reinterpret_cast(strings[i]), sizeof(strings[i]), "Vendor Reserved Data #%d", + (int) i); // for debugging use + CHIP_ERROR err = + vendorReserved.addVendorReservedElement(inputArray[i].vendorId, inputArray[i].profileNum, inputArray[i].tagNum, + ByteSpan(strings[i], strlen(reinterpret_cast(strings[i])))); + + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + } + + // manually figure out the order these should be read out in when sorted + struct VendorReservedElement * desiredOrder[] = { + &inputArray[2], &inputArray[3], &inputArray[1], &inputArray[5], &inputArray[0], &inputArray[4], + }; + + const struct VendorReservedElement * element = vendorReserved.cbegin(); + NL_TEST_ASSERT(inSuite, element); + NL_TEST_ASSERT(inSuite, element = vendorReserved.Next()); + + for (i = 0; element && i < ArraySize(desiredOrder); element = vendorReserved.Next(), i++) + { + NL_TEST_ASSERT(inSuite, + element->vendorId == desiredOrder[i]->vendorId && element->profileNum == desiredOrder[i]->profileNum && + element->tagNum == desiredOrder[i]->tagNum); + } + NL_TEST_ASSERT(inSuite, i == ArraySize(desiredOrder)); // check if previous loop matched for every array entry. + + // add another element, it should fail + uint8_t testByteSpan[] = { 0x1, 0x2, 0x3 }; + CHIP_ERROR err = vendorReserved.addVendorReservedElement(5, 10, 20, ByteSpan(testByteSpan)); + NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_NO_MEMORY); } static void TestAttestationElements_DeconstructionWithFirmwareInfo(nlTestSuite * inSuite, void * inContext) { CHIP_ERROR err = CHIP_NO_ERROR; - uint8_t attestationElementsTestVectorWithFirmwareInfo[] = { + static constexpr uint8_t attestationElementsTestVectorWithFirmwareInfo[] = { 0x15, 0x30, 0x01, 0x70, 0xd2, 0x84, 0x4b, 0xa2, 0x01, 0x26, 0x04, 0x46, 0x63, 0x73, 0x61, 0x63, 0x64, 0x30, 0xa0, 0x58, 0x1d, 0x15, 0x25, 0x01, 0x88, 0x99, 0x25, 0x02, 0xfe, 0xff, 0x25, 0x03, 0xd2, 0x04, 0x25, 0x04, 0x2e, 0x16, 0x24, 0x05, 0xaa, 0x25, 0x06, 0xde, 0xc0, 0x25, 0x07, 0x94, 0x26, 0x18, 0x58, 0x40, 0x96, 0x57, 0x2d, 0xd6, 0x3c, 0x03, 0x64, 0x0b, @@ -259,7 +323,7 @@ static void TestAttestationElements_DeconstructionWithFirmwareInfo(nlTestSuite * 0x00, 0x03, 0x00, 0x18, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x33, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18 }; - uint8_t certificationDeclarationTestVector[] = { + static constexpr uint8_t certificationDeclarationTestVector[] = { 0xd2, 0x84, 0x4b, 0xa2, 0x01, 0x26, 0x04, 0x46, 0x63, 0x73, 0x61, 0x63, 0x64, 0x30, 0xa0, 0x58, 0x1d, 0x15, 0x25, 0x01, 0x88, 0x99, 0x25, 0x02, 0xfe, 0xff, 0x25, 0x03, 0xd2, 0x04, 0x25, 0x04, 0x2e, 0x16, 0x24, 0x05, 0xaa, 0x25, 0x06, 0xde, 0xc0, 0x25, 0x07, 0x94, 0x26, 0x18, 0x58, 0x40, 0x96, 0x57, 0x2d, 0xd6, 0x3c, 0x03, 0x64, 0x0b, 0x28, @@ -267,58 +331,76 @@ static void TestAttestationElements_DeconstructionWithFirmwareInfo(nlTestSuite * 0xab, 0x66, 0x62, 0x2e, 0x9d, 0x26, 0x10, 0x41, 0xf8, 0x0e, 0x97, 0x49, 0xfe, 0xff, 0x78, 0x10, 0x02, 0x49, 0x67, 0xae, 0xdf, 0x41, 0x38, 0x36, 0x5b, 0x0a, 0x22, 0x57, 0x14, 0x9c, 0x9a, 0x12, 0x3e, 0x0d, 0x30, 0xaa }; - uint8_t attestationNonceTestVector[] = { 0xe0, 0x42, 0x1b, 0x91, 0xc6, 0xfd, 0xcd, 0xb4, 0x0e, 0x2a, 0x4d, - 0x2c, 0xf3, 0x1d, 0xb2, 0xb4, 0xe1, 0x8b, 0x41, 0x1b, 0x1d, 0x3a, - 0xd4, 0xd1, 0x2a, 0x9d, 0x90, 0xaa, 0x8e, 0x52, 0xfa, 0xe2 }; - uint32_t timestampTestVector = 677103357; - uint8_t firmwareInfoTestVector[] = { 0x30, 0x67, 0x80, 0x01, 0x05, 0xA1, 0x62, 0x30, 0x2F, 0xA0, 0x0B, 0x80, 0x09, 0x60, 0x86, - 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x81, 0x20, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, - 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, - 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x30, 0x2F, 0xA0, 0x0B, - 0x80, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x81, 0x20, 0x10, 0x11, - 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x10, - 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F }; - uint8_t vendorReserved1TestVector[] = { 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x64, 0x6f, - 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x31 }; - uint8_t vendorReserved3TestVector[] = { 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x64, 0x33, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65 }; - ByteSpan vendorReservedArrayTestVector[] = { ByteSpan(vendorReserved1TestVector), ByteSpan(vendorReserved3TestVector) }; - uint16_t vendorIdTestVector = 0xFFF1; - uint16_t profileNumTestVector = 0x003E; + static constexpr uint8_t attestationNonceTestVector[] = { 0xe0, 0x42, 0x1b, 0x91, 0xc6, 0xfd, 0xcd, 0xb4, 0x0e, 0x2a, 0x4d, + 0x2c, 0xf3, 0x1d, 0xb2, 0xb4, 0xe1, 0x8b, 0x41, 0x1b, 0x1d, 0x3a, + 0xd4, 0xd1, 0x2a, 0x9d, 0x90, 0xaa, 0x8e, 0x52, 0xfa, 0xe2 }; + static constexpr uint32_t timestampTestVector = 677103357; + static constexpr uint8_t firmwareInfoTestVector[] = { + 0x30, 0x67, 0x80, 0x01, 0x05, 0xA1, 0x62, 0x30, 0x2F, 0xA0, 0x0B, 0x80, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, + 0x03, 0x04, 0x02, 0x01, 0x81, 0x20, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, + 0xCC, 0xDD, 0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, + 0xEE, 0xFF, 0x30, 0x2F, 0xA0, 0x0B, 0x80, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x81, + 0x20, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x10, + 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F + }; + static constexpr uint8_t vendorReserved1TestVector[] = { 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x64, 0x6f, + 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x31 }; + static constexpr uint8_t vendorReserved3TestVector[] = { + 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x64, 0x33, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65 + }; + static constexpr ByteSpan vendorReservedArrayTestVector[] = { ByteSpan(vendorReserved1TestVector), + ByteSpan(vendorReserved3TestVector) }; + static constexpr uint16_t vendorIdTestVector = 0xFFF1; + static constexpr uint16_t profileNumTestVector = 0x003E; ByteSpan certificationDeclarationDeconstructed; ByteSpan attestationNonceDeconstructed; uint32_t timestampDeconstructed; ByteSpan firmwareInfoDeconstructed; - ByteSpan vendorReservedDeconstructed[3]; - size_t vendorReservedDeconstructedSize = ArraySize(vendorReservedDeconstructed); - uint16_t vendorIdDeconstructed; - uint16_t profileNumDeconstructed; + + DeviceAttestationVendorReservedDeconstructor vendorReserved; err = DeconstructAttestationElements(ByteSpan(attestationElementsTestVectorWithFirmwareInfo), certificationDeclarationDeconstructed, attestationNonceDeconstructed, - timestampDeconstructed, firmwareInfoDeconstructed, vendorReservedDeconstructed, - vendorReservedDeconstructedSize, vendorIdDeconstructed, profileNumDeconstructed); + timestampDeconstructed, firmwareInfoDeconstructed, vendorReserved); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, certificationDeclarationDeconstructed.data_equal(ByteSpan(certificationDeclarationTestVector))); NL_TEST_ASSERT(inSuite, attestationNonceDeconstructed.data_equal(ByteSpan(attestationNonceTestVector))); NL_TEST_ASSERT(inSuite, timestampTestVector == timestampDeconstructed); NL_TEST_ASSERT(inSuite, firmwareInfoDeconstructed.data_equal(ByteSpan(firmwareInfoTestVector))); - NL_TEST_ASSERT(inSuite, ArraySize(vendorReservedArrayTestVector) == vendorReservedDeconstructedSize); - for (size_t i = 0; i < ArraySize(vendorReservedArrayTestVector); ++i) + NL_TEST_ASSERT(inSuite, ArraySize(vendorReservedArrayTestVector) == vendorReserved.GetNumberOfElements()); + struct VendorReservedElement element; + size_t elementsSeen = 0; + + while (vendorReserved.GetNextVendorReservedElement(element) == CHIP_NO_ERROR) { - NL_TEST_ASSERT(inSuite, vendorReservedArrayTestVector[i].data_equal(vendorReservedDeconstructed[i])); + NL_TEST_ASSERT(inSuite, vendorIdTestVector == element.vendorId); + NL_TEST_ASSERT(inSuite, profileNumTestVector == element.profileNum); + switch (element.tagNum) + { + case 1: + NL_TEST_ASSERT(inSuite, element.vendorReservedData.data_equal(vendorReservedArrayTestVector[0])); + elementsSeen++; + break; + case 3: + NL_TEST_ASSERT(inSuite, element.vendorReservedData.data_equal(vendorReservedArrayTestVector[1])); + elementsSeen++; + break; + default: + NL_TEST_ASSERT(inSuite, 0); + break; + } } - NL_TEST_ASSERT(inSuite, vendorIdDeconstructed == vendorIdTestVector); - NL_TEST_ASSERT(inSuite, profileNumDeconstructed == profileNumTestVector); + NL_TEST_ASSERT(inSuite, elementsSeen == ArraySize(vendorReservedArrayTestVector)); } static void TestAttestationElements_DeconstructionUnordered(nlTestSuite * inSuite, void * inContext) { CHIP_ERROR err = CHIP_NO_ERROR; - uint8_t attestationElementsUnorderedTestVector[] = { + static constexpr uint8_t attestationElementsUnorderedTestVector[] = { 0x15, 0x30, 0x02, 0x20, 0xe0, 0x42, 0x1b, 0x91, 0xc6, 0xfd, 0xcd, 0xb4, 0x0e, 0x2a, 0x4d, 0x2c, 0xf3, 0x1d, 0xb2, 0xb4, 0xe1, 0x8b, 0x41, 0x1b, 0x1d, 0x3a, 0xd4, 0xd1, 0x2a, 0x9d, 0x90, 0xaa, 0x8e, 0x52, 0xfa, 0xe2, 0x30, 0x01, 0x70, 0xd2, 0x84, 0x4b, 0xa2, 0x01, 0x26, 0x04, 0x46, 0x63, 0x73, 0x61, 0x63, 0x64, 0x30, 0xa0, 0x58, 0x1d, 0x15, @@ -337,15 +419,11 @@ static void TestAttestationElements_DeconstructionUnordered(nlTestSuite * inSuit ByteSpan attestationNonceDeconstructed; uint32_t timestampDeconstructed; ByteSpan firmwareInfoDeconstructed; - ByteSpan vendorReservedDeconstructed[3]; - size_t vendorReservedDeconstructedSize = ArraySize(vendorReservedDeconstructed); - uint16_t vendorIdDeconstructed; - uint16_t profileNumDeconstructed; + DeviceAttestationVendorReservedDeconstructor vendorReserved; err = DeconstructAttestationElements(ByteSpan(attestationElementsUnorderedTestVector), certificationDeclarationDeconstructed, attestationNonceDeconstructed, timestampDeconstructed, firmwareInfoDeconstructed, - vendorReservedDeconstructed, vendorReservedDeconstructedSize, vendorIdDeconstructed, - profileNumDeconstructed); + vendorReserved); NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT); } @@ -357,6 +435,7 @@ static const nlTest sTests[] = { NL_TEST_DEF("Test Device Attestation Elements Roundtrip", TestAttestationElements_Roundtrip), NL_TEST_DEF("Test Device Attestation Elements Construction", TestAttestationElements_Construction), NL_TEST_DEF("Test Device Attestation Elements Deconstruction", TestAttestationElements_Deconstruction), + NL_TEST_DEF("Test Vendor Reserved Data Ordering", TestVendorReservedData), NL_TEST_DEF("Test Device Attestation Elements Deconstruction with Firmware Information", TestAttestationElements_DeconstructionWithFirmwareInfo), NL_TEST_DEF("Test Device Attestation Elements Deconstruction - Corrupted/Out of Order TLV", TestAttestationElements_DeconstructionUnordered), NL_TEST_SENTINEL() diff --git a/src/darwin/Framework/CHIP/templates/clusters-tests.zapt b/src/darwin/Framework/CHIP/templates/clusters-tests.zapt index c8d975f0be2815..fe71d829f37f5f 100644 --- a/src/darwin/Framework/CHIP/templates/clusters-tests.zapt +++ b/src/darwin/Framework/CHIP/templates/clusters-tests.zapt @@ -105,12 +105,6 @@ CHIPDevice * GetConnectedDevice() [self waitForExpectationsWithTimeout:kPairingTimeoutInSeconds handler:nil]; - XCTestExpectation * addressExpectation = [self expectationWithDescription:@"Address Updated"]; - pairing.expectation = addressExpectation; - [controller updateDevice:kDeviceId fabricId:0]; - - [self waitForExpectationsWithTimeout:kAddressResolveTimeoutInSeconds handler:nil]; - __block XCTestExpectation * connectionExpectation = [self expectationWithDescription:@"CASE established"]; [controller getConnectedDevice:kDeviceId queue:dispatch_get_main_queue() @@ -172,6 +166,8 @@ CHIPDevice * GetConnectedDevice() {{#unless (isStrEqual "Test Cluster" name)}} {{#unless (isStrEqual "Basic" name)}} {{#unless (isStrEqual "Thermostat" name)}} +{{! TODO: Re-enable Illuminance Measurement once Darwin tests can deal with actual null values being delivered for TLV null. }} +{{#unless (isStrEqual "Illuminance Measurement" name)}} {{#chip_server_cluster_attributes}} - (void)testSendCluster{{asUpperCamelCase parent.name}}ReadAttribute{{asUpperCamelCase name}}WithResponseHandler { @@ -215,6 +211,7 @@ CHIPDevice * GetConnectedDevice() {{/unless}} {{/unless}} {{/unless}} +{{/unless}} {{/chip_client_clusters}} @end diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm index 6187b4a26a85bb..4fd78fcd161516 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm @@ -500,6 +500,31 @@ DispatchSuccess(context, @ { @"value" : array }); }; +void CHIPSoftwareDiagnosticsThreadMetricsListAttributeCallbackBridge::OnSuccessFn(void * context, + const chip::app::DataModel::DecodableList & + list) +{ + id array = [[NSMutableArray alloc] init]; + auto iter = list.begin(); + while (iter.Next()) { + auto & entry = iter.GetValue(); + (void) entry; // All our types below might be unsupported + [array addObject:@ { + @"Id" : [NSNumber numberWithUnsignedLongLong:entry.id], + @"Name" : [[NSString alloc] initWithBytes:entry.name.data() length:entry.name.size() encoding:NSUTF8StringEncoding], + @"StackFreeCurrent" : [NSNumber numberWithUnsignedLong:entry.stackFreeCurrent], + @"StackFreeMinimum" : [NSNumber numberWithUnsignedLong:entry.stackFreeMinimum], + @"StackSize" : [NSNumber numberWithUnsignedLong:entry.stackSize], + }]; + } + if (iter.GetStatus() != CHIP_NO_ERROR) { + OnFailureFn(context, EMBER_ZCL_STATUS_INVALID_VALUE); + return; + } + + DispatchSuccess(context, @ { @"value" : array }); +}; + void CHIPTvChannelTvChannelListListAttributeCallbackBridge::OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & list) { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h index 35eb1dc1ccceb8..1e66269cf2cf90 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h @@ -553,6 +553,20 @@ class CHIPPowerSourceActiveBatteryFaultsListAttributeCallbackBridge static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & list); }; +class CHIPSoftwareDiagnosticsThreadMetricsListAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPSoftwareDiagnosticsThreadMetricsListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + + static void OnSuccessFn( + void * context, + const chip::app::DataModel::DecodableList & + list); +}; + class CHIPTvChannelTvChannelListListAttributeCallbackBridge : public CHIPCallbackBridge { public: diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h index 4b61fbbaeaa1f0..6811abb84188ad 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h @@ -1503,6 +1503,8 @@ NS_ASSUME_NONNULL_BEGIN - (void)resetWatermarks:(ResponseHandler)responseHandler; +- (void)readAttributeThreadMetricsWithResponseHandler:(ResponseHandler)responseHandler; + - (void)readAttributeCurrentHeapFreeWithResponseHandler:(ResponseHandler)responseHandler; - (void)readAttributeCurrentHeapUsedWithResponseHandler:(ResponseHandler)responseHandler; @@ -1704,6 +1706,57 @@ NS_ASSUME_NONNULL_BEGIN - (void)readAttributeUnsupportedWithResponseHandler:(ResponseHandler)responseHandler; - (void)writeAttributeUnsupportedWithValue:(bool)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeNullableBooleanWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeNullableBooleanWithValue:(bool)value responseHandler:(ResponseHandler)responseHandler; + +- (void)readAttributeNullableBitmap8WithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeNullableBitmap8WithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; + +- (void)readAttributeNullableBitmap16WithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeNullableBitmap16WithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; + +- (void)readAttributeNullableBitmap32WithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeNullableBitmap32WithValue:(uint32_t)value responseHandler:(ResponseHandler)responseHandler; + +- (void)readAttributeNullableBitmap64WithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeNullableBitmap64WithValue:(uint64_t)value responseHandler:(ResponseHandler)responseHandler; + +- (void)readAttributeNullableInt8uWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeNullableInt8uWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; + +- (void)readAttributeNullableInt16uWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeNullableInt16uWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; + +- (void)readAttributeNullableInt32uWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeNullableInt32uWithValue:(uint32_t)value responseHandler:(ResponseHandler)responseHandler; + +- (void)readAttributeNullableInt64uWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeNullableInt64uWithValue:(uint64_t)value responseHandler:(ResponseHandler)responseHandler; + +- (void)readAttributeNullableInt8sWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeNullableInt8sWithValue:(int8_t)value responseHandler:(ResponseHandler)responseHandler; + +- (void)readAttributeNullableInt16sWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeNullableInt16sWithValue:(int16_t)value responseHandler:(ResponseHandler)responseHandler; + +- (void)readAttributeNullableInt32sWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeNullableInt32sWithValue:(int32_t)value responseHandler:(ResponseHandler)responseHandler; + +- (void)readAttributeNullableInt64sWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeNullableInt64sWithValue:(int64_t)value responseHandler:(ResponseHandler)responseHandler; + +- (void)readAttributeNullableEnum8WithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeNullableEnum8WithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; + +- (void)readAttributeNullableEnum16WithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeNullableEnum16WithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; + +- (void)readAttributeNullableOctetStringWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeNullableOctetStringWithValue:(NSData *)value responseHandler:(ResponseHandler)responseHandler; + +- (void)readAttributeNullableCharStringWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeNullableCharStringWithValue:(NSString *)value responseHandler:(ResponseHandler)responseHandler; + - (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm index 2a0c79e7e18dc4..fa790d868363f6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm @@ -5368,6 +5368,14 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc }); } +- (void)readAttributeThreadMetricsWithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPSoftwareDiagnosticsThreadMetricsListAttributeCallbackBridge( + self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeThreadMetrics(success, failure); + }); +} + - (void)readAttributeCurrentHeapFreeWithResponseHandler:(ResponseHandler)responseHandler { new CHIPInt64uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -6174,6 +6182,244 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc }); } +- (void)readAttributeNullableBooleanWithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPBooleanAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeNullableBoolean(success, failure); + }); +} + +- (void)writeAttributeNullableBooleanWithValue:(bool)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeNullableBoolean(success, failure, value); + }); +} + +- (void)readAttributeNullableBitmap8WithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeNullableBitmap8(success, failure); + }); +} + +- (void)writeAttributeNullableBitmap8WithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeNullableBitmap8(success, failure, value); + }); +} + +- (void)readAttributeNullableBitmap16WithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeNullableBitmap16(success, failure); + }); +} + +- (void)writeAttributeNullableBitmap16WithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeNullableBitmap16(success, failure, value); + }); +} + +- (void)readAttributeNullableBitmap32WithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt32uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeNullableBitmap32(success, failure); + }); +} + +- (void)writeAttributeNullableBitmap32WithValue:(uint32_t)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeNullableBitmap32(success, failure, value); + }); +} + +- (void)readAttributeNullableBitmap64WithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt64uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeNullableBitmap64(success, failure); + }); +} + +- (void)writeAttributeNullableBitmap64WithValue:(uint64_t)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeNullableBitmap64(success, failure, value); + }); +} + +- (void)readAttributeNullableInt8uWithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeNullableInt8u(success, failure); + }); +} + +- (void)writeAttributeNullableInt8uWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeNullableInt8u(success, failure, value); + }); +} + +- (void)readAttributeNullableInt16uWithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeNullableInt16u(success, failure); + }); +} + +- (void)writeAttributeNullableInt16uWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeNullableInt16u(success, failure, value); + }); +} + +- (void)readAttributeNullableInt32uWithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt32uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeNullableInt32u(success, failure); + }); +} + +- (void)writeAttributeNullableInt32uWithValue:(uint32_t)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeNullableInt32u(success, failure, value); + }); +} + +- (void)readAttributeNullableInt64uWithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt64uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeNullableInt64u(success, failure); + }); +} + +- (void)writeAttributeNullableInt64uWithValue:(uint64_t)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeNullableInt64u(success, failure, value); + }); +} + +- (void)readAttributeNullableInt8sWithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt8sAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeNullableInt8s(success, failure); + }); +} + +- (void)writeAttributeNullableInt8sWithValue:(int8_t)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeNullableInt8s(success, failure, value); + }); +} + +- (void)readAttributeNullableInt16sWithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt16sAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeNullableInt16s(success, failure); + }); +} + +- (void)writeAttributeNullableInt16sWithValue:(int16_t)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeNullableInt16s(success, failure, value); + }); +} + +- (void)readAttributeNullableInt32sWithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt32sAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeNullableInt32s(success, failure); + }); +} + +- (void)writeAttributeNullableInt32sWithValue:(int32_t)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeNullableInt32s(success, failure, value); + }); +} + +- (void)readAttributeNullableInt64sWithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt64sAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeNullableInt64s(success, failure); + }); +} + +- (void)writeAttributeNullableInt64sWithValue:(int64_t)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeNullableInt64s(success, failure, value); + }); +} + +- (void)readAttributeNullableEnum8WithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeNullableEnum8(success, failure); + }); +} + +- (void)writeAttributeNullableEnum8WithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeNullableEnum8(success, failure, static_cast(value)); + }); +} + +- (void)readAttributeNullableEnum16WithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeNullableEnum16(success, failure); + }); +} + +- (void)writeAttributeNullableEnum16WithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeNullableEnum16(success, failure, static_cast(value)); + }); +} + +- (void)readAttributeNullableOctetStringWithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPOctetStringAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeNullableOctetString(success, failure); + }); +} + +- (void)writeAttributeNullableOctetStringWithValue:(NSData *)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeNullableOctetString(success, failure, [self asByteSpan:value]); + }); +} + +- (void)readAttributeNullableCharStringWithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPCharStringAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeNullableCharString(success, failure); + }); +} + +- (void)writeAttributeNullableCharStringWithValue:(NSString *)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeNullableCharString(success, failure, [self asCharSpan:value]); + }); +} + - (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 78d572a1b9e0ef..de0b783da7e38b 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -123,12 +123,6 @@ - (void)testInitStack [self waitForExpectationsWithTimeout:kPairingTimeoutInSeconds handler:nil]; - XCTestExpectation * addressExpectation = [self expectationWithDescription:@"Address Updated"]; - pairing.expectation = addressExpectation; - [controller updateDevice:kDeviceId fabricId:0]; - - [self waitForExpectationsWithTimeout:kAddressResolveTimeoutInSeconds handler:nil]; - __block XCTestExpectation * connectionExpectation = [self expectationWithDescription:@"CASE established"]; [controller getConnectedDevice:kDeviceId queue:dispatch_get_main_queue() @@ -21943,120 +21937,6 @@ - (void)testSendClusterIdentifyReadAttributeClusterRevisionWithResponseHandler [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterIlluminanceMeasurementReadAttributeMeasuredValueWithResponseHandler -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeMeasuredValueWithResponseHandler"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMeasuredValueWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"IlluminanceMeasurement MeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIlluminanceMeasurementReadAttributeMinMeasuredValueWithResponseHandler -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeMinMeasuredValueWithResponseHandler"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMinMeasuredValueWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"IlluminanceMeasurement MinMeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIlluminanceMeasurementReadAttributeMaxMeasuredValueWithResponseHandler -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeMaxMeasuredValueWithResponseHandler"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeMaxMeasuredValueWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"IlluminanceMeasurement MaxMeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIlluminanceMeasurementReadAttributeToleranceWithResponseHandler -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeToleranceWithResponseHandler"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeToleranceWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"IlluminanceMeasurement Tolerance Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIlluminanceMeasurementReadAttributeLightSensorTypeWithResponseHandler -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeLightSensorTypeWithResponseHandler"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLightSensorTypeWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"IlluminanceMeasurement LightSensorType Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIlluminanceMeasurementReadAttributeClusterRevisionWithResponseHandler -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeClusterRevisionWithResponseHandler"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"IlluminanceMeasurement ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - - (void)testSendClusterKeypadInputReadAttributeClusterRevisionWithResponseHandler { XCTestExpectation * expectation = @@ -24491,6 +24371,25 @@ - (void)testSendClusterScenesReadAttributeClusterRevisionWithResponseHandler [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterSoftwareDiagnosticsReadAttributeThreadMetricsWithResponseHandler +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"SoftwareDiagnosticsReadAttributeThreadMetricsWithResponseHandler"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeThreadMetricsWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"SoftwareDiagnostics ThreadMetrics Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterSoftwareDiagnosticsReadAttributeCurrentHeapFreeWithResponseHandler { XCTestExpectation * expectation = diff --git a/src/include/platform/PlatformManager.h b/src/include/platform/PlatformManager.h index 549b39fae29ba9..d5947c8f4a7a35 100644 --- a/src/include/platform/PlatformManager.h +++ b/src/include/platform/PlatformManager.h @@ -23,6 +23,7 @@ #pragma once +#include #include #include #include @@ -66,6 +67,16 @@ template class GenericThreadStackManagerImpl_OpenThread_LwIP; } // namespace Internal +// Maximum length of vendor defined name or prefix of the software thread that is +// static for the duration of the thread. +static constexpr size_t kMaxThreadNameLength = 32; + +struct ThreadMetrics : public app::Clusters::SoftwareDiagnostics::Structs::ThreadMetrics::Type +{ + char NameBuf[kMaxThreadNameLength + 1]; + ThreadMetrics * Next; /* Pointer to the next structure. */ +}; + class PlatformManager; /** @@ -177,6 +188,14 @@ class PlatformManager CHIP_ERROR GetCurrentHeapUsed(uint64_t & currentHeapUsed); CHIP_ERROR GetCurrentHeapHighWatermark(uint64_t & currentHeapHighWatermark); + /* + * Get the linked list of thread metrics of the current plaform. After usage, each caller of GetThreadMetrics + * needs to release the thread metrics list it gets via ReleaseThreadMetrics. + * + */ + CHIP_ERROR GetThreadMetrics(ThreadMetrics ** threadMetricsOut); + void ReleaseThreadMetrics(ThreadMetrics * threadMetrics); + /** * General Diagnostics methods. */ @@ -446,6 +465,16 @@ inline CHIP_ERROR PlatformManager::GetCurrentHeapHighWatermark(uint64_t & curren return static_cast(this)->_GetCurrentHeapHighWatermark(currentHeapHighWatermark); } +inline CHIP_ERROR PlatformManager::GetThreadMetrics(ThreadMetrics ** threadMetricsOut) +{ + return static_cast(this)->_GetThreadMetrics(threadMetricsOut); +} + +inline void PlatformManager::ReleaseThreadMetrics(ThreadMetrics * threadMetrics) +{ + return static_cast(this)->_ReleaseThreadMetrics(threadMetrics); +} + inline CHIP_ERROR PlatformManager::GetRebootCount(uint16_t & rebootCount) { return static_cast(this)->_GetRebootCount(rebootCount); diff --git a/src/include/platform/internal/GenericPlatformManagerImpl.h b/src/include/platform/internal/GenericPlatformManagerImpl.h index cd9be3ec4dc668..cf1ebc31fff05a 100644 --- a/src/include/platform/internal/GenericPlatformManagerImpl.h +++ b/src/include/platform/internal/GenericPlatformManagerImpl.h @@ -61,6 +61,8 @@ class GenericPlatformManagerImpl CHIP_ERROR _GetCurrentHeapFree(uint64_t & currentHeapFree); CHIP_ERROR _GetCurrentHeapUsed(uint64_t & currentHeapUsed); CHIP_ERROR _GetCurrentHeapHighWatermark(uint64_t & currentHeapHighWatermark); + CHIP_ERROR _GetThreadMetrics(ThreadMetrics ** threadMetricsOut); + void _ReleaseThreadMetrics(ThreadMetrics * threadMetrics); CHIP_ERROR _GetRebootCount(uint16_t & rebootCount); CHIP_ERROR _GetUpTime(uint64_t & upTime); @@ -100,6 +102,16 @@ inline CHIP_ERROR GenericPlatformManagerImpl::_GetCurrentHeapHighWate return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; } +template +inline CHIP_ERROR GenericPlatformManagerImpl::_GetThreadMetrics(ThreadMetrics ** threadMetricsOut) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +template +inline void GenericPlatformManagerImpl::_ReleaseThreadMetrics(ThreadMetrics * threadMetrics) +{} + template inline CHIP_ERROR GenericPlatformManagerImpl::_GetRebootCount(uint16_t & rebootCount) { diff --git a/src/inet/BUILD.gn b/src/inet/BUILD.gn index ebffb373509ae3..30c60673916893 100644 --- a/src/inet/BUILD.gn +++ b/src/inet/BUILD.gn @@ -49,8 +49,6 @@ buildconfig_header("inet_buildconfig") { defines += [ "INET_PLATFORM_CONFIG_INCLUDE=${chip_inet_platform_config_include}" ] } - - defines += [ "CHIP_INET_END_POINT_IMPL_CONFIG_FILE=" ] } source_set("inet_config_header") { @@ -69,7 +67,7 @@ static_library("inet") { sources = [ "EndPointBasis.h", - "EndPointBasisImpl${chip_system_config_inet}.h", + "EndPointState${chip_system_config_inet}.h", "IANAConstants.h", "IPAddress-StringFuncts.cpp", "IPAddress.cpp", diff --git a/src/inet/EndPointBasis.h b/src/inet/EndPointBasis.h index d7791815052732..0bee2f192770d9 100644 --- a/src/inet/EndPointBasis.h +++ b/src/inet/EndPointBasis.h @@ -39,7 +39,6 @@ class DLL_EXPORT EndPointBase { public: EndPointBase(InetLayer & aInetLayer, void * aAppState = nullptr) : mAppState(aAppState), mInetLayer(aInetLayer) {} - virtual ~EndPointBase() = default; /** * Returns a reference to the Inet layer object that owns this basis object. @@ -54,9 +53,3 @@ class DLL_EXPORT EndPointBase } // namespace Inet } // namespace chip - -#ifdef CHIP_INET_END_POINT_IMPL_CONFIG_FILE -#include CHIP_INET_END_POINT_IMPL_CONFIG_FILE -#else // CHIP_INET_END_POINT_IMPL_CONFIG_FILE -#include -#endif // CHIP_INET_END_POINT_IMPL_CONFIG_FILE diff --git a/src/inet/EndPointBasisImplLwIP.h b/src/inet/EndPointStateLwIP.h similarity index 83% rename from src/inet/EndPointBasisImplLwIP.h rename to src/inet/EndPointStateLwIP.h index 9d398c2bf182d2..ffc1c18b14c5d1 100644 --- a/src/inet/EndPointBasisImplLwIP.h +++ b/src/inet/EndPointStateLwIP.h @@ -17,7 +17,7 @@ */ /** - * LwIP implementation of EndPointBase. + * Shared state for LwIP implementations of TCPEndPoint and UDPEndPoint. */ #pragma once @@ -32,12 +32,10 @@ struct tcp_pcb; namespace chip { namespace Inet { -class DLL_EXPORT EndPointImplLwIP : public EndPointBase +class DLL_EXPORT EndPointStateLwIP { protected: - EndPointImplLwIP(InetLayer & inetLayer, void * appState = nullptr) : - EndPointBase(inetLayer, appState), mLwIPEndPointType(LwIPEndPointType::Unknown) - {} + EndPointStateLwIP() : mLwIPEndPointType(LwIPEndPointType::Unknown) {} /** Encapsulated LwIP protocol control block */ union @@ -59,7 +57,5 @@ class DLL_EXPORT EndPointImplLwIP : public EndPointBase } mLwIPEndPointType; }; -using EndPointBasis = EndPointImplLwIP; - } // namespace Inet } // namespace chip diff --git a/src/inet/EndPointBasisImplNetworkFramework.h b/src/inet/EndPointStateNetworkFramework.h similarity index 77% rename from src/inet/EndPointBasisImplNetworkFramework.h rename to src/inet/EndPointStateNetworkFramework.h index 8b72c18442fc44..5f70d77f5c7de5 100644 --- a/src/inet/EndPointBasisImplNetworkFramework.h +++ b/src/inet/EndPointStateNetworkFramework.h @@ -17,7 +17,7 @@ */ /** - * Network Framework implementation of EndPointBase. + * Shared state for Network Framework implementations of TCPEndPoint and UDPEndPoint. */ #pragma once @@ -31,16 +31,14 @@ namespace chip { namespace Inet { -class DLL_EXPORT EndPointImplNetworkFramework : public EndPointBase +class DLL_EXPORT EndPointStateNetworkFramework { protected: - EndPointImplNetworkFramework(InetLayer & inetLayer, void * appState = nullptr) : EndPointBase(inetLayer, appState) {} + EndPointStateNetworkFramework() {} nw_parameters_t mParameters; IPAddressType mAddrType; /**< Protocol family, i.e. IPv4 or IPv6. */ }; -using EndPointBasis = EndPointImplNetworkFramework; - } // namespace Inet } // namespace chip diff --git a/src/inet/EndPointBasisImplSockets.h b/src/inet/EndPointStateSockets.h similarity index 79% rename from src/inet/EndPointBasisImplSockets.h rename to src/inet/EndPointStateSockets.h index f6c4c474541d57..c83b3a106d689b 100644 --- a/src/inet/EndPointBasisImplSockets.h +++ b/src/inet/EndPointStateSockets.h @@ -17,7 +17,7 @@ */ /** - * Sockets implementation of EndPointBase. + * Shared state for socket implementations of TCPEndPoint and UDPEndPoint. */ #pragma once @@ -30,12 +30,10 @@ namespace chip { namespace Inet { -class DLL_EXPORT EndPointImplSockets : public EndPointBase +class DLL_EXPORT EndPointStateSockets { protected: - EndPointImplSockets(InetLayer & inetLayer, void * appState = nullptr) : - EndPointBase(inetLayer, appState), mSocket(kInvalidSocketFd) - {} + EndPointStateSockets() : mSocket(kInvalidSocketFd) {} static constexpr int kInvalidSocketFd = -1; int mSocket; /**< Encapsulated socket descriptor. */ @@ -43,7 +41,5 @@ class DLL_EXPORT EndPointImplSockets : public EndPointBase System::SocketWatchToken mWatch; /**< Socket event watcher */ }; -using EndPointBasis = EndPointImplSockets; - } // namespace Inet } // namespace chip diff --git a/src/inet/InetInterface.cpp b/src/inet/InetInterface.cpp index 8deff392f258fd..e769a0b369c8e2 100644 --- a/src/inet/InetInterface.cpp +++ b/src/inet/InetInterface.cpp @@ -275,6 +275,35 @@ bool InterfaceAddressIterator::HasBroadcastAddress() return HasCurrent() && mIntfIter.HasBroadcastAddress(); } +CHIP_ERROR InterfaceId::GetLinkLocalAddr(IPAddress * llAddr) +{ + VerifyOrReturnError(llAddr != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + +#if !LWIP_IPV6 + return CHIP_ERROR_NOT_IMPLEMENTED; +#endif //! LWIP_IPV6 + + for (struct netif * intf = netif_list; intf != nullptr; intf = intf->next) + { + if ((mPlatformInterface != nullptr) && (mPlatformInterface != intf)) + continue; + for (int j = 0; j < LWIP_IPV6_NUM_ADDRESSES; ++j) + { + if (ip6_addr_isvalid(netif_ip6_addr_state(intf, j)) && ip6_addr_islinklocal(netif_ip6_addr(intf, j))) + { + (*llAddr) = IPAddress(*netif_ip6_addr(intf, j)); + return CHIP_NO_ERROR; + } + } + if (mPlatformInterface != nullptr) + { + return INET_ERROR_ADDRESS_NOT_FOUND; + } + } + + return CHIP_NO_ERROR; +} + #endif // CHIP_SYSTEM_CONFIG_USE_LWIP #if CHIP_SYSTEM_CONFIG_USE_SOCKETS && CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS @@ -704,6 +733,38 @@ bool InterfaceAddressIterator::HasBroadcastAddress() return HasCurrent() && (mCurAddr->ifa_flags & IFF_BROADCAST) != 0; } +CHIP_ERROR InterfaceId::GetLinkLocalAddr(IPAddress * llAddr) +{ + VerifyOrReturnError(llAddr != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + + struct ifaddrs * ifaddr; + const int rv = getifaddrs(&ifaddr); + if (rv == -1) + { + return INET_ERROR_ADDRESS_NOT_FOUND; + } + + for (struct ifaddrs * ifaddr_iter = ifaddr; ifaddr_iter != nullptr; ifaddr_iter = ifaddr_iter->ifa_next) + { + if (ifaddr_iter->ifa_addr != nullptr) + { + if ((ifaddr_iter->ifa_addr->sa_family == AF_INET6) && + ((mPlatformInterface == 0) || (mPlatformInterface == if_nametoindex(ifaddr_iter->ifa_name)))) + { + struct in6_addr * sin6_addr = &(reinterpret_cast(ifaddr_iter->ifa_addr))->sin6_addr; + if (sin6_addr->s6_addr[0] == 0xfe && (sin6_addr->s6_addr[1] & 0xc0) == 0x80) // Link Local Address + { + (*llAddr) = IPAddress((reinterpret_cast(ifaddr_iter->ifa_addr))->sin6_addr); + break; + } + } + } + } + freeifaddrs(ifaddr); + + return CHIP_NO_ERROR; +} + #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS && CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS #if CHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF @@ -865,8 +926,65 @@ bool InterfaceAddressIterator::HasBroadcastAddress() return HasCurrent() && mIntfIter.HasBroadcastAddress(); } +CHIP_ERROR InterfaceId::GetLinkLocalAddr(IPAddress * llAddr) +{ + VerifyOrReturnError(llAddr != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + + net_if * const iface = mPlatformInterface ? net_if_get_by_index(mPlatformInterface) : net_if_get_default(); + VerifyOrReturnError(iface != nullptr, INET_ERROR_ADDRESS_NOT_FOUND); + + in6_addr * const ip6_addr = net_if_ipv6_get_ll(iface, NET_ADDR_PREFERRED); + VerifyOrReturnError(ip6_addr != nullptr, INET_ERROR_ADDRESS_NOT_FOUND); + + *llAddr = IPAddress(*ip6_addr); + + return CHIP_NO_ERROR; +} + #endif // CHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF +// static +InterfaceId InterfaceId::FromIPAddress(const IPAddress & addr) +{ + InterfaceAddressIterator addrIter; + + for (; addrIter.HasCurrent(); addrIter.Next()) + { + IPAddress curAddr = addrIter.GetAddress(); + if (addr == curAddr) + { + return addrIter.GetInterfaceId(); + } + } + + return InterfaceId::Null(); +} + +// static +bool InterfaceId::MatchLocalIPv6Subnet(const IPAddress & addr) +{ + if (addr.IsIPv6LinkLocal()) + return true; + + InterfaceAddressIterator ifAddrIter; + for (; ifAddrIter.HasCurrent(); ifAddrIter.Next()) + { + IPPrefix addrPrefix; + addrPrefix.IPAddr = ifAddrIter.GetAddress(); +#if INET_CONFIG_ENABLE_IPV4 + if (addrPrefix.IPAddr.IsIPv4()) + continue; +#endif // INET_CONFIG_ENABLE_IPV4 + if (addrPrefix.IPAddr.IsIPv6LinkLocal()) + continue; + addrPrefix.Length = ifAddrIter.GetPrefixLength(); + if (addrPrefix.MatchAddress(addr)) + return true; + } + + return false; +} + void InterfaceAddressIterator::GetAddressWithPrefix(IPPrefix & addrWithPrefix) { if (HasCurrent()) diff --git a/src/inet/InetInterface.h b/src/inet/InetInterface.h index 1de4b17ef63be3..29a9b76bf9c878 100644 --- a/src/inet/InetInterface.h +++ b/src/inet/InetInterface.h @@ -137,6 +137,39 @@ class InterfaceId */ static CHIP_ERROR InterfaceNameToId(const char * intfName, InterfaceId & intfId); + /** + * Get the interface identifier for the specified IP address. If the + * interface identifier cannot be derived it is set to the default InterfaceId. + * + * @note + * This function fetches the first interface (from the configured list + * of interfaces) that matches the specified IP address. + */ + static InterfaceId FromIPAddress(const IPAddress & addr); + + /** + * Check if there is a prefix match between the specified IPv6 address and any of + * the locally configured IPv6 addresses. + * + * @param[in] addr The IPv6 address to check for the prefix-match. + * @return true if a successful match is found, otherwise false. + */ + static bool MatchLocalIPv6Subnet(const IPAddress & addr); + + /** + * Get the link local IPv6 address. + * + * @param[out] llAddr The link local IPv6 address for the link. + * + * @retval #CHIP_ERROR_NOT_IMPLEMENTED If IPv6 is not supported. + * @retval #CHIP_ERROR_INVALID_ARGUMENT If the link local address + * is nullptr. + * @retval #INET_ERROR_ADDRESS_NOT_FOUND If the link does not have + * any address configured. + * @retval #CHIP_NO_ERROR On success. + */ + CHIP_ERROR GetLinkLocalAddr(IPAddress * llAddr); + private: #if CHIP_SYSTEM_CONFIG_USE_LWIP static constexpr PlatformType kPlatformNull = nullptr; diff --git a/src/inet/InetLayer.cpp b/src/inet/InetLayer.cpp index 7f5481b888511b..8b006a0f83f7b3 100644 --- a/src/inet/InetLayer.cpp +++ b/src/inet/InetLayer.cpp @@ -150,7 +150,7 @@ CHIP_ERROR InetLayer::Shutdown() #if INET_CONFIG_ENABLE_TCP_ENDPOINT // Abort all TCP endpoints owned by this instance. - TCPEndPoint::sPool.ForEachActiveObject([&](TCPEndPoint * lEndPoint) { + TCPEndPointImpl::sPool.ForEachActiveObject([&](TCPEndPoint * lEndPoint) { if ((lEndPoint != nullptr) && &lEndPoint->Layer() == this) { lEndPoint->Abort(); @@ -161,7 +161,7 @@ CHIP_ERROR InetLayer::Shutdown() #if INET_CONFIG_ENABLE_UDP_ENDPOINT // Close all UDP endpoints owned by this instance. - UDPEndPoint::sPool.ForEachActiveObject([&](UDPEndPoint * lEndPoint) { + UDPEndPointImpl::sPool.ForEachActiveObject([&](UDPEndPoint * lEndPoint) { if ((lEndPoint != nullptr) && &lEndPoint->Layer() == this) { lEndPoint->Close(); @@ -206,7 +206,7 @@ bool InetLayer::IsIdleTimerRunning() bool timerRunning = false; // See if there are any TCP connections with the idle timer check in use. - TCPEndPoint::sPool.ForEachActiveObject([&](TCPEndPoint * lEndPoint) { + TCPEndPointImpl::sPool.ForEachActiveObject([&](TCPEndPoint * lEndPoint) { if ((lEndPoint != nullptr) && (lEndPoint->mIdleTimeout != 0)) { timerRunning = true; @@ -219,91 +219,6 @@ bool InetLayer::IsIdleTimerRunning() } #endif // INET_CONFIG_ENABLE_TCP_ENDPOINT && INET_TCP_IDLE_CHECK_INTERVAL > 0 -/** - * Get the link local IPv6 address for a specified link or interface. - * - * @param[in] interface The interface for which the link local IPv6 - * address is being sought. - * - * @param[out] llAddr The link local IPv6 address for the link. - * - * @retval #CHIP_ERROR_NOT_IMPLEMENTED If IPv6 is not supported. - * @retval #CHIP_ERROR_INVALID_ARGUMENT If the link local address - * is nullptr. - * @retval #INET_ERROR_ADDRESS_NOT_FOUND If the link does not have - * any address configured. - * @retval #CHIP_NO_ERROR On success. - * - */ -CHIP_ERROR InetLayer::GetLinkLocalAddr(InterfaceId interface, IPAddress * llAddr) -{ - VerifyOrReturnError(llAddr != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - -#if CHIP_SYSTEM_CONFIG_USE_LWIP -#if !LWIP_IPV6 - return CHIP_ERROR_NOT_IMPLEMENTED; -#endif //! LWIP_IPV6 - - struct netif * link = interface.GetPlatformInterface(); - for (struct netif * intf = netif_list; intf != NULL; intf = intf->next) - { - if ((link != NULL) && (link != intf)) - continue; - for (int j = 0; j < LWIP_IPV6_NUM_ADDRESSES; ++j) - { - if (ip6_addr_isvalid(netif_ip6_addr_state(intf, j)) && ip6_addr_islinklocal(netif_ip6_addr(intf, j))) - { - (*llAddr) = IPAddress(*netif_ip6_addr(intf, j)); - return CHIP_NO_ERROR; - } - } - if (link != NULL) - { - return INET_ERROR_ADDRESS_NOT_FOUND; - } - } -#endif // CHIP_SYSTEM_CONFIG_USE_LWIP - -#if CHIP_SYSTEM_CONFIG_USE_SOCKETS && CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS - struct ifaddrs * ifaddr; - const int rv = getifaddrs(&ifaddr); - if (rv == -1) - { - return INET_ERROR_ADDRESS_NOT_FOUND; - } - - for (struct ifaddrs * ifaddr_iter = ifaddr; ifaddr_iter != nullptr; ifaddr_iter = ifaddr_iter->ifa_next) - { - if (ifaddr_iter->ifa_addr != nullptr) - { - if ((ifaddr_iter->ifa_addr->sa_family == AF_INET6) && - (!interface.IsPresent() || (if_nametoindex(ifaddr_iter->ifa_name) == interface.GetPlatformInterface()))) - { - struct in6_addr * sin6_addr = &(reinterpret_cast(ifaddr_iter->ifa_addr))->sin6_addr; - if (sin6_addr->s6_addr[0] == 0xfe && (sin6_addr->s6_addr[1] & 0xc0) == 0x80) // Link Local Address - { - (*llAddr) = IPAddress((reinterpret_cast(ifaddr_iter->ifa_addr))->sin6_addr); - break; - } - } - } - } - freeifaddrs(ifaddr); -#endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS && CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS - -#if CHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF - net_if * const iface = interface.IsPresent() ? net_if_get_by_index(interface.GetPlatformInterface()) : net_if_get_default(); - VerifyOrReturnError(iface != nullptr, INET_ERROR_ADDRESS_NOT_FOUND); - - in6_addr * const ip6_addr = net_if_ipv6_get_ll(iface, NET_ADDR_PREFERRED); - VerifyOrReturnError(ip6_addr != nullptr, INET_ERROR_ADDRESS_NOT_FOUND); - - *llAddr = IPAddress(*ip6_addr); -#endif // CHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF - - return CHIP_NO_ERROR; -} - #if INET_CONFIG_ENABLE_TCP_ENDPOINT /** * Creates a new TCPEndPoint object. @@ -330,7 +245,7 @@ CHIP_ERROR InetLayer::NewTCPEndPoint(TCPEndPoint ** retEndPoint) VerifyOrReturnError(mLayerState.IsInitialized(), CHIP_ERROR_INCORRECT_STATE); - *retEndPoint = TCPEndPoint::sPool.CreateObject(*this); + *retEndPoint = TCPEndPointImpl::sPool.CreateObject(*this); if (*retEndPoint == nullptr) { ChipLogError(Inet, "%s endpoint pool FULL", "TCP"); @@ -369,7 +284,7 @@ CHIP_ERROR InetLayer::NewUDPEndPoint(UDPEndPoint ** retEndPoint) VerifyOrReturnError(mLayerState.IsInitialized(), CHIP_ERROR_INCORRECT_STATE); - *retEndPoint = UDPEndPoint::sPool.CreateObject(*this); + *retEndPoint = UDPEndPointImpl::sPool.CreateObject(*this); if (*retEndPoint == nullptr) { ChipLogError(Inet, "%s endpoint pool FULL", "UDP"); @@ -382,81 +297,13 @@ CHIP_ERROR InetLayer::NewUDPEndPoint(UDPEndPoint ** retEndPoint) } #endif // INET_CONFIG_ENABLE_UDP_ENDPOINT -/** - * Get the interface identifier for the specified IP address. If the - * interface identifier cannot be derived it is set to the default - * InterfaceId. - * - * @note - * This function fetches the first interface (from the configured list - * of interfaces) that matches the specified IP address. - * - * @param[in] addr A reference to the IPAddress object. - * - * @param[out] intfId A reference to the InterfaceId object. - * - * @return #CHIP_NO_ERROR unconditionally. - * - */ -CHIP_ERROR InetLayer::GetInterfaceFromAddr(const IPAddress & addr, InterfaceId & intfId) -{ - InterfaceAddressIterator addrIter; - - for (; addrIter.HasCurrent(); addrIter.Next()) - { - IPAddress curAddr = addrIter.GetAddress(); - if (addr == curAddr) - { - intfId = addrIter.GetInterfaceId(); - return CHIP_NO_ERROR; - } - } - - intfId = InterfaceId::Null(); - - return CHIP_NO_ERROR; -} - -/** - * Check if there is a prefix match between the specified IPv6 address and any of - * the locally configured IPv6 addresses. - * - * @param[in] addr The IPv6 address to check for the prefix-match. - * - * @return true if a successful match is found, otherwise false. - * - */ -bool InetLayer::MatchLocalIPv6Subnet(const IPAddress & addr) -{ - if (addr.IsIPv6LinkLocal()) - return true; - - InterfaceAddressIterator ifAddrIter; - for (; ifAddrIter.HasCurrent(); ifAddrIter.Next()) - { - IPPrefix addrPrefix; - addrPrefix.IPAddr = ifAddrIter.GetAddress(); -#if INET_CONFIG_ENABLE_IPV4 - if (addrPrefix.IPAddr.IsIPv4()) - continue; -#endif // INET_CONFIG_ENABLE_IPV4 - if (addrPrefix.IPAddr.IsIPv6LinkLocal()) - continue; - addrPrefix.Length = ifAddrIter.GetPrefixLength(); - if (addrPrefix.MatchAddress(addr)) - return true; - } - - return false; -} - #if INET_CONFIG_ENABLE_TCP_ENDPOINT && INET_TCP_IDLE_CHECK_INTERVAL > 0 void InetLayer::HandleTCPInactivityTimer(chip::System::Layer * aSystemLayer, void * aAppState) { InetLayer & lInetLayer = *reinterpret_cast(aAppState); bool lTimerRequired = lInetLayer.IsIdleTimerRunning(); - TCPEndPoint::sPool.ForEachActiveObject([&](TCPEndPoint * lEndPoint) { + TCPEndPointImpl::sPool.ForEachActiveObject([&](TCPEndPoint * lEndPoint) { if (&lEndPoint->Layer() != &lInetLayer) return true; if (!lEndPoint->IsConnected()) diff --git a/src/inet/InetLayer.h b/src/inet/InetLayer.h index 5372f9c388d388..9ebbff3f136f58 100644 --- a/src/inet/InetLayer.h +++ b/src/inet/InetLayer.h @@ -125,13 +125,6 @@ class DLL_EXPORT InetLayer CHIP_ERROR NewUDPEndPoint(UDPEndPoint ** retEndPoint); #endif // INET_CONFIG_ENABLE_UDP_ENDPOINT - // DNS Resolution - - CHIP_ERROR GetInterfaceFromAddr(const IPAddress & addr, InterfaceId & intfId); - - CHIP_ERROR GetLinkLocalAddr(InterfaceId link, IPAddress * llAddr); - bool MatchLocalIPv6Subnet(const IPAddress & addr); - void * GetPlatformData(); void SetPlatformData(void * aPlatformData); diff --git a/src/inet/TCPEndPoint.cpp b/src/inet/TCPEndPoint.cpp index f93f68805c5d71..56fe46609648a0 100644 --- a/src/inet/TCPEndPoint.cpp +++ b/src/inet/TCPEndPoint.cpp @@ -87,9 +87,10 @@ namespace chip { namespace Inet { -BitMapObjectPool TCPEndPoint::sPool; - #if CHIP_SYSTEM_CONFIG_USE_LWIP + +BitMapObjectPool TCPEndPointImplLwIP::sPool; + namespace { /* @@ -108,7 +109,7 @@ err_t start_tcp_timers(void) } // anonymous namespace -CHIP_ERROR TCPEndPoint::BindImpl(IPAddressType addrType, const IPAddress & addr, uint16_t port, bool reuseAddr) +CHIP_ERROR TCPEndPointImplLwIP::BindImpl(IPAddressType addrType, const IPAddress & addr, uint16_t port, bool reuseAddr) { // Lock LwIP stack LOCK_TCPIP_CORE(); @@ -170,7 +171,7 @@ CHIP_ERROR TCPEndPoint::BindImpl(IPAddressType addrType, const IPAddress & addr, return res; } -CHIP_ERROR TCPEndPoint::ListenImpl(uint16_t backlog) +CHIP_ERROR TCPEndPointImplLwIP::ListenImpl(uint16_t backlog) { // Start listening for incoming connections. mTCP = tcp_listen(mTCP); @@ -183,7 +184,7 @@ CHIP_ERROR TCPEndPoint::ListenImpl(uint16_t backlog) return CHIP_NO_ERROR; } -CHIP_ERROR TCPEndPoint::ConnectImpl(const IPAddress & addr, uint16_t port, InterfaceId intfId) +CHIP_ERROR TCPEndPointImplLwIP::ConnectImpl(const IPAddress & addr, uint16_t port, InterfaceId intfId) { CHIP_ERROR res = CHIP_NO_ERROR; IPAddressType addrType = addr.Type(); @@ -195,12 +196,11 @@ CHIP_ERROR TCPEndPoint::ConnectImpl(const IPAddress & addr, uint16_t port, Inter if (intfId.IsPresent()) { IPAddress intfLLAddr; - InetLayer & lInetLayer = Layer(); if (!addr.IsIPv6LinkLocal() || mState == State::kBound) return CHIP_ERROR_NOT_IMPLEMENTED; - res = lInetLayer.GetLinkLocalAddr(intfId, &intfLLAddr); + res = intfId.GetLinkLocalAddr(&intfLLAddr); if (res != CHIP_NO_ERROR) return res; @@ -261,7 +261,7 @@ CHIP_ERROR TCPEndPoint::ConnectImpl(const IPAddress & addr, uint16_t port, Inter return res; } -CHIP_ERROR TCPEndPoint::GetPeerInfo(IPAddress * retAddr, uint16_t * retPort) const +CHIP_ERROR TCPEndPointImplLwIP::GetPeerInfo(IPAddress * retAddr, uint16_t * retPort) const { VerifyOrReturnError(IsConnected(), CHIP_ERROR_INCORRECT_STATE); @@ -291,7 +291,7 @@ CHIP_ERROR TCPEndPoint::GetPeerInfo(IPAddress * retAddr, uint16_t * retPort) con return res; } -CHIP_ERROR TCPEndPoint::GetLocalInfo(IPAddress * retAddr, uint16_t * retPort) const +CHIP_ERROR TCPEndPointImplLwIP::GetLocalInfo(IPAddress * retAddr, uint16_t * retPort) const { VerifyOrReturnError(IsConnected(), CHIP_ERROR_INCORRECT_STATE); @@ -321,7 +321,7 @@ CHIP_ERROR TCPEndPoint::GetLocalInfo(IPAddress * retAddr, uint16_t * retPort) co return res; } -CHIP_ERROR TCPEndPoint::GetInterfaceId(InterfaceId * retInterface) +CHIP_ERROR TCPEndPointImplLwIP::GetInterfaceId(InterfaceId * retInterface) { VerifyOrReturnError(IsConnected(), CHIP_ERROR_INCORRECT_STATE); @@ -332,7 +332,7 @@ CHIP_ERROR TCPEndPoint::GetInterfaceId(InterfaceId * retInterface) return CHIP_NO_ERROR; } -CHIP_ERROR TCPEndPoint::SendQueuedImpl(bool queueWasEmpty) +CHIP_ERROR TCPEndPointImplLwIP::SendQueuedImpl(bool queueWasEmpty) { #if INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT if (!mUserTimeoutTimerRunning) @@ -345,7 +345,7 @@ CHIP_ERROR TCPEndPoint::SendQueuedImpl(bool queueWasEmpty) return CHIP_NO_ERROR; } -CHIP_ERROR TCPEndPoint::EnableNoDelay() +CHIP_ERROR TCPEndPointImplLwIP::EnableNoDelay() { VerifyOrReturnError(IsConnected(), CHIP_ERROR_INCORRECT_STATE); @@ -365,7 +365,7 @@ CHIP_ERROR TCPEndPoint::EnableNoDelay() return res; } -CHIP_ERROR TCPEndPoint::EnableKeepAlive(uint16_t interval, uint16_t timeoutCount) +CHIP_ERROR TCPEndPointImplLwIP::EnableKeepAlive(uint16_t interval, uint16_t timeoutCount) { VerifyOrReturnError(IsConnected(), CHIP_ERROR_INCORRECT_STATE); CHIP_ERROR res = CHIP_ERROR_NOT_IMPLEMENTED; @@ -403,7 +403,7 @@ CHIP_ERROR TCPEndPoint::EnableKeepAlive(uint16_t interval, uint16_t timeoutCount return res; } -CHIP_ERROR TCPEndPoint::DisableKeepAlive() +CHIP_ERROR TCPEndPointImplLwIP::DisableKeepAlive() { VerifyOrReturnError(IsConnected(), CHIP_ERROR_INCORRECT_STATE); CHIP_ERROR res = CHIP_ERROR_NOT_IMPLEMENTED; @@ -432,17 +432,12 @@ CHIP_ERROR TCPEndPoint::DisableKeepAlive() return res; } -CHIP_ERROR TCPEndPoint::SetUserTimeoutImpl(uint32_t userTimeoutMillis) +CHIP_ERROR TCPEndPointImplLwIP::SetUserTimeoutImpl(uint32_t userTimeoutMillis) { return CHIP_ERROR_NOT_IMPLEMENTED; } -void TCPEndPoint::InitImpl() -{ - mUnackedLength = 0; -} - -CHIP_ERROR TCPEndPoint::DriveSendingImpl() +CHIP_ERROR TCPEndPointImplLwIP::DriveSendingImpl() { CHIP_ERROR err = CHIP_NO_ERROR; @@ -463,7 +458,7 @@ CHIP_ERROR TCPEndPoint::DriveSendingImpl() { // Find first packet buffer with remaining data to send by skipping // all sent but un-acked data. - TCPEndPoint::BufferOffset startOfUnsent = FindStartOfUnsent(); + TCPEndPointImplLwIP::BufferOffset startOfUnsent = FindStartOfUnsent(); // While there's data to be sent and a window to send it in... do @@ -547,9 +542,9 @@ CHIP_ERROR TCPEndPoint::DriveSendingImpl() return err; } -void TCPEndPoint::HandleConnectCompleteImpl() {} +void TCPEndPointImplLwIP::HandleConnectCompleteImpl() {} -void TCPEndPoint::DoCloseImpl(CHIP_ERROR err, State oldState) +void TCPEndPointImplLwIP::DoCloseImpl(CHIP_ERROR err, State oldState) { // Lock LwIP stack LOCK_TCPIP_CORE(); @@ -622,7 +617,7 @@ void TCPEndPoint::DoCloseImpl(CHIP_ERROR err, State oldState) } } -CHIP_ERROR TCPEndPoint::AckReceive(uint16_t len) +CHIP_ERROR TCPEndPointImplLwIP::AckReceive(uint16_t len) { VerifyOrReturnError(IsConnected(), CHIP_ERROR_INCORRECT_STATE); CHIP_ERROR res = CHIP_NO_ERROR; @@ -642,23 +637,18 @@ CHIP_ERROR TCPEndPoint::AckReceive(uint16_t len) } #if INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT -void TCPEndPoint::TCPUserTimeoutHandler(chip::System::Layer * aSystemLayer, void * aAppState) +void TCPEndPointImplLwIP::TCPUserTimeoutHandler() { - TCPEndPoint * tcpEndPoint = reinterpret_cast(aAppState); - - VerifyOrDie((aSystemLayer != nullptr) && (tcpEndPoint != nullptr)); - // Set the timer running flag to false - tcpEndPoint->mUserTimeoutTimerRunning = false; + mUserTimeoutTimerRunning = false; // Close Connection as we have timed out and there is still // data not sent out successfully. - - tcpEndPoint->DoClose(INET_ERROR_TCP_USER_TIMEOUT, false); + DoClose(INET_ERROR_TCP_USER_TIMEOUT, false); } #endif // INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT -uint16_t TCPEndPoint::RemainingToSend() +uint16_t TCPEndPointImplLwIP::RemainingToSend() { if (mSendQueue.IsNull()) { @@ -674,7 +664,7 @@ uint16_t TCPEndPoint::RemainingToSend() } } -TCPEndPoint::BufferOffset TCPEndPoint::FindStartOfUnsent() +TCPEndPointImplLwIP::BufferOffset TCPEndPointImplLwIP::FindStartOfUnsent() { // Find first packet buffer with remaining data to send by skipping // all sent but un-acked data. This is necessary because of the Consume() @@ -686,7 +676,7 @@ TCPEndPoint::BufferOffset TCPEndPoint::FindStartOfUnsent() // unsent data while retaining the buffers that have un-acked data is to // traverse all sent-but-unacked data in the chain to reach the beginning // of ready-to-send data. - TCPEndPoint::BufferOffset startOfUnsent(mSendQueue.Retain()); + TCPEndPointImplLwIP::BufferOffset startOfUnsent(mSendQueue.Retain()); uint16_t leftToSkip = mUnackedLength; VerifyOrDie(leftToSkip < mSendQueue->TotalLength()); @@ -714,7 +704,7 @@ TCPEndPoint::BufferOffset TCPEndPoint::FindStartOfUnsent() return startOfUnsent; } -CHIP_ERROR TCPEndPoint::GetPCB(IPAddressType addrType) +CHIP_ERROR TCPEndPointImplLwIP::GetPCB(IPAddressType addrType) { // IMMPORTANT: This method MUST be called with the LwIP stack LOCKED! @@ -801,7 +791,7 @@ CHIP_ERROR TCPEndPoint::GetPCB(IPAddressType addrType) return CHIP_NO_ERROR; } -void TCPEndPoint::HandleDataSent(uint16_t lenSent) +void TCPEndPointImplLwIP::HandleDataSent(uint16_t lenSent) { if (IsConnected()) { @@ -868,7 +858,7 @@ void TCPEndPoint::HandleDataSent(uint16_t lenSent) } } -void TCPEndPoint::HandleDataReceived(System::PacketBufferHandle && buf) +void TCPEndPointImplLwIP::HandleDataReceived(System::PacketBufferHandle && buf) { // Only receive new data while in the Connected or SendShutdown states. if (mState == State::kConnected || mState == State::kSendShutdown) @@ -915,7 +905,7 @@ void TCPEndPoint::HandleDataReceived(System::PacketBufferHandle && buf) } } -void TCPEndPoint::HandleIncomingConnection(TCPEndPoint * conEP) +void TCPEndPointImplLwIP::HandleIncomingConnection(TCPEndPoint * conEP) { CHIP_ERROR err = CHIP_NO_ERROR; IPAddress peerAddr; @@ -947,7 +937,7 @@ void TCPEndPoint::HandleIncomingConnection(TCPEndPoint * conEP) conEP->Free(); } -void TCPEndPoint::HandleError(CHIP_ERROR err) +void TCPEndPointImplLwIP::HandleError(CHIP_ERROR err) { if (mState == State::kListening) { @@ -958,13 +948,13 @@ void TCPEndPoint::HandleError(CHIP_ERROR err) DoClose(err, false); } -err_t TCPEndPoint::LwIPHandleConnectComplete(void * arg, struct tcp_pcb * tpcb, err_t lwipErr) +err_t TCPEndPointImplLwIP::LwIPHandleConnectComplete(void * arg, struct tcp_pcb * tpcb, err_t lwipErr) { err_t res = ERR_OK; if (arg != NULL) { - TCPEndPoint * ep = static_cast(arg); + TCPEndPointImplLwIP * ep = static_cast(arg); System::Layer * lSystemLayer = ep->Layer().SystemLayer(); if (lwipErr == ERR_OK) @@ -995,15 +985,15 @@ err_t TCPEndPoint::LwIPHandleConnectComplete(void * arg, struct tcp_pcb * tpcb, return res; } -err_t TCPEndPoint::LwIPHandleIncomingConnection(void * arg, struct tcp_pcb * tpcb, err_t lwipErr) +err_t TCPEndPointImplLwIP::LwIPHandleIncomingConnection(void * arg, struct tcp_pcb * tpcb, err_t lwipErr) { CHIP_ERROR err = chip::System::MapErrorLwIP(lwipErr); if (arg != NULL) { - TCPEndPoint * listenEP = static_cast(arg); - TCPEndPoint * conEP = NULL; - System::Layer * lSystemLayer = listenEP->Layer().SystemLayer(); + TCPEndPointImplLwIP * listenEP = static_cast(arg); + TCPEndPointImplLwIP * conEP = NULL; + System::Layer * lSystemLayer = listenEP->Layer().SystemLayer(); // Tell LwIP we've accepted the connection so it can decrement the listen PCB's pending_accepts counter. tcp_accepted(listenEP->mTCP); @@ -1019,7 +1009,9 @@ err_t TCPEndPoint::LwIPHandleIncomingConnection(void * arg, struct tcp_pcb * tpc { InetLayer & lInetLayer = listenEP->Layer(); - err = lInetLayer.NewTCPEndPoint(&conEP); + TCPEndPoint * connectEndPoint = nullptr; + err = lInetLayer.NewTCPEndPoint(&connectEndPoint); + conEP = static_cast(connectEndPoint); } // Ensure that TCP timers have been started @@ -1093,13 +1085,13 @@ err_t TCPEndPoint::LwIPHandleIncomingConnection(void * arg, struct tcp_pcb * tpc } } -err_t TCPEndPoint::LwIPHandleDataReceived(void * arg, struct tcp_pcb * tpcb, struct pbuf * p, err_t _err) +err_t TCPEndPointImplLwIP::LwIPHandleDataReceived(void * arg, struct tcp_pcb * tpcb, struct pbuf * p, err_t _err) { err_t res = ERR_OK; if (arg != NULL) { - TCPEndPoint * ep = static_cast(arg); + TCPEndPointImplLwIP * ep = static_cast(arg); System::Layer * lSystemLayer = ep->Layer().SystemLayer(); // Post callback to HandleDataReceived. @@ -1129,13 +1121,13 @@ err_t TCPEndPoint::LwIPHandleDataReceived(void * arg, struct tcp_pcb * tpcb, str return res; } -err_t TCPEndPoint::LwIPHandleDataSent(void * arg, struct tcp_pcb * tpcb, u16_t len) +err_t TCPEndPointImplLwIP::LwIPHandleDataSent(void * arg, struct tcp_pcb * tpcb, u16_t len) { err_t res = ERR_OK; if (arg != NULL) { - TCPEndPoint * ep = static_cast(arg); + TCPEndPointImplLwIP * ep = static_cast(arg); System::Layer * lSystemLayer = ep->Layer().SystemLayer(); // Post callback to HandleDataReceived. @@ -1159,11 +1151,11 @@ err_t TCPEndPoint::LwIPHandleDataSent(void * arg, struct tcp_pcb * tpcb, u16_t l return res; } -void TCPEndPoint::LwIPHandleError(void * arg, err_t lwipErr) +void TCPEndPointImplLwIP::LwIPHandleError(void * arg, err_t lwipErr) { if (arg != NULL) { - TCPEndPoint * ep = static_cast(arg); + TCPEndPointImplLwIP * ep = static_cast(arg); System::LayerLwIP * lSystemLayer = static_cast(ep->Layer().SystemLayer()); // At this point LwIP has already freed the PCB. Since the thread that owns the TCPEndPoint may @@ -1189,7 +1181,9 @@ void TCPEndPoint::LwIPHandleError(void * arg, err_t lwipErr) #if CHIP_SYSTEM_CONFIG_USE_SOCKETS -CHIP_ERROR TCPEndPoint::BindImpl(IPAddressType addrType, const IPAddress & addr, uint16_t port, bool reuseAddr) +BitMapObjectPool TCPEndPointImplSockets::sPool; + +CHIP_ERROR TCPEndPointImplSockets::BindImpl(IPAddressType addrType, const IPAddress & addr, uint16_t port, bool reuseAddr) { CHIP_ERROR res = GetSocket(addrType); @@ -1281,7 +1275,7 @@ CHIP_ERROR TCPEndPoint::BindImpl(IPAddressType addrType, const IPAddress & addr, return res; } -CHIP_ERROR TCPEndPoint::ListenImpl(uint16_t backlog) +CHIP_ERROR TCPEndPointImplSockets::ListenImpl(uint16_t backlog) { if (listen(mSocket, backlog) != 0) { @@ -1303,7 +1297,7 @@ CHIP_ERROR TCPEndPoint::ListenImpl(uint16_t backlog) return res; } -CHIP_ERROR TCPEndPoint::ConnectImpl(const IPAddress & addr, uint16_t port, InterfaceId intfId) +CHIP_ERROR TCPEndPointImplSockets::ConnectImpl(const IPAddress & addr, uint16_t port, InterfaceId intfId) { IPAddressType addrType = addr.Type(); @@ -1430,17 +1424,18 @@ CHIP_ERROR TCPEndPoint::ConnectImpl(const IPAddress & addr, uint16_t port, Inter return CHIP_NO_ERROR; } -CHIP_ERROR TCPEndPoint::GetPeerInfo(IPAddress * retAddr, uint16_t * retPort) const +CHIP_ERROR TCPEndPointImplSockets::GetPeerInfo(IPAddress * retAddr, uint16_t * retPort) const { return GetSocketInfo(getpeername, retAddr, retPort); } -CHIP_ERROR TCPEndPoint::GetLocalInfo(IPAddress * retAddr, uint16_t * retPort) const +CHIP_ERROR TCPEndPointImplSockets::GetLocalInfo(IPAddress * retAddr, uint16_t * retPort) const { return GetSocketInfo(getsockname, retAddr, retPort); } -CHIP_ERROR TCPEndPoint::GetSocketInfo(int getname(int, sockaddr *, socklen_t *), IPAddress * retAddr, uint16_t * retPort) const +CHIP_ERROR TCPEndPointImplSockets::GetSocketInfo(int getname(int, sockaddr *, socklen_t *), IPAddress * retAddr, + uint16_t * retPort) const { VerifyOrReturnError(IsConnected(), CHIP_ERROR_INCORRECT_STATE); @@ -1472,7 +1467,7 @@ CHIP_ERROR TCPEndPoint::GetSocketInfo(int getname(int, sockaddr *, socklen_t *), return CHIP_ERROR_INCORRECT_STATE; } -CHIP_ERROR TCPEndPoint::GetInterfaceId(InterfaceId * retInterface) +CHIP_ERROR TCPEndPointImplSockets::GetInterfaceId(InterfaceId * retInterface) { VerifyOrReturnError(IsConnected(), CHIP_ERROR_INCORRECT_STATE); @@ -1512,7 +1507,7 @@ CHIP_ERROR TCPEndPoint::GetInterfaceId(InterfaceId * retInterface) return INET_ERROR_WRONG_ADDRESS_TYPE; } -CHIP_ERROR TCPEndPoint::SendQueuedImpl(bool queueWasEmpty) +CHIP_ERROR TCPEndPointImplSockets::SendQueuedImpl(bool queueWasEmpty) { if (queueWasEmpty) { @@ -1522,7 +1517,7 @@ CHIP_ERROR TCPEndPoint::SendQueuedImpl(bool queueWasEmpty) return CHIP_NO_ERROR; } -CHIP_ERROR TCPEndPoint::EnableNoDelay() +CHIP_ERROR TCPEndPointImplSockets::EnableNoDelay() { VerifyOrReturnError(IsConnected(), CHIP_ERROR_INCORRECT_STATE); @@ -1538,7 +1533,7 @@ CHIP_ERROR TCPEndPoint::EnableNoDelay() return CHIP_NO_ERROR; } -CHIP_ERROR TCPEndPoint::EnableKeepAlive(uint16_t interval, uint16_t timeoutCount) +CHIP_ERROR TCPEndPointImplSockets::EnableKeepAlive(uint16_t interval, uint16_t timeoutCount) { VerifyOrReturnError(IsConnected(), CHIP_ERROR_INCORRECT_STATE); @@ -1573,7 +1568,7 @@ CHIP_ERROR TCPEndPoint::EnableKeepAlive(uint16_t interval, uint16_t timeoutCount return CHIP_NO_ERROR; } -CHIP_ERROR TCPEndPoint::DisableKeepAlive() +CHIP_ERROR TCPEndPointImplSockets::DisableKeepAlive() { VerifyOrReturnError(IsConnected(), CHIP_ERROR_INCORRECT_STATE); @@ -1587,7 +1582,7 @@ CHIP_ERROR TCPEndPoint::DisableKeepAlive() return CHIP_NO_ERROR; } -CHIP_ERROR TCPEndPoint::AckReceive(uint16_t len) +CHIP_ERROR TCPEndPointImplSockets::AckReceive(uint16_t len) { VerifyOrReturnError(IsConnected(), CHIP_ERROR_INCORRECT_STATE); @@ -1595,7 +1590,7 @@ CHIP_ERROR TCPEndPoint::AckReceive(uint16_t len) return CHIP_NO_ERROR; } -CHIP_ERROR TCPEndPoint::SetUserTimeoutImpl(uint32_t userTimeoutMillis) +CHIP_ERROR TCPEndPointImplSockets::SetUserTimeoutImpl(uint32_t userTimeoutMillis) { #if defined(TCP_USER_TIMEOUT) // Set the user timeout @@ -1610,15 +1605,7 @@ CHIP_ERROR TCPEndPoint::SetUserTimeoutImpl(uint32_t userTimeoutMillis) #endif // defined(TCP_USER_TIMEOUT) } -void TCPEndPoint::InitImpl() -{ -#if INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT - mBytesWrittenSinceLastProbe = 0; - mLastTCPKernelSendQueueLen = 0; -#endif // INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT -} - -CHIP_ERROR TCPEndPoint::DriveSendingImpl() +CHIP_ERROR TCPEndPointImplSockets::DriveSendingImpl() { CHIP_ERROR err = CHIP_NO_ERROR; @@ -1739,7 +1726,7 @@ CHIP_ERROR TCPEndPoint::DriveSendingImpl() return err; } -void TCPEndPoint::HandleConnectCompleteImpl() +void TCPEndPointImplSockets::HandleConnectCompleteImpl() { // Wait for ability to read or write on this endpoint. CHIP_ERROR err = static_cast(Layer().SystemLayer())->RequestCallbackOnPendingRead(mWatch); @@ -1754,7 +1741,7 @@ void TCPEndPoint::HandleConnectCompleteImpl() } } -void TCPEndPoint::DoCloseImpl(CHIP_ERROR err, State oldState) +void TCPEndPointImplSockets::DoCloseImpl(CHIP_ERROR err, State oldState) { struct linger lingerStruct; @@ -1799,30 +1786,26 @@ void TCPEndPoint::DoCloseImpl(CHIP_ERROR err, State oldState) } #if INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT -void TCPEndPoint::TCPUserTimeoutHandler(chip::System::Layer * aSystemLayer, void * aAppState) +void TCPEndPointImplSockets::TCPUserTimeoutHandler() { - TCPEndPoint * tcpEndPoint = reinterpret_cast(aAppState); - - VerifyOrDie((aSystemLayer != nullptr) && (tcpEndPoint != nullptr)); - // Set the timer running flag to false - tcpEndPoint->mUserTimeoutTimerRunning = false; + mUserTimeoutTimerRunning = false; CHIP_ERROR err = CHIP_NO_ERROR; bool isProgressing = false; - err = tcpEndPoint->CheckConnectionProgress(isProgressing); + err = CheckConnectionProgress(isProgressing); SuccessOrExit(err); - if (tcpEndPoint->mLastTCPKernelSendQueueLen == 0) + if (mLastTCPKernelSendQueueLen == 0) { #if INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS // If the kernel TCP send queue as well as the TCPEndPoint // send queue have been flushed then notify application // that all data has been acknowledged. - if (tcpEndPoint->mSendQueue.IsNull()) + if (mSendQueue.IsNull()) { - tcpEndPoint->SetTCPSendIdleAndNotifyChange(true); + SetTCPSendIdleAndNotifyChange(true); } #endif // INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS } @@ -1835,7 +1818,7 @@ void TCPEndPoint::TCPUserTimeoutHandler(chip::System::Layer * aSystemLayer, void // to shift it forward while also resetting the max // poll count. - tcpEndPoint->StartTCPUserTimeoutTimer(); + StartTCPUserTimeoutTimer(); } else { @@ -1843,13 +1826,13 @@ void TCPEndPoint::TCPUserTimeoutHandler(chip::System::Layer * aSystemLayer, void // Data flow is not progressing. // Decrement the remaining max TCP send queue polls. - tcpEndPoint->mTCPSendQueueRemainingPollCount--; + mTCPSendQueueRemainingPollCount--; - VerifyOrExit(tcpEndPoint->mTCPSendQueueRemainingPollCount != 0, err = INET_ERROR_TCP_USER_TIMEOUT); + VerifyOrExit(mTCPSendQueueRemainingPollCount != 0, err = INET_ERROR_TCP_USER_TIMEOUT); // Restart timer to poll again - tcpEndPoint->ScheduleNextTCPUserTimeoutPoll(tcpEndPoint->mTCPSendQueuePollPeriodMillis); + ScheduleNextTCPUserTimeoutPoll(mTCPSendQueuePollPeriodMillis); #else // Close the connection as the TCP UserTimeout has expired @@ -1864,12 +1847,12 @@ void TCPEndPoint::TCPUserTimeoutHandler(chip::System::Layer * aSystemLayer, void { // Close the connection as the TCP UserTimeout has expired - tcpEndPoint->DoClose(err, false); + DoClose(err, false); } } #endif // INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT -CHIP_ERROR TCPEndPoint::BindSrcAddrFromIntf(IPAddressType addrType, InterfaceId intfId) +CHIP_ERROR TCPEndPointImplSockets::BindSrcAddrFromIntf(IPAddressType addrType, InterfaceId intfId) { // If we are trying to make a TCP connection over a 'specified target interface', // then we bind the TCPEndPoint to an IP address on that target interface @@ -1923,7 +1906,7 @@ CHIP_ERROR TCPEndPoint::BindSrcAddrFromIntf(IPAddressType addrType, InterfaceId return CHIP_NO_ERROR; } -CHIP_ERROR TCPEndPoint::GetSocket(IPAddressType addrType) +CHIP_ERROR TCPEndPointImplSockets::GetSocket(IPAddressType addrType) { if (mSocket == kInvalidSocketFd) { @@ -1982,12 +1965,12 @@ CHIP_ERROR TCPEndPoint::GetSocket(IPAddressType addrType) } // static -void TCPEndPoint::HandlePendingIO(System::SocketEvents events, intptr_t data) +void TCPEndPointImplSockets::HandlePendingIO(System::SocketEvents events, intptr_t data) { - reinterpret_cast(data)->HandlePendingIO(events); + reinterpret_cast(data)->HandlePendingIO(events); } -void TCPEndPoint::HandlePendingIO(System::SocketEvents events) +void TCPEndPointImplSockets::HandlePendingIO(System::SocketEvents events) { // Prevent the end point from being freed while in the middle of a callback. Retain(); @@ -2049,7 +2032,7 @@ void TCPEndPoint::HandlePendingIO(System::SocketEvents events) Release(); } -void TCPEndPoint::ReceiveData() +void TCPEndPointImplSockets::ReceiveData() { System::PacketBufferHandle rcvBuf; bool isNewBuf = true; @@ -2193,10 +2176,10 @@ void TCPEndPoint::ReceiveData() DriveReceiving(); } -void TCPEndPoint::HandleIncomingConnection() +void TCPEndPointImplSockets::HandleIncomingConnection() { - CHIP_ERROR err = CHIP_NO_ERROR; - TCPEndPoint * conEP = nullptr; + CHIP_ERROR err = CHIP_NO_ERROR; + TCPEndPointImplSockets * conEP = nullptr; IPAddress peerAddr; uint16_t peerPort; @@ -2250,7 +2233,9 @@ void TCPEndPoint::HandleIncomingConnection() { InetLayer & lInetLayer = Layer(); - err = lInetLayer.NewTCPEndPoint(&conEP); + TCPEndPoint * connectEndPoint = nullptr; + err = lInetLayer.NewTCPEndPoint(&connectEndPoint); + conEP = static_cast(connectEndPoint); } // If all went well... @@ -2309,7 +2294,7 @@ void TCPEndPoint::HandleIncomingConnection() * This function probes the TCP output queue and checks if data is successfully * being transferred to the other end. */ -CHIP_ERROR TCPEndPoint::CheckConnectionProgress(bool & isProgressing) +CHIP_ERROR TCPEndPointImplSockets::CheckConnectionProgress(bool & isProgressing) { int currPendingBytesRaw = 0; uint32_t currPendingBytes; // Will be initialized once we know it's safe. @@ -2580,11 +2565,9 @@ void TCPEndPoint::StopConnectTimer() void TCPEndPoint::TCPConnectTimeoutHandler(chip::System::Layer * aSystemLayer, void * aAppState) { TCPEndPoint * tcpEndPoint = reinterpret_cast(aAppState); - VerifyOrDie((aSystemLayer != nullptr) && (tcpEndPoint != nullptr)); - // Close Connection as we have timed out and Connect has not returned to - // stop this timer. + // Close Connection as we have timed out and Connect has not returned to stop this timer. tcpEndPoint->DoClose(INET_ERROR_TCP_CONNECT_TIMEOUT, false); } @@ -2790,6 +2773,14 @@ void TCPEndPoint::RestartTCPUserTimeoutTimer() StartTCPUserTimeoutTimer(); } +// static +void TCPEndPoint::TCPUserTimeoutHandler(chip::System::Layer * aSystemLayer, void * aAppState) +{ + TCPEndPoint * tcpEndPoint = reinterpret_cast(aAppState); + VerifyOrDie((aSystemLayer != nullptr) && (tcpEndPoint != nullptr)); + tcpEndPoint->TCPUserTimeoutHandler(); +} + #endif // INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT } // namespace Inet diff --git a/src/inet/TCPEndPoint.h b/src/inet/TCPEndPoint.h index 41244c669dd5c2..a15b6cf7f7c1d5 100644 --- a/src/inet/TCPEndPoint.h +++ b/src/inet/TCPEndPoint.h @@ -37,6 +37,13 @@ #include +#if CHIP_SYSTEM_CONFIG_USE_LWIP +#include +#endif // CHIP_SYSTEM_CONFIG_USE_LWIP +#if CHIP_SYSTEM_CONFIG_USE_SOCKETS +#include +#endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS + #if CHIP_SYSTEM_CONFIG_USE_DISPATCH #include #endif @@ -67,15 +74,11 @@ class TCPEndPointDeletor * endpoints (SOCK_STREAM sockets on Linux and BSD-derived systems) or LwIP * TCP protocol control blocks, as the system is configured accordingly. */ -class DLL_EXPORT TCPEndPoint : public EndPointBasis, public ReferenceCounted +class DLL_EXPORT TCPEndPoint : public EndPointBase, public ReferenceCounted { - friend class InetLayer; - friend class ::chip::Transport::TCPTest; - friend class TCPTest; - public: TCPEndPoint(InetLayer & inetLayer, void * appState = nullptr) : - EndPointBasis(inetLayer, appState), OnConnectComplete(nullptr), OnDataReceived(nullptr), OnDataSent(nullptr), + EndPointBase(inetLayer, appState), OnConnectComplete(nullptr), OnDataReceived(nullptr), OnDataSent(nullptr), OnConnectionClosed(nullptr), OnPeerClose(nullptr), OnConnectionReceived(nullptr), OnAcceptError(nullptr), mState(State::kReady), mReceiveEnabled(true), mConnectTimeoutMsecs(0) // Initialize to zero for using system defaults. #if INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT @@ -89,9 +92,9 @@ class DLL_EXPORT TCPEndPoint : public EndPointBasis, public ReferenceCounted sPool; +protected: + friend class InetLayer; + friend class ::chip::Transport::TCPTest; + friend class TCPTest; /** * Basic dynamic state of the underlying endpoint. @@ -651,6 +655,7 @@ class DLL_EXPORT TCPEndPoint : public EndPointBasis, public ReferenceCountedDelete(); +} #if CHIP_SYSTEM_CONFIG_USE_LWIP + +class TCPEndPointImplLwIP : public TCPEndPoint, public EndPointStateLwIP +{ +public: + TCPEndPointImplLwIP(InetLayer & inetLayer, void * appState = nullptr) : TCPEndPoint(inetLayer, appState), mUnackedLength(0) {} + + // TCPEndPoint overrides. + CHIP_ERROR GetPeerInfo(IPAddress * retAddr, uint16_t * retPort) const override; + CHIP_ERROR GetLocalInfo(IPAddress * retAddr, uint16_t * retPort) const override; + CHIP_ERROR GetInterfaceId(InterfaceId * retInterface) override; + CHIP_ERROR EnableNoDelay() override; + CHIP_ERROR EnableKeepAlive(uint16_t interval, uint16_t timeoutCount) override; + CHIP_ERROR DisableKeepAlive() override; + CHIP_ERROR AckReceive(uint16_t len) override; +#if INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT + void TCPUserTimeoutHandler() override; +#endif // INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT + +private: + friend class InetLayer; + friend class BitMapObjectPool; + static BitMapObjectPool sPool; + void Delete() override { sPool.ReleaseObject(this); } + + // TCPEndPoint overrides. + CHIP_ERROR BindImpl(IPAddressType addrType, const IPAddress & addr, uint16_t port, bool reuseAddr) override; + CHIP_ERROR ListenImpl(uint16_t backlog) override; + CHIP_ERROR ConnectImpl(const IPAddress & addr, uint16_t port, InterfaceId intfId) override; + CHIP_ERROR SendQueuedImpl(bool queueWasEmpty) override; + CHIP_ERROR SetUserTimeoutImpl(uint32_t userTimeoutMillis) override; + CHIP_ERROR DriveSendingImpl() override; + void HandleConnectCompleteImpl() override; + void DoCloseImpl(CHIP_ERROR err, State oldState) override; + struct BufferOffset { BufferOffset(System::PacketBufferHandle && aBuffer) : buffer(std::move(aBuffer)), offset(0) {} @@ -736,10 +776,53 @@ class DLL_EXPORT TCPEndPoint : public EndPointBasis, public ReferenceCounted; + static BitMapObjectPool sPool; + void Delete() override { sPool.ReleaseObject(this); } + + // TCPEndPoint overrides. + CHIP_ERROR BindImpl(IPAddressType addrType, const IPAddress & addr, uint16_t port, bool reuseAddr) override; + CHIP_ERROR ListenImpl(uint16_t backlog) override; + CHIP_ERROR ConnectImpl(const IPAddress & addr, uint16_t port, InterfaceId intfId) override; + CHIP_ERROR SendQueuedImpl(bool queueWasEmpty) override; + CHIP_ERROR SetUserTimeoutImpl(uint32_t userTimeoutMillis) override; + CHIP_ERROR DriveSendingImpl() override; + void HandleConnectCompleteImpl() override; + void DoCloseImpl(CHIP_ERROR err, State oldState) override; + CHIP_ERROR GetSocketInfo(int getname(int, sockaddr *, socklen_t *), IPAddress * retAddr, uint16_t * retPort) const; CHIP_ERROR GetSocket(IPAddressType addrType); void HandlePendingIO(System::SocketEvents events); @@ -752,13 +835,21 @@ class DLL_EXPORT TCPEndPoint : public EndPointBasis, public ReferenceCounted UDPEndPoint::sPool; - #if CHIP_SYSTEM_CONFIG_USE_LWIP || CHIP_SYSTEM_CONFIG_USE_SOCKETS namespace { @@ -149,7 +147,10 @@ CHIP_ERROR CheckMulticastGroupArgs(InterfaceId aInterfaceId, const IPAddress & a #if CHIP_SYSTEM_CONFIG_USE_LWIP -CHIP_ERROR UDPEndPoint::BindImpl(IPAddressType addressType, const IPAddress & address, uint16_t port, InterfaceId interfaceId) +BitMapObjectPool UDPEndPointImplLwIP::sPool; + +CHIP_ERROR UDPEndPointImplLwIP::BindImpl(IPAddressType addressType, const IPAddress & address, uint16_t port, + InterfaceId interfaceId) { // Lock LwIP stack LOCK_TCPIP_CORE(); @@ -205,7 +206,7 @@ CHIP_ERROR UDPEndPoint::BindImpl(IPAddressType addressType, const IPAddress & ad return res; } -CHIP_ERROR UDPEndPoint::BindInterfaceImpl(IPAddressType addrType, InterfaceId intfId) +CHIP_ERROR UDPEndPointImplLwIP::BindInterfaceImpl(IPAddressType addrType, InterfaceId intfId) { // A lock is required because the LwIP thread may be referring to intf_filter, // while this code running in the Inet application is potentially modifying it. @@ -225,12 +226,12 @@ CHIP_ERROR UDPEndPoint::BindInterfaceImpl(IPAddressType addrType, InterfaceId in return err; } -CHIP_ERROR UDPEndPoint::LwIPBindInterface(struct udp_pcb * aUDP, InterfaceId intfId) +CHIP_ERROR UDPEndPointImplLwIP::LwIPBindInterface(struct udp_pcb * aUDP, InterfaceId intfId) { struct netif * netifp = nullptr; if (intfId.IsPresent()) { - netifp = UDPEndPoint::FindNetifFromInterfaceId(intfId); + netifp = UDPEndPointImplLwIP::FindNetifFromInterfaceId(intfId); if (netifp == nullptr) { return INET_ERROR_UNKNOWN_INTERFACE; @@ -241,7 +242,7 @@ CHIP_ERROR UDPEndPoint::LwIPBindInterface(struct udp_pcb * aUDP, InterfaceId int return CHIP_NO_ERROR; } -InterfaceId UDPEndPoint::GetBoundInterface() const +InterfaceId UDPEndPointImplLwIP::GetBoundInterface() const { #if HAVE_LWIP_UDP_BIND_NETIF return InterfaceId(netif_get_by_index(mUDP->netif_idx)); @@ -250,12 +251,12 @@ InterfaceId UDPEndPoint::GetBoundInterface() const #endif } -uint16_t UDPEndPoint::GetBoundPort() const +uint16_t UDPEndPointImplLwIP::GetBoundPort() const { return mUDP->local_port; } -CHIP_ERROR UDPEndPoint::ListenImpl() +CHIP_ERROR UDPEndPointImplLwIP::ListenImpl() { // Lock LwIP stack LOCK_TCPIP_CORE(); @@ -279,7 +280,7 @@ CHIP_ERROR UDPEndPoint::ListenImpl() return CHIP_NO_ERROR; } -CHIP_ERROR UDPEndPoint::SendMsgImpl(const IPPacketInfo * pktInfo, System::PacketBufferHandle && msg) +CHIP_ERROR UDPEndPointImplLwIP::SendMsgImpl(const IPPacketInfo * pktInfo, System::PacketBufferHandle && msg) { const IPAddress & destAddr = pktInfo->DestAddress; @@ -406,7 +407,7 @@ CHIP_ERROR UDPEndPoint::SendMsgImpl(const IPPacketInfo * pktInfo, System::Packet return res; } -void UDPEndPoint::CloseImpl() +void UDPEndPointImplLwIP::CloseImpl() { // Lock LwIP stack @@ -425,13 +426,13 @@ void UDPEndPoint::CloseImpl() UNLOCK_TCPIP_CORE(); } -void UDPEndPoint::Free() +void UDPEndPointImplLwIP::Free() { Close(); Release(); } -void UDPEndPoint::HandleDataReceived(System::PacketBufferHandle && msg) +void UDPEndPointImplLwIP::HandleDataReceived(System::PacketBufferHandle && msg) { if ((mState == State::kListening) && (OnMessageReceived != nullptr)) { @@ -453,7 +454,7 @@ void UDPEndPoint::HandleDataReceived(System::PacketBufferHandle && msg) } } -CHIP_ERROR UDPEndPoint::GetPCB(IPAddressType addrType) +CHIP_ERROR UDPEndPointImplLwIP::GetPCB(IPAddressType addrType) { // IMPORTANT: This method MUST be called with the LwIP stack LOCKED! @@ -531,12 +532,13 @@ CHIP_ERROR UDPEndPoint::GetPCB(IPAddressType addrType) } #if LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5 -void UDPEndPoint::LwIPReceiveUDPMessage(void * arg, struct udp_pcb * pcb, struct pbuf * p, const ip_addr_t * addr, u16_t port) +void UDPEndPointImplLwIP::LwIPReceiveUDPMessage(void * arg, struct udp_pcb * pcb, struct pbuf * p, const ip_addr_t * addr, + u16_t port) #else // LWIP_VERSION_MAJOR <= 1 && LWIP_VERSION_MINOR < 5 -void UDPEndPoint::LwIPReceiveUDPMessage(void * arg, struct udp_pcb * pcb, struct pbuf * p, ip_addr_t * addr, u16_t port) +void UDPEndPointImplLwIP::LwIPReceiveUDPMessage(void * arg, struct udp_pcb * pcb, struct pbuf * p, ip_addr_t * addr, u16_t port) #endif // LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5 { - UDPEndPoint * ep = static_cast(arg); + UDPEndPointImplLwIP * ep = static_cast(arg); System::Layer * lSystemLayer = ep->Layer().SystemLayer(); IPPacketInfo * pktInfo = nullptr; System::PacketBufferHandle buf = System::PacketBufferHandle::Adopt(p); @@ -601,7 +603,7 @@ void UDPEndPoint::LwIPReceiveUDPMessage(void * arg, struct udp_pcb * pcb, struct } } -CHIP_ERROR UDPEndPoint::SetMulticastLoopback(IPVersion aIPVersion, bool aLoopback) +CHIP_ERROR UDPEndPointImplLwIP::SetMulticastLoopback(IPVersion aIPVersion, bool aLoopback) { #if HAVE_LWIP_MULTICAST_LOOP if (mLwIPEndPointType == LwIPEndPointType::UDP) @@ -620,10 +622,8 @@ CHIP_ERROR UDPEndPoint::SetMulticastLoopback(IPVersion aIPVersion, bool aLoopbac return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; } -void UDPEndPoint::InitImpl() {} - #if INET_CONFIG_ENABLE_IPV4 -CHIP_ERROR UDPEndPoint::IPv4JoinLeaveMulticastGroupImpl(InterfaceId aInterfaceId, const IPAddress & aAddress, bool join) +CHIP_ERROR UDPEndPointImplLwIP::IPv4JoinLeaveMulticastGroupImpl(InterfaceId aInterfaceId, const IPAddress & aAddress, bool join) { #if LWIP_IPV4 && LWIP_IGMP const auto method = join ? igmp_joingroup_netif : igmp_leavegroup_netif; @@ -644,7 +644,7 @@ CHIP_ERROR UDPEndPoint::IPv4JoinLeaveMulticastGroupImpl(InterfaceId aInterfaceId } #endif // INET_CONFIG_ENABLE_IPV4 -CHIP_ERROR UDPEndPoint::IPv6JoinLeaveMulticastGroupImpl(InterfaceId aInterfaceId, const IPAddress & aAddress, bool join) +CHIP_ERROR UDPEndPointImplLwIP::IPv6JoinLeaveMulticastGroupImpl(InterfaceId aInterfaceId, const IPAddress & aAddress, bool join) { #ifdef HAVE_IPV6_MULTICAST const auto method = join ? mld6_joingroup_netif : mld6_leavegroup_netif; @@ -665,7 +665,7 @@ CHIP_ERROR UDPEndPoint::IPv6JoinLeaveMulticastGroupImpl(InterfaceId aInterfaceId #endif // HAVE_IPV6_MULTICAST } -struct netif * UDPEndPoint::FindNetifFromInterfaceId(InterfaceId aInterfaceId) +struct netif * UDPEndPointImplLwIP::FindNetifFromInterfaceId(InterfaceId aInterfaceId) { struct netif * lRetval = nullptr; @@ -685,7 +685,7 @@ struct netif * UDPEndPoint::FindNetifFromInterfaceId(InterfaceId aInterfaceId) return (lRetval); } -IPPacketInfo * UDPEndPoint::GetPacketInfo(const System::PacketBufferHandle & aBuffer) +IPPacketInfo * UDPEndPointImplLwIP::GetPacketInfo(const System::PacketBufferHandle & aBuffer) { if (!aBuffer->EnsureReservedSize(sizeof(IPPacketInfo) + 3)) { @@ -703,6 +703,8 @@ IPPacketInfo * UDPEndPoint::GetPacketInfo(const System::PacketBufferHandle & aBu #if CHIP_SYSTEM_CONFIG_USE_SOCKETS +BitMapObjectPool UDPEndPointImplSockets::sPool; + namespace { CHIP_ERROR IPv6Bind(int socket, const IPAddress & address, uint16_t port, InterfaceId interface) @@ -784,11 +786,11 @@ CHIP_ERROR IPv4Bind(int socket, const IPAddress & address, uint16_t port) } // anonymous namespace #if CHIP_SYSTEM_CONFIG_USE_PLATFORM_MULTICAST_API -UDPEndPoint::MulticastGroupHandler UDPEndPoint::sJoinMulticastGroupHandler; -UDPEndPoint::MulticastGroupHandler UDPEndPoint::sLeaveMulticastGroupHandler; +UDPEndPointImplSockets::MulticastGroupHandler UDPEndPointImplSockets::sJoinMulticastGroupHandler; +UDPEndPointImplSockets::MulticastGroupHandler UDPEndPointImplSockets::sLeaveMulticastGroupHandler; #endif // CHIP_SYSTEM_CONFIG_USE_PLATFORM_MULTICAST_API -CHIP_ERROR UDPEndPoint::BindImpl(IPAddressType addressType, const IPAddress & addr, uint16_t port, InterfaceId interface) +CHIP_ERROR UDPEndPointImplSockets::BindImpl(IPAddressType addressType, const IPAddress & addr, uint16_t port, InterfaceId interface) { // Make sure we have the appropriate type of socket. ReturnErrorOnFailure(GetSocket(addressType)); @@ -849,7 +851,7 @@ CHIP_ERROR UDPEndPoint::BindImpl(IPAddressType addressType, const IPAddress & ad return CHIP_NO_ERROR; } -CHIP_ERROR UDPEndPoint::BindInterfaceImpl(IPAddressType addressType, InterfaceId interfaceId) +CHIP_ERROR UDPEndPointImplSockets::BindInterfaceImpl(IPAddressType addressType, InterfaceId interfaceId) { // Make sure we have the appropriate type of socket. ReturnErrorOnFailure(GetSocket(addressType)); @@ -890,17 +892,17 @@ CHIP_ERROR UDPEndPoint::BindInterfaceImpl(IPAddressType addressType, InterfaceId #endif // HAVE_SO_BINDTODEVICE } -InterfaceId UDPEndPoint::GetBoundInterface() const +InterfaceId UDPEndPointImplSockets::GetBoundInterface() const { return mBoundIntfId; } -uint16_t UDPEndPoint::GetBoundPort() const +uint16_t UDPEndPointImplSockets::GetBoundPort() const { return mBoundPort; } -CHIP_ERROR UDPEndPoint::ListenImpl() +CHIP_ERROR UDPEndPointImplSockets::ListenImpl() { // Wait for ability to read on this endpoint. auto * layer = static_cast(Layer().SystemLayer()); @@ -908,7 +910,7 @@ CHIP_ERROR UDPEndPoint::ListenImpl() return layer->RequestCallbackOnPendingRead(mWatch); } -CHIP_ERROR UDPEndPoint::SendMsgImpl(const IPPacketInfo * aPktInfo, System::PacketBufferHandle && msg) +CHIP_ERROR UDPEndPointImplSockets::SendMsgImpl(const IPPacketInfo * aPktInfo, System::PacketBufferHandle && msg) { // Make sure we have the appropriate type of socket based on the // destination address. @@ -1048,7 +1050,7 @@ CHIP_ERROR UDPEndPoint::SendMsgImpl(const IPPacketInfo * aPktInfo, System::Packe return CHIP_NO_ERROR; } -void UDPEndPoint::CloseImpl() +void UDPEndPointImplSockets::CloseImpl() { if (mSocket != kInvalidSocketFd) { @@ -1066,13 +1068,13 @@ void UDPEndPoint::CloseImpl() #endif // CHIP_SYSTEM_CONFIG_USE_DISPATCH } -void UDPEndPoint::Free() +void UDPEndPointImplSockets::Free() { Close(); Release(); } -CHIP_ERROR UDPEndPoint::GetSocket(IPAddressType addressType) +CHIP_ERROR UDPEndPointImplSockets::GetSocket(IPAddressType addressType) { if (mSocket == kInvalidSocketFd) { @@ -1189,12 +1191,12 @@ CHIP_ERROR UDPEndPoint::GetSocket(IPAddressType addressType) } // static -void UDPEndPoint::HandlePendingIO(System::SocketEvents events, intptr_t data) +void UDPEndPointImplSockets::HandlePendingIO(System::SocketEvents events, intptr_t data) { - reinterpret_cast(data)->HandlePendingIO(events); + reinterpret_cast(data)->HandlePendingIO(events); } -void UDPEndPoint::HandlePendingIO(System::SocketEvents events) +void UDPEndPointImplSockets::HandlePendingIO(System::SocketEvents events) { if (mState != State::kListening || OnMessageReceived == nullptr || !events.Has(System::SocketEventFlags::kRead)) { @@ -1363,7 +1365,7 @@ static CHIP_ERROR SocketsSetMulticastLoopback(int aSocket, IPVersion aIPVersion, #endif // IPV6_MULTICAST_LOOP } -CHIP_ERROR UDPEndPoint::SetMulticastLoopback(IPVersion aIPVersion, bool aLoopback) +CHIP_ERROR UDPEndPointImplSockets::SetMulticastLoopback(IPVersion aIPVersion, bool aLoopback) { CHIP_ERROR lRetval = CHIP_ERROR_NOT_IMPLEMENTED; @@ -1374,14 +1376,9 @@ CHIP_ERROR UDPEndPoint::SetMulticastLoopback(IPVersion aIPVersion, bool aLoopbac return (lRetval); } -void UDPEndPoint::InitImpl() -{ - mBoundIntfId = InterfaceId::Null(); -} - #if INET_CONFIG_ENABLE_IPV4 -CHIP_ERROR UDPEndPoint::IPv4JoinLeaveMulticastGroupImpl(InterfaceId aInterfaceId, const IPAddress & aAddress, bool join) +CHIP_ERROR UDPEndPointImplSockets::IPv4JoinLeaveMulticastGroupImpl(InterfaceId aInterfaceId, const IPAddress & aAddress, bool join) { IPAddress lInterfaceAddress; bool lInterfaceAddressFound = false; @@ -1417,7 +1414,7 @@ CHIP_ERROR UDPEndPoint::IPv4JoinLeaveMulticastGroupImpl(InterfaceId aInterfaceId #endif // INET_CONFIG_ENABLE_IPV4 -CHIP_ERROR UDPEndPoint::IPv6JoinLeaveMulticastGroupImpl(InterfaceId aInterfaceId, const IPAddress & aAddress, bool join) +CHIP_ERROR UDPEndPointImplSockets::IPv6JoinLeaveMulticastGroupImpl(InterfaceId aInterfaceId, const IPAddress & aAddress, bool join) { #if CHIP_SYSTEM_CONFIG_USE_PLATFORM_MULTICAST_API MulticastGroupHandler handler = join ? sJoinMulticastGroupHandler : sLeaveMulticastGroupHandler; @@ -1452,7 +1449,10 @@ CHIP_ERROR UDPEndPoint::IPv6JoinLeaveMulticastGroupImpl(InterfaceId aInterfaceId #if CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK -CHIP_ERROR UDPEndPoint::BindImpl(IPAddressType addressType, const IPAddress & address, uint16_t port, InterfaceId intfId) +BitMapObjectPool UDPEndPointImplNetworkFramework::sPool; + +CHIP_ERROR UDPEndPointImplNetworkFramework::BindImpl(IPAddressType addressType, const IPAddress & address, uint16_t port, + InterfaceId intfId) { nw_parameters_configure_protocol_block_t configure_tls; nw_parameters_t parameters; @@ -1493,28 +1493,28 @@ CHIP_ERROR UDPEndPoint::BindImpl(IPAddressType addressType, const IPAddress & ad return CHIP_NO_ERROR; } -CHIP_ERROR UDPEndPoint::BindInterfaceImpl(IPAddressType addrType, InterfaceId intfId) +CHIP_ERROR UDPEndPointImplNetworkFramework::BindInterfaceImpl(IPAddressType addrType, InterfaceId intfId) { return INET_ERROR_UNKNOWN_INTERFACE; } -InterfaceId UDPEndPoint::GetBoundInterface() const +InterfaceId UDPEndPointImplNetworkFramework::GetBoundInterface() const { return InterfaceId::Null(); } -uint16_t UDPEndPoint::GetBoundPort() const +uint16_t UDPEndPointImplNetworkFramework::GetBoundPort() const { nw_endpoint_t endpoint = nw_parameters_copy_local_endpoint(mParameters); return nw_endpoint_get_port(endpoint); } -CHIP_ERROR UDPEndPoint::ListenImpl() +CHIP_ERROR UDPEndPointImplNetworkFramework::ListenImpl() { return StartListener(); } -CHIP_ERROR UDPEndPoint::SendMsgImpl(const IPPacketInfo * pktInfo, System::PacketBufferHandle && msg) +CHIP_ERROR UDPEndPointImplNetworkFramework::SendMsgImpl(const IPPacketInfo * pktInfo, System::PacketBufferHandle && msg) { dispatch_data_t content; @@ -1554,12 +1554,12 @@ CHIP_ERROR UDPEndPoint::SendMsgImpl(const IPPacketInfo * pktInfo, System::Packet return res; } -void UDPEndPoint::CloseImpl() +void UDPEndPointImplNetworkFramework::CloseImpl() { ReleaseAll(); } -void UDPEndPoint::ReleaseAll() +void UDPEndPointImplNetworkFramework::ReleaseAll() { OnMessageReceived = nullptr; @@ -1607,30 +1607,32 @@ void UDPEndPoint::ReleaseAll() } } -void UDPEndPoint::Free() +void UDPEndPointImplNetworkFramework::Free() { Close(); Release(); } -CHIP_ERROR UDPEndPoint::SetMulticastLoopback(IPVersion aIPVersion, bool aLoopback) +CHIP_ERROR UDPEndPointImplNetworkFramework::SetMulticastLoopback(IPVersion aIPVersion, bool aLoopback) { return CHIP_ERROR_NOT_IMPLEMENTED; } #if INET_CONFIG_ENABLE_IPV4 -CHIP_ERROR UDPEndPoint::IPv4JoinLeaveMulticastGroupImpl(InterfaceId aInterfaceId, const IPAddress & aAddress, bool join) +CHIP_ERROR UDPEndPointImplNetworkFramework::IPv4JoinLeaveMulticastGroupImpl(InterfaceId aInterfaceId, const IPAddress & aAddress, + bool join) { return CHIP_ERROR_NOT_IMPLEMENTED; } #endif // INET_CONFIG_ENABLE_IPV4 -CHIP_ERROR UDPEndPoint::IPv6JoinLeaveMulticastGroupImpl(InterfaceId aInterfaceId, const IPAddress & aAddress, bool join) +CHIP_ERROR UDPEndPointImplNetworkFramework::IPv6JoinLeaveMulticastGroupImpl(InterfaceId aInterfaceId, const IPAddress & aAddress, + bool join) { return CHIP_ERROR_NOT_IMPLEMENTED; } -CHIP_ERROR UDPEndPoint::ConfigureProtocol(IPAddressType aAddressType, const nw_parameters_t & aParameters) +CHIP_ERROR UDPEndPointImplNetworkFramework::ConfigureProtocol(IPAddressType aAddressType, const nw_parameters_t & aParameters) { CHIP_ERROR res = CHIP_NO_ERROR; @@ -1660,7 +1662,7 @@ CHIP_ERROR UDPEndPoint::ConfigureProtocol(IPAddressType aAddressType, const nw_p return res; } -void UDPEndPoint::GetPacketInfo(const nw_connection_t & aConnection, IPPacketInfo & aPacketInfo) +void UDPEndPointImplNetworkFramework::GetPacketInfo(const nw_connection_t & aConnection, IPPacketInfo & aPacketInfo) { nw_path_t path = nw_connection_copy_current_path(aConnection); nw_endpoint_t dest_endpoint = nw_path_copy_effective_local_endpoint(path); @@ -1673,8 +1675,8 @@ void UDPEndPoint::GetPacketInfo(const nw_connection_t & aConnection, IPPacketInf aPacketInfo.DestPort = nw_endpoint_get_port(dest_endpoint); } -CHIP_ERROR UDPEndPoint::GetEndPoint(nw_endpoint_t & aEndPoint, const IPAddressType aAddressType, const IPAddress & aAddress, - uint16_t aPort) +CHIP_ERROR UDPEndPointImplNetworkFramework::GetEndPoint(nw_endpoint_t & aEndPoint, const IPAddressType aAddressType, + const IPAddress & aAddress, uint16_t aPort) { char addrStr[INET6_ADDRSTRLEN]; char portStr[INET_PORTSTRLEN]; @@ -1699,7 +1701,7 @@ CHIP_ERROR UDPEndPoint::GetEndPoint(nw_endpoint_t & aEndPoint, const IPAddressTy return CHIP_NO_ERROR; } -CHIP_ERROR UDPEndPoint::GetConnection(const IPPacketInfo * aPktInfo) +CHIP_ERROR UDPEndPointImplNetworkFramework::GetConnection(const IPPacketInfo * aPktInfo) { VerifyOrReturnError(mParameters != nullptr, CHIP_ERROR_INCORRECT_STATE); @@ -1728,7 +1730,7 @@ CHIP_ERROR UDPEndPoint::GetConnection(const IPPacketInfo * aPktInfo) return StartConnection(connection); } -CHIP_ERROR UDPEndPoint::StartListener() +CHIP_ERROR UDPEndPointImplNetworkFramework::StartListener() { __block CHIP_ERROR res = CHIP_NO_ERROR; nw_listener_t listener; @@ -1801,7 +1803,7 @@ CHIP_ERROR UDPEndPoint::StartListener() return res; } -CHIP_ERROR UDPEndPoint::StartConnection(nw_connection_t & aConnection) +CHIP_ERROR UDPEndPointImplNetworkFramework::StartConnection(nw_connection_t & aConnection) { __block CHIP_ERROR res = CHIP_NO_ERROR; @@ -1861,7 +1863,7 @@ CHIP_ERROR UDPEndPoint::StartConnection(nw_connection_t & aConnection) return res; } -void UDPEndPoint::HandleDataReceived(const nw_connection_t & aConnection) +void UDPEndPointImplNetworkFramework::HandleDataReceived(const nw_connection_t & aConnection) { nw_connection_receive_completion_t handler = ^(dispatch_data_t content, nw_content_context_t context, bool is_complete, nw_error_t receive_error) { @@ -1909,7 +1911,7 @@ void UDPEndPoint::HandleDataReceived(const nw_connection_t & aConnection) nw_connection_receive_message(aConnection, handler); } -CHIP_ERROR UDPEndPoint::ReleaseListener() +CHIP_ERROR UDPEndPointImplNetworkFramework::ReleaseListener() { VerifyOrReturnError(mListener, CHIP_ERROR_INCORRECT_STATE); VerifyOrReturnError(mDispatchQueue, CHIP_ERROR_INCORRECT_STATE); @@ -1923,7 +1925,7 @@ CHIP_ERROR UDPEndPoint::ReleaseListener() return CHIP_NO_ERROR; } -CHIP_ERROR UDPEndPoint::ReleaseConnection() +CHIP_ERROR UDPEndPointImplNetworkFramework::ReleaseConnection() { VerifyOrReturnError(mConnection, CHIP_ERROR_INCORRECT_STATE); VerifyOrReturnError(mDispatchQueue, CHIP_ERROR_INCORRECT_STATE); diff --git a/src/inet/UDPEndPoint.h b/src/inet/UDPEndPoint.h index c8643b78d97501..97da7807b52a97 100644 --- a/src/inet/UDPEndPoint.h +++ b/src/inet/UDPEndPoint.h @@ -35,6 +35,16 @@ #include #include +#if CHIP_SYSTEM_CONFIG_USE_LWIP +#include +#endif // CHIP_SYSTEM_CONFIG_USE_LWIP +#if CHIP_SYSTEM_CONFIG_USE_SOCKETS +#include +#endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS +#if CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK +#include +#endif // CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK + #if CHIP_SYSTEM_CONFIG_USE_DISPATCH #include #endif @@ -60,20 +70,20 @@ class UDPEndPointDeletor * endpoints (SOCK_DGRAM sockets on Linux and BSD-derived systems) or LwIP * UDP protocol control blocks, as the system is configured accordingly. */ -class DLL_EXPORT UDPEndPoint : public EndPointBasis, public ReferenceCounted +class DLL_EXPORT UDPEndPoint : public EndPointBase, public ReferenceCounted { public: UDPEndPoint(InetLayer & inetLayer, void * appState = nullptr) : - EndPointBasis(inetLayer, appState), mState(State::kReady), OnMessageReceived(nullptr), OnReceiveError(nullptr) - { - InitImpl(); - } + EndPointBase(inetLayer, appState), mState(State::kReady), OnMessageReceived(nullptr), OnReceiveError(nullptr) + {} UDPEndPoint(const UDPEndPoint &) = delete; UDPEndPoint(UDPEndPoint &&) = delete; UDPEndPoint & operator=(const UDPEndPoint &) = delete; UDPEndPoint & operator=(UDPEndPoint &&) = delete; + virtual ~UDPEndPoint() = default; + /** * Type of message text reception event handling function. * @@ -104,7 +114,7 @@ class DLL_EXPORT UDPEndPoint : public EndPointBasis, public ReferenceCounted sPool; + virtual void Delete() = 0; + + /* + * Implementation helpers for shared methods. + */ +#if INET_CONFIG_ENABLE_IPV4 + virtual CHIP_ERROR IPv4JoinLeaveMulticastGroupImpl(InterfaceId aInterfaceId, const IPAddress & aAddress, bool join) = 0; +#endif // INET_CONFIG_ENABLE_IPV4 + virtual CHIP_ERROR IPv6JoinLeaveMulticastGroupImpl(InterfaceId aInterfaceId, const IPAddress & aAddress, bool join) = 0; + + virtual CHIP_ERROR BindImpl(IPAddressType addressType, const IPAddress & address, uint16_t port, InterfaceId interfaceId) = 0; + virtual CHIP_ERROR BindInterfaceImpl(IPAddressType addressType, InterfaceId interfaceId) = 0; + virtual CHIP_ERROR ListenImpl() = 0; + virtual CHIP_ERROR SendMsgImpl(const IPPacketInfo * pktInfo, chip::System::PacketBufferHandle && msg) = 0; + virtual void CloseImpl() = 0; +}; - CHIP_ERROR BindImpl(IPAddressType addressType, const IPAddress & address, uint16_t port, InterfaceId interfaceId); - CHIP_ERROR BindInterfaceImpl(IPAddressType addressType, InterfaceId interfaceId); - CHIP_ERROR ListenImpl(); - CHIP_ERROR SendMsgImpl(const IPPacketInfo * pktInfo, chip::System::PacketBufferHandle && msg); - void CloseImpl(); +inline void UDPEndPointDeletor::Release(UDPEndPoint * obj) +{ + obj->Delete(); +} #if CHIP_SYSTEM_CONFIG_USE_LWIP +class UDPEndPointImplLwIP : public UDPEndPoint, public EndPointStateLwIP +{ +public: + UDPEndPointImplLwIP(InetLayer & inetLayer, void * appState = nullptr) : UDPEndPoint(inetLayer, appState) {} + + // UDPEndPoint overrides. + CHIP_ERROR SetMulticastLoopback(IPVersion aIPVersion, bool aLoopback) override; + InterfaceId GetBoundInterface() const override; + uint16_t GetBoundPort() const override; + void Free() override; + +private: + friend class InetLayer; + friend class BitMapObjectPool; + static BitMapObjectPool sPool; + void Delete() override { sPool.ReleaseObject(this); } + + // UDPEndPoint overrides. +#if INET_CONFIG_ENABLE_IPV4 + CHIP_ERROR IPv4JoinLeaveMulticastGroupImpl(InterfaceId aInterfaceId, const IPAddress & aAddress, bool join) override; +#endif // INET_CONFIG_ENABLE_IPV4 + CHIP_ERROR IPv6JoinLeaveMulticastGroupImpl(InterfaceId aInterfaceId, const IPAddress & aAddress, bool join) override; + CHIP_ERROR BindImpl(IPAddressType addressType, const IPAddress & address, uint16_t port, InterfaceId interfaceId) override; + CHIP_ERROR BindInterfaceImpl(IPAddressType addressType, InterfaceId interfaceId) override; + CHIP_ERROR ListenImpl() override; + CHIP_ERROR SendMsgImpl(const IPPacketInfo * pktInfo, chip::System::PacketBufferHandle && msg) override; + void CloseImpl() override; + static struct netif * FindNetifFromInterfaceId(InterfaceId aInterfaceId); static CHIP_ERROR LwIPBindInterface(struct udp_pcb * aUDP, InterfaceId intfId); @@ -335,14 +381,55 @@ class DLL_EXPORT UDPEndPoint : public EndPointBasis, public ReferenceCounted 1 || LWIP_VERSION_MINOR >= 5 +}; + +using UDPEndPointImpl = UDPEndPointImplLwIP; #endif // CHIP_SYSTEM_CONFIG_USE_LWIP #if CHIP_SYSTEM_CONFIG_USE_SOCKETS + +class UDPEndPointImplSockets : public UDPEndPoint, public EndPointStateSockets +{ +public: + UDPEndPointImplSockets(InetLayer & inetLayer, void * appState = nullptr) : + UDPEndPoint(inetLayer, appState), mBoundIntfId(InterfaceId::Null()) + {} + + // UDPEndPoint overrides. + CHIP_ERROR SetMulticastLoopback(IPVersion aIPVersion, bool aLoopback) override; + InterfaceId GetBoundInterface() const override; + uint16_t GetBoundPort() const override; + void Free() override; + +private: + friend class InetLayer; + friend class BitMapObjectPool; + static BitMapObjectPool sPool; + void Delete() override { sPool.ReleaseObject(this); } + + // UDPEndPoint overrides. +#if INET_CONFIG_ENABLE_IPV4 + CHIP_ERROR IPv4JoinLeaveMulticastGroupImpl(InterfaceId aInterfaceId, const IPAddress & aAddress, bool join) override; +#endif // INET_CONFIG_ENABLE_IPV4 + CHIP_ERROR IPv6JoinLeaveMulticastGroupImpl(InterfaceId aInterfaceId, const IPAddress & aAddress, bool join) override; + CHIP_ERROR BindImpl(IPAddressType addressType, const IPAddress & address, uint16_t port, InterfaceId interfaceId) override; + CHIP_ERROR BindInterfaceImpl(IPAddressType addressType, InterfaceId interfaceId) override; + CHIP_ERROR ListenImpl() override; + CHIP_ERROR SendMsgImpl(const IPPacketInfo * pktInfo, chip::System::PacketBufferHandle && msg) override; + void CloseImpl() override; + CHIP_ERROR GetSocket(IPAddressType addressType); void HandlePendingIO(System::SocketEvents events); static void HandlePendingIO(System::SocketEvents events, intptr_t data); + InterfaceId mBoundIntfId; + uint16_t mBoundPort; + +#if CHIP_SYSTEM_CONFIG_USE_DISPATCH + dispatch_source_t mReadableSource = nullptr; +#endif // CHIP_SYSTEM_CONFIG_USE_DISPATCH + #if CHIP_SYSTEM_CONFIG_USE_PLATFORM_MULTICAST_API public: using MulticastGroupHandler = CHIP_ERROR (*)(InterfaceId, const IPAddress &); @@ -353,16 +440,42 @@ class DLL_EXPORT UDPEndPoint : public EndPointBasis, public ReferenceCounted; + static BitMapObjectPool sPool; + void Delete() override { sPool.ReleaseObject(this); } + + // UDPEndPoint overrides. +#if INET_CONFIG_ENABLE_IPV4 + CHIP_ERROR IPv4JoinLeaveMulticastGroupImpl(InterfaceId aInterfaceId, const IPAddress & aAddress, bool join) override; +#endif // INET_CONFIG_ENABLE_IPV4 + CHIP_ERROR IPv6JoinLeaveMulticastGroupImpl(InterfaceId aInterfaceId, const IPAddress & aAddress, bool join) override; + CHIP_ERROR BindImpl(IPAddressType addressType, const IPAddress & address, uint16_t port, InterfaceId interfaceId) override; + CHIP_ERROR BindInterfaceImpl(IPAddressType addressType, InterfaceId interfaceId) override; + CHIP_ERROR ListenImpl() override; + CHIP_ERROR SendMsgImpl(const IPPacketInfo * pktInfo, chip::System::PacketBufferHandle && msg) override; + void CloseImpl() override; + nw_listener_t mListener; dispatch_semaphore_t mListenerSemaphore; dispatch_queue_t mListenerQueue; @@ -381,13 +494,11 @@ class DLL_EXPORT UDPEndPoint : public EndPointBasis, public ReferenceCounted #include #include +#include namespace chip { -pthread_mutex_t * JniReferences::GetStackLock() -{ - return &mStackLock; -} - void JniReferences::SetJavaVm(JavaVM * jvm, const char * clsType) { VerifyOrReturn(mJvm == nullptr, ChipLogError(Support, "JavaVM is already set")); @@ -183,4 +179,21 @@ void JniReferences::ThrowError(JNIEnv * env, jclass exceptionCls, CHIP_ERROR err env->Throw(outEx); } +CHIP_ERROR JniReferences::CreateOptional(jobject objectToWrap, jobject & outOptional) +{ + JNIEnv * env = GetEnvForCurrentThread(); + jclass optionalCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/util/Optional", optionalCls); + VerifyOrReturnError(optionalCls != nullptr, CHIP_JNI_ERROR_TYPE_NOT_FOUND); + chip::JniClass jniClass(optionalCls); + + jmethodID ofMethod = env->GetStaticMethodID(optionalCls, "ofNullable", "(Ljava/lang/Object;)Ljava/util/Optional;"); + VerifyOrReturnError(ofMethod != nullptr, CHIP_JNI_ERROR_METHOD_NOT_FOUND); + outOptional = env->CallStaticObjectMethod(optionalCls, ofMethod, objectToWrap); + + VerifyOrReturnError(!env->ExceptionCheck(), CHIP_JNI_ERROR_EXCEPTION_THROWN); + + return CHIP_NO_ERROR; +} + } // namespace chip diff --git a/src/lib/support/JniReferences.h b/src/lib/support/JniReferences.h index ed0ede5970ae88..4bc9145af1edf1 100644 --- a/src/lib/support/JniReferences.h +++ b/src/lib/support/JniReferences.h @@ -21,6 +21,7 @@ #include #include #include +#include namespace chip { class JniReferences @@ -37,11 +38,6 @@ class JniReferences return jniReferences; } - /** - * Returns a stack lock to be shared by all controller JNI code. - */ - pthread_mutex_t * GetStackLock(); - /** * Set the JavaVM. * @@ -80,10 +76,15 @@ class JniReferences void ThrowError(JNIEnv * env, jclass exceptionCls, CHIP_ERROR errToThrow); + /** + * Creates a java.util.Optional wrapping the specified jobject. If the wrapped jobject is null, an empty + * Optional will be returned. + */ + CHIP_ERROR CreateOptional(jobject objectToWrap, jobject & outOptional); + private: JniReferences() {} - pthread_mutex_t mStackLock = PTHREAD_MUTEX_INITIALIZER; JavaVM * mJvm = nullptr; jobject mClassLoader = nullptr; jmethodID mFindClassMethod = nullptr; diff --git a/src/lib/support/JniTypeWrappers.h b/src/lib/support/JniTypeWrappers.h index 2b211564f4d947..25d620764ecd02 100644 --- a/src/lib/support/JniTypeWrappers.h +++ b/src/lib/support/JniTypeWrappers.h @@ -50,7 +50,10 @@ class JniByteArray ~JniByteArray() { mEnv->ReleaseByteArrayElements(mArray, mData, 0); } const jbyte * data() const { return mData; } - chip::ByteSpan byteSpan() const { return chip::ByteSpan(reinterpret_cast(data()), size()); } + chip::ByteSpan byteSpan() const + { + return chip::ByteSpan(reinterpret_cast(data()), static_cast(size())); + } jsize size() const { return mDataLength; } private: diff --git a/src/messaging/ExchangeContext.cpp b/src/messaging/ExchangeContext.cpp index 257537017eb32b..62282598cb922d 100644 --- a/src/messaging/ExchangeContext.cpp +++ b/src/messaging/ExchangeContext.cpp @@ -129,11 +129,13 @@ CHIP_ERROR ExchangeContext::SendMessage(Protocols::Id protocolId, uint8_t msgTyp const Transport::PeerAddress * peerAddress = GetSessionHandle().GetPeerAddress(mExchangeMgr->GetSessionManager()); // Treat unknown peer address as "not UDP", because we have no idea whether // it's safe to do MRP there. - bool isUDPTransport = peerAddress && peerAddress->GetTransportType() == Transport::Type::kUdp; + bool isUDPTransport = peerAddress && peerAddress->GetTransportType() == Transport::Type::kUdp; + + // this check is ignored by the ExchangeMsgDispatch if !AutoRequestAck() bool reliableTransmissionRequested = isUDPTransport && !sendFlags.Has(SendMessageFlags::kNoAutoRequestAck); // If a response message is expected... - if (sendFlags.Has(SendMessageFlags::kExpectResponse)) + if (sendFlags.Has(SendMessageFlags::kExpectResponse) && !IsGroupExchangeContext()) { // Only one 'response expected' message can be outstanding at a time. if (IsResponseExpected()) diff --git a/src/messaging/ExchangeContext.h b/src/messaging/ExchangeContext.h index 1494056191e420..449a9ffcb5463d 100644 --- a/src/messaging/ExchangeContext.h +++ b/src/messaging/ExchangeContext.h @@ -76,6 +76,8 @@ class DLL_EXPORT ExchangeContext : public ReliableMessageContext, public Referen bool IsEncryptionRequired() const { return mDispatch->IsEncryptionRequired(); } + bool IsGroupExchangeContext() const { return (mSession.HasValue() && mSession.Value().IsGroupSession()); } + /** * Send a CHIP message on this exchange. * diff --git a/src/platform/BUILD.gn b/src/platform/BUILD.gn index a1986be488c038..12bc0db6b2aad2 100644 --- a/src/platform/BUILD.gn +++ b/src/platform/BUILD.gn @@ -97,7 +97,6 @@ if (chip_device_platform != "none") { "CHIP_ENABLE_OPENTHREAD=${chip_enable_openthread}", "CHIP_WITH_GIO=${chip_with_gio}", "OPENTHREAD_CONFIG_ENABLE_TOBLE=false", - "CONFIG_USE_CLUSTERS_FOR_IP_COMMISSIONING=${chip_use_clusters_for_ip_commissioning}", "CHIP_DEVICE_CONFIG_ENABLE_DNSSD=${chip_device_config_enable_dnssd}", "CHIP_BYPASS_RENDEZVOUS=${chip_bypass_rendezvous}", "CHIP_STACK_LOCK_TRACKING_ENABLED=${chip_stack_lock_tracking_log}", @@ -226,7 +225,6 @@ if (chip_device_platform != "none") { chip_device_config_enable_dnssd = chip_mdns != "none" defines += [ "CHIP_DEVICE_CONFIG_ENABLE_DNSSD=${chip_device_config_enable_dnssd}", - "CONFIG_USE_CLUSTERS_FOR_IP_COMMISSIONING=${chip_use_clusters_for_ip_commissioning}", "EXTERNAL_KEYVALUESTOREMANAGERIMPL_HEADER=\"controller/java/AndroidKeyValueStoreManagerImpl.h\"", ] } diff --git a/src/platform/Linux/PlatformManagerImpl.cpp b/src/platform/Linux/PlatformManagerImpl.cpp index 39d00ff2da9950..badd1322cff65e 100644 --- a/src/platform/Linux/PlatformManagerImpl.cpp +++ b/src/platform/Linux/PlatformManagerImpl.cpp @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -286,6 +287,61 @@ CHIP_ERROR PlatformManagerImpl::_GetCurrentHeapHighWatermark(uint64_t & currentH return CHIP_NO_ERROR; } +CHIP_ERROR PlatformManagerImpl::_GetThreadMetrics(ThreadMetrics ** threadMetricsOut) +{ + CHIP_ERROR err = CHIP_ERROR_READ_FAILED; + DIR * proc_dir = opendir("/proc/self/task"); + + if (proc_dir == nullptr) + { + ChipLogError(DeviceLayer, "Failed to open current process task directory"); + } + else + { + ThreadMetrics * head = nullptr; + struct dirent * entry; + + /* proc available, iterate through tasks... */ + while ((entry = readdir(proc_dir)) != NULL) + { + if (entry->d_name[0] == '.') + continue; + + ThreadMetrics * thread = new ThreadMetrics(); + + strncpy(thread->NameBuf, entry->d_name, kMaxThreadNameLength); + thread->NameBuf[kMaxThreadNameLength] = '\0'; + thread->name = CharSpan(thread->NameBuf, strlen(thread->NameBuf)); + thread->id = atoi(entry->d_name); + + // TODO: Get stack info of each thread + thread->stackFreeCurrent = 0; + thread->stackFreeMinimum = 0; + thread->stackSize = 0; + + thread->Next = head; + head = thread; + } + + closedir(proc_dir); + + *threadMetricsOut = head; + err = CHIP_NO_ERROR; + } + + return err; +} + +void PlatformManagerImpl::_ReleaseThreadMetrics(ThreadMetrics * threadMetrics) +{ + while (threadMetrics) + { + ThreadMetrics * del = threadMetrics; + threadMetrics = threadMetrics->Next; + delete del; + } +} + CHIP_ERROR PlatformManagerImpl::_GetRebootCount(uint16_t & rebootCount) { uint32_t count = 0; diff --git a/src/platform/Linux/PlatformManagerImpl.h b/src/platform/Linux/PlatformManagerImpl.h index 7c9dc1df6ea525..15d4666d558761 100644 --- a/src/platform/Linux/PlatformManagerImpl.h +++ b/src/platform/Linux/PlatformManagerImpl.h @@ -64,6 +64,8 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener CHIP_ERROR _GetCurrentHeapFree(uint64_t & currentHeapFree); CHIP_ERROR _GetCurrentHeapUsed(uint64_t & currentHeapUsed); CHIP_ERROR _GetCurrentHeapHighWatermark(uint64_t & currentHeapHighWatermark); + CHIP_ERROR _GetThreadMetrics(ThreadMetrics ** threadMetricsOut); + void _ReleaseThreadMetrics(ThreadMetrics * threadMetrics); CHIP_ERROR _GetRebootCount(uint16_t & rebootCount); CHIP_ERROR _GetUpTime(uint64_t & upTime); diff --git a/src/platform/Zephyr/ThreadStackManagerImpl.cpp b/src/platform/Zephyr/ThreadStackManagerImpl.cpp index 7718ce9c2a68eb..3b0616e6a3ffa1 100644 --- a/src/platform/Zephyr/ThreadStackManagerImpl.cpp +++ b/src/platform/Zephyr/ThreadStackManagerImpl.cpp @@ -46,13 +46,13 @@ CHIP_ERROR ThreadStackManagerImpl::_InitThreadStack() ReturnErrorOnFailure(GenericThreadStackManagerImpl_OpenThread::DoInit(instance)); - UDPEndPoint::SetJoinMulticastGroupHandler([](InterfaceId, const IPAddress & address) { + UDPEndPointImplSockets::SetJoinMulticastGroupHandler([](InterfaceId, const IPAddress & address) { const otIp6Address otAddress = ToOpenThreadIP6Address(address); const auto otError = otIp6SubscribeMulticastAddress(openthread_get_default_instance(), &otAddress); return MapOpenThreadError(otError); }); - UDPEndPoint::SetLeaveMulticastGroupHandler([](InterfaceId, const IPAddress & address) { + UDPEndPointImplSockets::SetLeaveMulticastGroupHandler([](InterfaceId, const IPAddress & address) { const otIp6Address otAddress = ToOpenThreadIP6Address(address); const auto otError = otIp6UnsubscribeMulticastAddress(openthread_get_default_instance(), &otAddress); return MapOpenThreadError(otError); diff --git a/src/platform/device.gni b/src/platform/device.gni index 82ba57988caf69..2dce770b78cb10 100755 --- a/src/platform/device.gni +++ b/src/platform/device.gni @@ -76,9 +76,6 @@ declare_args() { } else { chip_mdns = "none" } - - # Enables full cluster-based commissioning for already-on-network devices. - chip_use_clusters_for_ip_commissioning = false } _chip_device_layer = "none" diff --git a/src/platform/fake/PlatformManagerImpl.h b/src/platform/fake/PlatformManagerImpl.h index e043c5fbc7e000..84b0a1588d9e29 100644 --- a/src/platform/fake/PlatformManagerImpl.h +++ b/src/platform/fake/PlatformManagerImpl.h @@ -105,6 +105,8 @@ class PlatformManagerImpl final : public PlatformManager CHIP_ERROR _GetCurrentHeapFree(uint64_t & currentHeapFree); CHIP_ERROR _GetCurrentHeapUsed(uint64_t & currentHeapUsed); CHIP_ERROR _GetCurrentHeapHighWatermark(uint64_t & currentHeapHighWatermark); + CHIP_ERROR _GetThreadMetrics(ThreadMetrics ** threadMetricsOut); + void _ReleaseThreadMetrics(ThreadMetrics * threadMetrics); CHIP_ERROR _GetRebootCount(uint16_t & rebootCount); CHIP_ERROR _GetUpTime(uint64_t & upTime); diff --git a/src/system/SystemPacketBuffer.h b/src/system/SystemPacketBuffer.h index 9280e56a43bf0a..77a5bd3e727218 100644 --- a/src/system/SystemPacketBuffer.h +++ b/src/system/SystemPacketBuffer.h @@ -844,7 +844,7 @@ using PacketBufferWriter = PacketBufferWriterBase\n" + " -a, --subject-cat \n" "\n" - " Subject DN CHIP Authentication Tag (in hex).\n" + " Subject DN CHIP CASE Authentication Tag (in hex).\n" "\n" " -c, --subject-cn-u \n" "\n" @@ -266,20 +266,7 @@ bool HandleOption(const char * progName, OptionSet * optSet, int id, const char PrintArgError("%s: Invalid value specified for the subject authentication tag attribute: %s\n", progName, arg); return false; } - - if (!gSubjectDN.HasAttr(kOID_AttributeType_ChipAuthTag1)) - { - attrOID = kOID_AttributeType_ChipAuthTag1; - } - else if (!gSubjectDN.HasAttr(kOID_AttributeType_ChipAuthTag2)) - { - attrOID = kOID_AttributeType_ChipAuthTag2; - } - else - { - PrintArgError("%s: Too many authentication tag attributes are specified: %s\n", progName, arg); - return false; - } + attrOID = kOID_AttributeType_ChipCASEAuthenticatedTag; err = gSubjectDN.AddAttribute(attrOID, chip32bitAttr); if (err != CHIP_NO_ERROR) diff --git a/src/tools/chip-cert/GeneralUtils.cpp b/src/tools/chip-cert/GeneralUtils.cpp index 23adb060aca962..e7735d87b34c93 100644 --- a/src/tools/chip-cert/GeneralUtils.cpp +++ b/src/tools/chip-cert/GeneralUtils.cpp @@ -38,8 +38,7 @@ int gNIDChipFirmwareSigningId; int gNIDChipICAId; int gNIDChipRootId; int gNIDChipFabricId; -int gNIDChipAuthTag1; -int gNIDChipAuthTag2; +int gNIDChipCASEAuthenticatedTag; int gNIDChipAttAttrVID; int gNIDChipAttAttrPID; int gNIDChipCurveP256 = EC_curve_nist2nid("P-256"); @@ -83,14 +82,8 @@ bool InitOpenSSL() ReportOpenSSLErrorAndExit("OBJ_create", res = false); } - gNIDChipAuthTag1 = OBJ_create("1.3.6.1.4.1.37244.1.6", "ChipAuthTag1", "ChipAuthTag1"); - if (gNIDChipAuthTag1 == 0) - { - ReportOpenSSLErrorAndExit("OBJ_create", res = false); - } - - gNIDChipAuthTag2 = OBJ_create("1.3.6.1.4.1.37244.1.7", "ChipAuthTag2", "ChipAuthTag2"); - if (gNIDChipAuthTag2 == 0) + gNIDChipCASEAuthenticatedTag = OBJ_create("1.3.6.1.4.1.37244.1.6", "ChipCASEAuthenticatedTag", "ChipCASEAuthenticatedTag"); + if (gNIDChipCASEAuthenticatedTag == 0) { ReportOpenSSLErrorAndExit("OBJ_create", res = false); } @@ -112,8 +105,7 @@ bool InitOpenSSL() ASN1_STRING_TABLE_add(gNIDChipICAId, 16, 16, B_ASN1_UTF8STRING, 0); ASN1_STRING_TABLE_add(gNIDChipRootId, 16, 16, B_ASN1_UTF8STRING, 0); ASN1_STRING_TABLE_add(gNIDChipFabricId, 16, 16, B_ASN1_UTF8STRING, 0); - ASN1_STRING_TABLE_add(gNIDChipAuthTag1, 8, 8, B_ASN1_UTF8STRING, 0); - ASN1_STRING_TABLE_add(gNIDChipAuthTag2, 8, 8, B_ASN1_UTF8STRING, 0); + ASN1_STRING_TABLE_add(gNIDChipCASEAuthenticatedTag, 8, 8, B_ASN1_UTF8STRING, 0); ASN1_STRING_TABLE_add(gNIDChipAttAttrVID, 4, 4, B_ASN1_UTF8STRING, 0); ASN1_STRING_TABLE_add(gNIDChipAttAttrPID, 4, 4, B_ASN1_UTF8STRING, 0); diff --git a/src/tools/chip-cert/chip-cert.h b/src/tools/chip-cert/chip-cert.h index 66e395993e539e..ccde5747a0e460 100644 --- a/src/tools/chip-cert/chip-cert.h +++ b/src/tools/chip-cert/chip-cert.h @@ -164,8 +164,7 @@ extern int gNIDChipFirmwareSigningId; extern int gNIDChipICAId; extern int gNIDChipRootId; extern int gNIDChipFabricId; -extern int gNIDChipAuthTag1; -extern int gNIDChipAuthTag2; +extern int gNIDChipCASEAuthenticatedTag; extern int gNIDChipCurveP256; extern int gNIDChipAttAttrVID; extern int gNIDChipAttAttrPID; diff --git a/src/transport/MessageCounter.h b/src/transport/MessageCounter.h index 62365d2b95fa88..2c48ac801e99db 100644 --- a/src/transport/MessageCounter.h +++ b/src/transport/MessageCounter.h @@ -47,10 +47,9 @@ class MessageCounter virtual ~MessageCounter() = default; - virtual Type GetType() = 0; - virtual uint32_t Value() = 0; /** Get current value */ - virtual CHIP_ERROR Advance() = 0; /** Advance the counter */ - virtual CHIP_ERROR SetCounter(uint32_t count) = 0; /** Set the counter to the specified value */ + virtual Type GetType() = 0; + virtual uint32_t Value() = 0; /** Get current value */ + virtual CHIP_ERROR Advance() = 0; /** Advance the counter */ }; class GlobalUnencryptedMessageCounter : public MessageCounter @@ -67,11 +66,6 @@ class GlobalUnencryptedMessageCounter : public MessageCounter ++value; return CHIP_NO_ERROR; } - CHIP_ERROR SetCounter(uint32_t count) override - { - value = count; - return CHIP_NO_ERROR; - } private: uint32_t value; @@ -86,7 +80,6 @@ class GlobalEncryptedMessageCounter : public MessageCounter Type GetType() override { return GlobalEncrypted; } uint32_t Value() override { return persisted.GetValue(); } CHIP_ERROR Advance() override { return persisted.Advance(); } - CHIP_ERROR SetCounter(uint32_t count) override { return CHIP_ERROR_NOT_IMPLEMENTED; } private: #if CONFIG_DEVICE_LAYER @@ -123,11 +116,6 @@ class LocalSessionMessageCounter : public MessageCounter ++value; return CHIP_NO_ERROR; } - CHIP_ERROR SetCounter(uint32_t count) override - { - value = count; - return CHIP_NO_ERROR; - } private: uint32_t value; diff --git a/src/transport/raw/PeerAddress.h b/src/transport/raw/PeerAddress.h index 535f0ff9102d48..7c7f80db6c3f1d 100644 --- a/src/transport/raw/PeerAddress.h +++ b/src/transport/raw/PeerAddress.h @@ -101,6 +101,8 @@ class PeerAddress bool IsInitialized() const { return mTransportType != Type::kUndefined; } + bool IsMulticast() { return Type::kUdp == mTransportType && mIPAddress.IsIPv6Multicast(); } + bool operator==(const PeerAddress & other) const { return (mTransportType == other.mTransportType) && (mIPAddress == other.mIPAddress) && (mPort == other.mPort) && @@ -201,6 +203,22 @@ class PeerAddress return TCP(addr).SetPort(port).SetInterface(interface); } + static PeerAddress Multicast(chip::FabricId fabric, chip::GroupId group) + { + constexpr uint8_t scope = 0x05; // Site-Local + constexpr uint8_t prefixLength = 0x40; // 64-bit long network prefix field + // The network prefix portion of the Multicast Address is the 64-bit bitstring formed by concatenating: + // * 0xFD to designate a locally assigned ULA prefix + // * The upper 56-bits of the Fabric ID for the network in big-endian order + const uint64_t prefix = 0xfd00000000000000 | ((fabric >> 8) & 0x00ffffffffffffff); + // The 32-bit group identifier portion of the Multicast Address is the 32-bits formed by: + // * The lower 8-bits of the Fabric ID + // * 0x00 + // * The 16-bits Group Identifier in big-endian order + uint32_t groupId = static_cast((fabric << 24) & 0xff000000) | group; + return UDP(Inet::IPAddress::MakeIPv6PrefixMulticast(scope, prefixLength, prefix, groupId)); + } + private: Inet::IPAddress mIPAddress = {}; Type mTransportType = Type::kUndefined; diff --git a/src/transport/raw/tests/BUILD.gn b/src/transport/raw/tests/BUILD.gn index bcc2aada1995fd..ae606987ed5b7d 100644 --- a/src/transport/raw/tests/BUILD.gn +++ b/src/transport/raw/tests/BUILD.gn @@ -39,7 +39,10 @@ static_library("helpers") { chip_test_suite("tests") { output_name = "libRawTransportTests" - test_sources = [ "TestMessageHeader.cpp" ] + test_sources = [ + "TestMessageHeader.cpp", + "TestPeerAddress.cpp", + ] if (current_os != "mac") { test_sources += [ "TestTCP.cpp" ] diff --git a/src/transport/raw/tests/TestPeerAddress.cpp b/src/transport/raw/tests/TestPeerAddress.cpp new file mode 100644 index 00000000000000..b6d67e8342b7b0 --- /dev/null +++ b/src/transport/raw/tests/TestPeerAddress.cpp @@ -0,0 +1,95 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2016-2017 Nest Labs, Inc. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __STDC_FORMAT_MACROS +#define __STDC_FORMAT_MACROS +#endif + +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS +#endif + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +using namespace chip; + +/** + * Test correct identification of IPv6 multicast addresses. + */ +void TestPeerAddressMulticast(nlTestSuite * inSuite, void * inContext) +{ + constexpr chip::FabricId fabric = 0xa1a2a4a8b1b2b4b8; + constexpr chip::GroupId group = 0xe10f; + chip::Transport::PeerAddress addr = chip::Transport::PeerAddress::Multicast(fabric, group); + NL_TEST_ASSERT(inSuite, chip::Transport::Type::kUdp == addr.GetTransportType()); + NL_TEST_ASSERT(inSuite, addr.IsMulticast()); + + const Inet::IPAddress & ip = addr.GetIPAddress(); + NL_TEST_ASSERT(inSuite, ip.IsIPv6Multicast()); + NL_TEST_ASSERT(inSuite, chip::Inet::IPAddressType::kIPv6 == ip.Type()); + + constexpr uint8_t expected[NL_INET_IPV6_ADDR_LEN_IN_BYTES] = { 0xff, 0x35, 0x00, 0x40, 0xfd, 0xa1, 0xa2, 0xa4, + 0xa8, 0xb1, 0xb2, 0xb4, 0xb8, 0x00, 0xe1, 0x0f }; + uint8_t result[NL_INET_IPV6_ADDR_LEN_IN_BYTES]; + uint8_t * p = result; + ip.WriteAddress(p); + NL_TEST_ASSERT(inSuite, !memcmp(expected, result, NL_INET_IPV6_ADDR_LEN_IN_BYTES)); +} + +/** + * Test Suite. It lists all the test functions. + */ + +// clang-format off +static const nlTest sTests[] = +{ + NL_TEST_DEF("PeerAddress Multicast", TestPeerAddressMulticast), + NL_TEST_SENTINEL() +}; +// clang-format on + +int TestPeerAddress(void) +{ + // clang-format off + nlTestSuite theSuite = + { + "PeerAddress", + &sTests[0], + nullptr, + nullptr + }; + // clang-format on + + // Run test suit againt one context. + nlTestRunner(&theSuite, nullptr); + + return (nlTestRunnerStats(&theSuite)); +} + +CHIP_REGISTER_TEST_SUITE(TestPeerAddress) diff --git a/zzz_generated/all-clusters-app/zap-generated/attribute-size.cpp b/zzz_generated/all-clusters-app/zap-generated/attribute-size.cpp index 598920833160b7..8fef1bef332005 100644 --- a/zzz_generated/all-clusters-app/zap-generated/attribute-size.cpp +++ b/zzz_generated/all-clusters-app/zap-generated/attribute-size.cpp @@ -661,6 +661,44 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo } break; } + case 0x0034: // Software Diagnostics Cluster + { + uint16_t entryOffset = kSizeLengthInBytes; + switch (am->attributeId) + { + case 0x0000: // ThreadMetrics + { + entryLength = 30; + if (((index - 1) * entryLength) > (am->size - entryLength)) + { + ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); + return 0; + } + entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); + // Struct _ThreadMetrics + _ThreadMetrics * entry = reinterpret_cast<_ThreadMetrics *>(write ? src : dest); + copyListMember(write ? dest : (uint8_t *) &entry->Id, write ? (uint8_t *) &entry->Id : src, write, &entryOffset, + sizeof(entry->Id)); // INT64U + ByteSpan NameSpanStorage(Uint8::from_const_char(entry->Name.data()), entry->Name.size()); // CHAR_STRING + ByteSpan * NameSpan = &NameSpanStorage; + if (CHIP_NO_ERROR != + (write ? WriteByteSpan(dest + entryOffset, 10, NameSpan) : ReadByteSpan(src + entryOffset, 10, NameSpan))) + { + ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); + return 0; + } + entryOffset = static_cast(entryOffset + 10); + copyListMember(write ? dest : (uint8_t *) &entry->StackFreeCurrent, write ? (uint8_t *) &entry->StackFreeCurrent : src, + write, &entryOffset, sizeof(entry->StackFreeCurrent)); // INT32U + copyListMember(write ? dest : (uint8_t *) &entry->StackFreeMinimum, write ? (uint8_t *) &entry->StackFreeMinimum : src, + write, &entryOffset, sizeof(entry->StackFreeMinimum)); // INT32U + copyListMember(write ? dest : (uint8_t *) &entry->StackSize, write ? (uint8_t *) &entry->StackSize : src, write, + &entryOffset, sizeof(entry->StackSize)); // INT32U + break; + } + } + break; + } case 0x0504: // TV Channel Cluster { uint16_t entryOffset = kSizeLengthInBytes; @@ -1204,6 +1242,15 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut break; } break; + case 0x0034: // Software Diagnostics Cluster + switch (attributeId) + { + case 0x0000: // ThreadMetrics + // Struct _ThreadMetrics + entryLength = 30; + break; + } + break; case 0x0504: // TV Channel Cluster switch (attributeId) { diff --git a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h index ecb85791eb497f..aecfa5f642587d 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -80,29 +80,29 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 543 - ProductLabel, */ \ + /* 544 - ProductLabel, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 608 - SerialNumber, */ \ + /* 609 - SerialNumber, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: OTA Software Update Requestor (server), big-endian */ \ \ - /* 641 - default ota provider, */ \ + /* 642 - default ota provider, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Commissioning (server), big-endian */ \ \ - /* 658 - Breadcrumb, */ \ + /* 659 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 666 - BasicCommissioningInfoList, */ \ + /* 667 - BasicCommissioningInfoList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -120,43 +120,43 @@ \ /* Endpoint: 0, Cluster: Network Commissioning (server), big-endian */ \ \ - /* 920 - FeatureMap, */ \ + /* 921 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Diagnostics (server), big-endian */ \ \ - /* 924 - UpTime, */ \ + /* 925 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 932 - TotalOperationalHours, */ \ + /* 933 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), big-endian */ \ \ - /* 936 - CurrentHeapFree, */ \ + /* 937 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 944 - CurrentHeapUsed, */ \ + /* 945 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 952 - CurrentHeapHighWatermark, */ \ + /* 953 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), big-endian */ \ \ - /* 960 - NetworkName, */ \ + /* 961 - NetworkName, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 977 - ExtendedPanId, */ \ + /* 978 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 985 - MeshLocalPrefix, */ \ + /* 986 - MeshLocalPrefix, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1003 - OverrunCount, */ \ + /* 1004 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1011 - NeighborTableList, */ \ + /* 1012 - NeighborTableList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -172,7 +172,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1265 - RouteTableList, */ \ + /* 1266 - RouteTableList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -188,184 +188,184 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1519 - PartitionId, */ \ + /* 1520 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1523 - TxTotalCount, */ \ + /* 1524 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1527 - TxUnicastCount, */ \ + /* 1528 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1531 - TxBroadcastCount, */ \ + /* 1532 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1535 - TxAckRequestedCount, */ \ + /* 1536 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1539 - TxAckedCount, */ \ + /* 1540 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1543 - TxNoAckRequestedCount, */ \ + /* 1544 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1547 - TxDataCount, */ \ + /* 1548 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1551 - TxDataPollCount, */ \ + /* 1552 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1555 - TxBeaconCount, */ \ + /* 1556 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1559 - TxBeaconRequestCount, */ \ + /* 1560 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1563 - TxOtherCount, */ \ + /* 1564 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1567 - TxRetryCount, */ \ + /* 1568 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1571 - TxDirectMaxRetryExpiryCount, */ \ + /* 1572 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1575 - TxIndirectMaxRetryExpiryCount, */ \ + /* 1576 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1579 - TxErrCcaCount, */ \ + /* 1580 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1583 - TxErrAbortCount, */ \ + /* 1584 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1587 - TxErrBusyChannelCount, */ \ + /* 1588 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1591 - RxTotalCount, */ \ + /* 1592 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1595 - RxUnicastCount, */ \ + /* 1596 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1599 - RxBroadcastCount, */ \ + /* 1600 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1603 - RxDataCount, */ \ + /* 1604 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1607 - RxDataPollCount, */ \ + /* 1608 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1611 - RxBeaconCount, */ \ + /* 1612 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1615 - RxBeaconRequestCount, */ \ + /* 1616 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1619 - RxOtherCount, */ \ + /* 1620 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1623 - RxAddressFilteredCount, */ \ + /* 1624 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1627 - RxDestAddrFilteredCount, */ \ + /* 1628 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1631 - RxDuplicatedCount, */ \ + /* 1632 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1635 - RxErrNoFrameCount, */ \ + /* 1636 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1639 - RxErrUnknownNeighborCount, */ \ + /* 1640 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1643 - RxErrInvalidSrcAddrCount, */ \ + /* 1644 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1647 - RxErrSecCount, */ \ + /* 1648 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1651 - RxErrFcsCount, */ \ + /* 1652 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1655 - RxErrOtherCount, */ \ + /* 1656 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1659 - ActiveTimestamp, */ \ + /* 1660 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1667 - PendingTimestamp, */ \ + /* 1668 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1675 - delay, */ \ + /* 1676 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1679 - SecurityPolicy, */ \ + /* 1680 - SecurityPolicy, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1685 - ChannelMask, */ \ + /* 1686 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1690 - OperationalDatasetComponents, */ \ + /* 1691 - OperationalDatasetComponents, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1704 - ActiveNetworkFaultsList, */ \ + /* 1705 - ActiveNetworkFaultsList, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), big-endian */ \ \ - /* 1708 - bssid, */ \ + /* 1709 - bssid, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1715 - BeaconLostCount, */ \ + /* 1716 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1719 - BeaconRxCount, */ \ + /* 1720 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1723 - PacketMulticastRxCount, */ \ + /* 1724 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1727 - PacketMulticastTxCount, */ \ + /* 1728 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1731 - PacketUnicastRxCount, */ \ + /* 1732 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1735 - PacketUnicastTxCount, */ \ + /* 1736 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1739 - CurrentMaxRate, */ \ + /* 1740 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1747 - OverrunCount, */ \ + /* 1748 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), big-endian */ \ \ - /* 1755 - PacketRxCount, */ \ + /* 1756 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1763 - PacketTxCount, */ \ + /* 1764 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1771 - TxErrCount, */ \ + /* 1772 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1779 - CollisionCount, */ \ + /* 1780 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1787 - OverrunCount, */ \ + /* 1788 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1795 - TimeSinceReset, */ \ + /* 1796 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Group Key Management (server), big-endian */ \ \ - /* 1803 - groups, */ \ + /* 1804 - groups, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -381,7 +381,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2057 - group keys, */ \ + /* 2058 - group keys, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -399,62 +399,62 @@ \ /* Endpoint: 1, Cluster: On/Off (server), big-endian */ \ \ - /* 2311 - FeatureMap, */ \ + /* 2312 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Power Source (server), big-endian */ \ \ - /* 2315 - Description, */ \ + /* 2316 - Description, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2376 - BatteryVoltage, */ \ + /* 2377 - BatteryVoltage, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2380 - BatteryTimeRemaining, */ \ + /* 2381 - BatteryTimeRemaining, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2384 - ActiveBatteryFaults, */ \ + /* 2385 - ActiveBatteryFaults, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2392 - FeatureMap, */ \ + /* 2393 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Bridged Device Basic (server), big-endian */ \ \ - /* 2396 - VendorName, */ \ + /* 2397 - VendorName, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2429 - ProductName, */ \ + /* 2430 - ProductName, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2462 - UserLabel, */ \ + /* 2463 - UserLabel, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2495 - HardwareVersionString, */ \ + /* 2496 - HardwareVersionString, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2560 - SoftwareVersion, */ \ + /* 2561 - SoftwareVersion, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2564 - SoftwareVersionString, */ \ + /* 2565 - SoftwareVersionString, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2629 - ManufacturingDate, */ \ + /* 2630 - ManufacturingDate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2646 - PartNumber, */ \ + /* 2647 - PartNumber, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -470,7 +470,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2901 - ProductURL, */ \ + /* 2902 - ProductURL, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -486,24 +486,24 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3156 - ProductLabel, */ \ + /* 3157 - ProductLabel, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3221 - SerialNumber, */ \ + /* 3222 - SerialNumber, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Switch (server), big-endian */ \ \ - /* 3254 - FeatureMap, */ \ + /* 3255 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Fixed Label (server), big-endian */ \ \ - /* 3258 - label list, */ \ + /* 3259 - label list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -521,31 +521,31 @@ \ /* Endpoint: 1, Cluster: Mode Select (server), big-endian */ \ \ - /* 3512 - Description, */ \ + /* 3513 - Description, */ \ 6, 'C', 'o', 'f', 'f', 'e', 'e', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Window Covering (server), big-endian */ \ \ - /* 3545 - FeatureMap, */ \ + /* 3546 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server), big-endian */ \ \ - /* 3549 - LifetimeEnergyConsumed, */ \ + /* 3550 - LifetimeEnergyConsumed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3553 - FeatureMap, */ \ + /* 3554 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Thermostat (server), big-endian */ \ \ - /* 3557 - FeatureMap, */ \ + /* 3558 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x0B, \ \ /* Endpoint: 1, Cluster: Color Control (server), big-endian */ \ \ - /* 3561 - compensation text, */ \ + /* 3562 - compensation text, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -563,18 +563,18 @@ \ /* Endpoint: 1, Cluster: IAS Zone (server), big-endian */ \ \ - /* 3816 - IAS CIE address, */ \ + /* 3817 - IAS CIE address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Wake on LAN (server), big-endian */ \ \ - /* 3824 - wake on lan mac address, */ \ + /* 3825 - wake on lan mac address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: TV Channel (server), big-endian */ \ \ - /* 3857 - tv channel list, */ \ + /* 3858 - tv channel list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -590,17 +590,17 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4111 - tv channel lineup, */ \ + /* 4112 - tv channel lineup, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4144 - current tv channel, */ \ + /* 4145 - current tv channel, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Target Navigator (server), big-endian */ \ \ - /* 4177 - target navigator list, */ \ + /* 4178 - target navigator list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -618,30 +618,30 @@ \ /* Endpoint: 1, Cluster: Media Playback (server), big-endian */ \ \ - /* 4431 - start time, */ \ + /* 4432 - start time, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, \ \ - /* 4439 - duration, */ \ + /* 4440 - duration, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4447 - position updated at, */ \ + /* 4448 - position updated at, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4455 - position, */ \ + /* 4456 - position, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4463 - playback speed, */ \ + /* 4464 - playback speed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4471 - seek range end, */ \ + /* 4472 - seek range end, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4479 - seek range start, */ \ + /* 4480 - seek range start, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Media Input (server), big-endian */ \ \ - /* 4487 - media input list, */ \ + /* 4488 - media input list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -659,7 +659,7 @@ \ /* Endpoint: 1, Cluster: Content Launcher (server), big-endian */ \ \ - /* 4741 - accepts header list, */ \ + /* 4742 - accepts header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -675,7 +675,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4995 - supported streaming types, */ \ + /* 4996 - supported streaming types, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -693,7 +693,7 @@ \ /* Endpoint: 1, Cluster: Audio Output (server), big-endian */ \ \ - /* 5249 - audio output list, */ \ + /* 5250 - audio output list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -711,7 +711,7 @@ \ /* Endpoint: 1, Cluster: Application Launcher (server), big-endian */ \ \ - /* 5503 - application launcher list, */ \ + /* 5504 - application launcher list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -729,45 +729,45 @@ \ /* Endpoint: 1, Cluster: Application Basic (server), big-endian */ \ \ - /* 5757 - vendor name, */ \ + /* 5758 - vendor name, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5790 - application name, */ \ + /* 5791 - application name, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5823 - application id, */ \ + /* 5824 - application id, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Test Cluster (server), big-endian */ \ \ - /* 5856 - bitmap32, */ \ + /* 5857 - bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 5860 - bitmap64, */ \ + /* 5861 - bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5868 - int32u, */ \ + /* 5869 - int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 5872 - int64u, */ \ + /* 5873 - int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5880 - int32s, */ \ + /* 5881 - int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 5884 - int64s, */ \ + /* 5885 - int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5892 - octet_string, */ \ + /* 5893 - octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5903 - list_int8u, */ \ + /* 5904 - list_int8u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5913 - list_octet_string, */ \ + /* 5914 - list_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -783,7 +783,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 6167 - list_struct_octet_string, */ \ + /* 6168 - list_struct_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -799,7 +799,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 6421 - long_octet_string, */ \ + /* 6422 - long_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -854,10 +854,10 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 7423 - char_string, */ \ + /* 7424 - char_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 7434 - long_char_string, */ \ + /* 7435 - long_char_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -912,23 +912,47 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 8436 - epoch_us, */ \ + /* 8437 - epoch_us, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 8445 - epoch_s, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* 8449 - nullable_bitmap32, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* 8453 - nullable_bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 8444 - epoch_s, */ \ + /* 8461 - nullable_int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ + /* 8465 - nullable_int64u, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 8473 - nullable_int32s, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* 8477 - nullable_int64s, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 8485 - nullable_octet_string, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 8496 - nullable_char_string, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ /* Endpoint: 1, Cluster: Electrical Measurement (server), big-endian */ \ \ - /* 8448 - measurement type, */ \ + /* 8507 - measurement type, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 8452 - total active power, */ \ + /* 8511 - total active power, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 2, Cluster: On/Off (server), big-endian */ \ \ - /* 8456 - FeatureMap, */ \ + /* 8515 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ } @@ -989,29 +1013,29 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 543 - ProductLabel, */ \ + /* 544 - ProductLabel, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 608 - SerialNumber, */ \ + /* 609 - SerialNumber, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: OTA Software Update Requestor (server), little-endian */ \ \ - /* 641 - default ota provider, */ \ + /* 642 - default ota provider, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Commissioning (server), little-endian */ \ \ - /* 658 - Breadcrumb, */ \ + /* 659 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 666 - BasicCommissioningInfoList, */ \ + /* 667 - BasicCommissioningInfoList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1029,43 +1053,43 @@ \ /* Endpoint: 0, Cluster: Network Commissioning (server), little-endian */ \ \ - /* 920 - FeatureMap, */ \ + /* 921 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Diagnostics (server), little-endian */ \ \ - /* 924 - UpTime, */ \ + /* 925 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 932 - TotalOperationalHours, */ \ + /* 933 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), little-endian */ \ \ - /* 936 - CurrentHeapFree, */ \ + /* 937 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 944 - CurrentHeapUsed, */ \ + /* 945 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 952 - CurrentHeapHighWatermark, */ \ + /* 953 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), little-endian */ \ \ - /* 960 - NetworkName, */ \ + /* 961 - NetworkName, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 977 - ExtendedPanId, */ \ + /* 978 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 985 - MeshLocalPrefix, */ \ + /* 986 - MeshLocalPrefix, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1003 - OverrunCount, */ \ + /* 1004 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1011 - NeighborTableList, */ \ + /* 1012 - NeighborTableList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1081,7 +1105,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1265 - RouteTableList, */ \ + /* 1266 - RouteTableList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1097,184 +1121,184 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1519 - PartitionId, */ \ + /* 1520 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1523 - TxTotalCount, */ \ + /* 1524 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1527 - TxUnicastCount, */ \ + /* 1528 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1531 - TxBroadcastCount, */ \ + /* 1532 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1535 - TxAckRequestedCount, */ \ + /* 1536 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1539 - TxAckedCount, */ \ + /* 1540 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1543 - TxNoAckRequestedCount, */ \ + /* 1544 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1547 - TxDataCount, */ \ + /* 1548 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1551 - TxDataPollCount, */ \ + /* 1552 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1555 - TxBeaconCount, */ \ + /* 1556 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1559 - TxBeaconRequestCount, */ \ + /* 1560 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1563 - TxOtherCount, */ \ + /* 1564 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1567 - TxRetryCount, */ \ + /* 1568 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1571 - TxDirectMaxRetryExpiryCount, */ \ + /* 1572 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1575 - TxIndirectMaxRetryExpiryCount, */ \ + /* 1576 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1579 - TxErrCcaCount, */ \ + /* 1580 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1583 - TxErrAbortCount, */ \ + /* 1584 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1587 - TxErrBusyChannelCount, */ \ + /* 1588 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1591 - RxTotalCount, */ \ + /* 1592 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1595 - RxUnicastCount, */ \ + /* 1596 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1599 - RxBroadcastCount, */ \ + /* 1600 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1603 - RxDataCount, */ \ + /* 1604 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1607 - RxDataPollCount, */ \ + /* 1608 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1611 - RxBeaconCount, */ \ + /* 1612 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1615 - RxBeaconRequestCount, */ \ + /* 1616 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1619 - RxOtherCount, */ \ + /* 1620 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1623 - RxAddressFilteredCount, */ \ + /* 1624 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1627 - RxDestAddrFilteredCount, */ \ + /* 1628 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1631 - RxDuplicatedCount, */ \ + /* 1632 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1635 - RxErrNoFrameCount, */ \ + /* 1636 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1639 - RxErrUnknownNeighborCount, */ \ + /* 1640 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1643 - RxErrInvalidSrcAddrCount, */ \ + /* 1644 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1647 - RxErrSecCount, */ \ + /* 1648 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1651 - RxErrFcsCount, */ \ + /* 1652 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1655 - RxErrOtherCount, */ \ + /* 1656 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1659 - ActiveTimestamp, */ \ + /* 1660 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1667 - PendingTimestamp, */ \ + /* 1668 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1675 - delay, */ \ + /* 1676 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1679 - SecurityPolicy, */ \ + /* 1680 - SecurityPolicy, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1685 - ChannelMask, */ \ + /* 1686 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1690 - OperationalDatasetComponents, */ \ + /* 1691 - OperationalDatasetComponents, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1704 - ActiveNetworkFaultsList, */ \ + /* 1705 - ActiveNetworkFaultsList, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), little-endian */ \ \ - /* 1708 - bssid, */ \ + /* 1709 - bssid, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1715 - BeaconLostCount, */ \ + /* 1716 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1719 - BeaconRxCount, */ \ + /* 1720 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1723 - PacketMulticastRxCount, */ \ + /* 1724 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1727 - PacketMulticastTxCount, */ \ + /* 1728 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1731 - PacketUnicastRxCount, */ \ + /* 1732 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1735 - PacketUnicastTxCount, */ \ + /* 1736 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1739 - CurrentMaxRate, */ \ + /* 1740 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1747 - OverrunCount, */ \ + /* 1748 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), little-endian */ \ \ - /* 1755 - PacketRxCount, */ \ + /* 1756 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1763 - PacketTxCount, */ \ + /* 1764 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1771 - TxErrCount, */ \ + /* 1772 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1779 - CollisionCount, */ \ + /* 1780 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1787 - OverrunCount, */ \ + /* 1788 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1795 - TimeSinceReset, */ \ + /* 1796 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Group Key Management (server), little-endian */ \ \ - /* 1803 - groups, */ \ + /* 1804 - groups, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1290,7 +1314,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2057 - group keys, */ \ + /* 2058 - group keys, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1308,62 +1332,62 @@ \ /* Endpoint: 1, Cluster: On/Off (server), little-endian */ \ \ - /* 2311 - FeatureMap, */ \ + /* 2312 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Power Source (server), little-endian */ \ \ - /* 2315 - Description, */ \ + /* 2316 - Description, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2376 - BatteryVoltage, */ \ + /* 2377 - BatteryVoltage, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2380 - BatteryTimeRemaining, */ \ + /* 2381 - BatteryTimeRemaining, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2384 - ActiveBatteryFaults, */ \ + /* 2385 - ActiveBatteryFaults, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2392 - FeatureMap, */ \ + /* 2393 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Bridged Device Basic (server), little-endian */ \ \ - /* 2396 - VendorName, */ \ + /* 2397 - VendorName, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2429 - ProductName, */ \ + /* 2430 - ProductName, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2462 - UserLabel, */ \ + /* 2463 - UserLabel, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2495 - HardwareVersionString, */ \ + /* 2496 - HardwareVersionString, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2560 - SoftwareVersion, */ \ + /* 2561 - SoftwareVersion, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2564 - SoftwareVersionString, */ \ + /* 2565 - SoftwareVersionString, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2629 - ManufacturingDate, */ \ + /* 2630 - ManufacturingDate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2646 - PartNumber, */ \ + /* 2647 - PartNumber, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1379,7 +1403,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2901 - ProductURL, */ \ + /* 2902 - ProductURL, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1395,24 +1419,24 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3156 - ProductLabel, */ \ + /* 3157 - ProductLabel, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3221 - SerialNumber, */ \ + /* 3222 - SerialNumber, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Switch (server), little-endian */ \ \ - /* 3254 - FeatureMap, */ \ + /* 3255 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Fixed Label (server), little-endian */ \ \ - /* 3258 - label list, */ \ + /* 3259 - label list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1430,31 +1454,31 @@ \ /* Endpoint: 1, Cluster: Mode Select (server), little-endian */ \ \ - /* 3512 - Description, */ \ + /* 3513 - Description, */ \ 6, 'C', 'o', 'f', 'f', 'e', 'e', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Window Covering (server), little-endian */ \ \ - /* 3545 - FeatureMap, */ \ + /* 3546 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server), little-endian */ \ \ - /* 3549 - LifetimeEnergyConsumed, */ \ + /* 3550 - LifetimeEnergyConsumed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3553 - FeatureMap, */ \ + /* 3554 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Thermostat (server), little-endian */ \ \ - /* 3557 - FeatureMap, */ \ + /* 3558 - FeatureMap, */ \ 0x0B, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Color Control (server), little-endian */ \ \ - /* 3561 - compensation text, */ \ + /* 3562 - compensation text, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1472,18 +1496,18 @@ \ /* Endpoint: 1, Cluster: IAS Zone (server), little-endian */ \ \ - /* 3816 - IAS CIE address, */ \ + /* 3817 - IAS CIE address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Wake on LAN (server), little-endian */ \ \ - /* 3824 - wake on lan mac address, */ \ + /* 3825 - wake on lan mac address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: TV Channel (server), little-endian */ \ \ - /* 3857 - tv channel list, */ \ + /* 3858 - tv channel list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1499,17 +1523,17 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4111 - tv channel lineup, */ \ + /* 4112 - tv channel lineup, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4144 - current tv channel, */ \ + /* 4145 - current tv channel, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Target Navigator (server), little-endian */ \ \ - /* 4177 - target navigator list, */ \ + /* 4178 - target navigator list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1527,30 +1551,30 @@ \ /* Endpoint: 1, Cluster: Media Playback (server), little-endian */ \ \ - /* 4431 - start time, */ \ + /* 4432 - start time, */ \ 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4439 - duration, */ \ + /* 4440 - duration, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4447 - position updated at, */ \ + /* 4448 - position updated at, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4455 - position, */ \ + /* 4456 - position, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4463 - playback speed, */ \ + /* 4464 - playback speed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4471 - seek range end, */ \ + /* 4472 - seek range end, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4479 - seek range start, */ \ + /* 4480 - seek range start, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Media Input (server), little-endian */ \ \ - /* 4487 - media input list, */ \ + /* 4488 - media input list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1568,7 +1592,7 @@ \ /* Endpoint: 1, Cluster: Content Launcher (server), little-endian */ \ \ - /* 4741 - accepts header list, */ \ + /* 4742 - accepts header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1584,7 +1608,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4995 - supported streaming types, */ \ + /* 4996 - supported streaming types, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1602,7 +1626,7 @@ \ /* Endpoint: 1, Cluster: Audio Output (server), little-endian */ \ \ - /* 5249 - audio output list, */ \ + /* 5250 - audio output list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1620,7 +1644,7 @@ \ /* Endpoint: 1, Cluster: Application Launcher (server), little-endian */ \ \ - /* 5503 - application launcher list, */ \ + /* 5504 - application launcher list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1638,45 +1662,45 @@ \ /* Endpoint: 1, Cluster: Application Basic (server), little-endian */ \ \ - /* 5757 - vendor name, */ \ + /* 5758 - vendor name, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5790 - application name, */ \ + /* 5791 - application name, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5823 - application id, */ \ + /* 5824 - application id, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Test Cluster (server), little-endian */ \ \ - /* 5856 - bitmap32, */ \ + /* 5857 - bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 5860 - bitmap64, */ \ + /* 5861 - bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5868 - int32u, */ \ + /* 5869 - int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 5872 - int64u, */ \ + /* 5873 - int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5880 - int32s, */ \ + /* 5881 - int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 5884 - int64s, */ \ + /* 5885 - int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5892 - octet_string, */ \ + /* 5893 - octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5903 - list_int8u, */ \ + /* 5904 - list_int8u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5913 - list_octet_string, */ \ + /* 5914 - list_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1692,7 +1716,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 6167 - list_struct_octet_string, */ \ + /* 6168 - list_struct_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1708,7 +1732,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 6421 - long_octet_string, */ \ + /* 6422 - long_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1763,10 +1787,10 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 7423 - char_string, */ \ + /* 7424 - char_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 7434 - long_char_string, */ \ + /* 7435 - long_char_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1821,29 +1845,53 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 8436 - epoch_us, */ \ + /* 8437 - epoch_us, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 8445 - epoch_s, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* 8449 - nullable_bitmap32, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* 8453 - nullable_bitmap64, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 8461 - nullable_int32u, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* 8465 - nullable_int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 8444 - epoch_s, */ \ + /* 8473 - nullable_int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ + /* 8477 - nullable_int64s, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 8485 - nullable_octet_string, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 8496 - nullable_char_string, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ /* Endpoint: 1, Cluster: Electrical Measurement (server), little-endian */ \ \ - /* 8448 - measurement type, */ \ + /* 8507 - measurement type, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 8452 - total active power, */ \ + /* 8511 - total active power, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 2, Cluster: On/Off (server), little-endian */ \ \ - /* 8456 - FeatureMap, */ \ + /* 8515 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ } #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (150) +#define GENERATED_DEFAULTS_COUNT (158) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -1871,7 +1919,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 500 +#define GENERATED_ATTRIBUTE_COUNT 518 #define GENERATED_ATTRIBUTES \ { \ \ @@ -1906,10 +1954,11 @@ ZAP_LONG_DEFAULTS_INDEX(171) }, /* SoftwareVersionString */ \ { 0x000B, ZAP_TYPE(CHAR_STRING), 17, ZAP_ATTRIBUTE_MASK(SINGLETON), \ ZAP_LONG_DEFAULTS_INDEX(236) }, /* ManufacturingDate */ \ - { 0x000C, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(253) }, /* PartNumber */ \ - { 0x000D, ZAP_TYPE(CHAR_STRING), 257, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(286) }, /* ProductURL */ \ - { 0x000E, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(543) }, /* ProductLabel */ \ - { 0x000F, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(608) }, /* SerialNumber */ \ + { 0x000C, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(253) }, /* PartNumber */ \ + { 0x000D, ZAP_TYPE(LONG_CHAR_STRING), 258, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_LONG_DEFAULTS_INDEX(286) }, /* ProductURL */ \ + { 0x000E, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(544) }, /* ProductLabel */ \ + { 0x000F, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(609) }, /* SerialNumber */ \ { 0x0010, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* LocalConfigDisabled */ \ { 0x0011, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(1) }, /* Reachable */ \ @@ -1920,44 +1969,45 @@ \ /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */ \ { 0x0001, ZAP_TYPE(OCTET_STRING), 17, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(641) }, /* default ota provider */ \ + ZAP_LONG_DEFAULTS_INDEX(642) }, /* default ota provider */ \ { 0x0002, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_EMPTY_DEFAULT() }, /* update possible */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x0000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(658) }, /* Breadcrumb */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(666) }, /* BasicCommissioningInfoList */ \ + { 0x0000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(659) }, /* Breadcrumb */ \ + { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(667) }, /* BasicCommissioningInfoList */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(920) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(921) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NetworkInterfaces */ \ { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* RebootCount */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(924) }, /* UpTime */ \ - { 0x0003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(932) }, /* TotalOperationalHours */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(925) }, /* UpTime */ \ + { 0x0003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(933) }, /* TotalOperationalHours */ \ { 0x0004, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BootReasons */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(936) }, /* CurrentHeapFree */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(944) }, /* CurrentHeapUsed */ \ - { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(952) }, /* CurrentHeapHighWatermark */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ThreadMetrics */ \ + { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(937) }, /* CurrentHeapFree */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(945) }, /* CurrentHeapUsed */ \ + { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(953) }, /* CurrentHeapHighWatermark */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ - { 0x0002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(960) }, /* NetworkName */ \ + { 0x0002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(961) }, /* NetworkName */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ - { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(977) }, /* ExtendedPanId */ \ - { 0x0005, ZAP_TYPE(OCTET_STRING), 18, 0, ZAP_LONG_DEFAULTS_INDEX(985) }, /* MeshLocalPrefix */ \ - { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1003) }, /* OverrunCount */ \ - { 0x0007, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1011) }, /* NeighborTableList */ \ - { 0x0008, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1265) }, /* RouteTableList */ \ - { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1519) }, /* PartitionId */ \ + { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(978) }, /* ExtendedPanId */ \ + { 0x0005, ZAP_TYPE(OCTET_STRING), 18, 0, ZAP_LONG_DEFAULTS_INDEX(986) }, /* MeshLocalPrefix */ \ + { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1004) }, /* OverrunCount */ \ + { 0x0007, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1012) }, /* NeighborTableList */ \ + { 0x0008, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1266) }, /* RouteTableList */ \ + { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1520) }, /* PartitionId */ \ { 0x000A, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* weighting */ \ { 0x000B, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* DataVersion */ \ { 0x000C, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* StableDataVersion */ \ @@ -1970,75 +2020,75 @@ { 0x0013, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PartitionIdChangeCount */ \ { 0x0014, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* BetterPartitionAttachAttemptCount */ \ { 0x0015, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ParentChangeCount */ \ - { 0x0016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1523) }, /* TxTotalCount */ \ - { 0x0017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1527) }, /* TxUnicastCount */ \ - { 0x0018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1531) }, /* TxBroadcastCount */ \ - { 0x0019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1535) }, /* TxAckRequestedCount */ \ - { 0x001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1539) }, /* TxAckedCount */ \ - { 0x001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1543) }, /* TxNoAckRequestedCount */ \ - { 0x001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1547) }, /* TxDataCount */ \ - { 0x001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1551) }, /* TxDataPollCount */ \ - { 0x001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1555) }, /* TxBeaconCount */ \ - { 0x001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1559) }, /* TxBeaconRequestCount */ \ - { 0x0020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1563) }, /* TxOtherCount */ \ - { 0x0021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1567) }, /* TxRetryCount */ \ - { 0x0022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1571) }, /* TxDirectMaxRetryExpiryCount */ \ - { 0x0023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1575) }, /* TxIndirectMaxRetryExpiryCount */ \ - { 0x0024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1579) }, /* TxErrCcaCount */ \ - { 0x0025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1583) }, /* TxErrAbortCount */ \ - { 0x0026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1587) }, /* TxErrBusyChannelCount */ \ - { 0x0027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1591) }, /* RxTotalCount */ \ - { 0x0028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1595) }, /* RxUnicastCount */ \ - { 0x0029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1599) }, /* RxBroadcastCount */ \ - { 0x002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1603) }, /* RxDataCount */ \ - { 0x002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1607) }, /* RxDataPollCount */ \ - { 0x002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1611) }, /* RxBeaconCount */ \ - { 0x002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1615) }, /* RxBeaconRequestCount */ \ - { 0x002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1619) }, /* RxOtherCount */ \ - { 0x002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1623) }, /* RxAddressFilteredCount */ \ - { 0x0030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1627) }, /* RxDestAddrFilteredCount */ \ - { 0x0031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1631) }, /* RxDuplicatedCount */ \ - { 0x0032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1635) }, /* RxErrNoFrameCount */ \ - { 0x0033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1639) }, /* RxErrUnknownNeighborCount */ \ - { 0x0034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1643) }, /* RxErrInvalidSrcAddrCount */ \ - { 0x0035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1647) }, /* RxErrSecCount */ \ - { 0x0036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1651) }, /* RxErrFcsCount */ \ - { 0x0037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1655) }, /* RxErrOtherCount */ \ - { 0x0038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1659) }, /* ActiveTimestamp */ \ - { 0x0039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1667) }, /* PendingTimestamp */ \ - { 0x003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1675) }, /* delay */ \ - { 0x003B, ZAP_TYPE(ARRAY), 6, 0, ZAP_LONG_DEFAULTS_INDEX(1679) }, /* SecurityPolicy */ \ - { 0x003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(1685) }, /* ChannelMask */ \ - { 0x003D, ZAP_TYPE(ARRAY), 14, 0, ZAP_LONG_DEFAULTS_INDEX(1690) }, /* OperationalDatasetComponents */ \ - { 0x003E, ZAP_TYPE(ARRAY), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1704) }, /* ActiveNetworkFaultsList */ \ + { 0x0016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1524) }, /* TxTotalCount */ \ + { 0x0017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1528) }, /* TxUnicastCount */ \ + { 0x0018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1532) }, /* TxBroadcastCount */ \ + { 0x0019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1536) }, /* TxAckRequestedCount */ \ + { 0x001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1540) }, /* TxAckedCount */ \ + { 0x001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1544) }, /* TxNoAckRequestedCount */ \ + { 0x001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1548) }, /* TxDataCount */ \ + { 0x001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1552) }, /* TxDataPollCount */ \ + { 0x001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1556) }, /* TxBeaconCount */ \ + { 0x001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1560) }, /* TxBeaconRequestCount */ \ + { 0x0020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1564) }, /* TxOtherCount */ \ + { 0x0021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1568) }, /* TxRetryCount */ \ + { 0x0022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1572) }, /* TxDirectMaxRetryExpiryCount */ \ + { 0x0023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1576) }, /* TxIndirectMaxRetryExpiryCount */ \ + { 0x0024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1580) }, /* TxErrCcaCount */ \ + { 0x0025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1584) }, /* TxErrAbortCount */ \ + { 0x0026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1588) }, /* TxErrBusyChannelCount */ \ + { 0x0027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1592) }, /* RxTotalCount */ \ + { 0x0028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1596) }, /* RxUnicastCount */ \ + { 0x0029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1600) }, /* RxBroadcastCount */ \ + { 0x002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1604) }, /* RxDataCount */ \ + { 0x002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1608) }, /* RxDataPollCount */ \ + { 0x002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1612) }, /* RxBeaconCount */ \ + { 0x002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1616) }, /* RxBeaconRequestCount */ \ + { 0x002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1620) }, /* RxOtherCount */ \ + { 0x002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1624) }, /* RxAddressFilteredCount */ \ + { 0x0030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1628) }, /* RxDestAddrFilteredCount */ \ + { 0x0031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1632) }, /* RxDuplicatedCount */ \ + { 0x0032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1636) }, /* RxErrNoFrameCount */ \ + { 0x0033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1640) }, /* RxErrUnknownNeighborCount */ \ + { 0x0034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1644) }, /* RxErrInvalidSrcAddrCount */ \ + { 0x0035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1648) }, /* RxErrSecCount */ \ + { 0x0036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1652) }, /* RxErrFcsCount */ \ + { 0x0037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1656) }, /* RxErrOtherCount */ \ + { 0x0038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1660) }, /* ActiveTimestamp */ \ + { 0x0039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1668) }, /* PendingTimestamp */ \ + { 0x003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1676) }, /* delay */ \ + { 0x003B, ZAP_TYPE(ARRAY), 6, 0, ZAP_LONG_DEFAULTS_INDEX(1680) }, /* SecurityPolicy */ \ + { 0x003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(1686) }, /* ChannelMask */ \ + { 0x003D, ZAP_TYPE(ARRAY), 14, 0, ZAP_LONG_DEFAULTS_INDEX(1691) }, /* OperationalDatasetComponents */ \ + { 0x003E, ZAP_TYPE(ARRAY), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1705) }, /* ActiveNetworkFaultsList */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ - { 0x0000, ZAP_TYPE(OCTET_STRING), 7, 0, ZAP_LONG_DEFAULTS_INDEX(1708) }, /* bssid */ \ + { 0x0000, ZAP_TYPE(OCTET_STRING), 7, 0, ZAP_LONG_DEFAULTS_INDEX(1709) }, /* bssid */ \ { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SecurityType */ \ { 0x0002, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* WiFiVersion */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ChannelNumber */ \ { 0x0004, ZAP_TYPE(INT8S), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Rssi */ \ - { 0x0005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1715) }, /* BeaconLostCount */ \ - { 0x0006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1719) }, /* BeaconRxCount */ \ - { 0x0007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1723) }, /* PacketMulticastRxCount */ \ - { 0x0008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1727) }, /* PacketMulticastTxCount */ \ - { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1731) }, /* PacketUnicastRxCount */ \ - { 0x000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1735) }, /* PacketUnicastTxCount */ \ - { 0x000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1739) }, /* CurrentMaxRate */ \ - { 0x000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1747) }, /* OverrunCount */ \ + { 0x0005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1716) }, /* BeaconLostCount */ \ + { 0x0006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1720) }, /* BeaconRxCount */ \ + { 0x0007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1724) }, /* PacketMulticastRxCount */ \ + { 0x0008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1728) }, /* PacketMulticastTxCount */ \ + { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1732) }, /* PacketUnicastRxCount */ \ + { 0x000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1736) }, /* PacketUnicastTxCount */ \ + { 0x000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1740) }, /* CurrentMaxRate */ \ + { 0x000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1748) }, /* OverrunCount */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* PHYRate */ \ { 0x0001, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* FullDuplex */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1755) }, /* PacketRxCount */ \ - { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1763) }, /* PacketTxCount */ \ - { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1771) }, /* TxErrCount */ \ - { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1779) }, /* CollisionCount */ \ - { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1787) }, /* OverrunCount */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1756) }, /* PacketRxCount */ \ + { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1764) }, /* PacketTxCount */ \ + { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1772) }, /* TxErrCount */ \ + { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1780) }, /* CollisionCount */ \ + { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1788) }, /* OverrunCount */ \ { 0x0007, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* CarrierDetect */ \ - { 0x0008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1795) }, /* TimeSinceReset */ \ + { 0x0008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1796) }, /* TimeSinceReset */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ @@ -2064,8 +2114,8 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Group Key Management (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1803) }, /* groups */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2057) }, /* group keys */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1804) }, /* groups */ \ + { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2058) }, /* group keys */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Identify (server) */ \ @@ -2091,7 +2141,7 @@ { 0x4001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OnTime */ \ { 0x4002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OffWaitTime */ \ { 0x4003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* StartUpOnOff */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(2311) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(2312) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: On/off Switch Configuration (server) */ \ @@ -2132,44 +2182,44 @@ ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Bridged Actions (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* action list */ \ - { 0x0001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* endpoint list */ \ - { 0x0002, ZAP_TYPE(CHAR_STRING), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* setup url */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* action list */ \ + { 0x0001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* endpoint list */ \ + { 0x0002, ZAP_TYPE(LONG_CHAR_STRING), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* setup url */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Power Source (server) */ \ { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* Status */ \ { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* Order */ \ - { 0x0002, ZAP_TYPE(CHAR_STRING), 61, 0, ZAP_LONG_DEFAULTS_INDEX(2315) }, /* Description */ \ - { 0x000B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(2376) }, /* BatteryVoltage */ \ + { 0x0002, ZAP_TYPE(CHAR_STRING), 61, 0, ZAP_LONG_DEFAULTS_INDEX(2316) }, /* Description */ \ + { 0x000B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(2377) }, /* BatteryVoltage */ \ { 0x000C, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BatteryPercentRemaining */ \ - { 0x000D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(2380) }, /* BatteryTimeRemaining */ \ + { 0x000D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(2381) }, /* BatteryTimeRemaining */ \ { 0x000E, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BatteryChargeLevel */ \ - { 0x0012, ZAP_TYPE(ARRAY), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2384) }, /* ActiveBatteryFaults */ \ + { 0x0012, ZAP_TYPE(ARRAY), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2385) }, /* ActiveBatteryFaults */ \ { 0x001A, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BatteryChargeState */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(2392) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(2393) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Bridged Device Basic (server) */ \ - { 0x0001, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(2396) }, /* VendorName */ \ + { 0x0001, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(2397) }, /* VendorName */ \ { 0x0002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* VendorID */ \ - { 0x0003, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(2429) }, /* ProductName */ \ + { 0x0003, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(2430) }, /* ProductName */ \ { 0x0005, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(2462) }, /* UserLabel */ \ + ZAP_LONG_DEFAULTS_INDEX(2463) }, /* UserLabel */ \ { 0x0007, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(0x00) }, /* HardwareVersion */ \ { 0x0008, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), \ - ZAP_LONG_DEFAULTS_INDEX(2495) }, /* HardwareVersionString */ \ - { 0x0009, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(2560) }, /* SoftwareVersion */ \ + ZAP_LONG_DEFAULTS_INDEX(2496) }, /* HardwareVersionString */ \ + { 0x0009, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(2561) }, /* SoftwareVersion */ \ { 0x000A, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), \ - ZAP_LONG_DEFAULTS_INDEX(2564) }, /* SoftwareVersionString */ \ + ZAP_LONG_DEFAULTS_INDEX(2565) }, /* SoftwareVersionString */ \ { 0x000B, ZAP_TYPE(CHAR_STRING), 17, ZAP_ATTRIBUTE_MASK(SINGLETON), \ - ZAP_LONG_DEFAULTS_INDEX(2629) }, /* ManufacturingDate */ \ - { 0x000C, ZAP_TYPE(CHAR_STRING), 255, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(2646) }, /* PartNumber */ \ - { 0x000D, ZAP_TYPE(CHAR_STRING), 255, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(2901) }, /* ProductURL */ \ + ZAP_LONG_DEFAULTS_INDEX(2630) }, /* ManufacturingDate */ \ + { 0x000C, ZAP_TYPE(CHAR_STRING), 255, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(2647) }, /* PartNumber */ \ + { 0x000D, ZAP_TYPE(CHAR_STRING), 255, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(2902) }, /* ProductURL */ \ { 0x000E, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), \ - ZAP_LONG_DEFAULTS_INDEX(3156) }, /* ProductLabel */ \ + ZAP_LONG_DEFAULTS_INDEX(3157) }, /* ProductLabel */ \ { 0x000F, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), \ - ZAP_LONG_DEFAULTS_INDEX(3221) }, /* SerialNumber */ \ + ZAP_LONG_DEFAULTS_INDEX(3222) }, /* SerialNumber */ \ { 0x0011, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(0x00) }, /* Reachable */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ @@ -2177,11 +2227,11 @@ { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(2) }, /* number of positions */ \ { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* current position */ \ { 0x0002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(2) }, /* multi press max */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3254) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3255) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Fixed Label (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(3258) }, /* label list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(3259) }, /* label list */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Boolean State (server) */ \ @@ -2193,7 +2243,7 @@ { 0x0001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* SupportedModes */ \ { 0x0002, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OnMode */ \ { 0x0003, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* StartUpMode */ \ - { 0x0004, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(3512) }, /* Description */ \ + { 0x0004, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(3513) }, /* Description */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Door Lock (server) */ \ @@ -2221,7 +2271,7 @@ { 0x0013, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* InstalledClosedLimitTilt */ \ { 0x0017, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* Mode */ \ { 0x001A, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* SafetyStatus */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3545) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3546) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Barrier Control (server) */ \ @@ -2250,11 +2300,11 @@ { 0x0012, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* EffectiveControlMode */ \ { 0x0013, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Capacity */ \ { 0x0014, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Speed */ \ - { 0x0017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3549) }, /* LifetimeEnergyConsumed */ \ + { 0x0017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3550) }, /* LifetimeEnergyConsumed */ \ { 0x0020, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* OperationMode */ \ { 0x0021, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* ControlMode */ \ { 0x0022, ZAP_TYPE(BITMAP16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* AlarmMask */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3553) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3554) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Thermostat (server) */ \ @@ -2282,7 +2332,7 @@ { 0x0020, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* start of week */ \ { 0x0021, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(7) }, /* number of weekly transitions */ \ { 0x0022, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(4) }, /* number of daily transitions */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3557) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3558) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ @@ -2299,7 +2349,7 @@ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x616B) }, /* current x */ \ { 0x0004, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x607D) }, /* current y */ \ { 0x0005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* drift compensation */ \ - { 0x0006, ZAP_TYPE(CHAR_STRING), 255, 0, ZAP_LONG_DEFAULTS_INDEX(3561) }, /* compensation text */ \ + { 0x0006, ZAP_TYPE(CHAR_STRING), 255, 0, ZAP_LONG_DEFAULTS_INDEX(3562) }, /* compensation text */ \ { 0x0007, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x00FA) }, /* color temperature */ \ { 0x0008, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* color mode */ \ { 0x000F, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* color control options */ \ @@ -2393,37 +2443,37 @@ { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* zone state */ \ { 0x0001, ZAP_TYPE(ENUM16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* zone type */ \ { 0x0002, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* zone status */ \ - { 0x0010, ZAP_TYPE(NODE_ID), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3816) }, /* IAS CIE address */ \ + { 0x0010, ZAP_TYPE(NODE_ID), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3817) }, /* IAS CIE address */ \ { 0x0011, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xff) }, /* Zone ID */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ - { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(3824) }, /* wake on lan mac address */ \ + { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(3825) }, /* wake on lan mac address */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: TV Channel (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(3857) }, /* tv channel list */ \ - { 0x0001, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(4111) }, /* tv channel lineup */ \ - { 0x0002, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(4144) }, /* current tv channel */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(3858) }, /* tv channel list */ \ + { 0x0001, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(4112) }, /* tv channel lineup */ \ + { 0x0002, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(4145) }, /* current tv channel */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Target Navigator (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(4177) }, /* target navigator list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(4178) }, /* target navigator list */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Media Playback (server) */ \ { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* playback state */ \ - { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(4431) }, /* start time */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(4439) }, /* duration */ \ - { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(4447) }, /* position updated at */ \ - { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(4455) }, /* position */ \ - { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(4463) }, /* playback speed */ \ - { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(4471) }, /* seek range end */ \ - { 0x0007, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(4479) }, /* seek range start */ \ + { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(4432) }, /* start time */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(4440) }, /* duration */ \ + { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(4448) }, /* position updated at */ \ + { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(4456) }, /* position */ \ + { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(4464) }, /* playback speed */ \ + { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(4472) }, /* seek range end */ \ + { 0x0007, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(4480) }, /* seek range start */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Media Input (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(4487) }, /* media input list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(4488) }, /* media input list */ \ { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current media input */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ @@ -2434,27 +2484,27 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Content Launcher (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(4741) }, /* accepts header list */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(4995) }, /* supported streaming types */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(4742) }, /* accepts header list */ \ + { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(4996) }, /* supported streaming types */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Audio Output (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(5249) }, /* audio output list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(5250) }, /* audio output list */ \ { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current audio output */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Application Launcher (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(5503) }, /* application launcher list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(5504) }, /* application launcher list */ \ { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* catalog vendor id */ \ { 0x0002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* application id */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Application Basic (server) */ \ - { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(5757) }, /* vendor name */ \ + { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(5758) }, /* vendor name */ \ { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* vendor id */ \ - { 0x0002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(5790) }, /* application name */ \ + { 0x0002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(5791) }, /* application name */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* product id */ \ - { 0x0005, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(5823) }, /* application id */ \ + { 0x0005, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(5824) }, /* application id */ \ { 0x0006, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* catalog vendor id */ \ { 0x0007, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* application status */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ @@ -2466,38 +2516,72 @@ { 0x0000, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(false) }, /* boolean */ \ { 0x0001, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap8 */ \ { 0x0002, ZAP_TYPE(BITMAP16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap16 */ \ - { 0x0003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(5856) }, /* bitmap32 */ \ - { 0x0004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(5860) }, /* bitmap64 */ \ + { 0x0003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(5857) }, /* bitmap32 */ \ + { 0x0004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(5861) }, /* bitmap64 */ \ { 0x0005, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8u */ \ { 0x0006, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16u */ \ - { 0x0008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(5868) }, /* int32u */ \ - { 0x000C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(5872) }, /* int64u */ \ + { 0x0008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(5869) }, /* int32u */ \ + { 0x000C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(5873) }, /* int64u */ \ { 0x000D, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8s */ \ { 0x000E, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16s */ \ - { 0x0010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(5880) }, /* int32s */ \ - { 0x0014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(5884) }, /* int64s */ \ + { 0x0010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(5881) }, /* int32s */ \ + { 0x0014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(5885) }, /* int64s */ \ { 0x0015, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum8 */ \ { 0x0016, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum16 */ \ { 0x0019, ZAP_TYPE(OCTET_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(5892) }, /* octet_string */ \ - { 0x001A, ZAP_TYPE(ARRAY), 10, 0, ZAP_LONG_DEFAULTS_INDEX(5903) }, /* list_int8u */ \ - { 0x001B, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(5913) }, /* list_octet_string */ \ - { 0x001C, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(6167) }, /* list_struct_octet_string */ \ + ZAP_LONG_DEFAULTS_INDEX(5893) }, /* octet_string */ \ + { 0x001A, ZAP_TYPE(ARRAY), 10, 0, ZAP_LONG_DEFAULTS_INDEX(5904) }, /* list_int8u */ \ + { 0x001B, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(5914) }, /* list_octet_string */ \ + { 0x001C, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(6168) }, /* list_struct_octet_string */ \ { 0x001D, ZAP_TYPE(LONG_OCTET_STRING), 1002, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(6421) }, /* long_octet_string */ \ - { 0x001E, ZAP_TYPE(CHAR_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(7423) }, /* char_string */ \ + ZAP_LONG_DEFAULTS_INDEX(6422) }, /* long_octet_string */ \ + { 0x001E, ZAP_TYPE(CHAR_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(7424) }, /* char_string */ \ { 0x001F, ZAP_TYPE(LONG_CHAR_STRING), 1002, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(7434) }, /* long_char_string */ \ - { 0x0020, ZAP_TYPE(EPOCH_US), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(8436) }, /* epoch_us */ \ - { 0x0021, ZAP_TYPE(EPOCH_S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(8444) }, /* epoch_s */ \ + ZAP_LONG_DEFAULTS_INDEX(7435) }, /* long_char_string */ \ + { 0x0020, ZAP_TYPE(EPOCH_US), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(8437) }, /* epoch_us */ \ + { 0x0021, ZAP_TYPE(EPOCH_S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(8445) }, /* epoch_s */ \ { 0x0022, ZAP_TYPE(VENDOR_ID), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* vendor_id */ \ { 0x0023, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* list_nullables_and_optionals_struct */ \ + ZAP_EMPTY_DEFAULT() }, /* list_nullables_and_optionals_struct */ \ + { 0x8000, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(false) }, /* nullable_boolean */ \ + { 0x8001, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0) }, /* nullable_bitmap8 */ \ + { 0x8002, ZAP_TYPE(BITMAP16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0) }, /* nullable_bitmap16 */ \ + { 0x8003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_LONG_DEFAULTS_INDEX(8449) }, /* nullable_bitmap32 */ \ + { 0x8004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_LONG_DEFAULTS_INDEX(8453) }, /* nullable_bitmap64 */ \ + { 0x8005, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int8u */ \ + { 0x8006, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int16u */ \ + { 0x8008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_LONG_DEFAULTS_INDEX(8461) }, /* nullable_int32u */ \ + { 0x800C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_LONG_DEFAULTS_INDEX(8465) }, /* nullable_int64u */ \ + { 0x800D, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int8s */ \ + { 0x800E, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int16s */ \ + { 0x8010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_LONG_DEFAULTS_INDEX(8473) }, /* nullable_int32s */ \ + { 0x8014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_LONG_DEFAULTS_INDEX(8477) }, /* nullable_int64s */ \ + { 0x8015, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0) }, /* nullable_enum8 */ \ + { 0x8016, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0) }, /* nullable_enum16 */ \ + { 0x8019, ZAP_TYPE(OCTET_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_LONG_DEFAULTS_INDEX(8485) }, /* nullable_octet_string */ \ + { 0x801E, ZAP_TYPE(CHAR_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_LONG_DEFAULTS_INDEX(8496) }, /* nullable_char_string */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ - { 0x0000, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(8448) }, /* measurement type */ \ - { 0x0304, ZAP_TYPE(INT32S), 4, 0, ZAP_LONG_DEFAULTS_INDEX(8452) }, /* total active power */ \ + { 0x0000, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(8507) }, /* measurement type */ \ + { 0x0304, ZAP_TYPE(INT32S), 4, 0, ZAP_LONG_DEFAULTS_INDEX(8511) }, /* total active power */ \ { 0x0505, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xffff) }, /* rms voltage */ \ { 0x0506, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* rms voltage min */ \ { 0x0507, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* rms voltage max */ \ @@ -2518,7 +2602,7 @@ { 0x4001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OnTime */ \ { 0x4002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OffWaitTime */ \ { 0x4003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* StartUpOnOff */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(8456) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(8515) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ @@ -2597,7 +2681,7 @@ { 0x0028, \ ZAP_ATTRIBUTE_INDEX(8), \ 19, \ - 653, \ + 654, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayBasicServer }, /* Endpoint: 0, Cluster: Basic (server) */ \ { \ @@ -2619,213 +2703,213 @@ 0x0033, ZAP_ATTRIBUTE_INDEX(36), 6, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { \ - 0x0034, ZAP_ATTRIBUTE_INDEX(42), 4, 26, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0034, ZAP_ATTRIBUTE_INDEX(42), 5, 26, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(46), 64, 774, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0035, ZAP_ATTRIBUTE_INDEX(47), 64, 774, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { \ - 0x0036, ZAP_ATTRIBUTE_INDEX(110), 14, 54, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0036, ZAP_ATTRIBUTE_INDEX(111), 14, 54, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ { \ - 0x0037, ZAP_ATTRIBUTE_INDEX(124), 10, 53, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0037, ZAP_ATTRIBUTE_INDEX(125), 10, 53, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { \ - 0x003C, ZAP_ATTRIBUTE_INDEX(134), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003C, ZAP_ATTRIBUTE_INDEX(135), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { \ - 0x003E, ZAP_ATTRIBUTE_INDEX(135), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003E, ZAP_ATTRIBUTE_INDEX(136), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x0405, ZAP_ATTRIBUTE_INDEX(141), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0405, ZAP_ATTRIBUTE_INDEX(142), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ { \ - 0xF000, ZAP_ATTRIBUTE_INDEX(145), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0xF000, ZAP_ATTRIBUTE_INDEX(146), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Binding (server) */ \ { \ - 0xF004, ZAP_ATTRIBUTE_INDEX(146), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0xF004, ZAP_ATTRIBUTE_INDEX(147), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Group Key Management (server) */ \ { 0x0003, \ - ZAP_ATTRIBUTE_INDEX(149), \ + ZAP_ATTRIBUTE_INDEX(150), \ 3, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayIdentifyServer }, /* Endpoint: 1, Cluster: Identify (server) */ \ { 0x0004, \ - ZAP_ATTRIBUTE_INDEX(152), \ + ZAP_ATTRIBUTE_INDEX(153), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayGroupsServer }, /* Endpoint: 1, Cluster: Groups (server) */ \ { 0x0005, \ - ZAP_ATTRIBUTE_INDEX(154), \ + ZAP_ATTRIBUTE_INDEX(155), \ 6, \ 8, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayScenesServer }, /* Endpoint: 1, Cluster: Scenes (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(160), \ + ZAP_ATTRIBUTE_INDEX(161), \ 7, \ 13, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ { \ - 0x0007, ZAP_ATTRIBUTE_INDEX(167), 3, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0007, ZAP_ATTRIBUTE_INDEX(168), 3, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: On/off Switch Configuration (server) */ \ { 0x0008, \ - ZAP_ATTRIBUTE_INDEX(170), \ + ZAP_ATTRIBUTE_INDEX(171), \ 15, \ 23, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \ { \ - 0x000F, ZAP_ATTRIBUTE_INDEX(185), 4, 5, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x000F, ZAP_ATTRIBUTE_INDEX(186), 4, 5, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Binary Input (Basic) (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(189), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(190), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ { \ - 0x0025, ZAP_ATTRIBUTE_INDEX(194), 4, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0025, ZAP_ATTRIBUTE_INDEX(195), 4, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Bridged Actions (server) */ \ { \ - 0x002F, ZAP_ATTRIBUTE_INDEX(198), 11, 88, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x002F, ZAP_ATTRIBUTE_INDEX(199), 11, 88, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Power Source (server) */ \ { \ - 0x0039, ZAP_ATTRIBUTE_INDEX(209), 15, 865, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0039, ZAP_ATTRIBUTE_INDEX(210), 15, 865, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Bridged Device Basic (server) */ \ { \ - 0x003B, ZAP_ATTRIBUTE_INDEX(224), 5, 9, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003B, ZAP_ATTRIBUTE_INDEX(225), 5, 9, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Switch (server) */ \ { \ - 0x0040, ZAP_ATTRIBUTE_INDEX(229), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0040, ZAP_ATTRIBUTE_INDEX(230), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Fixed Label (server) */ \ { \ - 0x0045, ZAP_ATTRIBUTE_INDEX(231), 2, 3, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0045, ZAP_ATTRIBUTE_INDEX(232), 2, 3, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Boolean State (server) */ \ { \ - 0x0050, ZAP_ATTRIBUTE_INDEX(233), 6, 38, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0050, ZAP_ATTRIBUTE_INDEX(234), 6, 38, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Mode Select (server) */ \ { 0x0101, \ - ZAP_ATTRIBUTE_INDEX(239), \ + ZAP_ATTRIBUTE_INDEX(240), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayDoorLockServer }, /* Endpoint: 1, Cluster: Door Lock (server) */ \ { \ - 0x0102, ZAP_ATTRIBUTE_INDEX(243), 20, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0102, ZAP_ATTRIBUTE_INDEX(244), 20, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Window Covering (server) */ \ { \ - 0x0103, ZAP_ATTRIBUTE_INDEX(263), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0103, ZAP_ATTRIBUTE_INDEX(264), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Barrier Control (server) */ \ { \ 0x0200, \ - ZAP_ATTRIBUTE_INDEX(268), \ + ZAP_ATTRIBUTE_INDEX(269), \ 24, \ 48, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayPumpConfigurationAndControlServer \ }, /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ { \ - 0x0201, ZAP_ATTRIBUTE_INDEX(292), 19, 34, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0201, ZAP_ATTRIBUTE_INDEX(293), 19, 34, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Thermostat (server) */ \ { \ 0x0204, \ - ZAP_ATTRIBUTE_INDEX(311), \ + ZAP_ATTRIBUTE_INDEX(312), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayThermostatUserInterfaceConfigurationServer \ }, /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ { 0x0300, \ - ZAP_ATTRIBUTE_INDEX(315), \ + ZAP_ATTRIBUTE_INDEX(316), \ 53, \ 341, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayColorControlServer }, /* Endpoint: 1, Cluster: Color Control (server) */ \ { \ - 0x0400, ZAP_ATTRIBUTE_INDEX(368), 6, 11, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0400, ZAP_ATTRIBUTE_INDEX(369), 6, 11, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Illuminance Measurement (server) */ \ { \ - 0x0402, ZAP_ATTRIBUTE_INDEX(374), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0402, ZAP_ATTRIBUTE_INDEX(375), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ { \ - 0x0403, ZAP_ATTRIBUTE_INDEX(379), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0403, ZAP_ATTRIBUTE_INDEX(380), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ { \ - 0x0404, ZAP_ATTRIBUTE_INDEX(383), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0404, ZAP_ATTRIBUTE_INDEX(384), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ { \ - 0x0405, ZAP_ATTRIBUTE_INDEX(388), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0405, ZAP_ATTRIBUTE_INDEX(389), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ { 0x0406, \ - ZAP_ATTRIBUTE_INDEX(393), \ + ZAP_ATTRIBUTE_INDEX(394), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOccupancySensingServer }, /* Endpoint: 1, Cluster: Occupancy Sensing (server) */ \ { 0x0500, \ - ZAP_ATTRIBUTE_INDEX(397), \ + ZAP_ATTRIBUTE_INDEX(398), \ 6, \ 16, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | \ ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ chipFuncArrayIasZoneServer }, /* Endpoint: 1, Cluster: IAS Zone (server) */ \ { \ - 0x0503, ZAP_ATTRIBUTE_INDEX(403), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0503, ZAP_ATTRIBUTE_INDEX(404), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ { \ - 0x0504, ZAP_ATTRIBUTE_INDEX(405), 4, 322, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0504, ZAP_ATTRIBUTE_INDEX(406), 4, 322, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: TV Channel (server) */ \ { \ - 0x0505, ZAP_ATTRIBUTE_INDEX(409), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0505, ZAP_ATTRIBUTE_INDEX(410), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Target Navigator (server) */ \ { \ - 0x0506, ZAP_ATTRIBUTE_INDEX(411), 9, 59, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0506, ZAP_ATTRIBUTE_INDEX(412), 9, 59, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Media Playback (server) */ \ { \ - 0x0507, ZAP_ATTRIBUTE_INDEX(420), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0507, ZAP_ATTRIBUTE_INDEX(421), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Media Input (server) */ \ { \ - 0x0508, ZAP_ATTRIBUTE_INDEX(423), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0508, ZAP_ATTRIBUTE_INDEX(424), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Low Power (server) */ \ { \ - 0x0509, ZAP_ATTRIBUTE_INDEX(424), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0509, ZAP_ATTRIBUTE_INDEX(425), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Keypad Input (server) */ \ { \ - 0x050A, ZAP_ATTRIBUTE_INDEX(425), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050A, ZAP_ATTRIBUTE_INDEX(426), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Content Launcher (server) */ \ { \ - 0x050B, ZAP_ATTRIBUTE_INDEX(428), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050B, ZAP_ATTRIBUTE_INDEX(429), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Audio Output (server) */ \ { \ - 0x050C, ZAP_ATTRIBUTE_INDEX(431), 4, 258, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050C, ZAP_ATTRIBUTE_INDEX(432), 4, 258, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Launcher (server) */ \ { \ - 0x050D, ZAP_ATTRIBUTE_INDEX(435), 8, 108, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050D, ZAP_ATTRIBUTE_INDEX(436), 8, 108, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Basic (server) */ \ { \ - 0x050E, ZAP_ATTRIBUTE_INDEX(443), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050E, ZAP_ATTRIBUTE_INDEX(444), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Account Login (server) */ \ { \ - 0x050F, ZAP_ATTRIBUTE_INDEX(444), 27, 2609, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050F, ZAP_ATTRIBUTE_INDEX(445), 44, 2680, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Test Cluster (server) */ \ { \ - 0x0B04, ZAP_ATTRIBUTE_INDEX(471), 12, 28, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0B04, ZAP_ATTRIBUTE_INDEX(489), 12, 28, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ { \ - 0xF000, ZAP_ATTRIBUTE_INDEX(483), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0xF000, ZAP_ATTRIBUTE_INDEX(501), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Binding (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(484), \ + ZAP_ATTRIBUTE_INDEX(502), \ 7, \ 13, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 2, Cluster: On/Off (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(491), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(509), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 2, Cluster: Descriptor (server) */ \ { 0x0406, \ - ZAP_ATTRIBUTE_INDEX(496), \ + ZAP_ATTRIBUTE_INDEX(514), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2837,17 +2921,17 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 18, 2400 }, { ZAP_CLUSTER_INDEX(18), 44, 6572 }, { ZAP_CLUSTER_INDEX(62), 3, 18 }, \ + { ZAP_CLUSTER_INDEX(0), 18, 2401 }, { ZAP_CLUSTER_INDEX(18), 44, 6643 }, { ZAP_CLUSTER_INDEX(62), 3, 18 }, \ } // Largest attribute size is needed for various buffers #define ATTRIBUTE_LARGEST (1003) // Total size of singleton attributes -#define ATTRIBUTE_SINGLETONS_SIZE (1518) +#define ATTRIBUTE_SINGLETONS_SIZE (1519) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (8990) +#define ATTRIBUTE_MAX_SIZE (9062) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (3) diff --git a/zzz_generated/app-common/app-common/zap-generated/att-storage.h b/zzz_generated/app-common/app-common/zap-generated/att-storage.h index ca7c9d07c8d080..91185bfe893995 100644 --- a/zzz_generated/app-common/app-common/zap-generated/att-storage.h +++ b/zzz_generated/app-common/app-common/zap-generated/att-storage.h @@ -20,25 +20,6 @@ // Prevent multiple inclusion #pragma once -// Attribute masks modify how attributes are used by the framework -// -// Attribute that has this mask is NOT read-only -#define ATTRIBUTE_MASK_WRITABLE (0x01) -// Attribute that has this mask is saved to a token -#define ATTRIBUTE_MASK_TOKENIZE (0x02) -// Attribute that has this mask has a min/max values -#define ATTRIBUTE_MASK_MIN_MAX (0x04) -// Manufacturer specific attribute -#define ATTRIBUTE_MASK_MANUFACTURER_SPECIFIC (0x08) -// Attribute deferred to external storage -#define ATTRIBUTE_MASK_EXTERNAL_STORAGE (0x10) -// Attribute is singleton -#define ATTRIBUTE_MASK_SINGLETON (0x20) -// Attribute is a client attribute -#define ATTRIBUTE_MASK_CLIENT (0x40) -// Attribute is nullable -#define ATTRIBUTE_MASK_NULLABLE (0x80) - // Cluster masks modify how clusters are used by the framework // // Does this cluster have init function? diff --git a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h index 7be477f2de5fd8..d8ba86510663b6 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h @@ -1392,6 +1392,23 @@ #define ZCL_TEST_VENDOR_ID_ATTRIBUTE_ID (0x0022) #define ZCL_LIST_OF_STRUCTS_WITH_OPTIONALS_ATTRIBUTE_ID (0x0023) #define ZCL_UNSUPPORTED_ATTRIBUTE_ID (0x00FF) +#define ZCL_NULLABLE_BOOLEAN_ATTRIBUTE_ID (0x8000) +#define ZCL_NULLABLE_BITMAP8_ATTRIBUTE_ID (0x8001) +#define ZCL_NULLABLE_BITMAP16_ATTRIBUTE_ID (0x8002) +#define ZCL_NULLABLE_BITMAP32_ATTRIBUTE_ID (0x8003) +#define ZCL_NULLABLE_BITMAP64_ATTRIBUTE_ID (0x8004) +#define ZCL_NULLABLE_INT8_U_ATTRIBUTE_ID (0x8005) +#define ZCL_NULLABLE_INT16_U_ATTRIBUTE_ID (0x8006) +#define ZCL_NULLABLE_INT32_U_ATTRIBUTE_ID (0x8008) +#define ZCL_NULLABLE_INT64_U_ATTRIBUTE_ID (0x800C) +#define ZCL_NULLABLE_INT8_S_ATTRIBUTE_ID (0x800D) +#define ZCL_NULLABLE_INT16_S_ATTRIBUTE_ID (0x800E) +#define ZCL_NULLABLE_INT32_S_ATTRIBUTE_ID (0x8010) +#define ZCL_NULLABLE_INT64_S_ATTRIBUTE_ID (0x8014) +#define ZCL_NULLABLE_ENUM8_ATTRIBUTE_ID (0x8015) +#define ZCL_NULLABLE_ENUM16_ATTRIBUTE_ID (0x8016) +#define ZCL_NULLABLE_OCTET_STRING_ATTRIBUTE_ID (0x8019) +#define ZCL_NULLABLE_CHAR_STRING_ATTRIBUTE_ID (0x801E) // Attribute ids for cluster: Messaging diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 0a3f9b19433c62..84a84720f3d9d7 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -28,6 +28,7 @@ #include #include #include +#include namespace chip { namespace app { @@ -40,10 +41,23 @@ namespace MainsVoltage { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -54,10 +68,23 @@ namespace MainsFrequency { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -68,10 +95,23 @@ namespace MainsAlarmMask { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -82,10 +122,23 @@ namespace MainsVoltageMinThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -96,10 +149,23 @@ namespace MainsVoltageMaxThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -110,10 +176,23 @@ namespace MainsVoltageDwellTrip { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -124,10 +203,23 @@ namespace BatteryVoltage { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -138,10 +230,23 @@ namespace BatteryPercentageRemaining { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -152,16 +257,23 @@ namespace BatteryManufacturer { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 16); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -175,10 +287,23 @@ namespace BatterySize { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -189,10 +314,23 @@ namespace BatteryAhrRating { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -203,10 +341,23 @@ namespace BatteryQuantity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -217,10 +368,23 @@ namespace BatteryRatedVoltage { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -231,10 +395,23 @@ namespace BatteryAlarmMask { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -245,10 +422,23 @@ namespace BatteryVoltageMinThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -259,10 +449,23 @@ namespace BatteryVoltageThreshold1 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -273,10 +476,23 @@ namespace BatteryVoltageThreshold2 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -287,10 +503,23 @@ namespace BatteryVoltageThreshold3 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -301,10 +530,23 @@ namespace BatteryPercentageMinThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -315,10 +557,23 @@ namespace BatteryPercentageThreshold1 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -329,10 +584,23 @@ namespace BatteryPercentageThreshold2 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -343,10 +611,23 @@ namespace BatteryPercentageThreshold3 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -357,10 +638,23 @@ namespace BatteryAlarmState { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -371,10 +665,23 @@ namespace Battery2Voltage { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -385,10 +692,23 @@ namespace Battery2PercentageRemaining { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -399,16 +719,23 @@ namespace Battery2Manufacturer { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 16); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -422,10 +749,23 @@ namespace Battery2Size { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -436,10 +776,23 @@ namespace Battery2AhrRating { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -450,10 +803,23 @@ namespace Battery2Quantity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -464,10 +830,23 @@ namespace Battery2RatedVoltage { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -478,10 +857,23 @@ namespace Battery2AlarmMask { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -492,10 +884,23 @@ namespace Battery2VoltageMinThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -506,10 +911,23 @@ namespace Battery2VoltageThreshold1 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -520,10 +938,23 @@ namespace Battery2VoltageThreshold2 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -534,10 +965,23 @@ namespace Battery2VoltageThreshold3 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -548,10 +992,23 @@ namespace Battery2PercentageMinThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -562,10 +1019,23 @@ namespace Battery2PercentageThreshold1 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -576,10 +1046,23 @@ namespace Battery2PercentageThreshold2 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -590,10 +1073,23 @@ namespace Battery2PercentageThreshold3 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -604,10 +1100,23 @@ namespace Battery2AlarmState { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -618,10 +1127,23 @@ namespace Battery3Voltage { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -632,10 +1154,23 @@ namespace Battery3PercentageRemaining { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -646,16 +1181,23 @@ namespace Battery3Manufacturer { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 16); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -669,10 +1211,23 @@ namespace Battery3Size { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -683,10 +1238,23 @@ namespace Battery3AhrRating { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -697,10 +1265,23 @@ namespace Battery3Quantity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -711,10 +1292,23 @@ namespace Battery3RatedVoltage { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -725,10 +1319,23 @@ namespace Battery3AlarmMask { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -739,10 +1346,23 @@ namespace Battery3VoltageMinThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -753,10 +1373,23 @@ namespace Battery3VoltageThreshold1 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -767,10 +1400,23 @@ namespace Battery3VoltageThreshold2 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -781,10 +1427,23 @@ namespace Battery3VoltageThreshold3 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -795,10 +1454,23 @@ namespace Battery3PercentageMinThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -809,10 +1481,23 @@ namespace Battery3PercentageThreshold1 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -823,10 +1508,23 @@ namespace Battery3PercentageThreshold2 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -837,10 +1535,23 @@ namespace Battery3PercentageThreshold3 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -851,10 +1562,23 @@ namespace Battery3AlarmState { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -871,11 +1595,23 @@ namespace CurrentTemperature { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -886,11 +1622,23 @@ namespace MinTempExperienced { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -901,11 +1649,23 @@ namespace MaxTempExperienced { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -916,11 +1676,23 @@ namespace OverTempTotalDwell { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -931,11 +1703,23 @@ namespace DeviceTempAlarmMask { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -946,11 +1730,23 @@ namespace LowTempThreshold { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -961,11 +1757,23 @@ namespace HighTempThreshold { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -982,10 +1790,23 @@ namespace IdentifyTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Identify::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Identify::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Identify::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -995,10 +1816,23 @@ namespace IdentifyType { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Identify::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Identify::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Identify::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -1014,10 +1848,23 @@ namespace NameSupport { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Groups::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Groups::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Groups::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -1033,10 +1880,23 @@ namespace SceneCount { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1046,10 +1906,23 @@ namespace CurrentScene { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1059,10 +1932,23 @@ namespace CurrentGroup { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -1072,10 +1958,23 @@ namespace SceneValid { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -1085,10 +1984,23 @@ namespace NameSupport { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -1098,10 +2010,23 @@ namespace LastConfiguredBy { EmberAfStatus Get(chip::EndpointId endpoint, chip::NodeId * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::NodeId value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) &value, ZCL_NODE_ID_ATTRIBUTE_TYPE); } @@ -1117,10 +2042,23 @@ namespace OnOff { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -1130,10 +2068,23 @@ namespace SampleMfgSpecificAttribute0x00000x1002 { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -1143,10 +2094,23 @@ namespace SampleMfgSpecificAttribute0x00000x1049 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1156,10 +2120,23 @@ namespace SampleMfgSpecificAttribute0x00010x1002 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1169,10 +2146,23 @@ namespace SampleMfgSpecificAttribute0x00010x1040 { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -1182,10 +2172,23 @@ namespace GlobalSceneControl { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -1195,10 +2198,23 @@ namespace OnTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -1208,10 +2224,23 @@ namespace OffWaitTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -1221,10 +2250,23 @@ namespace StartUpOnOff { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -1240,10 +2282,23 @@ namespace SwitchType { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -1254,10 +2309,23 @@ namespace SwitchActions { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -1274,10 +2342,23 @@ namespace CurrentLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1287,10 +2368,23 @@ namespace RemainingTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -1300,10 +2394,23 @@ namespace MinLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1313,10 +2420,23 @@ namespace MaxLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1326,10 +2446,23 @@ namespace CurrentFrequency { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -1339,10 +2472,23 @@ namespace MinFrequency { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -1352,10 +2498,23 @@ namespace MaxFrequency { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -1365,10 +2524,23 @@ namespace Options { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -1378,10 +2550,23 @@ namespace OnOffTransitionTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -1391,10 +2576,23 @@ namespace OnLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1404,10 +2602,23 @@ namespace OnTransitionTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -1417,10 +2628,23 @@ namespace OffTransitionTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -1430,10 +2654,23 @@ namespace DefaultMoveRate { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1443,10 +2680,23 @@ namespace StartUpCurrentLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1462,10 +2712,23 @@ namespace AlarmCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Alarms::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Alarms::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Alarms::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -1481,10 +2744,23 @@ namespace Time { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_EPOCH_S_ATTRIBUTE_TYPE); } @@ -1494,10 +2770,23 @@ namespace TimeStatus { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -1507,10 +2796,23 @@ namespace TimeZone { EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_INT32S_ATTRIBUTE_TYPE); } @@ -1520,10 +2822,23 @@ namespace DstStart { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -1533,10 +2848,23 @@ namespace DstEnd { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -1546,10 +2874,23 @@ namespace DstShift { EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_INT32S_ATTRIBUTE_TYPE); } @@ -1559,10 +2900,23 @@ namespace StandardTime { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -1572,10 +2926,23 @@ namespace LocalTime { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) value, sizeof(*value)); -} + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; +} EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -1585,10 +2952,23 @@ namespace LastSetTime { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_EPOCH_S_ATTRIBUTE_TYPE); } @@ -1598,10 +2978,23 @@ namespace ValidUntilTime { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_EPOCH_S_ATTRIBUTE_TYPE); } @@ -1617,16 +3010,23 @@ namespace ActiveText { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 16); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -1640,16 +3040,23 @@ namespace Description { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 16); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -1663,16 +3070,23 @@ namespace InactiveText { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 16); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -1686,10 +3100,23 @@ namespace OutOfService { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -1700,10 +3127,23 @@ namespace Polarity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -1713,10 +3153,23 @@ namespace PresentValue { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -1727,10 +3180,23 @@ namespace Reliability { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -1740,10 +3206,23 @@ namespace StatusFlags { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -1754,10 +3233,23 @@ namespace ApplicationType { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -1773,10 +3265,23 @@ namespace TotalProfileNum { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1786,10 +3291,23 @@ namespace MultipleScheduling { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -1799,10 +3317,23 @@ namespace EnergyFormatting { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -1812,10 +3343,23 @@ namespace EnergyRemote { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -1825,10 +3369,23 @@ namespace ScheduleMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -1844,10 +3401,23 @@ namespace StartTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -1857,10 +3427,23 @@ namespace FinishTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -1870,10 +3453,23 @@ namespace RemainingTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -1895,10 +3491,23 @@ namespace CheckInInterval { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -1908,10 +3517,23 @@ namespace LongPollInterval { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -1921,10 +3543,23 @@ namespace ShortPollInterval { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -1934,10 +3569,23 @@ namespace FastPollTimeout { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -1947,10 +3595,23 @@ namespace CheckInIntervalMin { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -1960,10 +3621,23 @@ namespace LongPollIntervalMin { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -1973,10 +3647,23 @@ namespace FastPollTimeoutMax { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -1992,21 +3679,28 @@ namespace SetupUrl { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 512, EMBER_ZCL_STATUS_INVALID_ARGUMENT); - uint8_t zclString[512 + 1]; + uint8_t zclString[512 + 2]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedActions::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - memcpy(value.data(), &zclString[1], 512); - value.reduce_size(emberAfStringLength(zclString)); + size_t length = emberAfLongStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 512, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + memcpy(value.data(), &zclString[2], 512); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(512 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 512, EMBER_ZCL_STATUS_INVALID_ARGUMENT); - uint8_t zclString[512 + 1]; - emberAfCopyInt8u(zclString, 0, static_cast(value.size())); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteServerAttribute(endpoint, Clusters::BridgedActions::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); + uint8_t zclString[512 + 2]; + emberAfCopyInt16u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[2], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::BridgedActions::Id, Id, zclString, ZCL_LONG_CHAR_STRING_ATTRIBUTE_TYPE); } } // namespace SetupUrl @@ -2021,10 +3715,23 @@ namespace InteractionModelVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -2034,16 +3741,23 @@ namespace VendorName { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 32); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(32 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -2057,10 +3771,23 @@ namespace VendorID { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -2070,16 +3797,23 @@ namespace ProductName { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 32); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(32 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -2093,10 +3827,23 @@ namespace ProductID { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -2106,16 +3853,23 @@ namespace UserLabel { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 32); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(32 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -2129,16 +3883,23 @@ namespace Location { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 2, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[2 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 2, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 2); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(2 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 2, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[2 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -2152,10 +3913,23 @@ namespace HardwareVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -2165,16 +3939,23 @@ namespace HardwareVersionString { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[64 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 64); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(64 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[64 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -2188,10 +3969,23 @@ namespace SoftwareVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -2201,16 +3995,23 @@ namespace SoftwareVersionString { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[64 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 64); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(64 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[64 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -2224,16 +4025,23 @@ namespace ManufacturingDate { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 16); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -2247,16 +4055,23 @@ namespace PartNumber { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 32); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(32 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -2270,21 +4085,28 @@ namespace ProductURL { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 256, EMBER_ZCL_STATUS_INVALID_ARGUMENT); - uint8_t zclString[256 + 1]; + uint8_t zclString[256 + 2]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - memcpy(value.data(), &zclString[1], 256); - value.reduce_size(emberAfStringLength(zclString)); + size_t length = emberAfLongStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 256, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + memcpy(value.data(), &zclString[2], 256); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(256 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 256, EMBER_ZCL_STATUS_INVALID_ARGUMENT); - uint8_t zclString[256 + 1]; - emberAfCopyInt8u(zclString, 0, static_cast(value.size())); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); + uint8_t zclString[256 + 2]; + emberAfCopyInt16u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[2], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, ZCL_LONG_CHAR_STRING_ATTRIBUTE_TYPE); } } // namespace ProductURL @@ -2293,16 +4115,23 @@ namespace ProductLabel { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[64 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 64); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(64 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[64 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -2316,16 +4145,23 @@ namespace SerialNumber { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 32); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(32 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -2339,10 +4175,23 @@ namespace LocalConfigDisabled { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -2352,10 +4201,23 @@ namespace Reachable { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -2371,17 +4233,24 @@ namespace DefaultOtaProvider { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) { - VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 16); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) { + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -2396,10 +4265,23 @@ namespace UpdatePossible { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -2416,10 +4298,23 @@ namespace Status { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -2429,10 +4324,23 @@ namespace Order { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -2442,16 +4350,23 @@ namespace Description { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 60, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[60 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 60, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 60); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(60 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 60, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[60 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -2465,10 +4380,23 @@ namespace WiredAssessedInputVoltage { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -2478,10 +4406,23 @@ namespace WiredAssessedInputFrequency { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -2491,10 +4432,23 @@ namespace WiredCurrentType { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -2504,10 +4458,23 @@ namespace WiredAssessedCurrent { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -2517,10 +4484,23 @@ namespace WiredNominalVoltage { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -2530,10 +4510,23 @@ namespace WiredMaximumCurrent { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -2543,10 +4536,23 @@ namespace WiredPresent { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -2556,10 +4562,23 @@ namespace BatteryVoltage { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -2569,10 +4588,23 @@ namespace BatteryPercentRemaining { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -2582,10 +4614,23 @@ namespace BatteryTimeRemaining { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -2595,10 +4640,23 @@ namespace BatteryChargeLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -2608,10 +4666,23 @@ namespace BatteryReplacementNeeded { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -2621,10 +4692,23 @@ namespace BatteryReplaceability { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -2634,10 +4718,23 @@ namespace BatteryPresent { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -2647,16 +4744,23 @@ namespace BatteryReplacementDescription { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 60, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[60 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 60, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 60); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(60 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 60, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[60 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -2670,10 +4774,23 @@ namespace BatteryCommonDesignation { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -2683,16 +4800,23 @@ namespace BatteryANSIDesignation { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 20, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[20 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 20, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 20); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(20 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 20, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[20 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -2706,16 +4830,23 @@ namespace BatteryIECDesignation { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 20, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[20 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 20, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 20); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(20 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 20, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[20 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -2729,10 +4860,23 @@ namespace BatteryApprovedChemistry { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -2742,10 +4886,23 @@ namespace BatteryCapacity { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -2755,10 +4912,23 @@ namespace BatteryQuantity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -2768,10 +4938,23 @@ namespace BatteryChargeState { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -2781,10 +4964,23 @@ namespace BatteryTimeToFullCharge { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -2794,10 +4990,23 @@ namespace BatteryFunctionalWhileCharging { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -2807,10 +5016,23 @@ namespace BatteryChargingCurrent { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -2826,10 +5048,23 @@ namespace Breadcrumb { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -2846,10 +5081,23 @@ namespace RebootCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -2860,10 +5108,23 @@ namespace UpTime { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -2874,10 +5135,23 @@ namespace TotalOperationalHours { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -2888,10 +5162,23 @@ namespace BootReasons { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -2908,10 +5195,23 @@ namespace CurrentHeapFree { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -2922,10 +5222,23 @@ namespace CurrentHeapUsed { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -2936,10 +5249,23 @@ namespace CurrentHeapHighWatermark { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -2956,10 +5282,23 @@ namespace Channel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -2970,10 +5309,23 @@ namespace RoutingRole { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); -} + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; +} EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -2984,17 +5336,24 @@ namespace NetworkName { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) { - VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 16); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) { + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -3009,10 +5368,23 @@ namespace PanId { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -3023,10 +5395,23 @@ namespace ExtendedPanId { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -3037,17 +5422,24 @@ namespace MeshLocalPrefix { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) { - VerifyOrReturnError(value.size() == 17, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[17 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 17, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 17); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) { + static_assert(17 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 17, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[17 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -3062,10 +5454,23 @@ namespace OverrunCount { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -3076,10 +5481,23 @@ namespace PartitionId { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3090,10 +5508,23 @@ namespace Weighting { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -3104,10 +5535,23 @@ namespace DataVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -3118,10 +5562,23 @@ namespace StableDataVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -3132,10 +5589,23 @@ namespace LeaderRouterId { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -3146,10 +5616,23 @@ namespace DetachedRoleCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -3160,10 +5643,23 @@ namespace ChildRoleCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -3174,10 +5670,23 @@ namespace RouterRoleCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -3188,10 +5697,23 @@ namespace LeaderRoleCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -3202,10 +5724,23 @@ namespace AttachAttemptCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -3216,10 +5751,23 @@ namespace PartitionIdChangeCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -3230,10 +5778,23 @@ namespace BetterPartitionAttachAttemptCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -3244,10 +5805,23 @@ namespace ParentChangeCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -3258,10 +5832,23 @@ namespace TxTotalCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3272,10 +5859,23 @@ namespace TxUnicastCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3286,10 +5886,23 @@ namespace TxBroadcastCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3300,10 +5913,23 @@ namespace TxAckRequestedCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3314,10 +5940,23 @@ namespace TxAckedCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3328,10 +5967,23 @@ namespace TxNoAckRequestedCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3342,10 +5994,23 @@ namespace TxDataCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3356,10 +6021,23 @@ namespace TxDataPollCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3370,10 +6048,23 @@ namespace TxBeaconCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3384,10 +6075,23 @@ namespace TxBeaconRequestCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3398,10 +6102,23 @@ namespace TxOtherCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3412,10 +6129,23 @@ namespace TxRetryCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3426,10 +6156,23 @@ namespace TxDirectMaxRetryExpiryCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3440,10 +6183,23 @@ namespace TxIndirectMaxRetryExpiryCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3454,10 +6210,23 @@ namespace TxErrCcaCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3468,10 +6237,23 @@ namespace TxErrAbortCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3482,10 +6264,23 @@ namespace TxErrBusyChannelCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3496,10 +6291,23 @@ namespace RxTotalCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3510,10 +6318,23 @@ namespace RxUnicastCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3524,10 +6345,23 @@ namespace RxBroadcastCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3538,10 +6372,23 @@ namespace RxDataCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3552,10 +6399,23 @@ namespace RxDataPollCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3566,10 +6426,23 @@ namespace RxBeaconCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3580,10 +6453,23 @@ namespace RxBeaconRequestCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3594,10 +6480,23 @@ namespace RxOtherCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3608,10 +6507,23 @@ namespace RxAddressFilteredCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3622,10 +6534,23 @@ namespace RxDestAddrFilteredCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3636,10 +6561,23 @@ namespace RxDuplicatedCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3650,10 +6588,23 @@ namespace RxErrNoFrameCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3664,10 +6615,23 @@ namespace RxErrUnknownNeighborCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3678,10 +6642,23 @@ namespace RxErrInvalidSrcAddrCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3692,10 +6669,23 @@ namespace RxErrSecCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3706,10 +6696,23 @@ namespace RxErrFcsCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3720,10 +6723,23 @@ namespace RxErrOtherCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3734,10 +6750,23 @@ namespace ActiveTimestamp { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -3748,10 +6777,23 @@ namespace PendingTimestamp { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -3762,10 +6804,23 @@ namespace Delay { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3776,17 +6831,24 @@ namespace ChannelMask { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) { - VerifyOrReturnError(value.size() == 4, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[4 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 4, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 4); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) { + static_assert(4 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 4, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[4 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -3807,17 +6869,24 @@ namespace Bssid { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) { - VerifyOrReturnError(value.size() == 6, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[6 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 6, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 6); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) { + static_assert(6 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 6, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[6 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -3832,10 +6901,23 @@ namespace SecurityType { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -3846,10 +6928,23 @@ namespace WiFiVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -3860,10 +6955,23 @@ namespace ChannelNumber { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -3874,10 +6982,23 @@ namespace Rssi { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT8S_ATTRIBUTE_TYPE); } @@ -3888,10 +7009,23 @@ namespace BeaconLostCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3902,10 +7036,23 @@ namespace BeaconRxCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3916,10 +7063,23 @@ namespace PacketMulticastRxCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3930,10 +7090,23 @@ namespace PacketMulticastTxCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3944,10 +7117,23 @@ namespace PacketUnicastRxCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3958,10 +7144,23 @@ namespace PacketUnicastTxCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3972,10 +7171,23 @@ namespace CurrentMaxRate { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -3986,10 +7198,23 @@ namespace OverrunCount { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -4006,10 +7231,23 @@ namespace PHYRate { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -4020,10 +7258,23 @@ namespace FullDuplex { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -4034,10 +7285,23 @@ namespace PacketRxCount { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -4048,10 +7312,23 @@ namespace PacketTxCount { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -4062,10 +7339,23 @@ namespace TxErrCount { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -4076,10 +7366,23 @@ namespace CollisionCount { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -4090,10 +7393,23 @@ namespace OverrunCount { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -4104,10 +7420,23 @@ namespace CarrierDetect { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -4118,10 +7447,23 @@ namespace TimeSinceReset { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -4138,16 +7480,23 @@ namespace VendorName { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 32); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(32 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -4161,10 +7510,23 @@ namespace VendorID { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -4175,16 +7537,23 @@ namespace ProductName { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 32); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(32 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -4198,16 +7567,23 @@ namespace UserLabel { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 32); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(32 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -4221,10 +7597,23 @@ namespace HardwareVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -4235,16 +7624,23 @@ namespace HardwareVersionString { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[64 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 64); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(64 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[64 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -4258,10 +7654,23 @@ namespace SoftwareVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -4272,16 +7681,23 @@ namespace SoftwareVersionString { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[64 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 64); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(64 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[64 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -4295,16 +7711,23 @@ namespace ManufacturingDate { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 16); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -4318,16 +7741,23 @@ namespace PartNumber { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 254, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[254 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 254, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 254); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(254 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 254, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[254 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -4341,16 +7771,23 @@ namespace ProductURL { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 254, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[254 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 254, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 254); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(254 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 254, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[254 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -4364,16 +7801,23 @@ namespace ProductLabel { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[64 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 64); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(64 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[64 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -4387,16 +7831,23 @@ namespace SerialNumber { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 32); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(32 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -4410,10 +7861,23 @@ namespace Reachable { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -4430,10 +7894,23 @@ namespace NumberOfPositions { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Switch::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Switch::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Switch::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -4443,10 +7920,23 @@ namespace CurrentPosition { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Switch::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Switch::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Switch::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -4456,10 +7946,23 @@ namespace MultiPressMax { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Switch::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Switch::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Switch::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -4475,10 +7978,23 @@ namespace SupportedFabrics { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -4489,10 +8005,23 @@ namespace CommissionedFabrics { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -4503,10 +8032,23 @@ namespace CurrentFabricIndex { EmberAfStatus Get(chip::EndpointId endpoint, chip::FabricIndex * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::FabricIndex value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, (uint8_t *) &value, ZCL_FABRIC_IDX_ATTRIBUTE_TYPE); } @@ -4529,10 +8071,23 @@ namespace StateValue { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BooleanState::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::BooleanState::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BooleanState::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -4548,10 +8103,23 @@ namespace CurrentMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -4561,10 +8129,23 @@ namespace OnMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -4574,10 +8155,23 @@ namespace StartUpMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -4587,16 +8181,23 @@ namespace Description { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 32); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(32 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -4616,10 +8217,23 @@ namespace PhysicalClosedLimit { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -4630,10 +8244,23 @@ namespace MotorStepSize { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -4644,10 +8271,23 @@ namespace Status { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -4658,10 +8298,23 @@ namespace ClosedLimit { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -4672,10 +8325,23 @@ namespace Mode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -4692,10 +8358,23 @@ namespace LockState { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -4705,10 +8384,23 @@ namespace LockType { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -4718,10 +8410,23 @@ namespace ActuatorEnabled { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -4731,10 +8436,23 @@ namespace DoorState { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -4744,10 +8462,23 @@ namespace DoorOpenEvents { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -4757,10 +8488,23 @@ namespace DoorClosedEvents { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -4770,10 +8514,23 @@ namespace OpenPeriod { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -4783,10 +8540,23 @@ namespace NumLockRecordsSupported { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -4796,10 +8566,23 @@ namespace NumTotalUsersSupported { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -4809,10 +8592,23 @@ namespace NumPinUsersSupported { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -4822,10 +8618,23 @@ namespace NumRfidUsersSupported { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -4835,10 +8644,23 @@ namespace NumWeekdaySchedulesSupportedPerUser { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -4848,10 +8670,23 @@ namespace NumYeardaySchedulesSupportedPerUser { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -4861,10 +8696,23 @@ namespace NumHolidaySchedulesSupportedPerUser { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -4874,10 +8722,23 @@ namespace MaxPinLength { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -4887,10 +8748,23 @@ namespace MinPinLength { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -4900,10 +8774,23 @@ namespace MaxRfidCodeLength { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -4913,10 +8800,23 @@ namespace MinRfidCodeLength { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -4926,10 +8826,23 @@ namespace EnableLogging { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -4939,16 +8852,23 @@ namespace Language { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 2, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[2 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 2, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 2); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(2 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 2, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[2 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -4962,10 +8882,23 @@ namespace LedSettings { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -4975,10 +8908,23 @@ namespace AutoRelockTime { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -4988,10 +8934,23 @@ namespace SoundVolume { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -5001,10 +8960,23 @@ namespace OperatingMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -5014,10 +8986,23 @@ namespace SupportedOperatingModes { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -5027,10 +9012,23 @@ namespace DefaultConfigurationRegister { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -5040,10 +9038,23 @@ namespace EnableLocalProgramming { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -5053,10 +9064,23 @@ namespace EnableOneTouchLocking { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -5066,10 +9090,23 @@ namespace EnableInsideStatusLed { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -5079,10 +9116,23 @@ namespace EnablePrivacyModeButton { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -5092,10 +9142,23 @@ namespace WrongCodeEntryLimit { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -5105,10 +9168,23 @@ namespace UserCodeTemporaryDisableTime { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -5118,10 +9194,23 @@ namespace SendPinOverTheAir { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -5131,10 +9220,23 @@ namespace RequirePinForRfOperation { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -5144,10 +9246,23 @@ namespace ZigbeeSecurityLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -5157,10 +9272,23 @@ namespace AlarmMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -5170,10 +9298,23 @@ namespace KeypadOperationEventMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -5183,10 +9324,23 @@ namespace RfOperationEventMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -5196,10 +9350,23 @@ namespace ManualOperationEventMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -5209,10 +9376,23 @@ namespace RfidOperationEventMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -5222,10 +9402,23 @@ namespace KeypadProgrammingEventMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -5235,10 +9428,23 @@ namespace RfProgrammingEventMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -5248,10 +9454,23 @@ namespace RfidProgrammingEventMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -5267,10 +9486,23 @@ namespace Type { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -5280,10 +9512,23 @@ namespace PhysicalClosedLimitLift { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5293,10 +9538,23 @@ namespace PhysicalClosedLimitTilt { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5306,10 +9564,23 @@ namespace CurrentPositionLift { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5319,10 +9590,23 @@ namespace CurrentPositionTilt { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5332,10 +9616,23 @@ namespace NumberOfActuationsLift { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5345,10 +9642,23 @@ namespace NumberOfActuationsTilt { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5358,10 +9668,23 @@ namespace ConfigStatus { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -5371,10 +9694,23 @@ namespace CurrentPositionLiftPercentage { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -5384,10 +9720,23 @@ namespace CurrentPositionTiltPercentage { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -5397,10 +9746,23 @@ namespace OperationalStatus { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -5410,10 +9772,23 @@ namespace TargetPositionLiftPercent100ths { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5423,10 +9798,23 @@ namespace TargetPositionTiltPercent100ths { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5436,10 +9824,23 @@ namespace EndProductType { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -5449,10 +9850,23 @@ namespace CurrentPositionLiftPercent100ths { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5462,10 +9876,23 @@ namespace CurrentPositionTiltPercent100ths { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5475,10 +9902,23 @@ namespace InstalledOpenLimitLift { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5488,10 +9928,23 @@ namespace InstalledClosedLimitLift { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5501,10 +9954,23 @@ namespace InstalledOpenLimitTilt { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5514,10 +9980,23 @@ namespace InstalledClosedLimitTilt { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5527,10 +10006,23 @@ namespace VelocityLift { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5540,10 +10032,23 @@ namespace AccelerationTimeLift { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5553,10 +10058,23 @@ namespace DecelerationTimeLift { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5566,10 +10084,23 @@ namespace Mode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -5579,16 +10110,23 @@ namespace IntermediateSetpointsLift { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) { - VerifyOrReturnError(value.size() == 254, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[254 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 254, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 254); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) { + static_assert(254 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 254, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[254 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -5602,16 +10140,23 @@ namespace IntermediateSetpointsTilt { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) { - VerifyOrReturnError(value.size() == 254, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[254 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 254, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 254); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) { + static_assert(254 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 254, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[254 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -5625,10 +10170,23 @@ namespace SafetyStatus { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -5644,10 +10202,23 @@ namespace BarrierMovingState { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -5657,10 +10228,23 @@ namespace BarrierSafetyStatus { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -5670,10 +10254,23 @@ namespace BarrierCapabilities { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -5683,10 +10280,23 @@ namespace BarrierOpenEvents { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5696,10 +10306,23 @@ namespace BarrierCloseEvents { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5709,10 +10332,23 @@ namespace BarrierCommandOpenEvents { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5722,10 +10358,23 @@ namespace BarrierCommandCloseEvents { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5735,10 +10384,23 @@ namespace BarrierOpenPeriod { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5748,10 +10410,23 @@ namespace BarrierClosePeriod { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5761,10 +10436,23 @@ namespace BarrierPosition { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -5780,10 +10468,23 @@ namespace MaxPressure { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -5794,10 +10495,23 @@ namespace MaxSpeed { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5808,10 +10522,23 @@ namespace MaxFlow { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5822,10 +10549,23 @@ namespace MinConstPressure { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -5836,10 +10576,23 @@ namespace MaxConstPressure { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -5850,10 +10603,23 @@ namespace MinCompPressure { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -5864,10 +10630,23 @@ namespace MaxCompPressure { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -5878,10 +10657,23 @@ namespace MinConstSpeed { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5892,10 +10684,23 @@ namespace MaxConstSpeed { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5906,10 +10711,23 @@ namespace MinConstFlow { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5920,10 +10738,23 @@ namespace MaxConstFlow { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5934,10 +10765,23 @@ namespace MinConstTemp { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -5948,10 +10792,23 @@ namespace MaxConstTemp { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -5962,10 +10819,23 @@ namespace PumpStatus { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -5976,10 +10846,23 @@ namespace EffectiveOperationMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -5990,10 +10873,23 @@ namespace EffectiveControlMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); -} + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; +} EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6004,10 +10900,23 @@ namespace Capacity { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -6018,10 +10927,23 @@ namespace Speed { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -6032,10 +10954,23 @@ namespace LifetimeEnergyConsumed { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -6046,10 +10981,23 @@ namespace OperationMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6060,10 +11008,23 @@ namespace ControlMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6074,10 +11035,23 @@ namespace AlarmMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -6094,10 +11068,23 @@ namespace LocalTemperature { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -6107,10 +11094,23 @@ namespace OutdoorTemperature { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -6120,10 +11120,23 @@ namespace Occupancy { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -6133,10 +11146,23 @@ namespace AbsMinHeatSetpointLimit { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -6146,10 +11172,23 @@ namespace AbsMaxHeatSetpointLimit { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -6159,10 +11198,23 @@ namespace AbsMinCoolSetpointLimit { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -6172,10 +11224,23 @@ namespace AbsMaxCoolSetpointLimit { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -6185,10 +11250,23 @@ namespace PiCoolingDemand { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -6198,10 +11276,23 @@ namespace PiHeatingDemand { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -6211,10 +11302,23 @@ namespace HvacSystemTypeConfiguration { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -6224,10 +11328,23 @@ namespace LocalTemperatureCalibration { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT8S_ATTRIBUTE_TYPE); } @@ -6237,10 +11354,23 @@ namespace OccupiedCoolingSetpoint { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -6250,10 +11380,23 @@ namespace OccupiedHeatingSetpoint { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -6263,10 +11406,23 @@ namespace UnoccupiedCoolingSetpoint { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -6276,10 +11432,23 @@ namespace UnoccupiedHeatingSetpoint { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -6289,10 +11458,23 @@ namespace MinHeatSetpointLimit { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -6302,10 +11484,23 @@ namespace MaxHeatSetpointLimit { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -6315,10 +11510,23 @@ namespace MinCoolSetpointLimit { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -6328,10 +11536,23 @@ namespace MaxCoolSetpointLimit { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -6341,10 +11562,23 @@ namespace MinSetpointDeadBand { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT8S_ATTRIBUTE_TYPE); } @@ -6354,10 +11588,23 @@ namespace RemoteSensing { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -6367,10 +11614,23 @@ namespace ControlSequenceOfOperation { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6380,10 +11640,23 @@ namespace SystemMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6393,10 +11666,23 @@ namespace AlarmMask { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -6406,10 +11692,23 @@ namespace ThermostatRunningMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6419,10 +11718,23 @@ namespace StartOfWeek { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6432,10 +11744,23 @@ namespace NumberOfWeeklyTransitions { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -6445,10 +11770,23 @@ namespace NumberOfDailyTransitions { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -6458,10 +11796,23 @@ namespace TemperatureSetpointHold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6471,10 +11822,23 @@ namespace TemperatureSetpointHoldDuration { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -6484,10 +11848,23 @@ namespace ThermostatProgrammingOperationMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -6497,10 +11874,23 @@ namespace HvacRelayState { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -6510,10 +11900,23 @@ namespace SetpointChangeSource { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6523,10 +11926,23 @@ namespace SetpointChangeAmount { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -6536,10 +11952,23 @@ namespace SetpointChangeSourceTimestamp { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_EPOCH_S_ATTRIBUTE_TYPE); } @@ -6549,10 +11978,23 @@ namespace AcType { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6562,10 +12004,23 @@ namespace AcCapacity { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -6575,10 +12030,23 @@ namespace AcRefrigerantType { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6588,10 +12056,23 @@ namespace AcCompressor { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6601,10 +12082,23 @@ namespace AcErrorCode { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -6614,10 +12108,23 @@ namespace AcLouverPosition { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6627,10 +12134,23 @@ namespace AcCoilTemperature { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -6640,10 +12160,23 @@ namespace AcCapacityFormat { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6659,10 +12192,23 @@ namespace FanMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::FanControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::FanControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::FanControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6672,10 +12218,23 @@ namespace FanModeSequence { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::FanControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::FanControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::FanControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6691,10 +12250,23 @@ namespace RelativeHumidity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -6705,10 +12277,23 @@ namespace DehumidificationCooling { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -6719,10 +12304,23 @@ namespace RhDehumidificationSetpoint { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -6733,10 +12331,23 @@ namespace RelativeHumidityMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6747,10 +12358,23 @@ namespace DehumidificationLockout { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6761,10 +12385,23 @@ namespace DehumidificationHysteresis { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -6775,10 +12412,23 @@ namespace DehumidificationMaxCool { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -6789,10 +12439,23 @@ namespace RelativeHumidityDisplay { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6809,11 +12472,23 @@ namespace TemperatureDisplayMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6824,11 +12499,23 @@ namespace KeypadLockout { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6839,11 +12526,23 @@ namespace ScheduleProgrammingVisibility { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6860,10 +12559,23 @@ namespace CurrentHue { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -6873,10 +12585,23 @@ namespace CurrentSaturation { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -6886,10 +12611,23 @@ namespace RemainingTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -6899,10 +12637,23 @@ namespace CurrentX { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -6912,10 +12663,23 @@ namespace CurrentY { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -6925,10 +12689,23 @@ namespace DriftCompensation { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6938,16 +12715,23 @@ namespace CompensationText { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 254, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[254 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 254, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 254); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(254 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 254, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[254 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -6961,10 +12745,23 @@ namespace ColorTemperature { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -6974,10 +12771,23 @@ namespace ColorMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6987,10 +12797,23 @@ namespace ColorControlOptions { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -7000,10 +12823,23 @@ namespace NumberOfPrimaries { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7013,10 +12849,23 @@ namespace Primary1X { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7026,10 +12875,23 @@ namespace Primary1Y { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7039,10 +12901,23 @@ namespace Primary1Intensity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7052,10 +12927,23 @@ namespace Primary2X { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7065,10 +12953,23 @@ namespace Primary2Y { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7078,10 +12979,23 @@ namespace Primary2Intensity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7091,10 +13005,23 @@ namespace Primary3X { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7104,10 +13031,23 @@ namespace Primary3Y { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7117,10 +13057,23 @@ namespace Primary3Intensity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7130,10 +13083,23 @@ namespace Primary4X { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7143,10 +13109,23 @@ namespace Primary4Y { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7156,10 +13135,23 @@ namespace Primary4Intensity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7169,10 +13161,23 @@ namespace Primary5X { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7182,10 +13187,23 @@ namespace Primary5Y { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7195,10 +13213,23 @@ namespace Primary5Intensity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7208,10 +13239,23 @@ namespace Primary6X { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7221,10 +13265,23 @@ namespace Primary6Y { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7234,10 +13291,23 @@ namespace Primary6Intensity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7247,10 +13317,23 @@ namespace WhitePointX { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7260,10 +13343,23 @@ namespace WhitePointY { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7273,10 +13369,23 @@ namespace ColorPointRX { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7286,10 +13395,23 @@ namespace ColorPointRY { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7299,10 +13421,23 @@ namespace ColorPointRIntensity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7312,10 +13447,23 @@ namespace ColorPointGX { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7325,10 +13473,23 @@ namespace ColorPointGY { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7338,10 +13499,23 @@ namespace ColorPointGIntensity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7351,10 +13525,23 @@ namespace ColorPointBX { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7364,10 +13551,23 @@ namespace ColorPointBY { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7377,10 +13577,23 @@ namespace ColorPointBIntensity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7390,10 +13603,23 @@ namespace EnhancedCurrentHue { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7403,10 +13629,23 @@ namespace EnhancedColorMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -7416,10 +13655,23 @@ namespace ColorLoopActive { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7429,10 +13681,23 @@ namespace ColorLoopDirection { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7442,10 +13707,23 @@ namespace ColorLoopTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7455,10 +13733,23 @@ namespace ColorLoopStartEnhancedHue { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7468,10 +13759,23 @@ namespace ColorLoopStoredEnhancedHue { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7481,10 +13785,23 @@ namespace ColorCapabilities { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -7494,10 +13811,23 @@ namespace ColorTempPhysicalMin { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7507,10 +13837,23 @@ namespace ColorTempPhysicalMax { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7520,10 +13863,23 @@ namespace CoupleColorTempToLevelMinMireds { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7533,10 +13889,23 @@ namespace StartUpColorTemperatureMireds { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7552,10 +13921,23 @@ namespace PhysicalMinLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7566,10 +13948,23 @@ namespace PhysicalMaxLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7580,10 +13975,23 @@ namespace BallastStatus { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -7594,10 +14002,23 @@ namespace MinLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7608,10 +14029,23 @@ namespace MaxLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7622,10 +14056,23 @@ namespace PowerOnLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7636,10 +14083,23 @@ namespace PowerOnFadeTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7650,10 +14110,23 @@ namespace IntrinsicBallastFactor { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7664,10 +14137,23 @@ namespace BallastFactorAdjustment { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7678,10 +14164,23 @@ namespace LampQuality { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7692,17 +14191,24 @@ namespace LampType { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 16); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -7716,17 +14222,24 @@ namespace LampManufacturer { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 16); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -7740,10 +14253,23 @@ namespace LampAlarmMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -7758,54 +14284,166 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - return emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (NumericAttributeTraits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = temp; + } + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + auto value = NumericAttributeTraits::kNullValue; + return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, reinterpret_cast(&value), + ZCL_INT16U_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - return emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (NumericAttributeTraits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = temp; + } + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + auto value = NumericAttributeTraits::kNullValue; + return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, reinterpret_cast(&value), + ZCL_INT16U_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - return emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (NumericAttributeTraits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = temp; + } + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + auto value = NumericAttributeTraits::kNullValue; + return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, reinterpret_cast(&value), + ZCL_INT16U_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + } // namespace MaxMeasuredValue namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7814,16 +14452,49 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) namespace LightSensorType { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - return emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (NumericAttributeTraits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = temp; + } + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + auto value = NumericAttributeTraits::kNullValue; + return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, reinterpret_cast(&value), + ZCL_ENUM8_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + } // namespace LightSensorType } // namespace Attributes @@ -7836,10 +14507,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -7850,10 +14534,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -7864,10 +14561,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -7878,10 +14588,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7898,10 +14621,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -7912,10 +14648,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -7926,10 +14675,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -7940,10 +14702,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7954,10 +14729,23 @@ namespace ScaledValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -7968,10 +14756,23 @@ namespace MinScaledValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -7982,10 +14783,23 @@ namespace MaxScaledValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -7996,10 +14810,23 @@ namespace ScaledTolerance { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -8010,10 +14837,23 @@ namespace Scale { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT8S_ATTRIBUTE_TYPE); } @@ -8030,10 +14870,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -8043,10 +14896,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -8056,10 +14922,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -8069,10 +14948,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -8088,10 +14980,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -8102,10 +15007,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -8116,10 +15034,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -8130,10 +15061,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -8150,10 +15094,23 @@ namespace Occupancy { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -8164,10 +15121,23 @@ namespace OccupancySensorType { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -8177,10 +15147,23 @@ namespace OccupancySensorTypeBitmap { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -8191,10 +15174,23 @@ namespace PirOccupiedToUnoccupiedDelay { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -8204,10 +15200,23 @@ namespace PirUnoccupiedToOccupiedDelay { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -8217,10 +15226,23 @@ namespace PirUnoccupiedToOccupiedThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -8230,10 +15252,23 @@ namespace UltrasonicOccupiedToUnoccupiedDelay { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -8243,10 +15278,23 @@ namespace UltrasonicUnoccupiedToOccupiedDelay { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -8256,10 +15304,23 @@ namespace UltrasonicUnoccupiedToOccupiedThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -8269,10 +15330,23 @@ namespace PhysicalContactOccupiedToUnoccupiedDelay { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -8282,10 +15356,23 @@ namespace PhysicalContactUnoccupiedToOccupiedDelay { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -8295,10 +15382,23 @@ namespace PhysicalContactUnoccupiedToOccupiedThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -8314,11 +15414,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8329,11 +15441,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8344,11 +15468,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8359,11 +15495,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8380,11 +15528,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8395,11 +15555,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8410,11 +15582,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8425,11 +15609,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8446,11 +15642,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8461,11 +15669,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8476,11 +15696,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8491,11 +15723,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8512,11 +15756,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8527,11 +15783,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8542,11 +15810,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8557,11 +15837,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8578,11 +15870,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8593,11 +15897,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8608,11 +15924,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8623,11 +15951,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8644,11 +15984,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8659,11 +16011,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8674,11 +16038,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8689,11 +16065,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8710,11 +16098,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8725,11 +16125,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8740,11 +16152,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8755,11 +16179,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8776,11 +16212,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8791,11 +16239,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8806,11 +16266,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8821,11 +16293,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8842,11 +16326,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8857,11 +16353,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8872,11 +16380,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8887,11 +16407,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8908,10 +16440,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8922,10 +16467,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8936,10 +16494,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8950,10 +16521,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8970,11 +16554,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8985,11 +16581,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9000,11 +16608,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9015,11 +16635,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9036,11 +16668,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9051,11 +16695,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9066,11 +16722,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9081,11 +16749,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9102,11 +16782,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9117,11 +16809,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9132,11 +16836,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9147,11 +16863,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9168,11 +16896,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9183,11 +16923,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9198,11 +16950,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9213,11 +16977,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9234,11 +17010,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9249,11 +17037,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9264,11 +17064,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9279,11 +17091,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9300,11 +17124,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9315,11 +17151,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9330,11 +17178,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9345,11 +17205,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9366,11 +17238,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9381,11 +17265,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9396,11 +17292,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9411,11 +17319,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9432,11 +17352,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9447,11 +17379,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9462,11 +17406,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9477,11 +17433,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9498,11 +17466,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9513,11 +17493,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9528,11 +17520,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9543,11 +17547,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9564,11 +17580,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9579,11 +17607,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9594,11 +17634,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9609,11 +17661,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9630,11 +17694,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9645,11 +17721,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9660,11 +17748,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9675,11 +17775,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9696,11 +17808,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9711,11 +17835,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9726,11 +17862,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9741,11 +17889,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9762,10 +17922,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9776,10 +17949,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9790,10 +17976,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9804,10 +18003,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9824,11 +18036,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9839,11 +18063,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9854,11 +18090,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9869,11 +18117,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9890,11 +18150,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9905,11 +18177,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9920,11 +18204,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9935,11 +18231,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9956,11 +18264,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9971,11 +18291,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9986,11 +18318,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -10001,11 +18345,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -10022,11 +18378,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -10037,11 +18405,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -10052,11 +18432,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -10067,11 +18459,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -10088,11 +18492,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -10103,11 +18519,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -10118,11 +18546,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -10133,11 +18573,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -10154,11 +18606,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -10169,11 +18633,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -10184,11 +18660,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -10199,11 +18687,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -10220,11 +18720,23 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -10235,11 +18747,23 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -10250,11 +18774,23 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -10265,11 +18801,23 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, (uint8_t *) value, - sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -10286,10 +18834,23 @@ namespace ZoneState { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -10299,10 +18860,23 @@ namespace ZoneType { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) &value, ZCL_ENUM16_ATTRIBUTE_TYPE); } @@ -10312,10 +18886,23 @@ namespace ZoneStatus { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -10325,10 +18912,23 @@ namespace IasCieAddress { EmberAfStatus Get(chip::EndpointId endpoint, chip::NodeId * value) { - return emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::NodeId value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) &value, ZCL_NODE_ID_ATTRIBUTE_TYPE); } @@ -10338,10 +18938,23 @@ namespace ZoneId { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -10351,10 +18964,23 @@ namespace NumberOfZoneSensitivityLevelsSupported { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -10364,10 +18990,23 @@ namespace CurrentZoneSensitivityLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -10383,10 +19022,23 @@ namespace MaxDuration { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::IasWd::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::IasWd::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::IasWd::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -10402,16 +19054,23 @@ namespace WakeOnLanMacAddress { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WakeOnLan::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 32); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(32 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -10431,16 +19090,23 @@ namespace TvChannelLineup { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) { - VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TvChannel::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 32); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) { + static_assert(32 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -10454,16 +19120,23 @@ namespace CurrentTvChannel { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) { - VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TvChannel::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 32); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) { + static_assert(32 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -10483,10 +19156,23 @@ namespace CurrentNavigatorTarget { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TargetNavigator::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TargetNavigator::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TargetNavigator::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -10502,10 +19188,23 @@ namespace PlaybackState { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -10515,10 +19214,23 @@ namespace StartTime { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -10528,10 +19240,23 @@ namespace Duration { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) value, sizeof(*value)); -} -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -10541,10 +19266,23 @@ namespace PositionUpdatedAt { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -10554,10 +19292,23 @@ namespace Position { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -10567,10 +19318,23 @@ namespace PlaybackSpeed { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -10580,10 +19344,23 @@ namespace SeekRangeEnd { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -10593,10 +19370,23 @@ namespace SeekRangeStart { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -10612,10 +19402,23 @@ namespace CurrentMediaInput { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::MediaInput::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::MediaInput::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::MediaInput::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -10637,10 +19440,23 @@ namespace CurrentAudioOutput { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::AudioOutput::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::AudioOutput::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::AudioOutput::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -10656,10 +19472,23 @@ namespace CatalogVendorId { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -10670,10 +19499,23 @@ namespace ApplicationId { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -10690,16 +19532,23 @@ namespace VendorName { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 32); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(32 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -10713,10 +19562,23 @@ namespace VendorId { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -10726,16 +19588,23 @@ namespace ApplicationName { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 32); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(32 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -10749,10 +19618,23 @@ namespace ProductId { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -10762,16 +19644,23 @@ namespace ApplicationId { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 32); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(32 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[32 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -10785,10 +19674,23 @@ namespace CatalogVendorId { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -10798,10 +19700,23 @@ namespace ApplicationStatus { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -10817,10 +19732,23 @@ namespace Boolean { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -10830,10 +19758,23 @@ namespace Bitmap8 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -10843,10 +19784,23 @@ namespace Bitmap16 { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -10856,10 +19810,23 @@ namespace Bitmap32 { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -10869,10 +19836,23 @@ namespace Bitmap64 { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_BITMAP64_ATTRIBUTE_TYPE); } @@ -10882,10 +19862,23 @@ namespace Int8u { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -10895,10 +19888,23 @@ namespace Int16u { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -10908,10 +19914,23 @@ namespace Int32u { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -10921,10 +19940,23 @@ namespace Int64u { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -10934,10 +19966,23 @@ namespace Int8s { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT8S_ATTRIBUTE_TYPE); } @@ -10947,10 +19992,23 @@ namespace Int16s { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -10960,10 +20018,23 @@ namespace Int32s { EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT32S_ATTRIBUTE_TYPE); } @@ -10973,10 +20044,23 @@ namespace Int64s { EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT64S_ATTRIBUTE_TYPE); } @@ -10986,10 +20070,23 @@ namespace Enum8 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -10999,10 +20096,23 @@ namespace Enum16 { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_ENUM16_ATTRIBUTE_TYPE); } @@ -11012,16 +20122,23 @@ namespace OctetString { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) { - VerifyOrReturnError(value.size() == 10, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[10 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 10, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 10); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) { + static_assert(10 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 10, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[10 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -11035,16 +20152,23 @@ namespace LongOctetString { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) { - VerifyOrReturnError(value.size() == 1000, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[1000 + 2]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfLongStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 1000, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[2], 1000); - value.reduce_size(emberAfLongStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) { + static_assert(1000 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 1000, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[1000 + 2]; emberAfCopyInt16u(zclString, 0, static_cast(value.size())); @@ -11058,16 +20182,23 @@ namespace CharString { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 10, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[10 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 10, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 10); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(10 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 10, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[10 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -11081,16 +20212,23 @@ namespace LongCharString { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 1000, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[1000 + 2]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfLongStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 1000, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[2], 1000); - value.reduce_size(emberAfLongStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(1000 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 1000, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[1000 + 2]; emberAfCopyInt16u(zclString, 0, static_cast(value.size())); @@ -11104,10 +20242,23 @@ namespace EpochUs { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_EPOCH_US_ATTRIBUTE_TYPE); } @@ -11117,10 +20268,23 @@ namespace EpochS { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_EPOCH_S_ATTRIBUTE_TYPE); } @@ -11130,10 +20294,23 @@ namespace VendorId { EmberAfStatus Get(chip::EndpointId endpoint, chip::VendorId * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::VendorId value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_VENDOR_ID_ATTRIBUTE_TYPE); } @@ -11143,189 +20320,1056 @@ namespace Unsupported { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace Unsupported -} // namespace Attributes -} // namespace TestCluster - -namespace ApplianceIdentification { -namespace Attributes { - -namespace CompanyName { +namespace NullableBoolean { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); - uint8_t zclString[16 + 1]; + NumericAttributeTraits::StorageType temp; EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, sizeof(zclString)); + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - memcpy(value.data(), &zclString[1], 16); - value.reduce_size(emberAfStringLength(zclString)); + if (NumericAttributeTraits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = temp; + } return status; } -EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); - uint8_t zclString[16 + 1]; - emberAfCopyInt8u(zclString, 0, static_cast(value.size())); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, - ZCL_CHAR_STRING_ATTRIBUTE_TYPE); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } -} // namespace CompanyName - -namespace CompanyId { - -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +EmberAfStatus SetNull(chip::EndpointId endpoint) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) value, sizeof(*value)); + auto value = NumericAttributeTraits::kNullValue; + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), + ZCL_BOOLEAN_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) + +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); } -} // namespace CompanyId +} // namespace NullableBoolean -namespace BrandName { +namespace NullableBitmap8 { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); - uint8_t zclString[16 + 1]; + NumericAttributeTraits::StorageType temp; EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, sizeof(zclString)); + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - memcpy(value.data(), &zclString[1], 16); - value.reduce_size(emberAfStringLength(zclString)); + if (NumericAttributeTraits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = temp; + } return status; } -EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); - uint8_t zclString[16 + 1]; - emberAfCopyInt8u(zclString, 0, static_cast(value.size())); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, - ZCL_CHAR_STRING_ATTRIBUTE_TYPE); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } -} // namespace BrandName - -namespace BrandId { - -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +EmberAfStatus SetNull(chip::EndpointId endpoint) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) value, sizeof(*value)); + auto value = NumericAttributeTraits::kNullValue; + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), + ZCL_BITMAP8_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) + +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) &value, - ZCL_INT16U_ATTRIBUTE_TYPE); + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); } -} // namespace BrandId +} // namespace NullableBitmap8 -namespace Model { +namespace NullableBitmap16 { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); - uint8_t zclString[16 + 1]; + NumericAttributeTraits::StorageType temp; EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, sizeof(zclString)); + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - memcpy(value.data(), &zclString[1], 16); - value.reduce_size(emberAfStringLength(zclString)); + if (NumericAttributeTraits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = temp; + } return status; } -EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); - uint8_t zclString[16 + 1]; - emberAfCopyInt8u(zclString, 0, static_cast(value.size())); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, - ZCL_OCTET_STRING_ATTRIBUTE_TYPE); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } -} // namespace Model +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + auto value = NumericAttributeTraits::kNullValue; + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), + ZCL_BITMAP16_ATTRIBUTE_TYPE); +} -namespace PartNumber { +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) + return Set(endpoint, value.Value()); +} + +} // namespace NullableBitmap16 + +namespace NullableBitmap32 { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); - uint8_t zclString[16 + 1]; + NumericAttributeTraits::StorageType temp; EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, sizeof(zclString)); + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - memcpy(value.data(), &zclString[1], 16); - value.reduce_size(emberAfStringLength(zclString)); + if (NumericAttributeTraits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = temp; + } return status; } -EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); - uint8_t zclString[16 + 1]; - emberAfCopyInt8u(zclString, 0, static_cast(value.size())); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, - ZCL_OCTET_STRING_ATTRIBUTE_TYPE); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_BITMAP32_ATTRIBUTE_TYPE); } -} // namespace PartNumber +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + auto value = NumericAttributeTraits::kNullValue; + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), + ZCL_BITMAP32_ATTRIBUTE_TYPE); +} -namespace ProductRevision { +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) + return Set(endpoint, value.Value()); +} + +} // namespace NullableBitmap32 + +namespace NullableBitmap64 { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - VerifyOrReturnError(value.size() == 6, EMBER_ZCL_STATUS_INVALID_ARGUMENT); - uint8_t zclString[6 + 1]; + NumericAttributeTraits::StorageType temp; EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, sizeof(zclString)); + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - memcpy(value.data(), &zclString[1], 6); - value.reduce_size(emberAfStringLength(zclString)); + if (NumericAttributeTraits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = temp; + } return status; } -EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - VerifyOrReturnError(value.size() <= 6, EMBER_ZCL_STATUS_INVALID_ARGUMENT); - uint8_t zclString[6 + 1]; - emberAfCopyInt8u(zclString, 0, static_cast(value.size())); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, - ZCL_OCTET_STRING_ATTRIBUTE_TYPE); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_BITMAP64_ATTRIBUTE_TYPE); } -} // namespace ProductRevision +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + auto value = NumericAttributeTraits::kNullValue; + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), + ZCL_BITMAP64_ATTRIBUTE_TYPE); +} -namespace SoftwareRevision { +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) + return Set(endpoint, value.Value()); +} + +} // namespace NullableBitmap64 + +namespace NullableInt8u { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - VerifyOrReturnError(value.size() == 6, EMBER_ZCL_STATUS_INVALID_ARGUMENT); - uint8_t zclString[6 + 1]; + NumericAttributeTraits::StorageType temp; EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, sizeof(zclString)); + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (NumericAttributeTraits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = temp; + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +{ + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + auto value = NumericAttributeTraits::kNullValue; + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), + ZCL_INT8U_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace NullableInt8u + +namespace NullableInt16u { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (NumericAttributeTraits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = temp; + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +{ + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + auto value = NumericAttributeTraits::kNullValue; + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), + ZCL_INT16U_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace NullableInt16u + +namespace NullableInt32u { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (NumericAttributeTraits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = temp; + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + auto value = NumericAttributeTraits::kNullValue; + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), + ZCL_INT32U_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace NullableInt32u + +namespace NullableInt64u { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (NumericAttributeTraits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = temp; + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) +{ + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + auto value = NumericAttributeTraits::kNullValue; + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), + ZCL_INT64U_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace NullableInt64u + +namespace NullableInt8s { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (NumericAttributeTraits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = temp; + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) +{ + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT8S_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + auto value = NumericAttributeTraits::kNullValue; + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), + ZCL_INT8S_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace NullableInt8s + +namespace NullableInt16s { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (NumericAttributeTraits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = temp; + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) +{ + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + auto value = NumericAttributeTraits::kNullValue; + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), + ZCL_INT16S_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace NullableInt16s + +namespace NullableInt32s { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (NumericAttributeTraits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = temp; + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) +{ + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT32S_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + auto value = NumericAttributeTraits::kNullValue; + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), + ZCL_INT32S_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace NullableInt32s + +namespace NullableInt64s { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (NumericAttributeTraits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = temp; + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) +{ + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT64S_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + auto value = NumericAttributeTraits::kNullValue; + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), + ZCL_INT64S_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace NullableInt64s + +namespace NullableEnum8 { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (NumericAttributeTraits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = temp; + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +{ + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + auto value = NumericAttributeTraits::kNullValue; + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), + ZCL_ENUM8_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace NullableEnum8 + +namespace NullableEnum16 { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (NumericAttributeTraits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = temp; + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +{ + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_ENUM16_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + auto value = NumericAttributeTraits::kNullValue; + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, reinterpret_cast(&value), + ZCL_ENUM16_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace NullableEnum16 + +namespace NullableOctetString { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + uint8_t zclString[10 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + value.SetNull(); + return EMBER_ZCL_STATUS_SUCCESS; + } + auto & span = value.SetNonNull(); + + VerifyOrReturnError(span.size() == 10, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + memcpy(span.data(), &zclString[1], 10); + span.reduce_size(length); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +{ + static_assert(10 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 10, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[10 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + uint8_t zclString[1] = { 0xFF }; + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace NullableOctetString + +namespace NullableCharString { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + uint8_t zclString[10 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + value.SetNull(); + return EMBER_ZCL_STATUS_SUCCESS; + } + auto & span = value.SetNonNull(); + + VerifyOrReturnError(span.size() == 10, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + memcpy(span.data(), &zclString[1], 10); + span.reduce_size(length); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + static_assert(10 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 10, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[10 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + uint8_t zclString[1] = { 0xFF }; + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace NullableCharString + +} // namespace Attributes +} // namespace TestCluster + +namespace ApplianceIdentification { +namespace Attributes { + +namespace CompanyName { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + uint8_t zclString[16 + 1]; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + memcpy(value.data(), &zclString[1], 16); + value.reduce_size(length); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, + ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace CompanyName + +namespace CompanyId { + +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +{ + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +{ + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) &value, + ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace CompanyId + +namespace BrandName { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + uint8_t zclString[16 + 1]; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + memcpy(value.data(), &zclString[1], 16); + value.reduce_size(length); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, + ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace BrandName + +namespace BrandId { + +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +{ + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +{ + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) &value, + ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace BrandId + +namespace Model { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) +{ + uint8_t zclString[16 + 1]; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + memcpy(value.data(), &zclString[1], 16); + value.reduce_size(length); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +{ + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, + ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +} // namespace Model + +namespace PartNumber { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) +{ + uint8_t zclString[16 + 1]; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + memcpy(value.data(), &zclString[1], 16); + value.reduce_size(length); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +{ + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, + ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +} // namespace PartNumber + +namespace ProductRevision { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) +{ + uint8_t zclString[6 + 1]; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 6, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 6); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) { + static_assert(6 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 6, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[6 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, + ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +} // namespace ProductRevision + +namespace SoftwareRevision { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) +{ + uint8_t zclString[6 + 1]; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 6, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + memcpy(value.data(), &zclString[1], 6); + value.reduce_size(length); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +{ + static_assert(6 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 6, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[6 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -11340,17 +21384,24 @@ namespace ProductTypeName { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) { - VerifyOrReturnError(value.size() == 2, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[2 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 2, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 2); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) { + static_assert(2 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 2, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[2 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -11365,10 +21416,23 @@ namespace ProductTypeId { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11379,10 +21443,23 @@ namespace CecedSpecificationVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -11399,17 +21476,24 @@ namespace CompanyName { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 16); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -11423,10 +21507,23 @@ namespace MeterTypeId { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11437,10 +21534,23 @@ namespace DataQualityId { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11451,17 +21561,24 @@ namespace CustomerName { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 16); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -11475,17 +21592,24 @@ namespace Model { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) { - VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 16); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) { + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -11499,17 +21623,24 @@ namespace PartNumber { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) { - VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 16); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) { + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -11523,17 +21654,24 @@ namespace ProductRevision { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) { - VerifyOrReturnError(value.size() == 6, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[6 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 6, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 6); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) { + static_assert(6 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 6, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[6 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -11547,17 +21685,24 @@ namespace SoftwareRevision { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) { - VerifyOrReturnError(value.size() == 6, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[6 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 6, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 6); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) { + static_assert(6 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 6, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[6 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -11571,17 +21716,24 @@ namespace UtilityName { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 16); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -11595,17 +21747,24 @@ namespace Pod { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) { - VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); memcpy(value.data(), &zclString[1], 16); - value.reduce_size(emberAfStringLength(zclString)); + value.reduce_size(length); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) { + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); uint8_t zclString[16 + 1]; emberAfCopyInt8u(zclString, 0, static_cast(value.size())); @@ -11625,10 +21784,23 @@ namespace LogMaxSize { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -11639,10 +21811,23 @@ namespace LogQueueMaxSize { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -11659,10 +21844,23 @@ namespace MeasurementType { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -11673,10 +21871,23 @@ namespace DcVoltage { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11687,10 +21898,23 @@ namespace DcVoltageMin { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11701,10 +21925,23 @@ namespace DcVoltageMax { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11715,10 +21952,23 @@ namespace DcCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11729,10 +21979,23 @@ namespace DcCurrentMin { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11743,10 +22006,23 @@ namespace DcCurrentMax { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11757,10 +22033,23 @@ namespace DcPower { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11771,10 +22060,23 @@ namespace DcPowerMin { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11785,10 +22087,23 @@ namespace DcPowerMax { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11799,10 +22114,23 @@ namespace DcVoltageMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11813,10 +22141,23 @@ namespace DcVoltageDivisor { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11827,10 +22168,23 @@ namespace DcCurrentMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11841,10 +22195,23 @@ namespace DcCurrentDivisor { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11855,10 +22222,23 @@ namespace DcPowerMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11869,10 +22249,23 @@ namespace DcPowerDivisor { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11883,10 +22276,23 @@ namespace AcFrequency { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11897,10 +22303,23 @@ namespace AcFrequencyMin { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11911,10 +22330,23 @@ namespace AcFrequencyMax { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11925,10 +22357,23 @@ namespace NeutralCurrent { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11939,10 +22384,23 @@ namespace TotalActivePower { EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT32S_ATTRIBUTE_TYPE); } @@ -11953,10 +22411,23 @@ namespace TotalReactivePower { EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT32S_ATTRIBUTE_TYPE); } @@ -11967,10 +22438,23 @@ namespace TotalApparentPower { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -11981,10 +22465,23 @@ namespace Measured1stHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11995,10 +22492,23 @@ namespace Measured3rdHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12009,10 +22519,23 @@ namespace Measured5thHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12023,10 +22546,23 @@ namespace Measured7thHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12037,10 +22573,23 @@ namespace Measured9thHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12051,10 +22600,23 @@ namespace Measured11thHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12065,10 +22627,23 @@ namespace MeasuredPhase1stHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12079,10 +22654,23 @@ namespace MeasuredPhase3rdHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12093,10 +22681,23 @@ namespace MeasuredPhase5thHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12107,10 +22708,23 @@ namespace MeasuredPhase7thHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12121,10 +22735,23 @@ namespace MeasuredPhase9thHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12135,10 +22762,23 @@ namespace MeasuredPhase11thHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12149,10 +22789,23 @@ namespace AcFrequencyMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12163,10 +22816,23 @@ namespace AcFrequencyDivisor { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12177,10 +22843,23 @@ namespace PowerMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -12191,10 +22870,23 @@ namespace PowerDivisor { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -12205,10 +22897,23 @@ namespace HarmonicCurrentMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT8S_ATTRIBUTE_TYPE); } @@ -12219,10 +22924,23 @@ namespace PhaseHarmonicCurrentMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT8S_ATTRIBUTE_TYPE); } @@ -12233,10 +22951,23 @@ namespace InstantaneousVoltage { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12247,10 +22978,23 @@ namespace InstantaneousLineCurrent { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12261,10 +23005,23 @@ namespace InstantaneousActiveCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12275,10 +23032,23 @@ namespace InstantaneousReactiveCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12289,10 +23059,23 @@ namespace InstantaneousPower { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12303,10 +23086,23 @@ namespace RmsVoltage { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12317,10 +23113,23 @@ namespace RmsVoltageMin { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12331,10 +23140,23 @@ namespace RmsVoltageMax { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12345,10 +23167,23 @@ namespace RmsCurrent { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12359,10 +23194,23 @@ namespace RmsCurrentMin { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12373,10 +23221,23 @@ namespace RmsCurrentMax { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12387,10 +23248,23 @@ namespace ActivePower { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12401,10 +23275,23 @@ namespace ActivePowerMin { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12415,10 +23302,23 @@ namespace ActivePowerMax { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12429,10 +23329,23 @@ namespace ReactivePower { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12443,10 +23356,23 @@ namespace ApparentPower { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12457,10 +23383,23 @@ namespace PowerFactor { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT8S_ATTRIBUTE_TYPE); } @@ -12471,10 +23410,23 @@ namespace AverageRmsVoltageMeasurementPeriod { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12485,10 +23437,23 @@ namespace AverageRmsUnderVoltageCounter { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12499,10 +23464,23 @@ namespace RmsExtremeOverVoltagePeriod { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12513,10 +23491,23 @@ namespace RmsExtremeUnderVoltagePeriod { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12527,10 +23518,23 @@ namespace RmsVoltageSagPeriod { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12541,10 +23545,23 @@ namespace RmsVoltageSwellPeriod { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12555,10 +23572,23 @@ namespace AcVoltageMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12569,10 +23599,23 @@ namespace AcVoltageDivisor { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12583,10 +23626,23 @@ namespace AcCurrentMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12597,10 +23653,23 @@ namespace AcCurrentDivisor { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12611,10 +23680,23 @@ namespace AcPowerMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12625,10 +23707,23 @@ namespace AcPowerDivisor { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12639,10 +23734,23 @@ namespace OverloadAlarmsMask { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -12653,10 +23761,23 @@ namespace VoltageOverload { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12667,10 +23788,23 @@ namespace CurrentOverload { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12681,10 +23815,23 @@ namespace AcOverloadAlarmsMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -12695,10 +23842,23 @@ namespace AcVoltageOverload { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12709,10 +23869,23 @@ namespace AcCurrentOverload { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12723,10 +23896,23 @@ namespace AcActivePowerOverload { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12737,10 +23923,23 @@ namespace AcReactivePowerOverload { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12751,10 +23950,23 @@ namespace AverageRmsOverVoltage { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12765,10 +23977,23 @@ namespace AverageRmsUnderVoltage { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12779,10 +24004,23 @@ namespace RmsExtremeOverVoltage { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12793,10 +24031,23 @@ namespace RmsExtremeUnderVoltage { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12807,10 +24058,23 @@ namespace RmsVoltageSag { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12821,10 +24085,23 @@ namespace RmsVoltageSwell { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12835,10 +24112,23 @@ namespace LineCurrentPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12849,10 +24139,23 @@ namespace ActiveCurrentPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12863,10 +24166,23 @@ namespace ReactiveCurrentPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12877,10 +24193,23 @@ namespace RmsVoltagePhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12891,10 +24220,23 @@ namespace RmsVoltageMinPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12905,10 +24247,23 @@ namespace RmsVoltageMaxPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12919,10 +24274,23 @@ namespace RmsCurrentPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12933,10 +24301,23 @@ namespace RmsCurrentMinPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12947,10 +24328,23 @@ namespace RmsCurrentMaxPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12961,10 +24355,23 @@ namespace ActivePowerPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12975,10 +24382,23 @@ namespace ActivePowerMinPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12989,10 +24409,23 @@ namespace ActivePowerMaxPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -13003,10 +24436,23 @@ namespace ReactivePowerPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -13017,10 +24463,23 @@ namespace ApparentPowerPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -13031,10 +24490,23 @@ namespace PowerFactorPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT8S_ATTRIBUTE_TYPE); } @@ -13045,10 +24517,23 @@ namespace AverageRmsVoltageMeasurementPeriodPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -13059,10 +24544,23 @@ namespace AverageRmsOverVoltageCounterPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -13073,10 +24571,23 @@ namespace AverageRmsUnderVoltageCounterPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -13087,10 +24598,23 @@ namespace RmsExtremeOverVoltagePeriodPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -13101,10 +24625,23 @@ namespace RmsExtremeUnderVoltagePeriodPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -13115,10 +24652,23 @@ namespace RmsVoltageSagPeriodPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -13129,10 +24679,23 @@ namespace RmsVoltageSwellPeriodPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -13143,10 +24706,23 @@ namespace LineCurrentPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -13157,10 +24733,23 @@ namespace ActiveCurrentPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -13171,10 +24760,23 @@ namespace ReactiveCurrentPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -13185,10 +24787,23 @@ namespace RmsVoltagePhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -13199,10 +24814,23 @@ namespace RmsVoltageMinPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -13213,10 +24841,23 @@ namespace RmsVoltageMaxPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -13227,10 +24868,23 @@ namespace RmsCurrentPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -13241,10 +24895,23 @@ namespace RmsCurrentMinPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -13255,10 +24922,23 @@ namespace RmsCurrentMaxPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -13269,10 +24949,23 @@ namespace ActivePowerPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -13283,10 +24976,23 @@ namespace ActivePowerMinPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -13297,10 +25003,23 @@ namespace ActivePowerMaxPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -13311,10 +25030,23 @@ namespace ReactivePowerPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -13325,10 +25057,23 @@ namespace ApparentPowerPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -13339,10 +25084,23 @@ namespace PowerFactorPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT8S_ATTRIBUTE_TYPE); } @@ -13353,10 +25111,23 @@ namespace AverageRmsVoltageMeasurementPeriodPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -13367,10 +25138,23 @@ namespace AverageRmsOverVoltageCounterPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -13381,10 +25165,23 @@ namespace AverageRmsUnderVoltageCounterPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -13395,10 +25192,23 @@ namespace RmsExtremeOverVoltagePeriodPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -13409,10 +25219,23 @@ namespace RmsExtremeUnderVoltagePeriodPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -13423,10 +25246,23 @@ namespace RmsVoltageSagPeriodPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -13437,10 +25273,23 @@ namespace RmsVoltageSwellPeriodPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -13463,10 +25312,23 @@ namespace EmberSampleAttribute { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -13477,10 +25339,23 @@ namespace EmberSampleAttribute2 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -13497,10 +25372,23 @@ namespace EmberSampleAttribute3 { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster2::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster2::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster2::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -13511,10 +25399,23 @@ namespace EmberSampleAttribute4 { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster2::Id, Id, (uint8_t *) value, sizeof(*value)); + NumericAttributeTraits::StorageType temp; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster2::Id, Id, + reinterpret_cast(&temp), sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; + } + *value = temp; + return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } return emberAfWriteServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster2::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 0130eb536d5adb..3d3e4f5b4bcc27 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -24,6 +24,7 @@ #pragma once +#include #include #include @@ -790,7 +791,7 @@ namespace BridgedActions { namespace Attributes { namespace SetupUrl { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // long_char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace SetupUrl @@ -866,7 +867,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace PartNumber namespace ProductURL { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // long_char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace ProductURL @@ -2902,18 +2903,24 @@ namespace IlluminanceMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int16u EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int16u EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int16u EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); } // namespace MaxMeasuredValue namespace Tolerance { @@ -2922,8 +2929,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Tolerance namespace LightSensorType { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // enum8 EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); } // namespace LightSensorType } // namespace Attributes @@ -4243,6 +4252,125 @@ EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace Unsupported +namespace NullableBoolean { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +} // namespace NullableBoolean + +namespace NullableBitmap8 { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +} // namespace NullableBitmap8 + +namespace NullableBitmap16 { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // bitmap16 +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +} // namespace NullableBitmap16 + +namespace NullableBitmap32 { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // bitmap32 +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +} // namespace NullableBitmap32 + +namespace NullableBitmap64 { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // bitmap64 +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +} // namespace NullableBitmap64 + +namespace NullableInt8u { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +} // namespace NullableInt8u + +namespace NullableInt16u { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +} // namespace NullableInt16u + +namespace NullableInt32u { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +} // namespace NullableInt32u + +namespace NullableInt64u { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int64u +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +} // namespace NullableInt64u + +namespace NullableInt8s { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int8s +EmberAfStatus Set(chip::EndpointId endpoint, int8_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +} // namespace NullableInt8s + +namespace NullableInt16s { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +} // namespace NullableInt16s + +namespace NullableInt32s { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int32s +EmberAfStatus Set(chip::EndpointId endpoint, int32_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +} // namespace NullableInt32s + +namespace NullableInt64s { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int64s +EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +} // namespace NullableInt64s + +namespace NullableEnum8 { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +} // namespace NullableEnum8 + +namespace NullableEnum16 { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // enum16 +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +} // namespace NullableEnum16 + +namespace NullableOctetString { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // octet_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +} // namespace NullableOctetString + +namespace NullableCharString { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +} // namespace NullableCharString + } // namespace Attributes } // namespace TestCluster diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 86de01e8024951..7827e2f86bdd36 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -28538,6 +28538,193 @@ struct TypeInfo static constexpr AttributeId GetAttributeId() { return Attributes::Unsupported::Id; } }; } // namespace Unsupported +namespace NullableBoolean { +struct TypeInfo +{ + using Type = DataModel::Nullable; + using DecodableType = DataModel::Nullable; + using DecodableArgType = const DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NullableBoolean::Id; } +}; +} // namespace NullableBoolean +namespace NullableBitmap8 { +struct TypeInfo +{ + using Type = DataModel::Nullable; + using DecodableType = DataModel::Nullable; + using DecodableArgType = const DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NullableBitmap8::Id; } +}; +} // namespace NullableBitmap8 +namespace NullableBitmap16 { +struct TypeInfo +{ + using Type = DataModel::Nullable; + using DecodableType = DataModel::Nullable; + using DecodableArgType = const DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NullableBitmap16::Id; } +}; +} // namespace NullableBitmap16 +namespace NullableBitmap32 { +struct TypeInfo +{ + using Type = DataModel::Nullable; + using DecodableType = DataModel::Nullable; + using DecodableArgType = const DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NullableBitmap32::Id; } +}; +} // namespace NullableBitmap32 +namespace NullableBitmap64 { +struct TypeInfo +{ + using Type = DataModel::Nullable; + using DecodableType = DataModel::Nullable; + using DecodableArgType = const DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NullableBitmap64::Id; } +}; +} // namespace NullableBitmap64 +namespace NullableInt8u { +struct TypeInfo +{ + using Type = DataModel::Nullable; + using DecodableType = DataModel::Nullable; + using DecodableArgType = const DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NullableInt8u::Id; } +}; +} // namespace NullableInt8u +namespace NullableInt16u { +struct TypeInfo +{ + using Type = DataModel::Nullable; + using DecodableType = DataModel::Nullable; + using DecodableArgType = const DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NullableInt16u::Id; } +}; +} // namespace NullableInt16u +namespace NullableInt32u { +struct TypeInfo +{ + using Type = DataModel::Nullable; + using DecodableType = DataModel::Nullable; + using DecodableArgType = const DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NullableInt32u::Id; } +}; +} // namespace NullableInt32u +namespace NullableInt64u { +struct TypeInfo +{ + using Type = DataModel::Nullable; + using DecodableType = DataModel::Nullable; + using DecodableArgType = const DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NullableInt64u::Id; } +}; +} // namespace NullableInt64u +namespace NullableInt8s { +struct TypeInfo +{ + using Type = DataModel::Nullable; + using DecodableType = DataModel::Nullable; + using DecodableArgType = const DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NullableInt8s::Id; } +}; +} // namespace NullableInt8s +namespace NullableInt16s { +struct TypeInfo +{ + using Type = DataModel::Nullable; + using DecodableType = DataModel::Nullable; + using DecodableArgType = const DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NullableInt16s::Id; } +}; +} // namespace NullableInt16s +namespace NullableInt32s { +struct TypeInfo +{ + using Type = DataModel::Nullable; + using DecodableType = DataModel::Nullable; + using DecodableArgType = const DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NullableInt32s::Id; } +}; +} // namespace NullableInt32s +namespace NullableInt64s { +struct TypeInfo +{ + using Type = DataModel::Nullable; + using DecodableType = DataModel::Nullable; + using DecodableArgType = const DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NullableInt64s::Id; } +}; +} // namespace NullableInt64s +namespace NullableEnum8 { +struct TypeInfo +{ + using Type = DataModel::Nullable; + using DecodableType = DataModel::Nullable; + using DecodableArgType = const DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NullableEnum8::Id; } +}; +} // namespace NullableEnum8 +namespace NullableEnum16 { +struct TypeInfo +{ + using Type = DataModel::Nullable; + using DecodableType = DataModel::Nullable; + using DecodableArgType = const DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NullableEnum16::Id; } +}; +} // namespace NullableEnum16 +namespace NullableOctetString { +struct TypeInfo +{ + using Type = DataModel::Nullable; + using DecodableType = DataModel::Nullable; + using DecodableArgType = const DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NullableOctetString::Id; } +}; +} // namespace NullableOctetString +namespace NullableCharString { +struct TypeInfo +{ + using Type = DataModel::Nullable; + using DecodableType = DataModel::Nullable; + using DecodableArgType = const DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NullableCharString::Id; } +}; +} // namespace NullableCharString namespace FeatureMap { struct TypeInfo { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index 3c6feef0adebe6..50cc4fd8a2df34 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -4516,6 +4516,74 @@ namespace Unsupported { static constexpr AttributeId Id = 0x000000FF; } // namespace Unsupported +namespace NullableBoolean { +static constexpr AttributeId Id = 0x00008000; +} // namespace NullableBoolean + +namespace NullableBitmap8 { +static constexpr AttributeId Id = 0x00008001; +} // namespace NullableBitmap8 + +namespace NullableBitmap16 { +static constexpr AttributeId Id = 0x00008002; +} // namespace NullableBitmap16 + +namespace NullableBitmap32 { +static constexpr AttributeId Id = 0x00008003; +} // namespace NullableBitmap32 + +namespace NullableBitmap64 { +static constexpr AttributeId Id = 0x00008004; +} // namespace NullableBitmap64 + +namespace NullableInt8u { +static constexpr AttributeId Id = 0x00008005; +} // namespace NullableInt8u + +namespace NullableInt16u { +static constexpr AttributeId Id = 0x00008006; +} // namespace NullableInt16u + +namespace NullableInt32u { +static constexpr AttributeId Id = 0x00008008; +} // namespace NullableInt32u + +namespace NullableInt64u { +static constexpr AttributeId Id = 0x0000800C; +} // namespace NullableInt64u + +namespace NullableInt8s { +static constexpr AttributeId Id = 0x0000800D; +} // namespace NullableInt8s + +namespace NullableInt16s { +static constexpr AttributeId Id = 0x0000800E; +} // namespace NullableInt16s + +namespace NullableInt32s { +static constexpr AttributeId Id = 0x00008010; +} // namespace NullableInt32s + +namespace NullableInt64s { +static constexpr AttributeId Id = 0x00008014; +} // namespace NullableInt64s + +namespace NullableEnum8 { +static constexpr AttributeId Id = 0x00008015; +} // namespace NullableEnum8 + +namespace NullableEnum16 { +static constexpr AttributeId Id = 0x00008016; +} // namespace NullableEnum16 + +namespace NullableOctetString { +static constexpr AttributeId Id = 0x00008019; +} // namespace NullableOctetString + +namespace NullableCharString { +static constexpr AttributeId Id = 0x0000801E; +} // namespace NullableCharString + namespace FeatureMap { static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; } // namespace FeatureMap diff --git a/zzz_generated/bridge-app/zap-generated/attribute-size.cpp b/zzz_generated/bridge-app/zap-generated/attribute-size.cpp index 07b040a2406610..29098e84ad5b3c 100644 --- a/zzz_generated/bridge-app/zap-generated/attribute-size.cpp +++ b/zzz_generated/bridge-app/zap-generated/attribute-size.cpp @@ -326,6 +326,44 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo } break; } + case 0x0034: // Software Diagnostics Cluster + { + uint16_t entryOffset = kSizeLengthInBytes; + switch (am->attributeId) + { + case 0x0000: // ThreadMetrics + { + entryLength = 30; + if (((index - 1) * entryLength) > (am->size - entryLength)) + { + ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); + return 0; + } + entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); + // Struct _ThreadMetrics + _ThreadMetrics * entry = reinterpret_cast<_ThreadMetrics *>(write ? src : dest); + copyListMember(write ? dest : (uint8_t *) &entry->Id, write ? (uint8_t *) &entry->Id : src, write, &entryOffset, + sizeof(entry->Id)); // INT64U + ByteSpan NameSpanStorage(Uint8::from_const_char(entry->Name.data()), entry->Name.size()); // CHAR_STRING + ByteSpan * NameSpan = &NameSpanStorage; + if (CHIP_NO_ERROR != + (write ? WriteByteSpan(dest + entryOffset, 10, NameSpan) : ReadByteSpan(src + entryOffset, 10, NameSpan))) + { + ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); + return 0; + } + entryOffset = static_cast(entryOffset + 10); + copyListMember(write ? dest : (uint8_t *) &entry->StackFreeCurrent, write ? (uint8_t *) &entry->StackFreeCurrent : src, + write, &entryOffset, sizeof(entry->StackFreeCurrent)); // INT32U + copyListMember(write ? dest : (uint8_t *) &entry->StackFreeMinimum, write ? (uint8_t *) &entry->StackFreeMinimum : src, + write, &entryOffset, sizeof(entry->StackFreeMinimum)); // INT32U + copyListMember(write ? dest : (uint8_t *) &entry->StackSize, write ? (uint8_t *) &entry->StackSize : src, write, + &entryOffset, sizeof(entry->StackSize)); // INT32U + break; + } + } + break; + } case 0x0035: // Thread Network Diagnostics Cluster { uint16_t entryOffset = kSizeLengthInBytes; @@ -561,6 +599,15 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut break; } break; + case 0x0034: // Software Diagnostics Cluster + switch (attributeId) + { + case 0x0000: // ThreadMetrics + // Struct _ThreadMetrics + entryLength = 30; + break; + } + break; case 0x0035: // Thread Network Diagnostics Cluster switch (attributeId) { diff --git a/zzz_generated/bridge-app/zap-generated/endpoint_config.h b/zzz_generated/bridge-app/zap-generated/endpoint_config.h index 6700280de3bf89..242c588af35e88 100644 --- a/zzz_generated/bridge-app/zap-generated/endpoint_config.h +++ b/zzz_generated/bridge-app/zap-generated/endpoint_config.h @@ -695,7 +695,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 155 +#define GENERATED_ATTRIBUTE_COUNT 156 #define GENERATED_ATTRIBUTES \ { \ \ @@ -742,8 +742,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(510) }, /* CurrentHeapFree */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(518) }, /* CurrentHeapUsed */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ThreadMetrics */ \ + { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(510) }, /* CurrentHeapFree */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(518) }, /* CurrentHeapUsed */ \ { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(526) }, /* CurrentHeapHighWatermark */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ @@ -934,43 +935,43 @@ 0x0033, ZAP_ATTRIBUTE_INDEX(21), 6, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { \ - 0x0034, ZAP_ATTRIBUTE_INDEX(27), 4, 26, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0034, ZAP_ATTRIBUTE_INDEX(27), 5, 26, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(31), 64, 774, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0035, ZAP_ATTRIBUTE_INDEX(32), 64, 774, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { \ - 0x0036, ZAP_ATTRIBUTE_INDEX(95), 14, 54, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0036, ZAP_ATTRIBUTE_INDEX(96), 14, 54, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ { \ - 0x0037, ZAP_ATTRIBUTE_INDEX(109), 10, 53, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0037, ZAP_ATTRIBUTE_INDEX(110), 10, 53, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { \ - 0x003C, ZAP_ATTRIBUTE_INDEX(119), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003C, ZAP_ATTRIBUTE_INDEX(120), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { \ - 0x003E, ZAP_ATTRIBUTE_INDEX(120), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003E, ZAP_ATTRIBUTE_INDEX(121), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(126), \ + ZAP_ATTRIBUTE_INDEX(127), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ { 0x0008, \ - ZAP_ATTRIBUTE_INDEX(128), \ + ZAP_ATTRIBUTE_INDEX(129), \ 15, \ 23, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(143), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(144), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ { \ - 0x003B, ZAP_ATTRIBUTE_INDEX(148), 5, 9, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003B, ZAP_ATTRIBUTE_INDEX(149), 5, 9, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Switch (server) */ \ { \ - 0x0040, ZAP_ATTRIBUTE_INDEX(153), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0040, ZAP_ATTRIBUTE_INDEX(154), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Fixed Label (server) */ \ } diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index dd3f54bf834010..0aafb45048cf77 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -2415,6 +2415,17 @@ static void OnPowerSourceActiveBatteryFaultsListAttributeResponse(void * context command->SetCommandExitStatus(err); } +static void OnSoftwareDiagnosticsThreadMetricsListAttributeResponse( + void * context, + const chip::app::DataModel::DecodableList & + list) +{ + CHIP_ERROR err = LogValue("OnSoftwareDiagnosticsThreadMetricsListAttributeResponse", 0, list); + + ModelCommand * command = static_cast(context); + command->SetCommandExitStatus(err); +} + static void OnTvChannelTvChannelListListAttributeResponse( void * context, const chip::app::DataModel::DecodableList & list) @@ -20573,6 +20584,7 @@ class ReadScenesClusterRevision : public ModelCommand | * ResetWatermarks | 0x00 | |------------------------------------------------------------------------------| | Attributes: | | +| * ThreadMetrics | 0x0000 | | * CurrentHeapFree | 0x0001 | | * CurrentHeapUsed | 0x0002 | | * CurrentHeapHighWatermark | 0x0003 | @@ -20598,6 +20610,41 @@ class SoftwareDiagnosticsResetWatermarks : public ModelCommand chip::app::Clusters::SoftwareDiagnostics::Commands::ResetWatermarks::Type mRequest; }; +/* + * Attribute ThreadMetrics + */ +class ReadSoftwareDiagnosticsThreadMetrics : public ModelCommand +{ +public: + ReadSoftwareDiagnosticsThreadMetrics() : ModelCommand("read") + { + AddArgument("attr-name", "thread-metrics"); + ModelCommand::AddArguments(); + } + + ~ReadSoftwareDiagnosticsThreadMetrics() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0034) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::SoftwareDiagnosticsCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeThreadMetrics(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback( + OnSoftwareDiagnosticsThreadMetricsListAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + /* * Attribute CurrentHeapFree */ @@ -21628,6 +21675,23 @@ class ReadTemperatureMeasurementClusterRevision : public ModelCommand | * VendorId | 0x0022 | | * ListNullablesAndOptionalsStruct | 0x0023 | | * Unsupported | 0x00FF | +| * NullableBoolean | 0x8000 | +| * NullableBitmap8 | 0x8001 | +| * NullableBitmap16 | 0x8002 | +| * NullableBitmap32 | 0x8003 | +| * NullableBitmap64 | 0x8004 | +| * NullableInt8u | 0x8005 | +| * NullableInt16u | 0x8006 | +| * NullableInt32u | 0x8008 | +| * NullableInt64u | 0x800C | +| * NullableInt8s | 0x800D | +| * NullableInt16s | 0x800E | +| * NullableInt32s | 0x8010 | +| * NullableInt64s | 0x8014 | +| * NullableEnum8 | 0x8015 | +| * NullableEnum16 | 0x8016 | +| * NullableOctetString | 0x8019 | +| * NullableCharString | 0x801E | | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ @@ -23558,6 +23622,1145 @@ class WriteTestClusterUnsupported : public ModelCommand bool mValue; }; +/* + * Attribute NullableBoolean + */ +class ReadTestClusterNullableBoolean : public ModelCommand +{ +public: + ReadTestClusterNullableBoolean() : ModelCommand("read") + { + AddArgument("attr-name", "nullable-boolean"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterNullableBoolean() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeNullableBoolean(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnBooleanAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterNullableBoolean : public ModelCommand +{ +public: + WriteTestClusterNullableBoolean() : ModelCommand("write") + { + AddArgument("attr-name", "nullable-boolean"); + AddArgument("attr-value", 0, 1, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterNullableBoolean() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeNullableBoolean(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + bool mValue; +}; + +/* + * Attribute NullableBitmap8 + */ +class ReadTestClusterNullableBitmap8 : public ModelCommand +{ +public: + ReadTestClusterNullableBitmap8() : ModelCommand("read") + { + AddArgument("attr-name", "nullable-bitmap8"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterNullableBitmap8() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeNullableBitmap8(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt8uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterNullableBitmap8 : public ModelCommand +{ +public: + WriteTestClusterNullableBitmap8() : ModelCommand("write") + { + AddArgument("attr-name", "nullable-bitmap8"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterNullableBitmap8() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeNullableBitmap8(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint8_t mValue; +}; + +/* + * Attribute NullableBitmap16 + */ +class ReadTestClusterNullableBitmap16 : public ModelCommand +{ +public: + ReadTestClusterNullableBitmap16() : ModelCommand("read") + { + AddArgument("attr-name", "nullable-bitmap16"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterNullableBitmap16() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeNullableBitmap16(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt16uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterNullableBitmap16 : public ModelCommand +{ +public: + WriteTestClusterNullableBitmap16() : ModelCommand("write") + { + AddArgument("attr-name", "nullable-bitmap16"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterNullableBitmap16() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeNullableBitmap16(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint16_t mValue; +}; + +/* + * Attribute NullableBitmap32 + */ +class ReadTestClusterNullableBitmap32 : public ModelCommand +{ +public: + ReadTestClusterNullableBitmap32() : ModelCommand("read") + { + AddArgument("attr-name", "nullable-bitmap32"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterNullableBitmap32() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeNullableBitmap32(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt32uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterNullableBitmap32 : public ModelCommand +{ +public: + WriteTestClusterNullableBitmap32() : ModelCommand("write") + { + AddArgument("attr-name", "nullable-bitmap32"); + AddArgument("attr-value", 0, UINT32_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterNullableBitmap32() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeNullableBitmap32(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint32_t mValue; +}; + +/* + * Attribute NullableBitmap64 + */ +class ReadTestClusterNullableBitmap64 : public ModelCommand +{ +public: + ReadTestClusterNullableBitmap64() : ModelCommand("read") + { + AddArgument("attr-name", "nullable-bitmap64"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterNullableBitmap64() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeNullableBitmap64(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt64uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterNullableBitmap64 : public ModelCommand +{ +public: + WriteTestClusterNullableBitmap64() : ModelCommand("write") + { + AddArgument("attr-name", "nullable-bitmap64"); + AddArgument("attr-value", 0, UINT64_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterNullableBitmap64() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeNullableBitmap64(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint64_t mValue; +}; + +/* + * Attribute NullableInt8u + */ +class ReadTestClusterNullableInt8u : public ModelCommand +{ +public: + ReadTestClusterNullableInt8u() : ModelCommand("read") + { + AddArgument("attr-name", "nullable-int8u"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterNullableInt8u() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeNullableInt8u(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt8uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterNullableInt8u : public ModelCommand +{ +public: + WriteTestClusterNullableInt8u() : ModelCommand("write") + { + AddArgument("attr-name", "nullable-int8u"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterNullableInt8u() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeNullableInt8u(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint8_t mValue; +}; + +/* + * Attribute NullableInt16u + */ +class ReadTestClusterNullableInt16u : public ModelCommand +{ +public: + ReadTestClusterNullableInt16u() : ModelCommand("read") + { + AddArgument("attr-name", "nullable-int16u"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterNullableInt16u() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeNullableInt16u(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt16uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterNullableInt16u : public ModelCommand +{ +public: + WriteTestClusterNullableInt16u() : ModelCommand("write") + { + AddArgument("attr-name", "nullable-int16u"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterNullableInt16u() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeNullableInt16u(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint16_t mValue; +}; + +/* + * Attribute NullableInt32u + */ +class ReadTestClusterNullableInt32u : public ModelCommand +{ +public: + ReadTestClusterNullableInt32u() : ModelCommand("read") + { + AddArgument("attr-name", "nullable-int32u"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterNullableInt32u() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeNullableInt32u(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt32uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterNullableInt32u : public ModelCommand +{ +public: + WriteTestClusterNullableInt32u() : ModelCommand("write") + { + AddArgument("attr-name", "nullable-int32u"); + AddArgument("attr-value", 0, UINT32_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterNullableInt32u() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeNullableInt32u(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint32_t mValue; +}; + +/* + * Attribute NullableInt64u + */ +class ReadTestClusterNullableInt64u : public ModelCommand +{ +public: + ReadTestClusterNullableInt64u() : ModelCommand("read") + { + AddArgument("attr-name", "nullable-int64u"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterNullableInt64u() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeNullableInt64u(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt64uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterNullableInt64u : public ModelCommand +{ +public: + WriteTestClusterNullableInt64u() : ModelCommand("write") + { + AddArgument("attr-name", "nullable-int64u"); + AddArgument("attr-value", 0, UINT64_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterNullableInt64u() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeNullableInt64u(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint64_t mValue; +}; + +/* + * Attribute NullableInt8s + */ +class ReadTestClusterNullableInt8s : public ModelCommand +{ +public: + ReadTestClusterNullableInt8s() : ModelCommand("read") + { + AddArgument("attr-name", "nullable-int8s"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterNullableInt8s() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeNullableInt8s(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt8sAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterNullableInt8s : public ModelCommand +{ +public: + WriteTestClusterNullableInt8s() : ModelCommand("write") + { + AddArgument("attr-name", "nullable-int8s"); + AddArgument("attr-value", INT8_MIN, INT8_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterNullableInt8s() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeNullableInt8s(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + int8_t mValue; +}; + +/* + * Attribute NullableInt16s + */ +class ReadTestClusterNullableInt16s : public ModelCommand +{ +public: + ReadTestClusterNullableInt16s() : ModelCommand("read") + { + AddArgument("attr-name", "nullable-int16s"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterNullableInt16s() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeNullableInt16s(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt16sAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterNullableInt16s : public ModelCommand +{ +public: + WriteTestClusterNullableInt16s() : ModelCommand("write") + { + AddArgument("attr-name", "nullable-int16s"); + AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterNullableInt16s() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeNullableInt16s(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + int16_t mValue; +}; + +/* + * Attribute NullableInt32s + */ +class ReadTestClusterNullableInt32s : public ModelCommand +{ +public: + ReadTestClusterNullableInt32s() : ModelCommand("read") + { + AddArgument("attr-name", "nullable-int32s"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterNullableInt32s() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeNullableInt32s(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt32sAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterNullableInt32s : public ModelCommand +{ +public: + WriteTestClusterNullableInt32s() : ModelCommand("write") + { + AddArgument("attr-name", "nullable-int32s"); + AddArgument("attr-value", INT32_MIN, INT32_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterNullableInt32s() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeNullableInt32s(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + int32_t mValue; +}; + +/* + * Attribute NullableInt64s + */ +class ReadTestClusterNullableInt64s : public ModelCommand +{ +public: + ReadTestClusterNullableInt64s() : ModelCommand("read") + { + AddArgument("attr-name", "nullable-int64s"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterNullableInt64s() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeNullableInt64s(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt64sAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterNullableInt64s : public ModelCommand +{ +public: + WriteTestClusterNullableInt64s() : ModelCommand("write") + { + AddArgument("attr-name", "nullable-int64s"); + AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterNullableInt64s() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeNullableInt64s(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + int64_t mValue; +}; + +/* + * Attribute NullableEnum8 + */ +class ReadTestClusterNullableEnum8 : public ModelCommand +{ +public: + ReadTestClusterNullableEnum8() : ModelCommand("read") + { + AddArgument("attr-name", "nullable-enum8"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterNullableEnum8() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeNullableEnum8(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt8uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterNullableEnum8 : public ModelCommand +{ +public: + WriteTestClusterNullableEnum8() : ModelCommand("write") + { + AddArgument("attr-name", "nullable-enum8"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterNullableEnum8() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeNullableEnum8(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint8_t mValue; +}; + +/* + * Attribute NullableEnum16 + */ +class ReadTestClusterNullableEnum16 : public ModelCommand +{ +public: + ReadTestClusterNullableEnum16() : ModelCommand("read") + { + AddArgument("attr-name", "nullable-enum16"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterNullableEnum16() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeNullableEnum16(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt16uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterNullableEnum16 : public ModelCommand +{ +public: + WriteTestClusterNullableEnum16() : ModelCommand("write") + { + AddArgument("attr-name", "nullable-enum16"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterNullableEnum16() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeNullableEnum16(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint16_t mValue; +}; + +/* + * Attribute NullableOctetString + */ +class ReadTestClusterNullableOctetString : public ModelCommand +{ +public: + ReadTestClusterNullableOctetString() : ModelCommand("read") + { + AddArgument("attr-name", "nullable-octet-string"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterNullableOctetString() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeNullableOctetString(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnOctetStringAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterNullableOctetString : public ModelCommand +{ +public: + WriteTestClusterNullableOctetString() : ModelCommand("write") + { + AddArgument("attr-name", "nullable-octet-string"); + AddArgument("attr-value", &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterNullableOctetString() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeNullableOctetString(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + chip::ByteSpan mValue; +}; + +/* + * Attribute NullableCharString + */ +class ReadTestClusterNullableCharString : public ModelCommand +{ +public: + ReadTestClusterNullableCharString() : ModelCommand("read") + { + AddArgument("attr-name", "nullable-char-string"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterNullableCharString() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeNullableCharString(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnCharStringAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterNullableCharString : public ModelCommand +{ +public: + WriteTestClusterNullableCharString() : ModelCommand("write") + { + AddArgument("attr-name", "nullable-char-string"); + AddArgument("attr-value", &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterNullableCharString() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeNullableCharString(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + chip::CharSpan mValue; +}; + /* * Attribute ClusterRevision */ @@ -30085,6 +31288,7 @@ void registerClusterSoftwareDiagnostics(Commands & commands) commands_list clusterCommands = { make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -30218,6 +31422,40 @@ void registerClusterTestCluster(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // }; diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 8ff802472670a1..2f8cfdc51b53eb 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -111,8 +111,9 @@ class Test_TC_BI_1_1 : public TestCommand CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -128,8 +129,9 @@ class Test_TC_BI_1_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t clusterRevisionArgument; clusterRevisionArgument = 1U; @@ -144,8 +146,9 @@ class Test_TC_BI_1_1 : public TestCommand CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2); @@ -357,8 +360,9 @@ class Test_TC_BI_2_1 : public TestCommand CHIP_ERROR TestReadMandatoryNonGlobalAttributeOutOfService_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -374,8 +378,9 @@ class Test_TC_BI_2_1 : public TestCommand CHIP_ERROR TestReadMandatoryNonGlobalAttributeConstraintsOutOfService_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_1, OnFailureCallback_1); @@ -391,8 +396,9 @@ class Test_TC_BI_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryNonGlobalAttributeOutOfService_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); bool outOfServiceArgument; outOfServiceArgument = 0; @@ -407,8 +413,9 @@ class Test_TC_BI_2_1 : public TestCommand CHIP_ERROR TestReadsBackTheMandatoryNonGlobalAttributeOutOfService_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_3, OnFailureCallback_3); @@ -424,8 +431,9 @@ class Test_TC_BI_2_1 : public TestCommand CHIP_ERROR TestReadMandatoryNonGlobalAttributeConstraintsPresentValue_4() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_4, OnFailureCallback_4); @@ -441,8 +449,9 @@ class Test_TC_BI_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryNonGlobalAttributePresentValue_5() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); bool presentValueArgument; presentValueArgument = 0; @@ -457,8 +466,9 @@ class Test_TC_BI_2_1 : public TestCommand CHIP_ERROR TestReadsBackTheMandatoryNonGlobalAttributePresentValue_6() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_6, OnFailureCallback_6); @@ -474,8 +484,9 @@ class Test_TC_BI_2_1 : public TestCommand CHIP_ERROR TestReadMandatoryNonGlobalAttributeStatusFlags_7() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_7, OnFailureCallback_7); @@ -491,8 +502,9 @@ class Test_TC_BI_2_1 : public TestCommand CHIP_ERROR TestReadMandatoryNonGlobalAttributeConstraintsStatusFlags_8() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_8, OnFailureCallback_8); @@ -509,8 +521,9 @@ class Test_TC_BI_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryNonGlobalAttributeStatusFlags_9() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t statusFlagsArgument; statusFlagsArgument = 0; @@ -525,8 +538,9 @@ class Test_TC_BI_2_1 : public TestCommand CHIP_ERROR TestReadsBackTheMandatoryNonGlobalAttributeStatusFlags_10() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_10, OnFailureCallback_10); @@ -702,8 +716,9 @@ class Test_TC_BI_2_2 : public TestCommand CHIP_ERROR TestReadsPresentValueAttributeFromDut_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -719,8 +734,9 @@ class Test_TC_BI_2_2 : public TestCommand CHIP_ERROR TestReadsOutOfServiceAttributeFromDut_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_1, OnFailureCallback_1); @@ -736,8 +752,9 @@ class Test_TC_BI_2_2 : public TestCommand CHIP_ERROR TestReadsStatusFlagsAttributeFromDut_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2); @@ -753,8 +770,9 @@ class Test_TC_BI_2_2 : public TestCommand CHIP_ERROR TestReadsPresentValueAttributeFromDut_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_3, OnFailureCallback_3); @@ -770,8 +788,9 @@ class Test_TC_BI_2_2 : public TestCommand CHIP_ERROR TestReadsOutOfServiceAttributeFromDut_4() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_4, OnFailureCallback_4); @@ -787,8 +806,9 @@ class Test_TC_BI_2_2 : public TestCommand CHIP_ERROR TestReadsStatusFlagsAttributeFromDut_5() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_5, OnFailureCallback_5); @@ -804,8 +824,9 @@ class Test_TC_BI_2_2 : public TestCommand CHIP_ERROR TestReadsStatusFlagsAttributeFromDut_6() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_6, OnFailureCallback_6); @@ -821,8 +842,9 @@ class Test_TC_BI_2_2 : public TestCommand CHIP_ERROR TestReadsStatusFlagsAttributeFromDut_7() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BinaryInputBasicClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_7, OnFailureCallback_7); @@ -926,8 +948,9 @@ class Test_TC_BOOL_1_1 : public TestCommand CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BooleanStateClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -943,8 +966,9 @@ class Test_TC_BOOL_1_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BooleanStateClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t clusterRevisionArgument; clusterRevisionArgument = 1U; @@ -959,8 +983,9 @@ class Test_TC_BOOL_1_1 : public TestCommand CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BooleanStateClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2); @@ -1078,8 +1103,9 @@ class Test_TC_BOOL_2_1 : public TestCommand CHIP_ERROR TestReadMandatoryNonGlobalAttributeStateValue_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BooleanStateClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_0, OnFailureCallback_0); @@ -1095,8 +1121,9 @@ class Test_TC_BOOL_2_1 : public TestCommand CHIP_ERROR TestReadMandatoryNonGlobalAttributeConstraintsStateValue_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BooleanStateClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -1112,8 +1139,9 @@ class Test_TC_BOOL_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValueToMandatoryNonGlobalAttributeStateValue_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BooleanStateClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); bool stateValueArgument; stateValueArgument = 1; @@ -1128,8 +1156,9 @@ class Test_TC_BOOL_2_1 : public TestCommand CHIP_ERROR TestReadsBackTheMandatoryNonGlobalAttributeStateValue_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BooleanStateClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_3, OnFailureCallback_3); @@ -1205,8 +1234,9 @@ class Test_TC_CC_1_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t clusterRevisionArgument; clusterRevisionArgument = 4U; @@ -3191,8 +3221,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadsMandatoryAttributeCurrentHue_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_0, OnFailureCallback_0); @@ -3208,8 +3239,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestValidateConstraintsOfAttributeCurrentHue_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -3226,8 +3258,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValueToMandatoryAttributeCurrentHue_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t currentHueArgument; currentHueArgument = 0; @@ -3242,8 +3275,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadsBackMandatoryAttributeCurrentHue_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_3, OnFailureCallback_3); @@ -3259,8 +3293,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadsMandatoryAttributeCurrentSaturation_4() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_4, OnFailureCallback_4); @@ -3276,8 +3311,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestValidateConstraintsOfAttributeCurrentSaturation_5() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_5, OnFailureCallback_5); @@ -3294,8 +3330,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValueToMandatoryAttributeCurrentSaturation_6() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t currentSaturationArgument; currentSaturationArgument = 0; @@ -3310,8 +3347,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadsBackMandatoryAttributeCurrentSaturation_7() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_7, OnFailureCallback_7); @@ -3327,8 +3365,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeCurrentX_8() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_8, OnFailureCallback_8); @@ -3344,8 +3383,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestValidateConstraintsOfAttributeCurrentX_9() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_9, OnFailureCallback_9); @@ -3362,8 +3402,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValueToMandatoryAttributeCurrentX_10() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t currentXArgument; currentXArgument = 24939U; @@ -3378,8 +3419,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadsBackMandatoryAttributeCurrentX_11() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_11, OnFailureCallback_11); @@ -3395,8 +3437,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeCurrentY_12() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_12, OnFailureCallback_12); @@ -3412,8 +3455,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestValidateConstraintsOfAttributeCurrentY_13() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_13, OnFailureCallback_13); @@ -3430,8 +3474,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeCurrentY_14() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t currentYArgument; currentYArgument = 24701U; @@ -3446,8 +3491,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadsBackMandatoryAttributeCurrentY_15() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_15, OnFailureCallback_15); @@ -3463,8 +3509,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestValidateConstraintsOfAttributeColorTemperatureMireds_16() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_16, OnFailureCallback_16); @@ -3481,8 +3528,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestValidateConstraintsOfAttributeColorMode_17() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_17, OnFailureCallback_17); @@ -3499,8 +3547,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeOptions_18() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_18, OnFailureCallback_18); @@ -3516,8 +3565,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestValidateConstraintsOfAttributeOptions_19() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_19, OnFailureCallback_19); @@ -3533,8 +3583,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeOptions_20() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t colorControlOptionsArgument; colorControlOptionsArgument = 0; @@ -3549,8 +3600,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadsBackMandatoryAttributeOptions_21() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_21, OnFailureCallback_21); @@ -3566,8 +3618,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeEnhancedCurrentHue_22() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_22, OnFailureCallback_22); @@ -3583,8 +3636,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestValidateConstraintsOfAttributeEnhancedCurrentHue_23() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_23, OnFailureCallback_23); @@ -3600,8 +3654,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeEnhancedCurrentHue_24() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t enhancedCurrentHueArgument; enhancedCurrentHueArgument = 0U; @@ -3616,8 +3671,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadsBackMandatoryAttributeEnhancedCurrentHue_25() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_25, OnFailureCallback_25); @@ -3633,8 +3689,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestValidateConstraintsOfAttributeEnhancedColorMode_26() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_26, OnFailureCallback_26); @@ -3650,8 +3707,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeColorLoopActive_27() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_27, OnFailureCallback_27); @@ -3667,8 +3725,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopActive_28() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_28, OnFailureCallback_28); @@ -3684,8 +3743,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorLoopActive_29() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t colorLoopActiveArgument; colorLoopActiveArgument = 0; @@ -3700,8 +3760,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadsBackMandatoryAttributeColorLoopActive_30() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_30, OnFailureCallback_30); @@ -3717,8 +3778,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeColorLoopDirection_31() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_31, OnFailureCallback_31); @@ -3734,8 +3796,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopDirection_32() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_32, OnFailureCallback_32); @@ -3751,8 +3814,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorLoopDirection_33() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t colorLoopDirectionArgument; colorLoopDirectionArgument = 0; @@ -3767,8 +3831,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadsBackMandatoryAttributeColorLoopDirection_34() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_34, OnFailureCallback_34); @@ -3784,8 +3849,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeColorLoopTime_35() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_35, OnFailureCallback_35); @@ -3801,8 +3867,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopTime_36() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_36, OnFailureCallback_36); @@ -3818,8 +3885,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorLoopTime_37() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t colorLoopTimeArgument; colorLoopTimeArgument = 25U; @@ -3834,8 +3902,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadsBackMandatoryAttributeColorLoopTime_38() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_38, OnFailureCallback_38); @@ -3851,8 +3920,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeColorLoopStartEnhancedHue_39() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_39, OnFailureCallback_39); @@ -3868,8 +3938,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopStartEnhancedHue_40() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_40, OnFailureCallback_40); @@ -3885,8 +3956,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorLoopStartEnhancedHue_41() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t colorLoopStartEnhancedHueArgument; colorLoopStartEnhancedHueArgument = 8960U; @@ -3901,8 +3973,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadsBackMandatoryAttributeColorLoopStartEnhancedHue_42() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_42, OnFailureCallback_42); @@ -3918,8 +3991,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeColorLoopStoredEnhancedHue_43() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_43, OnFailureCallback_43); @@ -3935,8 +4009,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopStoredEnhancedHue_44() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_44, OnFailureCallback_44); @@ -3952,8 +4027,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorLoopStoredEnhancedHue_45() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t colorLoopStoredEnhancedHueArgument; colorLoopStoredEnhancedHueArgument = 0U; @@ -3968,8 +4044,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadsBackMandatoryAttributeColorLoopStoredEnhancedHue_46() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_46, OnFailureCallback_46); @@ -3985,8 +4062,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeColorCapabilities_47() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_47, OnFailureCallback_47); @@ -4002,8 +4080,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestValidateConstraintsOfAttributeColorCapabilities_48() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_48, OnFailureCallback_48); @@ -4020,8 +4099,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorCapabilities_49() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t colorCapabilitiesArgument; colorCapabilitiesArgument = 0U; @@ -4036,8 +4116,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadsBackMandatoryAttributeColorCapabilities_50() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_50, OnFailureCallback_50); @@ -4053,8 +4134,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeColorTempPhysicalMinMireds_51() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_51, OnFailureCallback_51); @@ -4070,8 +4152,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestValidateConstraintsOfAttributeColorTempPhysicalMinMireds_52() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_52, OnFailureCallback_52); @@ -4088,8 +4171,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorTempPhysicalMinMireds_53() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t colorTempPhysicalMinArgument; colorTempPhysicalMinArgument = 0U; @@ -4104,8 +4188,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadsBackMandatoryAttributeColorTempPhysicalMinMireds_54() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_54, OnFailureCallback_54); @@ -4121,8 +4206,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeColorTempPhysicalMaxMireds_55() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_55, OnFailureCallback_55); @@ -4138,8 +4224,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestValidateConstraintsOfAttributeColorTempPhysicalMaxMireds_56() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_56, OnFailureCallback_56); @@ -4156,8 +4243,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeColorTempPhysicalMaxMireds_57() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t colorTempPhysicalMaxArgument; colorTempPhysicalMaxArgument = 65279U; @@ -4172,8 +4260,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadsBackMandatoryAttributeColorTempPhysicalMaxMireds_58() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_58, OnFailureCallback_58); @@ -4189,8 +4278,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheOptionalAttributeCoupleColorTempToLevelMinMireds_59() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_59, OnFailureCallback_59); @@ -4206,8 +4296,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToOptionalAttributeCoupleColorTempToLevelMinMireds_60() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t coupleColorTempToLevelMinMiredsArgument; coupleColorTempToLevelMinMiredsArgument = 0U; @@ -4222,8 +4313,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadsBackOptionalAttributeCoupleColorTempToLevelMinMireds_61() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_61, OnFailureCallback_61); @@ -4239,8 +4331,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheOptionalAttributeStartUpColorTemperatureMireds_62() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_62, OnFailureCallback_62); @@ -4257,8 +4350,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToOptionalAttributeStartUpColorTemperatureMireds_63() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t startUpColorTemperatureMiredsArgument; startUpColorTemperatureMiredsArgument = 0U; @@ -4273,8 +4367,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadsBackOptionalAttributeStartUpColorTemperatureMireds_64() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_64, OnFailureCallback_64); @@ -4290,8 +4385,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheOptionalAttributeRemainingTime_65() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_65, OnFailureCallback_65); @@ -4307,8 +4403,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestValidateConstraintsOfAttributeRemainingTime_66() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_66, OnFailureCallback_66); @@ -4325,8 +4422,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToOptionalAttributeRemainingTime_67() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t remainingTimeArgument; remainingTimeArgument = 0U; @@ -4341,8 +4439,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadsBackOptionalAttributeRemainingTime_68() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_68, OnFailureCallback_68); @@ -4358,8 +4457,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheOptionalAttributeDriftCompensation_69() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_69, OnFailureCallback_69); @@ -4376,8 +4476,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToOptionalAttributeDriftCompensation_70() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t driftCompensationArgument; driftCompensationArgument = static_cast(0); @@ -4392,8 +4493,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadsBackOptionalAttributeDriftCompensation_71() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_71, OnFailureCallback_71); @@ -4409,8 +4511,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheOptionalAttributeCompensationText_72() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_72, OnFailureCallback_72); @@ -4427,8 +4530,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeNumberOfPrimaries_73() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_73, OnFailureCallback_73); @@ -4445,8 +4549,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultMandatoryAttributeNumberOfPrimaries_74() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t numberOfPrimariesArgument; numberOfPrimariesArgument = 0; @@ -4461,8 +4566,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadBackTheMandatoryAttributeNumberOfPrimaries_75() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_75, OnFailureCallback_75); @@ -4478,8 +4584,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributePrimary1X_76() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_76, OnFailureCallback_76); @@ -4496,8 +4603,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary1X_77() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t primary1XArgument; primary1XArgument = 0U; @@ -4512,8 +4620,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadBackTheMandatoryAttributePrimary1X_78() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_78, OnFailureCallback_78); @@ -4529,8 +4638,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributePrimary1Y_79() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_79, OnFailureCallback_79); @@ -4547,8 +4657,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary1Y_80() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t primary1YArgument; primary1YArgument = 0U; @@ -4563,8 +4674,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadBackTheMandatoryAttributePrimary1Y_81() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_81, OnFailureCallback_81); @@ -4580,8 +4692,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributePrimary1Intensity_82() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_82, OnFailureCallback_82); @@ -4597,8 +4710,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributePrimary2X_83() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_83, OnFailureCallback_83); @@ -4615,8 +4729,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary2X_84() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t primary2XArgument; primary2XArgument = 0U; @@ -4631,8 +4746,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadBackTheMandatoryAttributePrimary2X_85() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_85, OnFailureCallback_85); @@ -4648,8 +4764,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributePrimary2Y_86() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_86, OnFailureCallback_86); @@ -4666,8 +4783,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary2Y_87() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t primary2YArgument; primary2YArgument = 0U; @@ -4682,8 +4800,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadBackTheMandatoryAttributePrimary2Y_88() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_88, OnFailureCallback_88); @@ -4699,8 +4818,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestValidateConstraintsOfAttributePrimary2Intensity_89() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_89, OnFailureCallback_89); @@ -4716,8 +4836,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributePrimary3X_90() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_90, OnFailureCallback_90); @@ -4734,8 +4855,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary3X_91() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t primary3XArgument; primary3XArgument = 0U; @@ -4750,8 +4872,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadBackTheMandatoryAttributePrimary3X_92() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_92, OnFailureCallback_92); @@ -4767,8 +4890,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributePrimary3Y_93() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_93, OnFailureCallback_93); @@ -4785,8 +4909,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary3Y_94() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t primary3YArgument; primary3YArgument = 0U; @@ -4801,8 +4926,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadBackTheMandatoryAttributePrimary3Y_95() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_95, OnFailureCallback_95); @@ -4818,8 +4944,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributePrimary3Intensity_96() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_96, OnFailureCallback_96); @@ -4835,8 +4962,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributePrimary4X_97() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_97, OnFailureCallback_97); @@ -4853,8 +4981,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary4X_98() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t primary4XArgument; primary4XArgument = 0U; @@ -4869,8 +4998,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadBackTheMandatoryAttributePrimary4X_99() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_99, OnFailureCallback_99); @@ -4886,8 +5016,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributePrimary4Y_100() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_100, OnFailureCallback_100); @@ -4904,8 +5035,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary4Y_101() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t primary4YArgument; primary4YArgument = 0U; @@ -4920,8 +5052,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadBackTheMandatoryAttributePrimary4Y_102() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_102, OnFailureCallback_102); @@ -4937,8 +5070,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributePrimary4Intensity_103() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_103, OnFailureCallback_103); @@ -4954,8 +5088,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributePrimary5X_104() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_104, OnFailureCallback_104); @@ -4972,8 +5107,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary5X_105() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t primary5XArgument; primary5XArgument = 0U; @@ -4988,8 +5124,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadBackTheMandatoryAttributePrimary5X_106() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_106, OnFailureCallback_106); @@ -5005,8 +5142,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributePrimary5Y_107() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_107, OnFailureCallback_107); @@ -5023,8 +5161,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary5Y_108() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t primary5YArgument; primary5YArgument = 0U; @@ -5039,8 +5178,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadBackTheMandatoryAttributePrimary5Y_109() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_109, OnFailureCallback_109); @@ -5056,8 +5196,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributePrimary5Intensity_110() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_110, OnFailureCallback_110); @@ -5073,8 +5214,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributePrimary6X_111() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_111, OnFailureCallback_111); @@ -5091,8 +5233,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary6X_112() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t primary6XArgument; primary6XArgument = 0U; @@ -5107,8 +5250,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadBackTheMandatoryAttributePrimary6X_113() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_113, OnFailureCallback_113); @@ -5124,8 +5268,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributePrimary6Y_114() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_114, OnFailureCallback_114); @@ -5142,8 +5287,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultMandatoryAttributePrimary6Y_115() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t primary6YArgument; primary6YArgument = 0U; @@ -5158,8 +5304,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadBackTheMandatoryAttributePrimary6Y_116() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_116, OnFailureCallback_116); @@ -5175,8 +5322,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributePrimary6Intensity_117() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_117, OnFailureCallback_117); @@ -5192,8 +5340,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheOptionalAttributeWhitePointX_118() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_118, OnFailureCallback_118); @@ -5210,8 +5359,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultOptionalAttributeWhitePointX_119() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t whitePointXArgument; whitePointXArgument = 0U; @@ -5226,8 +5376,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadBackTheOptionalAttributeWhitePointX_120() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_120, OnFailureCallback_120); @@ -5243,8 +5394,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheOptionalAttributeWhitePointY_121() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_121, OnFailureCallback_121); @@ -5261,8 +5413,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultOptionalAttributeWhitePointY_122() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t whitePointYArgument; whitePointYArgument = 0U; @@ -5277,8 +5430,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadBackTheOptionalAttributeWhitePointY_123() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_123, OnFailureCallback_123); @@ -5294,8 +5448,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheOptionalAttributeColorPointRX_124() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_124, OnFailureCallback_124); @@ -5312,8 +5467,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointRX_125() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t colorPointRXArgument; colorPointRXArgument = 0U; @@ -5328,8 +5484,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadBackTheOptionalAttributeColorPointRX_126() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_126, OnFailureCallback_126); @@ -5345,8 +5502,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheOptionalAttributeColorPointRY_127() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_127, OnFailureCallback_127); @@ -5363,8 +5521,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointRY_128() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t colorPointRYArgument; colorPointRYArgument = 0U; @@ -5379,8 +5538,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadBackTheOptionalAttributeColorPointRY_129() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_129, OnFailureCallback_129); @@ -5396,8 +5556,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheOptionalAttributeColorPointRIntensity_130() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_130, OnFailureCallback_130); @@ -5413,8 +5574,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheOptionalAttributeColorPointGX_131() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_131, OnFailureCallback_131); @@ -5431,8 +5593,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointGX_132() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t colorPointGXArgument; colorPointGXArgument = 0U; @@ -5447,8 +5610,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadBackTheOptionalAttributeColorPointGX_133() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_133, OnFailureCallback_133); @@ -5464,8 +5628,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheOptionalAttributeColorPointGY_134() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_134, OnFailureCallback_134); @@ -5482,8 +5647,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointGY_135() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t colorPointGYArgument; colorPointGYArgument = 0U; @@ -5498,8 +5664,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadBackTheOptionalAttributeColorPointGY_136() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_136, OnFailureCallback_136); @@ -5515,8 +5682,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheOptionalAttributeColorPointGIntensity_137() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_137, OnFailureCallback_137); @@ -5532,8 +5700,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheOptionalAttributeColorPointBX_138() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_138, OnFailureCallback_138); @@ -5550,8 +5719,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointBX_139() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t colorPointBXArgument; colorPointBXArgument = 0U; @@ -5566,8 +5736,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadBackTheOptionalAttributeColorPointBX_140() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_140, OnFailureCallback_140); @@ -5583,8 +5754,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheOptionalAttributeColorPointBY_141() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_141, OnFailureCallback_141); @@ -5601,8 +5773,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultOptionalAttributeColorPointBY_142() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t colorPointBYArgument; colorPointBYArgument = 0U; @@ -5617,8 +5790,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadBackTheOptionalAttributeColorPointBY_143() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_143, OnFailureCallback_143); @@ -5634,8 +5808,9 @@ class Test_TC_CC_2_1 : public TestCommand CHIP_ERROR TestReadTheOptionalAttributeColorPointBIntensity_144() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_144, OnFailureCallback_144); @@ -5751,7 +5926,8 @@ class Test_TC_CC_3_1 : public TestCommand CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -5763,7 +5939,7 @@ class Test_TC_CC_3_1 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -5773,8 +5949,9 @@ class Test_TC_CC_3_1 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -5790,7 +5967,8 @@ class Test_TC_CC_3_1 : public TestCommand CHIP_ERROR TestMoveToHueShortestDistanceCommand_2() { - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveToHue::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::MoveToHue::Type; RequestType request; request.hue = 150; @@ -5807,7 +5985,7 @@ class Test_TC_CC_3_1 : public TestCommand (static_cast(context))->OnFailureResponse_2(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -5817,7 +5995,8 @@ class Test_TC_CC_3_1 : public TestCommand CHIP_ERROR TestMoveToHueLongestDistanceCommand_3() { - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveToHue::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::MoveToHue::Type; RequestType request; request.hue = 200; @@ -5834,7 +6013,7 @@ class Test_TC_CC_3_1 : public TestCommand (static_cast(context))->OnFailureResponse_3(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -5844,7 +6023,8 @@ class Test_TC_CC_3_1 : public TestCommand CHIP_ERROR TestMoveToHueUpCommand_4() { - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveToHue::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::MoveToHue::Type; RequestType request; request.hue = 250; @@ -5861,7 +6041,7 @@ class Test_TC_CC_3_1 : public TestCommand (static_cast(context))->OnFailureResponse_4(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -5871,7 +6051,8 @@ class Test_TC_CC_3_1 : public TestCommand CHIP_ERROR TestMoveToHueDownCommand_5() { - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveToHue::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::MoveToHue::Type; RequestType request; request.hue = 225; @@ -5888,7 +6069,7 @@ class Test_TC_CC_3_1 : public TestCommand (static_cast(context))->OnFailureResponse_5(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -5898,7 +6079,8 @@ class Test_TC_CC_3_1 : public TestCommand CHIP_ERROR TestTurnOffLightThatWeTurnedOn_6() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -5910,7 +6092,7 @@ class Test_TC_CC_3_1 : public TestCommand (static_cast(context))->OnFailureResponse_6(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -5920,8 +6102,9 @@ class Test_TC_CC_3_1 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_7() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_7, OnFailureCallback_7); @@ -6037,7 +6220,8 @@ class Test_TC_CC_3_2 : public TestCommand CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -6049,7 +6233,7 @@ class Test_TC_CC_3_2 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -6059,8 +6243,9 @@ class Test_TC_CC_3_2 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -6076,7 +6261,8 @@ class Test_TC_CC_3_2 : public TestCommand CHIP_ERROR TestMoveHueUpCommand_2() { - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveHue::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::MoveHue::Type; RequestType request; request.moveMode = static_cast(1); @@ -6092,7 +6278,7 @@ class Test_TC_CC_3_2 : public TestCommand (static_cast(context))->OnFailureResponse_2(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -6102,7 +6288,8 @@ class Test_TC_CC_3_2 : public TestCommand CHIP_ERROR TestMoveHueStopCommand_3() { - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveHue::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::MoveHue::Type; RequestType request; request.moveMode = static_cast(0); @@ -6118,7 +6305,7 @@ class Test_TC_CC_3_2 : public TestCommand (static_cast(context))->OnFailureResponse_3(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -6128,7 +6315,8 @@ class Test_TC_CC_3_2 : public TestCommand CHIP_ERROR TestMoveHueDownCommand_4() { - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveHue::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::MoveHue::Type; RequestType request; request.moveMode = static_cast(3); @@ -6144,7 +6332,7 @@ class Test_TC_CC_3_2 : public TestCommand (static_cast(context))->OnFailureResponse_4(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -6154,7 +6342,8 @@ class Test_TC_CC_3_2 : public TestCommand CHIP_ERROR TestMoveHueStopCommand_5() { - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveHue::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::MoveHue::Type; RequestType request; request.moveMode = static_cast(0); @@ -6170,7 +6359,7 @@ class Test_TC_CC_3_2 : public TestCommand (static_cast(context))->OnFailureResponse_5(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -6180,7 +6369,8 @@ class Test_TC_CC_3_2 : public TestCommand CHIP_ERROR TestTurnOffLightThatWeTurnedOn_6() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -6192,7 +6382,7 @@ class Test_TC_CC_3_2 : public TestCommand (static_cast(context))->OnFailureResponse_6(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -6202,8 +6392,9 @@ class Test_TC_CC_3_2 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_7() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_7, OnFailureCallback_7); @@ -6311,7 +6502,8 @@ class Test_TC_CC_3_3 : public TestCommand CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -6323,7 +6515,7 @@ class Test_TC_CC_3_3 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -6333,8 +6525,9 @@ class Test_TC_CC_3_3 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -6350,7 +6543,8 @@ class Test_TC_CC_3_3 : public TestCommand CHIP_ERROR TestStepHueUpCommand_2() { - using RequestType = chip::app::Clusters::ColorControl::Commands::StepHue::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::StepHue::Type; RequestType request; request.stepMode = static_cast(1); @@ -6367,7 +6561,7 @@ class Test_TC_CC_3_3 : public TestCommand (static_cast(context))->OnFailureResponse_2(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -6377,7 +6571,8 @@ class Test_TC_CC_3_3 : public TestCommand CHIP_ERROR TestStepHueDownCommand_3() { - using RequestType = chip::app::Clusters::ColorControl::Commands::StepHue::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::StepHue::Type; RequestType request; request.stepMode = static_cast(3); @@ -6394,7 +6589,7 @@ class Test_TC_CC_3_3 : public TestCommand (static_cast(context))->OnFailureResponse_3(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -6404,7 +6599,8 @@ class Test_TC_CC_3_3 : public TestCommand CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -6416,7 +6612,7 @@ class Test_TC_CC_3_3 : public TestCommand (static_cast(context))->OnFailureResponse_4(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -6426,8 +6622,9 @@ class Test_TC_CC_3_3 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_5, OnFailureCallback_5); @@ -6531,7 +6728,8 @@ class Test_TC_CC_4_1 : public TestCommand CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -6543,7 +6741,7 @@ class Test_TC_CC_4_1 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -6553,8 +6751,9 @@ class Test_TC_CC_4_1 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -6570,7 +6769,8 @@ class Test_TC_CC_4_1 : public TestCommand CHIP_ERROR TestMoveToSaturationCommand_2() { - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveToSaturation::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::MoveToSaturation::Type; RequestType request; request.saturation = 90; @@ -6586,7 +6786,7 @@ class Test_TC_CC_4_1 : public TestCommand (static_cast(context))->OnFailureResponse_2(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -6596,7 +6796,8 @@ class Test_TC_CC_4_1 : public TestCommand CHIP_ERROR TestTurnOffLightThatWeTurnedOn_3() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -6608,7 +6809,7 @@ class Test_TC_CC_4_1 : public TestCommand (static_cast(context))->OnFailureResponse_3(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -6618,8 +6819,9 @@ class Test_TC_CC_4_1 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_4, OnFailureCallback_4); @@ -6727,7 +6929,8 @@ class Test_TC_CC_4_2 : public TestCommand CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -6739,7 +6942,7 @@ class Test_TC_CC_4_2 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -6749,8 +6952,9 @@ class Test_TC_CC_4_2 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -6766,7 +6970,8 @@ class Test_TC_CC_4_2 : public TestCommand CHIP_ERROR TestMoveSaturationUpCommand_2() { - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type; RequestType request; request.moveMode = static_cast(1); @@ -6782,7 +6987,7 @@ class Test_TC_CC_4_2 : public TestCommand (static_cast(context))->OnFailureResponse_2(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -6792,7 +6997,8 @@ class Test_TC_CC_4_2 : public TestCommand CHIP_ERROR TestMoveSaturationDownCommand_3() { - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type; RequestType request; request.moveMode = static_cast(3); @@ -6808,7 +7014,7 @@ class Test_TC_CC_4_2 : public TestCommand (static_cast(context))->OnFailureResponse_3(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -6818,7 +7024,8 @@ class Test_TC_CC_4_2 : public TestCommand CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -6830,7 +7037,7 @@ class Test_TC_CC_4_2 : public TestCommand (static_cast(context))->OnFailureResponse_4(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -6840,8 +7047,9 @@ class Test_TC_CC_4_2 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_5, OnFailureCallback_5); @@ -6949,7 +7157,8 @@ class Test_TC_CC_4_3 : public TestCommand CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -6961,7 +7170,7 @@ class Test_TC_CC_4_3 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -6971,8 +7180,9 @@ class Test_TC_CC_4_3 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -6988,7 +7198,8 @@ class Test_TC_CC_4_3 : public TestCommand CHIP_ERROR TestStepSaturationUpCommand_2() { - using RequestType = chip::app::Clusters::ColorControl::Commands::StepSaturation::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::StepSaturation::Type; RequestType request; request.stepMode = static_cast(1); @@ -7005,7 +7216,7 @@ class Test_TC_CC_4_3 : public TestCommand (static_cast(context))->OnFailureResponse_2(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -7015,7 +7226,8 @@ class Test_TC_CC_4_3 : public TestCommand CHIP_ERROR TestStepSaturationDownCommand_3() { - using RequestType = chip::app::Clusters::ColorControl::Commands::StepSaturation::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::StepSaturation::Type; RequestType request; request.stepMode = static_cast(3); @@ -7032,7 +7244,7 @@ class Test_TC_CC_4_3 : public TestCommand (static_cast(context))->OnFailureResponse_3(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -7042,7 +7254,8 @@ class Test_TC_CC_4_3 : public TestCommand CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -7054,7 +7267,7 @@ class Test_TC_CC_4_3 : public TestCommand (static_cast(context))->OnFailureResponse_4(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -7064,8 +7277,9 @@ class Test_TC_CC_4_3 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_5, OnFailureCallback_5); @@ -7169,7 +7383,8 @@ class Test_TC_CC_4_4 : public TestCommand CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -7181,7 +7396,7 @@ class Test_TC_CC_4_4 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -7191,8 +7406,9 @@ class Test_TC_CC_4_4 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -7208,7 +7424,8 @@ class Test_TC_CC_4_4 : public TestCommand CHIP_ERROR TestMoveToCurrentHueAndSaturationCommand_2() { - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveToHueAndSaturation::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::MoveToHueAndSaturation::Type; RequestType request; request.hue = 40; @@ -7225,7 +7442,7 @@ class Test_TC_CC_4_4 : public TestCommand (static_cast(context))->OnFailureResponse_2(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -7235,7 +7452,8 @@ class Test_TC_CC_4_4 : public TestCommand CHIP_ERROR TestTurnOffLightThatWeTurnedOn_3() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -7247,7 +7465,7 @@ class Test_TC_CC_4_4 : public TestCommand (static_cast(context))->OnFailureResponse_3(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -7257,8 +7475,9 @@ class Test_TC_CC_4_4 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_4, OnFailureCallback_4); @@ -7362,7 +7581,8 @@ class Test_TC_CC_5_1 : public TestCommand CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -7374,7 +7594,7 @@ class Test_TC_CC_5_1 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -7384,8 +7604,9 @@ class Test_TC_CC_5_1 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -7401,7 +7622,8 @@ class Test_TC_CC_5_1 : public TestCommand CHIP_ERROR TestMoveToColorCommand_2() { - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveToColor::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::MoveToColor::Type; RequestType request; request.colorX = 200U; @@ -7418,7 +7640,7 @@ class Test_TC_CC_5_1 : public TestCommand (static_cast(context))->OnFailureResponse_2(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -7428,7 +7650,8 @@ class Test_TC_CC_5_1 : public TestCommand CHIP_ERROR TestTurnOffLightThatWeTurnedOn_3() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -7440,7 +7663,7 @@ class Test_TC_CC_5_1 : public TestCommand (static_cast(context))->OnFailureResponse_3(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -7450,8 +7673,9 @@ class Test_TC_CC_5_1 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_4, OnFailureCallback_4); @@ -7559,7 +7783,8 @@ class Test_TC_CC_5_2 : public TestCommand CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -7571,7 +7796,7 @@ class Test_TC_CC_5_2 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -7581,8 +7806,9 @@ class Test_TC_CC_5_2 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -7598,7 +7824,8 @@ class Test_TC_CC_5_2 : public TestCommand CHIP_ERROR TestMoveColorCommand_2() { - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveColor::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::MoveColor::Type; RequestType request; request.rateX = 15; @@ -7614,7 +7841,7 @@ class Test_TC_CC_5_2 : public TestCommand (static_cast(context))->OnFailureResponse_2(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -7624,7 +7851,8 @@ class Test_TC_CC_5_2 : public TestCommand CHIP_ERROR TestStopMoveStepCommand_3() { - using RequestType = chip::app::Clusters::ColorControl::Commands::StopMoveStep::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::StopMoveStep::Type; RequestType request; request.optionsMask = 0; @@ -7638,7 +7866,7 @@ class Test_TC_CC_5_2 : public TestCommand (static_cast(context))->OnFailureResponse_3(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -7648,7 +7876,8 @@ class Test_TC_CC_5_2 : public TestCommand CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -7660,7 +7889,7 @@ class Test_TC_CC_5_2 : public TestCommand (static_cast(context))->OnFailureResponse_4(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -7670,8 +7899,9 @@ class Test_TC_CC_5_2 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_5, OnFailureCallback_5); @@ -7775,7 +8005,8 @@ class Test_TC_CC_5_3 : public TestCommand CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -7787,7 +8018,7 @@ class Test_TC_CC_5_3 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -7797,8 +8028,9 @@ class Test_TC_CC_5_3 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -7814,7 +8046,8 @@ class Test_TC_CC_5_3 : public TestCommand CHIP_ERROR TestStepColorCommand_2() { - using RequestType = chip::app::Clusters::ColorControl::Commands::StepColor::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::StepColor::Type; RequestType request; request.stepX = 15; @@ -7831,7 +8064,7 @@ class Test_TC_CC_5_3 : public TestCommand (static_cast(context))->OnFailureResponse_2(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -7841,7 +8074,8 @@ class Test_TC_CC_5_3 : public TestCommand CHIP_ERROR TestTurnOffLightThatWeTurnedOn_3() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -7853,7 +8087,7 @@ class Test_TC_CC_5_3 : public TestCommand (static_cast(context))->OnFailureResponse_3(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -7863,8 +8097,9 @@ class Test_TC_CC_5_3 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_4, OnFailureCallback_4); @@ -7968,7 +8203,8 @@ class Test_TC_CC_6_1 : public TestCommand CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -7980,7 +8216,7 @@ class Test_TC_CC_6_1 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -7990,8 +8226,9 @@ class Test_TC_CC_6_1 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -8007,7 +8244,8 @@ class Test_TC_CC_6_1 : public TestCommand CHIP_ERROR TestMoveToColorTemperatureCommand_2() { - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveToColorTemperature::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::MoveToColorTemperature::Type; RequestType request; request.colorTemperature = 100U; @@ -8023,7 +8261,7 @@ class Test_TC_CC_6_1 : public TestCommand (static_cast(context))->OnFailureResponse_2(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -8033,7 +8271,8 @@ class Test_TC_CC_6_1 : public TestCommand CHIP_ERROR TestTurnOffLightThatWeTurnedOn_3() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -8045,7 +8284,7 @@ class Test_TC_CC_6_1 : public TestCommand (static_cast(context))->OnFailureResponse_3(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -8055,8 +8294,9 @@ class Test_TC_CC_6_1 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_4, OnFailureCallback_4); @@ -8168,7 +8408,8 @@ class Test_TC_CC_6_2 : public TestCommand CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -8180,7 +8421,7 @@ class Test_TC_CC_6_2 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -8190,8 +8431,9 @@ class Test_TC_CC_6_2 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -8207,7 +8449,8 @@ class Test_TC_CC_6_2 : public TestCommand CHIP_ERROR TestMoveUpColorTemperatureCommand_2() { - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type; RequestType request; request.moveMode = static_cast(1); @@ -8225,7 +8468,7 @@ class Test_TC_CC_6_2 : public TestCommand (static_cast(context))->OnFailureResponse_2(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -8235,7 +8478,8 @@ class Test_TC_CC_6_2 : public TestCommand CHIP_ERROR TestStopColorTemperatureCommand_3() { - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type; RequestType request; request.moveMode = static_cast(0); @@ -8253,7 +8497,7 @@ class Test_TC_CC_6_2 : public TestCommand (static_cast(context))->OnFailureResponse_3(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -8263,7 +8507,8 @@ class Test_TC_CC_6_2 : public TestCommand CHIP_ERROR TestMoveDownColorTemperatureCommand_4() { - using RequestType = chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type; RequestType request; request.moveMode = static_cast(3); @@ -8281,7 +8526,7 @@ class Test_TC_CC_6_2 : public TestCommand (static_cast(context))->OnFailureResponse_4(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -8291,7 +8536,8 @@ class Test_TC_CC_6_2 : public TestCommand CHIP_ERROR TestTurnOffLightThatWeTurnedOn_5() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -8303,7 +8549,7 @@ class Test_TC_CC_6_2 : public TestCommand (static_cast(context))->OnFailureResponse_5(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -8313,8 +8559,9 @@ class Test_TC_CC_6_2 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_6, OnFailureCallback_6); @@ -8422,7 +8669,8 @@ class Test_TC_CC_6_3 : public TestCommand CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -8434,7 +8682,7 @@ class Test_TC_CC_6_3 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -8444,8 +8692,9 @@ class Test_TC_CC_6_3 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -8461,7 +8710,8 @@ class Test_TC_CC_6_3 : public TestCommand CHIP_ERROR TestStepUpColorTemperatureCommand_2() { - using RequestType = chip::app::Clusters::ColorControl::Commands::StepColorTemperature::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::StepColorTemperature::Type; RequestType request; request.stepMode = static_cast(1); @@ -8480,7 +8730,7 @@ class Test_TC_CC_6_3 : public TestCommand (static_cast(context))->OnFailureResponse_2(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -8490,7 +8740,8 @@ class Test_TC_CC_6_3 : public TestCommand CHIP_ERROR TestStepDownColorTemperatureCommand_3() { - using RequestType = chip::app::Clusters::ColorControl::Commands::StepColorTemperature::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::StepColorTemperature::Type; RequestType request; request.stepMode = static_cast(3); @@ -8509,7 +8760,7 @@ class Test_TC_CC_6_3 : public TestCommand (static_cast(context))->OnFailureResponse_3(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -8519,7 +8770,8 @@ class Test_TC_CC_6_3 : public TestCommand CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -8531,7 +8783,7 @@ class Test_TC_CC_6_3 : public TestCommand (static_cast(context))->OnFailureResponse_4(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -8541,8 +8793,9 @@ class Test_TC_CC_6_3 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_5, OnFailureCallback_5); @@ -8661,7 +8914,8 @@ class Test_TC_CC_7_1 : public TestCommand CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -8673,7 +8927,7 @@ class Test_TC_CC_7_1 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -8683,8 +8937,9 @@ class Test_TC_CC_7_1 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -8700,7 +8955,8 @@ class Test_TC_CC_7_1 : public TestCommand CHIP_ERROR TestEnhancedMoveToHueCommand_2() { - using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type; RequestType request; request.enhancedHue = 1025U; @@ -8717,7 +8973,7 @@ class Test_TC_CC_7_1 : public TestCommand (static_cast(context))->OnFailureResponse_2(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -8727,8 +8983,9 @@ class Test_TC_CC_7_1 : public TestCommand CHIP_ERROR TestCheckRemainingTimeAttributeValueMatchedTheValueSentByTheLastCommand_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_3, OnFailureCallback_3); @@ -8744,7 +9001,8 @@ class Test_TC_CC_7_1 : public TestCommand CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -8756,7 +9014,7 @@ class Test_TC_CC_7_1 : public TestCommand (static_cast(context))->OnFailureResponse_4(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -8766,8 +9024,9 @@ class Test_TC_CC_7_1 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_5, OnFailureCallback_5); @@ -8883,7 +9142,8 @@ class Test_TC_CC_7_2 : public TestCommand CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -8895,7 +9155,7 @@ class Test_TC_CC_7_2 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -8905,8 +9165,9 @@ class Test_TC_CC_7_2 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -8922,7 +9183,8 @@ class Test_TC_CC_7_2 : public TestCommand CHIP_ERROR TestEnhancedMoveHueDownCommand_2() { - using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type; RequestType request; request.moveMode = static_cast(3); @@ -8938,7 +9200,7 @@ class Test_TC_CC_7_2 : public TestCommand (static_cast(context))->OnFailureResponse_2(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -8948,7 +9210,8 @@ class Test_TC_CC_7_2 : public TestCommand CHIP_ERROR TestEnhancedMoveHueStopCommand_3() { - using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type; RequestType request; request.moveMode = static_cast(0); @@ -8964,7 +9227,7 @@ class Test_TC_CC_7_2 : public TestCommand (static_cast(context))->OnFailureResponse_3(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -8974,7 +9237,8 @@ class Test_TC_CC_7_2 : public TestCommand CHIP_ERROR TestEnhancedMoveHueUpCommand_4() { - using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type; RequestType request; request.moveMode = static_cast(1); @@ -8990,7 +9254,7 @@ class Test_TC_CC_7_2 : public TestCommand (static_cast(context))->OnFailureResponse_4(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -9000,7 +9264,8 @@ class Test_TC_CC_7_2 : public TestCommand CHIP_ERROR TestEnhancedMoveHueStopCommand_5() { - using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type; RequestType request; request.moveMode = static_cast(0); @@ -9016,7 +9281,7 @@ class Test_TC_CC_7_2 : public TestCommand (static_cast(context))->OnFailureResponse_5(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -9026,7 +9291,8 @@ class Test_TC_CC_7_2 : public TestCommand CHIP_ERROR TestTurnOffLightThatWeTurnedOn_6() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -9038,7 +9304,7 @@ class Test_TC_CC_7_2 : public TestCommand (static_cast(context))->OnFailureResponse_6(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -9048,8 +9314,9 @@ class Test_TC_CC_7_2 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_7() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_7, OnFailureCallback_7); @@ -9157,7 +9424,8 @@ class Test_TC_CC_7_3 : public TestCommand CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -9169,7 +9437,7 @@ class Test_TC_CC_7_3 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -9179,8 +9447,9 @@ class Test_TC_CC_7_3 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -9196,7 +9465,8 @@ class Test_TC_CC_7_3 : public TestCommand CHIP_ERROR TestEnhancedStepHueUpCommand_2() { - using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedStepHue::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedStepHue::Type; RequestType request; request.stepMode = static_cast(0); @@ -9213,7 +9483,7 @@ class Test_TC_CC_7_3 : public TestCommand (static_cast(context))->OnFailureResponse_2(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -9223,7 +9493,8 @@ class Test_TC_CC_7_3 : public TestCommand CHIP_ERROR TestEnhancedStepHueDownCommand_3() { - using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedStepHue::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedStepHue::Type; RequestType request; request.stepMode = static_cast(1); @@ -9240,7 +9511,7 @@ class Test_TC_CC_7_3 : public TestCommand (static_cast(context))->OnFailureResponse_3(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -9250,7 +9521,8 @@ class Test_TC_CC_7_3 : public TestCommand CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -9262,7 +9534,7 @@ class Test_TC_CC_7_3 : public TestCommand (static_cast(context))->OnFailureResponse_4(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -9272,8 +9544,9 @@ class Test_TC_CC_7_3 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_5, OnFailureCallback_5); @@ -9377,7 +9650,8 @@ class Test_TC_CC_7_4 : public TestCommand CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -9389,7 +9663,7 @@ class Test_TC_CC_7_4 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -9399,8 +9673,9 @@ class Test_TC_CC_7_4 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -9416,7 +9691,8 @@ class Test_TC_CC_7_4 : public TestCommand CHIP_ERROR TestEnhancedMoveToHueAndSaturationCommand_2() { - using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHueAndSaturation::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHueAndSaturation::Type; RequestType request; request.enhancedHue = 1200U; @@ -9433,7 +9709,7 @@ class Test_TC_CC_7_4 : public TestCommand (static_cast(context))->OnFailureResponse_2(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -9443,7 +9719,8 @@ class Test_TC_CC_7_4 : public TestCommand CHIP_ERROR TestTurnOffLightThatWeTurnedOn_3() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -9455,7 +9732,7 @@ class Test_TC_CC_7_4 : public TestCommand (static_cast(context))->OnFailureResponse_3(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -9465,8 +9742,9 @@ class Test_TC_CC_7_4 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_4() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_4, OnFailureCallback_4); @@ -9694,7 +9972,8 @@ class Test_TC_CC_8_1 : public TestCommand CHIP_ERROR TestTurnOnLightForColorControlTests_0() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -9706,7 +9985,7 @@ class Test_TC_CC_8_1 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -9716,8 +9995,9 @@ class Test_TC_CC_8_1 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -9733,7 +10013,8 @@ class Test_TC_CC_8_1 : public TestCommand CHIP_ERROR TestColorLoopSetCommandSetAllAttributs_2() { - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; RequestType request; request.updateFlags = static_cast>(14); @@ -9752,7 +10033,7 @@ class Test_TC_CC_8_1 : public TestCommand (static_cast(context))->OnFailureResponse_2(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -9762,8 +10043,9 @@ class Test_TC_CC_8_1 : public TestCommand CHIP_ERROR TestCheckColorLoopDirectionValue_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_3, OnFailureCallback_3); @@ -9779,8 +10061,9 @@ class Test_TC_CC_8_1 : public TestCommand CHIP_ERROR TestCheckColorLoopTimeValue_4() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_4, OnFailureCallback_4); @@ -9796,8 +10079,9 @@ class Test_TC_CC_8_1 : public TestCommand CHIP_ERROR TestCheckColorLoopStartEnhancedHueValue_5() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_5, OnFailureCallback_5); @@ -9813,8 +10097,9 @@ class Test_TC_CC_8_1 : public TestCommand CHIP_ERROR TestCheckColorLoopActiveValue_6() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_6, OnFailureCallback_6); @@ -9830,7 +10115,8 @@ class Test_TC_CC_8_1 : public TestCommand CHIP_ERROR TestColorLoopSetCommandStartColorLoop_7() { - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; RequestType request; request.updateFlags = static_cast>(1); @@ -9849,7 +10135,7 @@ class Test_TC_CC_8_1 : public TestCommand (static_cast(context))->OnFailureResponse_7(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -9859,8 +10145,9 @@ class Test_TC_CC_8_1 : public TestCommand CHIP_ERROR TestCheckColorLoopActiveValue_8() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_8, OnFailureCallback_8); @@ -9876,7 +10163,8 @@ class Test_TC_CC_8_1 : public TestCommand CHIP_ERROR TestColorLoopSetCommandSetDirectionAndTimeWhileRunning_9() { - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; RequestType request; request.updateFlags = static_cast>(6); @@ -9895,7 +10183,7 @@ class Test_TC_CC_8_1 : public TestCommand (static_cast(context))->OnFailureResponse_9(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -9905,8 +10193,9 @@ class Test_TC_CC_8_1 : public TestCommand CHIP_ERROR TestCheckColorLoopDirectionValue_10() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_10, OnFailureCallback_10); @@ -9922,8 +10211,9 @@ class Test_TC_CC_8_1 : public TestCommand CHIP_ERROR TestCheckColorLoopTimeValue_11() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_11, OnFailureCallback_11); @@ -9939,7 +10229,8 @@ class Test_TC_CC_8_1 : public TestCommand CHIP_ERROR TestColorLoopSetCommandSetDirectionWhileRunning_12() { - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; RequestType request; request.updateFlags = static_cast>(2); @@ -9958,7 +10249,7 @@ class Test_TC_CC_8_1 : public TestCommand (static_cast(context))->OnFailureResponse_12(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -9968,8 +10259,9 @@ class Test_TC_CC_8_1 : public TestCommand CHIP_ERROR TestCheckColorLoopDirectionValue_13() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_13, OnFailureCallback_13); @@ -9985,7 +10277,8 @@ class Test_TC_CC_8_1 : public TestCommand CHIP_ERROR TestTurnOffLightThatWeTurnedOn_14() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -9997,7 +10290,7 @@ class Test_TC_CC_8_1 : public TestCommand (static_cast(context))->OnFailureResponse_14(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -10007,8 +10300,9 @@ class Test_TC_CC_8_1 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_15() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_15, OnFailureCallback_15); @@ -10386,7 +10680,8 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestPreconditionTurnOnLightForColorControlTests_0() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -10398,7 +10693,7 @@ class Test_TC_CC_9_1 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -10408,8 +10703,9 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -10425,7 +10721,8 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_2() { - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; RequestType request; request.updateFlags = static_cast>(1); @@ -10444,7 +10741,7 @@ class Test_TC_CC_9_1 : public TestCommand (static_cast(context))->OnFailureResponse_2(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -10454,8 +10751,9 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_3, OnFailureCallback_3); @@ -10471,7 +10769,8 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_4() { - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; RequestType request; request.updateFlags = static_cast>(2); @@ -10490,7 +10789,7 @@ class Test_TC_CC_9_1 : public TestCommand (static_cast(context))->OnFailureResponse_4(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -10500,8 +10799,9 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_5() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_5, OnFailureCallback_5); @@ -10517,7 +10817,8 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_6() { - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; RequestType request; request.updateFlags = static_cast>(4); @@ -10536,7 +10837,7 @@ class Test_TC_CC_9_1 : public TestCommand (static_cast(context))->OnFailureResponse_6(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -10546,8 +10847,9 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestReadColorLoopTimeAttributeFromDut_7() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_7, OnFailureCallback_7); @@ -10563,7 +10865,8 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_8() { - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; RequestType request; request.updateFlags = static_cast>(8); @@ -10582,7 +10885,7 @@ class Test_TC_CC_9_1 : public TestCommand (static_cast(context))->OnFailureResponse_8(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -10592,8 +10895,9 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestReadColorLoopStartEnhancedHueAttributeFromDut_9() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_9, OnFailureCallback_9); @@ -10609,7 +10913,8 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_10() { - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; RequestType request; request.updateFlags = static_cast>(1); @@ -10628,7 +10933,7 @@ class Test_TC_CC_9_1 : public TestCommand (static_cast(context))->OnFailureResponse_10(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -10638,8 +10943,9 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_11() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_11, OnFailureCallback_11); @@ -10655,7 +10961,8 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_12() { - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; RequestType request; request.updateFlags = static_cast>(1); @@ -10674,7 +10981,7 @@ class Test_TC_CC_9_1 : public TestCommand (static_cast(context))->OnFailureResponse_12(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -10684,8 +10991,9 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_13() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_13, OnFailureCallback_13); @@ -10701,7 +11009,8 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_14() { - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; RequestType request; request.updateFlags = static_cast>(2); @@ -10720,7 +11029,7 @@ class Test_TC_CC_9_1 : public TestCommand (static_cast(context))->OnFailureResponse_14(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -10730,8 +11039,9 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_15() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_15, OnFailureCallback_15); @@ -10747,7 +11057,8 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_16() { - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; RequestType request; request.updateFlags = static_cast>(1); @@ -10766,7 +11077,7 @@ class Test_TC_CC_9_1 : public TestCommand (static_cast(context))->OnFailureResponse_16(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -10776,8 +11087,9 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_17() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_17, OnFailureCallback_17); @@ -10793,7 +11105,8 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_18() { - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; RequestType request; request.updateFlags = static_cast>(1); @@ -10812,7 +11125,7 @@ class Test_TC_CC_9_1 : public TestCommand (static_cast(context))->OnFailureResponse_18(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -10822,8 +11135,9 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_19() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_19, OnFailureCallback_19); @@ -10839,7 +11153,8 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestEnhancedMoveToHueCommand10_20() { - using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type; RequestType request; request.enhancedHue = 40960U; @@ -10856,7 +11171,7 @@ class Test_TC_CC_9_1 : public TestCommand (static_cast(context))->OnFailureResponse_20(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -10868,8 +11183,9 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_22() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_22, OnFailureCallback_22); @@ -10885,7 +11201,8 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_23() { - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; RequestType request; request.updateFlags = static_cast>(2); @@ -10904,7 +11221,7 @@ class Test_TC_CC_9_1 : public TestCommand (static_cast(context))->OnFailureResponse_23(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -10914,8 +11231,9 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_24() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_24, OnFailureCallback_24); @@ -10931,7 +11249,8 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_25() { - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; RequestType request; request.updateFlags = static_cast>(1); @@ -10950,7 +11269,7 @@ class Test_TC_CC_9_1 : public TestCommand (static_cast(context))->OnFailureResponse_25(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -10960,8 +11279,9 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_26() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_26, OnFailureCallback_26); @@ -10977,7 +11297,8 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_27() { - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; RequestType request; request.updateFlags = static_cast>(1); @@ -10996,7 +11317,7 @@ class Test_TC_CC_9_1 : public TestCommand (static_cast(context))->OnFailureResponse_27(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -11006,8 +11327,9 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_28() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_28, OnFailureCallback_28); @@ -11023,7 +11345,8 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_29() { - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; RequestType request; request.updateFlags = static_cast>(2); @@ -11042,7 +11365,7 @@ class Test_TC_CC_9_1 : public TestCommand (static_cast(context))->OnFailureResponse_29(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -11052,8 +11375,9 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_30() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_30, OnFailureCallback_30); @@ -11069,7 +11393,8 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_31() { - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; RequestType request; request.updateFlags = static_cast>(1); @@ -11088,7 +11413,7 @@ class Test_TC_CC_9_1 : public TestCommand (static_cast(context))->OnFailureResponse_31(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -11098,8 +11423,9 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_32() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_32, OnFailureCallback_32); @@ -11115,7 +11441,8 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_33() { - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; RequestType request; request.updateFlags = static_cast>(1); @@ -11134,7 +11461,7 @@ class Test_TC_CC_9_1 : public TestCommand (static_cast(context))->OnFailureResponse_33(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -11144,8 +11471,9 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_34() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_34, OnFailureCallback_34); @@ -11161,7 +11489,8 @@ class Test_TC_CC_9_1 : public TestCommand CHIP_ERROR TestTurnOffLightForColorControlTests_35() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -11173,7 +11502,7 @@ class Test_TC_CC_9_1 : public TestCommand (static_cast(context))->OnFailureResponse_35(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -11367,7 +11696,8 @@ class Test_TC_CC_9_2 : public TestCommand CHIP_ERROR TestPreconditionTurnOnLightForColorControlTests_0() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -11379,7 +11709,7 @@ class Test_TC_CC_9_2 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -11389,8 +11719,9 @@ class Test_TC_CC_9_2 : public TestCommand CHIP_ERROR TestPreconditionCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -11406,7 +11737,8 @@ class Test_TC_CC_9_2 : public TestCommand CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_2() { - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; RequestType request; request.updateFlags = static_cast>(15); @@ -11425,7 +11757,7 @@ class Test_TC_CC_9_2 : public TestCommand (static_cast(context))->OnFailureResponse_2(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -11435,8 +11767,9 @@ class Test_TC_CC_9_2 : public TestCommand CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_3, OnFailureCallback_3); @@ -11452,8 +11785,9 @@ class Test_TC_CC_9_2 : public TestCommand CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_4() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_4, OnFailureCallback_4); @@ -11469,8 +11803,9 @@ class Test_TC_CC_9_2 : public TestCommand CHIP_ERROR TestReadColorLoopTimeAttributeFromDut_5() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_5, OnFailureCallback_5); @@ -11486,8 +11821,9 @@ class Test_TC_CC_9_2 : public TestCommand CHIP_ERROR TestReadColorLoopStartEnhancedHueAttributeFromDut_6() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_6, OnFailureCallback_6); @@ -11503,7 +11839,8 @@ class Test_TC_CC_9_2 : public TestCommand CHIP_ERROR TestColorLoopSetCommandSetAllAttributes_7() { - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; RequestType request; request.updateFlags = static_cast>(1); @@ -11522,7 +11859,7 @@ class Test_TC_CC_9_2 : public TestCommand (static_cast(context))->OnFailureResponse_7(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -11532,8 +11869,9 @@ class Test_TC_CC_9_2 : public TestCommand CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_8() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_8, OnFailureCallback_8); @@ -11549,7 +11887,8 @@ class Test_TC_CC_9_2 : public TestCommand CHIP_ERROR TestColorLoopSetCommandStartColorLoop_9() { - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; RequestType request; request.updateFlags = static_cast>(2); @@ -11568,7 +11907,7 @@ class Test_TC_CC_9_2 : public TestCommand (static_cast(context))->OnFailureResponse_9(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -11578,8 +11917,9 @@ class Test_TC_CC_9_2 : public TestCommand CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_10() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_10, OnFailureCallback_10); @@ -11595,7 +11935,8 @@ class Test_TC_CC_9_2 : public TestCommand CHIP_ERROR TestColorLoopSetCommandStartColorLoop_11() { - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; RequestType request; request.updateFlags = static_cast>(1); @@ -11614,7 +11955,7 @@ class Test_TC_CC_9_2 : public TestCommand (static_cast(context))->OnFailureResponse_11(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -11624,8 +11965,9 @@ class Test_TC_CC_9_2 : public TestCommand CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_12() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_12, OnFailureCallback_12); @@ -11641,7 +11983,8 @@ class Test_TC_CC_9_2 : public TestCommand CHIP_ERROR TestTurnOffLightForColorControlTests_13() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -11653,7 +11996,7 @@ class Test_TC_CC_9_2 : public TestCommand (static_cast(context))->OnFailureResponse_13(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -11847,7 +12190,8 @@ class Test_TC_CC_9_3 : public TestCommand CHIP_ERROR TestPreconditionTurnOnLightForColorControlTests_0() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -11859,7 +12203,7 @@ class Test_TC_CC_9_3 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -11869,8 +12213,9 @@ class Test_TC_CC_9_3 : public TestCommand CHIP_ERROR TestPreconditionCheckOnOffAttributeValueIsTrueAfterOnCommand_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -11886,7 +12231,8 @@ class Test_TC_CC_9_3 : public TestCommand CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_2() { - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; RequestType request; request.updateFlags = static_cast>(15); @@ -11905,7 +12251,7 @@ class Test_TC_CC_9_3 : public TestCommand (static_cast(context))->OnFailureResponse_2(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -11915,8 +12261,9 @@ class Test_TC_CC_9_3 : public TestCommand CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_3, OnFailureCallback_3); @@ -11932,8 +12279,9 @@ class Test_TC_CC_9_3 : public TestCommand CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_4() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_4, OnFailureCallback_4); @@ -11949,8 +12297,9 @@ class Test_TC_CC_9_3 : public TestCommand CHIP_ERROR TestReadColorLoopTimeAttributeFromDut_5() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_5, OnFailureCallback_5); @@ -11966,8 +12315,9 @@ class Test_TC_CC_9_3 : public TestCommand CHIP_ERROR TestReadColorLoopStartEnhancedHueAttributeFromDut_6() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_6, OnFailureCallback_6); @@ -11983,7 +12333,8 @@ class Test_TC_CC_9_3 : public TestCommand CHIP_ERROR TestColorLoopSetCommandSetAllAttributes_7() { - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; RequestType request; request.updateFlags = static_cast>(1); @@ -12002,7 +12353,7 @@ class Test_TC_CC_9_3 : public TestCommand (static_cast(context))->OnFailureResponse_7(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -12012,8 +12363,9 @@ class Test_TC_CC_9_3 : public TestCommand CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_8() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_8, OnFailureCallback_8); @@ -12029,7 +12381,8 @@ class Test_TC_CC_9_3 : public TestCommand CHIP_ERROR TestColorLoopSetCommandStartColorLoop_9() { - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; RequestType request; request.updateFlags = static_cast>(4); @@ -12048,7 +12401,7 @@ class Test_TC_CC_9_3 : public TestCommand (static_cast(context))->OnFailureResponse_9(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -12058,8 +12411,9 @@ class Test_TC_CC_9_3 : public TestCommand CHIP_ERROR TestReadColorLoopTimeAttributeFromDut_10() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_10, OnFailureCallback_10); @@ -12075,7 +12429,8 @@ class Test_TC_CC_9_3 : public TestCommand CHIP_ERROR TestColorLoopSetCommandStartColorLoop_11() { - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; RequestType request; request.updateFlags = static_cast>(1); @@ -12094,7 +12449,7 @@ class Test_TC_CC_9_3 : public TestCommand (static_cast(context))->OnFailureResponse_11(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -12104,8 +12459,9 @@ class Test_TC_CC_9_3 : public TestCommand CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_12() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_12, OnFailureCallback_12); @@ -12121,7 +12477,8 @@ class Test_TC_CC_9_3 : public TestCommand CHIP_ERROR TestTurnOffLightForColorControlTests_13() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -12133,7 +12490,7 @@ class Test_TC_CC_9_3 : public TestCommand (static_cast(context))->OnFailureResponse_13(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -12218,11 +12575,11 @@ class Test_TC_DM_1_1 : public TestCommand break; case 11: ChipLogProgress(chipTool, " ***** Test Step 11 : Query ManufacturingDate\n"); - err = TestQueryManufacturingDate_11(); + err = ShouldSkip("MANF_DATE") ? CHIP_NO_ERROR : TestQueryManufacturingDate_11(); break; case 12: ChipLogProgress(chipTool, " ***** Test Step 12 : Query PartNumber\n"); - err = TestQueryPartNumber_12(); + err = ShouldSkip("PART_NUM") ? CHIP_NO_ERROR : TestQueryPartNumber_12(); break; case 13: ChipLogProgress(chipTool, " ***** Test Step 13 : Query ProductURL\n"); @@ -12443,8 +12800,9 @@ class Test_TC_DM_1_1 : public TestCommand CHIP_ERROR TestQueryInteractionModelVersion_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -12460,8 +12818,9 @@ class Test_TC_DM_1_1 : public TestCommand CHIP_ERROR TestQueryVendorName_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -12478,8 +12837,9 @@ class Test_TC_DM_1_1 : public TestCommand CHIP_ERROR TestQueryVendorID_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_2, OnFailureCallback_2); @@ -12495,8 +12855,9 @@ class Test_TC_DM_1_1 : public TestCommand CHIP_ERROR TestQueryProductName_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_3, OnFailureCallback_3); @@ -12513,8 +12874,9 @@ class Test_TC_DM_1_1 : public TestCommand CHIP_ERROR TestQueryProductID_4() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_4, OnFailureCallback_4); @@ -12530,8 +12892,9 @@ class Test_TC_DM_1_1 : public TestCommand CHIP_ERROR TestQueryUserLabel_5() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_5, OnFailureCallback_5); @@ -12548,8 +12911,9 @@ class Test_TC_DM_1_1 : public TestCommand CHIP_ERROR TestQueryUserLocation_6() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_6, OnFailureCallback_6); @@ -12567,8 +12931,9 @@ class Test_TC_DM_1_1 : public TestCommand CHIP_ERROR TestQueryHardwareVersion_7() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_7, OnFailureCallback_7); @@ -12584,8 +12949,9 @@ class Test_TC_DM_1_1 : public TestCommand CHIP_ERROR TestQueryHardwareVersionString_8() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_8, OnFailureCallback_8); @@ -12603,8 +12969,9 @@ class Test_TC_DM_1_1 : public TestCommand CHIP_ERROR TestQuerySoftwareVersion_9() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_9, OnFailureCallback_9); @@ -12620,8 +12987,9 @@ class Test_TC_DM_1_1 : public TestCommand CHIP_ERROR TestQuerySoftwareVersionString_10() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_10, OnFailureCallback_10); @@ -12640,8 +13008,9 @@ class Test_TC_DM_1_1 : public TestCommand CHIP_ERROR TestQueryManufacturingDate_11() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_11, OnFailureCallback_11); @@ -12663,8 +13032,9 @@ class Test_TC_DM_1_1 : public TestCommand CHIP_ERROR TestQueryPartNumber_12() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_12, OnFailureCallback_12); @@ -12684,8 +13054,9 @@ class Test_TC_DM_1_1 : public TestCommand CHIP_ERROR TestQueryProductURL_13() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_13, OnFailureCallback_13); @@ -12706,8 +13077,9 @@ class Test_TC_DM_1_1 : public TestCommand CHIP_ERROR TestQueryProductLabel_14() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_14, OnFailureCallback_14); @@ -12727,8 +13099,9 @@ class Test_TC_DM_1_1 : public TestCommand CHIP_ERROR TestQuerySerialNumber_15() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_15, OnFailureCallback_15); @@ -12748,8 +13121,9 @@ class Test_TC_DM_1_1 : public TestCommand CHIP_ERROR TestQueryLocalConfigDisabled_16() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_16, OnFailureCallback_16); @@ -12768,8 +13142,9 @@ class Test_TC_DM_1_1 : public TestCommand CHIP_ERROR TestQueryReachable_17() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_17, OnFailureCallback_17); @@ -12944,8 +13319,9 @@ class Test_TC_DM_2_2 : public TestCommand CHIP_ERROR TestQueryFabricsList_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::OperationalCredentialsClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -12964,8 +13340,9 @@ class Test_TC_DM_2_2 : public TestCommand CHIP_ERROR TestQuerySupportedFabrics_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::OperationalCredentialsClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_1, OnFailureCallback_1); @@ -12981,8 +13358,9 @@ class Test_TC_DM_2_2 : public TestCommand CHIP_ERROR TestQueryCommissionedFabrics_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::OperationalCredentialsClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2); @@ -12998,8 +13376,9 @@ class Test_TC_DM_2_2 : public TestCommand CHIP_ERROR TestQueryUserTrustedRootCertificates_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::OperationalCredentialsClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_3, OnFailureCallback_3); @@ -13103,8 +13482,9 @@ class Test_TC_EMR_1_1 : public TestCommand CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ElectricalMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -13120,8 +13500,9 @@ class Test_TC_EMR_1_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ElectricalMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t clusterRevisionArgument; clusterRevisionArgument = 1U; @@ -13136,8 +13517,9 @@ class Test_TC_EMR_1_1 : public TestCommand CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ElectricalMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2); @@ -13213,8 +13595,9 @@ class Test_TC_FLW_1_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::FlowMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t clusterRevisionArgument; clusterRevisionArgument = 2U; @@ -13383,8 +13766,9 @@ class Test_TC_FLW_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::FlowMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -13400,8 +13784,9 @@ class Test_TC_FLW_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeMinMeasuredValue_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::FlowMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_1, OnFailureCallback_1); @@ -13417,8 +13802,9 @@ class Test_TC_FLW_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeMaxMeasuredValue_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::FlowMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2); @@ -13434,8 +13820,9 @@ class Test_TC_FLW_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValueToOptionalAttributeMinMeasuredValue_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::FlowMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); int16_t minMeasuredValueArgument; minMeasuredValueArgument = 0; @@ -13450,8 +13837,9 @@ class Test_TC_FLW_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValueToOptionalAttributeMaxMeasuredValue_4() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::FlowMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); int16_t maxMeasuredValueArgument; maxMeasuredValueArgument = 0; @@ -13466,8 +13854,9 @@ class Test_TC_FLW_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_5() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::FlowMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_5, OnFailureCallback_5); @@ -13483,8 +13872,9 @@ class Test_TC_FLW_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeMinMeasuredValue_6() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::FlowMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_6, OnFailureCallback_6); @@ -13500,8 +13890,9 @@ class Test_TC_FLW_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeMaxMeasuredValue_7() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::FlowMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_7, OnFailureCallback_7); @@ -13593,8 +13984,9 @@ class Test_TC_FLW_2_2 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::FlowMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -13610,8 +14002,9 @@ class Test_TC_FLW_2_2 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::FlowMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_1, OnFailureCallback_1); @@ -13715,8 +14108,9 @@ class Test_TC_ILL_1_1 : public TestCommand CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::IlluminanceMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -13732,8 +14126,9 @@ class Test_TC_ILL_1_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::IlluminanceMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t clusterRevisionArgument; clusterRevisionArgument = 1U; @@ -13748,8 +14143,9 @@ class Test_TC_ILL_1_1 : public TestCommand CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::IlluminanceMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2); @@ -13825,8 +14221,9 @@ class Test_TC_LVL_1_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t clusterRevisionArgument; clusterRevisionArgument = 4U; @@ -13991,8 +14388,9 @@ class Test_TC_LVL_2_1 : public TestCommand CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -14008,7 +14406,8 @@ class Test_TC_LVL_2_1 : public TestCommand CHIP_ERROR TestSendsAMoveToLevelCommand_1() { - using RequestType = chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type; RequestType request; request.level = 64; @@ -14024,7 +14423,7 @@ class Test_TC_LVL_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_1(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -14036,8 +14435,9 @@ class Test_TC_LVL_2_1 : public TestCommand CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_3, OnFailureCallback_3); @@ -14053,7 +14453,8 @@ class Test_TC_LVL_2_1 : public TestCommand CHIP_ERROR TestSendsAMoveToLevelCommand_4() { - using RequestType = chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type; RequestType request; request.level = 128; @@ -14069,7 +14470,7 @@ class Test_TC_LVL_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_4(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -14081,8 +14482,9 @@ class Test_TC_LVL_2_1 : public TestCommand CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_6() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_6, OnFailureCallback_6); @@ -14098,8 +14500,9 @@ class Test_TC_LVL_2_1 : public TestCommand CHIP_ERROR TestReadsOnOffTransitionTimeAttributeFromDut_7() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_7, OnFailureCallback_7); @@ -14115,7 +14518,8 @@ class Test_TC_LVL_2_1 : public TestCommand CHIP_ERROR TestSendsAMoveToLevelCommand_8() { - using RequestType = chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type; RequestType request; request.level = 254; @@ -14131,7 +14535,7 @@ class Test_TC_LVL_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_8(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -14143,8 +14547,9 @@ class Test_TC_LVL_2_1 : public TestCommand CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_10() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_10, OnFailureCallback_10); @@ -14160,7 +14565,8 @@ class Test_TC_LVL_2_1 : public TestCommand CHIP_ERROR TestResetLevelTo0_11() { - using RequestType = chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type; RequestType request; request.level = 0; @@ -14176,7 +14582,7 @@ class Test_TC_LVL_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_11(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -14369,8 +14775,9 @@ class Test_TC_LVL_3_1 : public TestCommand CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -14386,8 +14793,9 @@ class Test_TC_LVL_3_1 : public TestCommand CHIP_ERROR TestReadsMaxLevelAttributeFromDut_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -14403,7 +14811,8 @@ class Test_TC_LVL_3_1 : public TestCommand CHIP_ERROR TestSendsAMoveUpCommand_2() { - using RequestType = chip::app::Clusters::LevelControl::Commands::Move::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::LevelControl::Commands::Move::Type; RequestType request; request.moveMode = static_cast(0); @@ -14419,7 +14828,7 @@ class Test_TC_LVL_3_1 : public TestCommand (static_cast(context))->OnFailureResponse_2(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -14431,8 +14840,9 @@ class Test_TC_LVL_3_1 : public TestCommand CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_4() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_4, OnFailureCallback_4); @@ -14448,8 +14858,9 @@ class Test_TC_LVL_3_1 : public TestCommand CHIP_ERROR TestReadsMinLevelAttributeFromDut_5() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_5, OnFailureCallback_5); @@ -14465,7 +14876,8 @@ class Test_TC_LVL_3_1 : public TestCommand CHIP_ERROR TestSendsAMoveDownCommand_6() { - using RequestType = chip::app::Clusters::LevelControl::Commands::Move::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::LevelControl::Commands::Move::Type; RequestType request; request.moveMode = static_cast(1); @@ -14481,7 +14893,7 @@ class Test_TC_LVL_3_1 : public TestCommand (static_cast(context))->OnFailureResponse_6(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -14493,8 +14905,9 @@ class Test_TC_LVL_3_1 : public TestCommand CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_8() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_8, OnFailureCallback_8); @@ -14510,8 +14923,9 @@ class Test_TC_LVL_3_1 : public TestCommand CHIP_ERROR TestWriteDefaultMoveRateAttributeFromDut_9() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t defaultMoveRateArgument; defaultMoveRateArgument = 20; @@ -14526,8 +14940,9 @@ class Test_TC_LVL_3_1 : public TestCommand CHIP_ERROR TestReadsDefaultMoveRateAttributeFromDut_10() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_10, OnFailureCallback_10); @@ -14543,7 +14958,8 @@ class Test_TC_LVL_3_1 : public TestCommand CHIP_ERROR TestSendsAMoveUpCommandAtDefaultMoveRate_11() { - using RequestType = chip::app::Clusters::LevelControl::Commands::Move::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::LevelControl::Commands::Move::Type; RequestType request; request.moveMode = static_cast(1); @@ -14559,7 +14975,7 @@ class Test_TC_LVL_3_1 : public TestCommand (static_cast(context))->OnFailureResponse_11(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -14571,8 +14987,9 @@ class Test_TC_LVL_3_1 : public TestCommand CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_13() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_13, OnFailureCallback_13); @@ -14710,7 +15127,8 @@ class Test_TC_LVL_4_1 : public TestCommand CHIP_ERROR TestSendingOnCommand_0() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -14722,7 +15140,7 @@ class Test_TC_LVL_4_1 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -14732,7 +15150,8 @@ class Test_TC_LVL_4_1 : public TestCommand CHIP_ERROR TestPreconditionDutLevelIsSetTo0x80_1() { - using RequestType = chip::app::Clusters::LevelControl::Commands::Step::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::LevelControl::Commands::Step::Type; RequestType request; request.stepMode = static_cast(0); @@ -14749,7 +15168,7 @@ class Test_TC_LVL_4_1 : public TestCommand (static_cast(context))->OnFailureResponse_1(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -14761,8 +15180,9 @@ class Test_TC_LVL_4_1 : public TestCommand CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_3, OnFailureCallback_3); @@ -14778,7 +15198,8 @@ class Test_TC_LVL_4_1 : public TestCommand CHIP_ERROR TestSendsStepDownCommandToDut_4() { - using RequestType = chip::app::Clusters::LevelControl::Commands::Step::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::LevelControl::Commands::Step::Type; RequestType request; request.stepMode = static_cast(1); @@ -14795,7 +15216,7 @@ class Test_TC_LVL_4_1 : public TestCommand (static_cast(context))->OnFailureResponse_4(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -14807,8 +15228,9 @@ class Test_TC_LVL_4_1 : public TestCommand CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_6() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_6, OnFailureCallback_6); @@ -14824,7 +15246,8 @@ class Test_TC_LVL_4_1 : public TestCommand CHIP_ERROR TestSendsAStepUpCommand_7() { - using RequestType = chip::app::Clusters::LevelControl::Commands::Step::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::LevelControl::Commands::Step::Type; RequestType request; request.stepMode = static_cast(0); @@ -14841,7 +15264,7 @@ class Test_TC_LVL_4_1 : public TestCommand (static_cast(context))->OnFailureResponse_7(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -14853,8 +15276,9 @@ class Test_TC_LVL_4_1 : public TestCommand CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_9() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::LevelControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_9, OnFailureCallback_9); @@ -14870,7 +15294,8 @@ class Test_TC_LVL_4_1 : public TestCommand CHIP_ERROR TestSendingOffCommand_10() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -14882,7 +15307,7 @@ class Test_TC_LVL_4_1 : public TestCommand (static_cast(context))->OnFailureResponse_10(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -14968,7 +15393,8 @@ class Test_TC_LVL_5_1 : public TestCommand CHIP_ERROR TestSendingOnCommand_0() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -14980,7 +15406,7 @@ class Test_TC_LVL_5_1 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -14990,7 +15416,8 @@ class Test_TC_LVL_5_1 : public TestCommand CHIP_ERROR TestPreconditionDutLevelIsSetTo0x80_1() { - using RequestType = chip::app::Clusters::LevelControl::Commands::Step::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::LevelControl::Commands::Step::Type; RequestType request; request.stepMode = static_cast(0); @@ -15007,7 +15434,7 @@ class Test_TC_LVL_5_1 : public TestCommand (static_cast(context))->OnFailureResponse_1(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -15019,7 +15446,8 @@ class Test_TC_LVL_5_1 : public TestCommand CHIP_ERROR TestSendsAMoveUpCommandToDut_3() { - using RequestType = chip::app::Clusters::LevelControl::Commands::Move::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::LevelControl::Commands::Move::Type; RequestType request; request.moveMode = static_cast(0); @@ -15035,7 +15463,7 @@ class Test_TC_LVL_5_1 : public TestCommand (static_cast(context))->OnFailureResponse_3(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -15047,7 +15475,8 @@ class Test_TC_LVL_5_1 : public TestCommand CHIP_ERROR TestSendsStopCommandToDut_5() { - using RequestType = chip::app::Clusters::LevelControl::Commands::Stop::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::LevelControl::Commands::Stop::Type; RequestType request; request.optionMask = 0; @@ -15061,7 +15490,7 @@ class Test_TC_LVL_5_1 : public TestCommand (static_cast(context))->OnFailureResponse_5(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -15071,7 +15500,8 @@ class Test_TC_LVL_5_1 : public TestCommand CHIP_ERROR TestSendingOffCommand_6() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -15083,7 +15513,7 @@ class Test_TC_LVL_5_1 : public TestCommand (static_cast(context))->OnFailureResponse_6(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -15153,8 +15583,9 @@ class Test_TC_MC_1_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::RelativeHumidityMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t clusterRevisionArgument; clusterRevisionArgument = 1U; @@ -15221,7 +15652,8 @@ class Test_TC_MC_2_1 : public TestCommand CHIP_ERROR TestPutTheDeviceIntoLowPowerMode_0() { - using RequestType = chip::app::Clusters::LowPower::Commands::Sleep::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::LowPower::Commands::Sleep::Type; RequestType request; @@ -15233,7 +15665,7 @@ class Test_TC_MC_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -15845,8 +16277,9 @@ class Test_TC_OCC_1_1 : public TestCommand CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -15862,8 +16295,9 @@ class Test_TC_OCC_1_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t clusterRevisionArgument; clusterRevisionArgument = 2U; @@ -16047,8 +16481,9 @@ class Test_TC_OCC_2_1 : public TestCommand CHIP_ERROR TestReadsMandatoryAttributeConstrainsOccupancy_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -16065,8 +16500,9 @@ class Test_TC_OCC_2_1 : public TestCommand CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributeOccupancy_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t occupancyArgument; occupancyArgument = 0; @@ -16081,8 +16517,9 @@ class Test_TC_OCC_2_1 : public TestCommand CHIP_ERROR TestReadsBackMandatoryAttributeOccupancy_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2); @@ -16098,8 +16535,9 @@ class Test_TC_OCC_2_1 : public TestCommand CHIP_ERROR TestReadsMandatoryAttributeConstrainsOccupancySensorType_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_3, OnFailureCallback_3); @@ -16116,8 +16554,9 @@ class Test_TC_OCC_2_1 : public TestCommand CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributeOccupancySensorType_4() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t occupancySensorTypeArgument; occupancySensorTypeArgument = static_cast(0); @@ -16132,8 +16571,9 @@ class Test_TC_OCC_2_1 : public TestCommand CHIP_ERROR TestReadsBackMandatoryAttributeOccupancySensorType_5() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_5, OnFailureCallback_5); @@ -16149,8 +16589,9 @@ class Test_TC_OCC_2_1 : public TestCommand CHIP_ERROR TestReadsMandatoryAttributeConstrainsOccupancySensorTypeBitmap_6() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_6, OnFailureCallback_6); @@ -16168,8 +16609,9 @@ class Test_TC_OCC_2_1 : public TestCommand CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributeOccupancySensorTypeBitmap_7() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t occupancySensorTypeBitmapArgument; occupancySensorTypeBitmapArgument = 1; @@ -16184,8 +16626,9 @@ class Test_TC_OCC_2_1 : public TestCommand CHIP_ERROR TestReadsBackMandatoryAttributeOccupancySensorTypeBitmap_8() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_8, OnFailureCallback_8); @@ -16277,8 +16720,9 @@ class Test_TC_OCC_2_2 : public TestCommand CHIP_ERROR TestReadsOccupancyAttributeFromDut_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -16294,8 +16738,9 @@ class Test_TC_OCC_2_2 : public TestCommand CHIP_ERROR TestReadsOccupancyAttributeFromDut_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_1, OnFailureCallback_1); @@ -16438,8 +16883,9 @@ class Test_TC_OO_1_1 : public TestCommand CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_0, OnFailureCallback_0); @@ -16455,8 +16901,9 @@ class Test_TC_OO_1_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t clusterRevisionArgument; clusterRevisionArgument = 3U; @@ -16471,8 +16918,9 @@ class Test_TC_OO_1_1 : public TestCommand CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_2, OnFailureCallback_2); @@ -16488,8 +16936,9 @@ class Test_TC_OO_1_1 : public TestCommand CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_3, OnFailureCallback_3); @@ -16505,8 +16954,9 @@ class Test_TC_OO_1_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToOptionalGlobalAttributeFeatureMap_4() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint32_t featureMapArgument; featureMapArgument = 0UL; @@ -16521,8 +16971,9 @@ class Test_TC_OO_1_1 : public TestCommand CHIP_ERROR TestReadsBackOptionalGlobalAttributeFeatureMap_5() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_5, OnFailureCallback_5); @@ -16745,8 +17196,9 @@ class Test_TC_OO_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeOnOff_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_0, OnFailureCallback_0); @@ -16762,8 +17214,9 @@ class Test_TC_OO_2_1 : public TestCommand CHIP_ERROR TestReadsBackMandatoryAttributeOnOff_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -16779,8 +17232,9 @@ class Test_TC_OO_2_1 : public TestCommand CHIP_ERROR TestReadLtAttributeGlobalSceneControl_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2); @@ -16796,8 +17250,9 @@ class Test_TC_OO_2_1 : public TestCommand CHIP_ERROR TestReadLtAttributeOnTime_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_3, OnFailureCallback_3); @@ -16813,8 +17268,9 @@ class Test_TC_OO_2_1 : public TestCommand CHIP_ERROR TestReadLtAttributeOffWaitTime_4() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_4, OnFailureCallback_4); @@ -16830,8 +17286,9 @@ class Test_TC_OO_2_1 : public TestCommand CHIP_ERROR TestReadLtAttributeStartUpOnOff_5() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_5, OnFailureCallback_5); @@ -16847,8 +17304,9 @@ class Test_TC_OO_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValueToLtAttributeOnTime_6() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t onTimeArgument; onTimeArgument = 0U; @@ -16863,8 +17321,9 @@ class Test_TC_OO_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValueToLtAttributeOffWaitTime_7() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t offWaitTimeArgument; offWaitTimeArgument = 0U; @@ -16879,8 +17338,9 @@ class Test_TC_OO_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValueToLtAttributeStartUpOnOff_8() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t startUpOnOffArgument; startUpOnOffArgument = static_cast(0); @@ -16895,8 +17355,9 @@ class Test_TC_OO_2_1 : public TestCommand CHIP_ERROR TestReadsBackLtAttributeOnTime_9() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_9, OnFailureCallback_9); @@ -16912,8 +17373,9 @@ class Test_TC_OO_2_1 : public TestCommand CHIP_ERROR TestReadsBackLtAttributeOffWaitTime_10() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_10, OnFailureCallback_10); @@ -16929,8 +17391,9 @@ class Test_TC_OO_2_1 : public TestCommand CHIP_ERROR TestReadsBackLtAttributeStartUpOnOff_11() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_11, OnFailureCallback_11); @@ -17120,7 +17583,8 @@ class Test_TC_OO_2_2 : public TestCommand CHIP_ERROR TestSendOffCommand_0() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -17132,7 +17596,7 @@ class Test_TC_OO_2_2 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -17142,8 +17606,9 @@ class Test_TC_OO_2_2 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -17159,7 +17624,8 @@ class Test_TC_OO_2_2 : public TestCommand CHIP_ERROR TestSendOnCommand_2() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -17171,7 +17637,7 @@ class Test_TC_OO_2_2 : public TestCommand (static_cast(context))->OnFailureResponse_2(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -17181,8 +17647,9 @@ class Test_TC_OO_2_2 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_3, OnFailureCallback_3); @@ -17198,7 +17665,8 @@ class Test_TC_OO_2_2 : public TestCommand CHIP_ERROR TestSendOffCommand_4() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -17210,7 +17678,7 @@ class Test_TC_OO_2_2 : public TestCommand (static_cast(context))->OnFailureResponse_4(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -17220,8 +17688,9 @@ class Test_TC_OO_2_2 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_5, OnFailureCallback_5); @@ -17237,7 +17706,8 @@ class Test_TC_OO_2_2 : public TestCommand CHIP_ERROR TestSendToggleCommand_6() { - using RequestType = chip::app::Clusters::OnOff::Commands::Toggle::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Toggle::Type; RequestType request; @@ -17249,7 +17719,7 @@ class Test_TC_OO_2_2 : public TestCommand (static_cast(context))->OnFailureResponse_6(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -17259,8 +17729,9 @@ class Test_TC_OO_2_2 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterToggleCommand_7() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_7, OnFailureCallback_7); @@ -17276,7 +17747,8 @@ class Test_TC_OO_2_2 : public TestCommand CHIP_ERROR TestSendToggleCommand_8() { - using RequestType = chip::app::Clusters::OnOff::Commands::Toggle::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Toggle::Type; RequestType request; @@ -17288,7 +17760,7 @@ class Test_TC_OO_2_2 : public TestCommand (static_cast(context))->OnFailureResponse_8(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -17298,8 +17770,9 @@ class Test_TC_OO_2_2 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterToggleCommand_9() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_9, OnFailureCallback_9); @@ -17315,7 +17788,8 @@ class Test_TC_OO_2_2 : public TestCommand CHIP_ERROR TestSendOnCommand_10() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -17327,7 +17801,7 @@ class Test_TC_OO_2_2 : public TestCommand (static_cast(context))->OnFailureResponse_10(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -17337,8 +17811,9 @@ class Test_TC_OO_2_2 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_11() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_11, OnFailureCallback_11); @@ -17354,7 +17829,8 @@ class Test_TC_OO_2_2 : public TestCommand CHIP_ERROR TestSendOffCommand_12() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -17366,7 +17842,7 @@ class Test_TC_OO_2_2 : public TestCommand (static_cast(context))->OnFailureResponse_12(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -17376,8 +17852,9 @@ class Test_TC_OO_2_2 : public TestCommand CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_13() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_13, OnFailureCallback_13); @@ -17955,7 +18432,8 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestSendOnCommand_0() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -17967,7 +18445,7 @@ class Test_TC_OO_2_3 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -17979,8 +18457,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOnOffAttributeFromDut_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_2, OnFailureCallback_2); @@ -17996,8 +18475,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsGlobalSceneControlAttributeFromDut_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_3, OnFailureCallback_3); @@ -18013,7 +18493,8 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestSendOnCommand_4() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -18025,7 +18506,7 @@ class Test_TC_OO_2_3 : public TestCommand (static_cast(context))->OnFailureResponse_4(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -18037,8 +18518,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOnOffAttributeFromDut_6() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_6, OnFailureCallback_6); @@ -18054,8 +18536,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsGlobalSceneControlAttributeFromDut_7() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_7, OnFailureCallback_7); @@ -18071,7 +18554,8 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestSendOnCommand_8() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -18083,7 +18567,7 @@ class Test_TC_OO_2_3 : public TestCommand (static_cast(context))->OnFailureResponse_8(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -18095,8 +18579,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOnOffAttributeFromDut_10() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_10, OnFailureCallback_10); @@ -18112,8 +18597,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsGlobalSceneControlAttributeFromDut_11() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_11, OnFailureCallback_11); @@ -18129,8 +18615,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOnTimeAttributeFromDut_12() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_12, OnFailureCallback_12); @@ -18146,8 +18633,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOffWaitTimeAttributeFromDut_13() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_13, OnFailureCallback_13); @@ -18163,7 +18651,8 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestSendOnCommand_14() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -18175,7 +18664,7 @@ class Test_TC_OO_2_3 : public TestCommand (static_cast(context))->OnFailureResponse_14(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -18185,8 +18674,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOnOffAttributeFromDut_15() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_15, OnFailureCallback_15); @@ -18202,8 +18692,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOnTimeAttributeFromDut_16() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_16, OnFailureCallback_16); @@ -18219,8 +18710,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOffWaitTimeAttributeFromDut_17() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_17, OnFailureCallback_17); @@ -18236,7 +18728,8 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestSendOffCommand_18() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -18248,7 +18741,7 @@ class Test_TC_OO_2_3 : public TestCommand (static_cast(context))->OnFailureResponse_18(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -18258,8 +18751,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOnOffAttributeFromDut_19() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_19, OnFailureCallback_19); @@ -18275,8 +18769,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOnTimeAttributeFromDut_20() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_20, OnFailureCallback_20); @@ -18292,8 +18787,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOnOffAttributeFromDut_21() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_21, OnFailureCallback_21); @@ -18309,8 +18805,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOnTimeAttributeFromDut_22() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_22, OnFailureCallback_22); @@ -18326,8 +18823,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOffWaitTimeAttributeFromDut_23() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_23, OnFailureCallback_23); @@ -18343,7 +18841,8 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestSendOnCommand_24() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -18355,7 +18854,7 @@ class Test_TC_OO_2_3 : public TestCommand (static_cast(context))->OnFailureResponse_24(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -18365,8 +18864,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOnTimeAttributeFromDut_25() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_25, OnFailureCallback_25); @@ -18382,8 +18882,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOffWaitTimeAttributeFromDut_26() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_26, OnFailureCallback_26); @@ -18399,7 +18900,8 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestSendOffCommand_27() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -18411,7 +18913,7 @@ class Test_TC_OO_2_3 : public TestCommand (static_cast(context))->OnFailureResponse_27(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -18421,8 +18923,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOnOffAttributeFromDut_28() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_28, OnFailureCallback_28); @@ -18438,8 +18941,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOnTimeAttributeFromDut_29() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_29, OnFailureCallback_29); @@ -18455,8 +18959,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOnOffAttributeFromDut_30() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_30, OnFailureCallback_30); @@ -18472,8 +18977,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOnTimeAttributeFromDut_31() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_31, OnFailureCallback_31); @@ -18489,7 +18995,8 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestSendOnCommand_32() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -18501,7 +19008,7 @@ class Test_TC_OO_2_3 : public TestCommand (static_cast(context))->OnFailureResponse_32(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -18511,8 +19018,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOnOffAttributeFromDut_33() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_33, OnFailureCallback_33); @@ -18528,8 +19036,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOnTimeAttributeFromDut_34() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_34, OnFailureCallback_34); @@ -18545,8 +19054,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOffWaitTimeAttributeFromDut_35() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_35, OnFailureCallback_35); @@ -18562,7 +19072,8 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestSendOffCommand_36() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -18574,7 +19085,7 @@ class Test_TC_OO_2_3 : public TestCommand (static_cast(context))->OnFailureResponse_36(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -18584,8 +19095,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOnOffAttributeFromDut_37() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_37, OnFailureCallback_37); @@ -18601,8 +19113,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOnTimeAttributeFromDut_38() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_38, OnFailureCallback_38); @@ -18618,8 +19131,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOnOffAttributeFromDut_39() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_39, OnFailureCallback_39); @@ -18635,8 +19149,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOnTimeAttributeFromDut_40() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_40, OnFailureCallback_40); @@ -18652,8 +19167,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOffWaitTimeAttributeFromDut_41() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_41, OnFailureCallback_41); @@ -18669,8 +19185,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOnOffAttributeFromDut_42() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_42, OnFailureCallback_42); @@ -18686,8 +19203,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOnTimeAttributeFromDut_43() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_43, OnFailureCallback_43); @@ -18703,8 +19221,9 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestReadsOffWaitTimeAttributeFromDut_44() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_44, OnFailureCallback_44); @@ -18720,7 +19239,8 @@ class Test_TC_OO_2_3 : public TestCommand CHIP_ERROR TestSendOffCommand_45() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -18732,7 +19252,7 @@ class Test_TC_OO_2_3 : public TestCommand (static_cast(context))->OnFailureResponse_45(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -18844,8 +19364,9 @@ class Test_TC_PRS_1_1 : public TestCommand CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -18861,8 +19382,9 @@ class Test_TC_PRS_1_1 : public TestCommand CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_1, OnFailureCallback_1); @@ -18878,8 +19400,9 @@ class Test_TC_PRS_1_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t clusterRevisionArgument; clusterRevisionArgument = 2U; @@ -18894,8 +19417,9 @@ class Test_TC_PRS_1_1 : public TestCommand CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_3, OnFailureCallback_3); @@ -19076,8 +19600,9 @@ class Test_TC_PRS_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeConstraintsMeasuredValue_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -19093,8 +19618,9 @@ class Test_TC_PRS_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeMeasuredValue_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); int16_t measuredValueArgument; measuredValueArgument = 0; @@ -19109,8 +19635,9 @@ class Test_TC_PRS_2_1 : public TestCommand CHIP_ERROR TestReadsBackMandatoryAttributeMeasuredValue_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2); @@ -19126,8 +19653,9 @@ class Test_TC_PRS_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeConstraintsMinMeasuredValue_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_3, OnFailureCallback_3); @@ -19143,8 +19671,9 @@ class Test_TC_PRS_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeMinMeasuredValue_4() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); int16_t minMeasuredValueArgument; minMeasuredValueArgument = 0; @@ -19159,8 +19688,9 @@ class Test_TC_PRS_2_1 : public TestCommand CHIP_ERROR TestReadsBackMandatoryAttributeMinMeasuredValue_5() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_5, OnFailureCallback_5); @@ -19176,8 +19706,9 @@ class Test_TC_PRS_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeConstraintsMaxMeasuredValue_6() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_6, OnFailureCallback_6); @@ -19193,8 +19724,9 @@ class Test_TC_PRS_2_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryAttributeMaxMeasuredValue_7() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); int16_t maxMeasuredValueArgument; maxMeasuredValueArgument = 0; @@ -19209,8 +19741,9 @@ class Test_TC_PRS_2_1 : public TestCommand CHIP_ERROR TestReadsBackMandatoryAttributeMaxMeasuredValue_8() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_8, OnFailureCallback_8); @@ -19286,8 +19819,9 @@ class Test_TC_PCC_1_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t clusterRevisionArgument; clusterRevisionArgument = 3U; @@ -19462,8 +19996,9 @@ class Test_TC_PCC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeMaxPressure_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -19479,8 +20014,9 @@ class Test_TC_PCC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeEffectiveOperationMode_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster .ReadAttribute( @@ -19497,8 +20033,9 @@ class Test_TC_PCC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeEffectiveControlMode_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2); @@ -19514,8 +20051,9 @@ class Test_TC_PCC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeCapacity_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_3, OnFailureCallback_3); @@ -19531,8 +20069,9 @@ class Test_TC_PCC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeMaxPressure_4() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_4, OnFailureCallback_4); @@ -19548,8 +20087,9 @@ class Test_TC_PCC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeEffectiveOperationMode_5() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster .ReadAttribute( @@ -19566,8 +20106,9 @@ class Test_TC_PCC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeEffectiveControlMode_6() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_6, OnFailureCallback_6); @@ -19583,8 +20124,9 @@ class Test_TC_PCC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeCapacity_7() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_7, OnFailureCallback_7); @@ -19681,8 +20223,9 @@ class Test_TC_PCC_2_2 : public TestCommand CHIP_ERROR TestWrite1ToTheOperationModeAttributeToDutOperationMode_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t operationModeArgument; operationModeArgument = static_cast(1); @@ -19697,8 +20240,9 @@ class Test_TC_PCC_2_2 : public TestCommand CHIP_ERROR TestWrite2ToTheOperationModeAttributeToDutOperationMode_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t operationModeArgument; operationModeArgument = static_cast(2); @@ -19713,8 +20257,9 @@ class Test_TC_PCC_2_2 : public TestCommand CHIP_ERROR TestWrite3ToTheOperationModeAttributeToDutOperationMode_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t operationModeArgument; operationModeArgument = static_cast(3); @@ -19802,8 +20347,9 @@ class Test_TC_PCC_2_3 : public TestCommand CHIP_ERROR TestWrite0ToTheOperationModeAttributeToDut_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t operationModeArgument; operationModeArgument = static_cast(0); @@ -19818,8 +20364,9 @@ class Test_TC_PCC_2_3 : public TestCommand CHIP_ERROR TestReadsTheAttributeEffectiveOperationMode_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster .ReadAttribute( @@ -19896,8 +20443,9 @@ class Test_TC_RH_1_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::RelativeHumidityMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t clusterRevisionArgument; clusterRevisionArgument = 1U; @@ -19988,8 +20536,9 @@ class Test_TC_RH_2_1 : public TestCommand CHIP_ERROR TestReadsConstraintsOfAttributeMeasuredValue_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::RelativeHumidityMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -20005,8 +20554,9 @@ class Test_TC_RH_2_1 : public TestCommand CHIP_ERROR TestReadsConstraintsOfAttributeMinMeasuredValue_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::RelativeHumidityMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_1, OnFailureCallback_1); @@ -20099,8 +20649,9 @@ class Test_TC_RH_2_2 : public TestCommand CHIP_ERROR TestReadsMeasuredValueAttributeFromDut_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::RelativeHumidityMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -20116,8 +20667,9 @@ class Test_TC_RH_2_2 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::RelativeHumidityMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_1, OnFailureCallback_1); @@ -20221,8 +20773,9 @@ class Test_TC_TM_1_1 : public TestCommand CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TemperatureMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -20238,8 +20791,9 @@ class Test_TC_TM_1_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TemperatureMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t clusterRevisionArgument; clusterRevisionArgument = 3U; @@ -20254,8 +20808,9 @@ class Test_TC_TM_1_1 : public TestCommand CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TemperatureMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2); @@ -20333,8 +20888,9 @@ class Test_TC_TM_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TemperatureMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -20426,8 +20982,9 @@ class Test_TC_TM_2_2 : public TestCommand CHIP_ERROR TestReadsMeasuredValueAttributeFromDut_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TemperatureMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -20443,8 +21000,9 @@ class Test_TC_TM_2_2 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TemperatureMeasurementClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_1, OnFailureCallback_1); @@ -20520,8 +21078,9 @@ class Test_TC_TSTAT_1_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t clusterRevisionArgument; clusterRevisionArgument = 5U; @@ -21422,8 +21981,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutLocalTemperature_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -21439,8 +21999,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsMandatoryAttributesFromDutAbsMinHeatSetpointLimit_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_1, OnFailureCallback_1); @@ -21456,8 +22017,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutAbsMinHeatSetpointLimit_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2); @@ -21475,8 +22037,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutAbsMinHeatSetpointLimit_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); int16_t absMinHeatSetpointLimitArgument; absMinHeatSetpointLimitArgument = 700; @@ -21491,8 +22054,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadBackMandatoryAttributesFromDutAbsMinHeatSetpointLimit_4() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_4, OnFailureCallback_4); @@ -21508,8 +22072,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_5() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_5, OnFailureCallback_5); @@ -21525,8 +22090,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_6() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_6, OnFailureCallback_6); @@ -21544,8 +22110,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutAbsMaxHeatSetpointLimit_7() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); int16_t absMaxHeatSetpointLimitArgument; absMaxHeatSetpointLimitArgument = 3000; @@ -21560,8 +22127,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadBackMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_8() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_8, OnFailureCallback_8); @@ -21577,8 +22145,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsMandatoryAttributesFromDutAbsMinCoolSetpointLimit_9() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_9, OnFailureCallback_9); @@ -21594,8 +22163,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutAbsMinCoolSetpointLimit_10() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_10, OnFailureCallback_10); @@ -21613,8 +22183,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutAbsMinCoolSetpointLimit_11() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); int16_t absMinCoolSetpointLimitArgument; absMinCoolSetpointLimitArgument = 1600; @@ -21629,8 +22200,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadBackMandatoryAttributesFromDutAbsMinCoolSetpointLimit_12() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_12, OnFailureCallback_12); @@ -21646,8 +22218,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsMandatoryAttributesFromDutAbsMaxCoolSetpointLimit_13() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_13, OnFailureCallback_13); @@ -21663,8 +22236,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutAbsMaxCoolSetpointLimit_14() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_14, OnFailureCallback_14); @@ -21682,8 +22256,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutAbsMaxCoolSetpointLimit_15() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); int16_t absMaxCoolSetpointLimitArgument; absMaxCoolSetpointLimitArgument = 3200; @@ -21698,8 +22273,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadBackMandatoryAttributesFromDutAbsMaxCoolSetpointLimit_16() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_16, OnFailureCallback_16); @@ -21715,8 +22291,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsMandatoryAttributesFromDutOccupiedCoolingSetpoint_17() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_17, OnFailureCallback_17); @@ -21732,8 +22309,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutOccupiedCoolingSetpoint_18() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_18, OnFailureCallback_18); @@ -21751,8 +22329,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutOccupiedCoolingSetpoint_19() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); int16_t occupiedCoolingSetpointArgument; occupiedCoolingSetpointArgument = 2600; @@ -21767,8 +22346,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadBackMandatoryAttributesFromDutOccupiedCoolingSetpoint_20() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_20, OnFailureCallback_20); @@ -21784,8 +22364,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsMandatoryAttributesFromDutOccupiedHeatingSetpoint_21() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_21, OnFailureCallback_21); @@ -21801,8 +22382,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutOccupiedHeatingSetpoint_22() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_22, OnFailureCallback_22); @@ -21820,8 +22402,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutOccupiedHeatingSetpoint_23() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); int16_t occupiedHeatingSetpointArgument; occupiedHeatingSetpointArgument = 2000; @@ -21836,8 +22419,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadBackMandatoryAttributesFromDutOccupiedHeatingSetpoint_24() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_24, OnFailureCallback_24); @@ -21853,8 +22437,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsMandatoryAttributesFromDutMinHeatSetpointLimit_25() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_25, OnFailureCallback_25); @@ -21870,8 +22455,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutMinHeatSetpointLimit_26() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_26, OnFailureCallback_26); @@ -21889,8 +22475,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutMinHeatSetpointLimit_27() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); int16_t minHeatSetpointLimitArgument; minHeatSetpointLimitArgument = 700; @@ -21905,8 +22492,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadBackMandatoryAttributesFromDutMinHeatSetpointLimit_28() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_28, OnFailureCallback_28); @@ -21922,8 +22510,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsMandatoryAttributesFromDutMaxHeatSetpointLimit_29() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_29, OnFailureCallback_29); @@ -21939,8 +22528,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutMaxHeatSetpointLimit_30() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_30, OnFailureCallback_30); @@ -21958,8 +22548,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutMaxHeatSetpointLimit_31() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); int16_t maxHeatSetpointLimitArgument; maxHeatSetpointLimitArgument = 3000; @@ -21974,8 +22565,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadBackMandatoryAttributesFromDutMaxHeatSetpointLimit_32() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_32, OnFailureCallback_32); @@ -21991,8 +22583,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsMandatoryAttributesFromDutMinCoolSetpointLimit_33() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_33, OnFailureCallback_33); @@ -22008,8 +22601,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutMinCoolSetpointLimit_34() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_34, OnFailureCallback_34); @@ -22027,8 +22621,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutMinCoolSetpointLimit_35() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); int16_t minCoolSetpointLimitArgument; minCoolSetpointLimitArgument = 1600; @@ -22043,8 +22638,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadBackMandatoryAttributesFromDutMinCoolSetpointLimit_36() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_36, OnFailureCallback_36); @@ -22060,8 +22656,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsMandatoryAttributesFromDutMaxCoolSetpointLimit_37() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_37, OnFailureCallback_37); @@ -22077,8 +22674,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutMaxCoolSetpointLimit_38() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_38, OnFailureCallback_38); @@ -22096,8 +22694,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutMaxCoolSetpointLimit_39() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); int16_t maxCoolSetpointLimitArgument; maxCoolSetpointLimitArgument = 3200; @@ -22112,8 +22711,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadBackMandatoryAttributesFromDutMaxCoolSetpointLimit_40() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_40, OnFailureCallback_40); @@ -22129,8 +22729,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsMandatoryAttributesFromDutControlSequenceOfOperation_41() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_41, OnFailureCallback_41); @@ -22146,8 +22747,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutControlSequenceOfOperation_42() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_42, OnFailureCallback_42); @@ -22164,8 +22766,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutControlSequenceOfOperation_43() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t controlSequenceOfOperationArgument; controlSequenceOfOperationArgument = static_cast(4); @@ -22180,8 +22783,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadBackMandatoryAttributesFromDutControlSequenceOfOperation_44() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_44, OnFailureCallback_44); @@ -22197,8 +22801,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsMandatoryAttributesFromDutSystemMode_45() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_45, OnFailureCallback_45); @@ -22214,8 +22819,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutSystemMode_46() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_46, OnFailureCallback_46); @@ -22232,8 +22838,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributesToDutSystemMode_47() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t systemModeArgument; systemModeArgument = static_cast(1); @@ -22248,8 +22855,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadBackMandatoryAttributesFromDutSystemMode_48() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_48, OnFailureCallback_48); @@ -22265,8 +22873,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsOptionalAttributesFromDutMinSetpointDeadBand_49() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_49, OnFailureCallback_49); @@ -22282,8 +22891,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutMinSetpointDeadBand_50() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_50, OnFailureCallback_50); @@ -22300,8 +22910,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestWritesTheRespectiveDefaultValueToOptionalAttributesToDutMinSetpointDeadBand_51() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); int8_t minSetpointDeadBandArgument; minSetpointDeadBandArgument = 25; @@ -22316,8 +22927,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadBackOptionalAttributesFromDutMinSetpointDeadBand_52() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_52, OnFailureCallback_52); @@ -22333,8 +22945,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutStartOfWeek_53() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_53, OnFailureCallback_53); @@ -22351,8 +22964,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestWritesTheRespectiveDefaultValueToOptionalAttributesToDutStartOfWeek_54() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t startOfWeekArgument; startOfWeekArgument = static_cast(0); @@ -22367,8 +22981,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadBackOptionalAttributesFromDutStartOfWeek_55() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_55, OnFailureCallback_55); @@ -22384,8 +22999,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutNumberOfWeeklyTransitions_56() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_56, OnFailureCallback_56); @@ -22401,8 +23017,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestWritesTheRespectiveDefaultValueToOptionalAttributesToDutNumberOfWeeklyTransitions_57() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t numberOfWeeklyTransitionsArgument; numberOfWeeklyTransitionsArgument = 0; @@ -22417,8 +23034,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutNumberOfDailyTransitions_58() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_58, OnFailureCallback_58); @@ -22434,8 +23052,9 @@ class Test_TC_TSTAT_2_1 : public TestCommand CHIP_ERROR TestWritesTheRespectiveDefaultValueToOptionalAttributesToDutNumberOfDailyTransitions_59() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t numberOfDailyTransitionsArgument; numberOfDailyTransitionsArgument = 0; @@ -22510,8 +23129,9 @@ class Test_TC_TSUIC_1_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t clusterRevisionArgument; clusterRevisionArgument = 2U; @@ -22776,8 +23396,9 @@ class Test_TC_TSUIC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster .ReadAttribute( @@ -22794,8 +23415,9 @@ class Test_TC_TSUIC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster .ReadAttribute( @@ -22812,8 +23434,9 @@ class Test_TC_TSUIC_2_1 : public TestCommand CHIP_ERROR TestWriteToTheMandatoryAttributeTemperatureDisplayMode_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t temperatureDisplayModeArgument; temperatureDisplayModeArgument = static_cast(0); @@ -22829,8 +23452,9 @@ class Test_TC_TSUIC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster .ReadAttribute( @@ -22847,8 +23471,9 @@ class Test_TC_TSUIC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_4() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster .ReadAttribute( @@ -22865,8 +23490,9 @@ class Test_TC_TSUIC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_5() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster .ReadAttribute( @@ -22883,8 +23509,9 @@ class Test_TC_TSUIC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_6() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster .ReadAttribute( @@ -22901,8 +23528,9 @@ class Test_TC_TSUIC_2_1 : public TestCommand CHIP_ERROR TestWriteToTheMandatoryAttributeKeypadLockout_7() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t keypadLockoutArgument; keypadLockoutArgument = static_cast(0); @@ -22918,8 +23546,9 @@ class Test_TC_TSUIC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_8() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster .ReadAttribute( @@ -22936,8 +23565,9 @@ class Test_TC_TSUIC_2_1 : public TestCommand CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_9() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster .ReadAttribute( @@ -22954,8 +23584,9 @@ class Test_TC_TSUIC_2_1 : public TestCommand CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_10() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute< chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo>( @@ -22972,8 +23603,9 @@ class Test_TC_TSUIC_2_1 : public TestCommand CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_11() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute< chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo>( @@ -22990,8 +23622,9 @@ class Test_TC_TSUIC_2_1 : public TestCommand CHIP_ERROR TestWriteToTheMandatoryAttributeScheduleProgrammingVisibility_12() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t scheduleProgrammingVisibilityArgument; scheduleProgrammingVisibilityArgument = static_cast(0); @@ -23007,8 +23640,9 @@ class Test_TC_TSUIC_2_1 : public TestCommand CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_13() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute< chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo>( @@ -23025,8 +23659,9 @@ class Test_TC_TSUIC_2_1 : public TestCommand CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_14() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute< chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo>( @@ -23203,8 +23838,9 @@ class Test_TC_TSUIC_2_2 : public TestCommand CHIP_ERROR TestWritesAValueOf0ToTemperatureDisplayModeAttributeOfDut_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t temperatureDisplayModeArgument; temperatureDisplayModeArgument = static_cast(0); @@ -23220,8 +23856,9 @@ class Test_TC_TSUIC_2_2 : public TestCommand CHIP_ERROR TestWritesAValueOf1ToTemperatureDisplayModeAttributeOfDut_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t temperatureDisplayModeArgument; temperatureDisplayModeArgument = static_cast(1); @@ -23237,8 +23874,9 @@ class Test_TC_TSUIC_2_2 : public TestCommand CHIP_ERROR TestWritesAValueOf0ToKeypadLockoutAttributeOfDut_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t keypadLockoutArgument; keypadLockoutArgument = static_cast(0); @@ -23254,8 +23892,9 @@ class Test_TC_TSUIC_2_2 : public TestCommand CHIP_ERROR TestWritesAValueOf1ToKeypadLockoutAttributeOfDut_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t keypadLockoutArgument; keypadLockoutArgument = static_cast(1); @@ -23271,8 +23910,9 @@ class Test_TC_TSUIC_2_2 : public TestCommand CHIP_ERROR TestWritesAValueOf2ToKeypadLockoutAttributeOfDut_4() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t keypadLockoutArgument; keypadLockoutArgument = static_cast(2); @@ -23288,8 +23928,9 @@ class Test_TC_TSUIC_2_2 : public TestCommand CHIP_ERROR TestWritesAValueOf3ToKeypadLockoutAttributeOfDut_5() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t keypadLockoutArgument; keypadLockoutArgument = static_cast(3); @@ -23305,8 +23946,9 @@ class Test_TC_TSUIC_2_2 : public TestCommand CHIP_ERROR TestWritesAValueOf4ToKeypadLockoutAttributeOfDut_6() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t keypadLockoutArgument; keypadLockoutArgument = static_cast(4); @@ -23322,8 +23964,9 @@ class Test_TC_TSUIC_2_2 : public TestCommand CHIP_ERROR TestWritesAValueOf5ToKeypadLockoutAttributeOfDut_7() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t keypadLockoutArgument; keypadLockoutArgument = static_cast(5); @@ -23339,8 +23982,9 @@ class Test_TC_TSUIC_2_2 : public TestCommand CHIP_ERROR TestWritesAValueOf0ToScheduleProgrammingVisibilityAttributeOfDut_8() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t scheduleProgrammingVisibilityArgument; scheduleProgrammingVisibilityArgument = static_cast(0); @@ -23356,8 +24000,9 @@ class Test_TC_TSUIC_2_2 : public TestCommand CHIP_ERROR TestWritesAValueOf1ToScheduleProgrammingVisibilityAttributeOfDut_9() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t scheduleProgrammingVisibilityArgument; scheduleProgrammingVisibilityArgument = static_cast(1); @@ -23461,8 +24106,9 @@ class Test_TC_DIAGTH_1_1 : public TestCommand CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -23478,8 +24124,9 @@ class Test_TC_DIAGTH_1_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); uint16_t clusterRevisionArgument; clusterRevisionArgument = 1U; @@ -23494,8 +24141,9 @@ class Test_TC_DIAGTH_1_1 : public TestCommand CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2); @@ -23675,8 +24323,9 @@ class Test_TC_WNCV_1_1 : public TestCommand CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -23692,8 +24341,9 @@ class Test_TC_WNCV_1_1 : public TestCommand CHIP_ERROR TestWriteTheDefaultValueToMandatoryGlobalAttributeClusterRevision_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t clusterRevisionArgument; clusterRevisionArgument = 5U; @@ -23708,8 +24358,9 @@ class Test_TC_WNCV_1_1 : public TestCommand CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2); @@ -23725,8 +24376,9 @@ class Test_TC_WNCV_1_1 : public TestCommand CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_3, OnFailureCallback_3); @@ -23742,8 +24394,9 @@ class Test_TC_WNCV_1_1 : public TestCommand CHIP_ERROR TestReadsBackGlobalAttributeFeatureMap_4() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_4, OnFailureCallback_4); @@ -23958,8 +24611,9 @@ class Test_TC_WNCV_2_1 : public TestCommand CHIP_ERROR TestReadTheRoMandatoryAttributeDefaultType_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_0, OnFailureCallback_0); @@ -23975,8 +24629,9 @@ class Test_TC_WNCV_2_1 : public TestCommand CHIP_ERROR TestReadsBackTheRoMandatoryAttributeType_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -23992,8 +24647,9 @@ class Test_TC_WNCV_2_1 : public TestCommand CHIP_ERROR TestReadTheRoMandatoryAttributeDefaultConfigStatus_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2); @@ -24009,8 +24665,9 @@ class Test_TC_WNCV_2_1 : public TestCommand CHIP_ERROR TestReadsBackTheRoMandatoryAttributeConfigStatus_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_3, OnFailureCallback_3); @@ -24026,8 +24683,9 @@ class Test_TC_WNCV_2_1 : public TestCommand CHIP_ERROR TestReadTheRoMandatoryAttributeDefaultOperationalStatus_4() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_4, OnFailureCallback_4); @@ -24043,8 +24701,9 @@ class Test_TC_WNCV_2_1 : public TestCommand CHIP_ERROR TestReadsBackTheRoMandatoryAttributeOperationalStatus_5() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_5, OnFailureCallback_5); @@ -24060,8 +24719,9 @@ class Test_TC_WNCV_2_1 : public TestCommand CHIP_ERROR TestReadTheRoMandatoryAttributeDefaultEndProductType_6() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_6, OnFailureCallback_6); @@ -24077,8 +24737,9 @@ class Test_TC_WNCV_2_1 : public TestCommand CHIP_ERROR TestReadsBackTheRoMandatoryAttributeEndProductType_7() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_7, OnFailureCallback_7); @@ -24094,8 +24755,9 @@ class Test_TC_WNCV_2_1 : public TestCommand CHIP_ERROR TestReadTheRwMandatoryAttributeDefaultMode_8() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_8, OnFailureCallback_8); @@ -24111,8 +24773,9 @@ class Test_TC_WNCV_2_1 : public TestCommand CHIP_ERROR TestWriteAValueIntoTheRwMandatoryAttributeMode_9() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t modeArgument; modeArgument = 7; @@ -24127,8 +24790,9 @@ class Test_TC_WNCV_2_1 : public TestCommand CHIP_ERROR TestReadsBackTheRwMandatoryAttributeMode_10() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_10, OnFailureCallback_10); @@ -24268,8 +24932,9 @@ class Test_TC_WNCV_2_5 : public TestCommand CHIP_ERROR TestReadsEndProductTypeAttributeFromDut_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -24285,8 +24950,9 @@ class Test_TC_WNCV_2_5 : public TestCommand CHIP_ERROR TestReadsEndProductTypeAttributeConstraintsFromDut_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_1, OnFailureCallback_1); @@ -24373,7 +25039,8 @@ class Test_TC_WNCV_3_1 : public TestCommand CHIP_ERROR Test1aThAdjustsTheTheDutToANonOpenPosition_0() { - using RequestType = chip::app::Clusters::WindowCovering::Commands::DownOrClose::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::WindowCovering::Commands::DownOrClose::Type; RequestType request; @@ -24385,7 +25052,7 @@ class Test_TC_WNCV_3_1 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -24395,7 +25062,8 @@ class Test_TC_WNCV_3_1 : public TestCommand CHIP_ERROR Test2aThSendsUpOrOpenCommandToDut_1() { - using RequestType = chip::app::Clusters::WindowCovering::Commands::UpOrOpen::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::WindowCovering::Commands::UpOrOpen::Type; RequestType request; @@ -24407,7 +25075,7 @@ class Test_TC_WNCV_3_1 : public TestCommand (static_cast(context))->OnFailureResponse_1(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -24417,8 +25085,9 @@ class Test_TC_WNCV_3_1 : public TestCommand CHIP_ERROR Test3aThReadsOperationalStatusAttributeFromDut_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2); @@ -24504,7 +25173,8 @@ class Test_TC_WNCV_3_2 : public TestCommand CHIP_ERROR Test1aThAdjustsTheTheDutToANonClosedPosition_0() { - using RequestType = chip::app::Clusters::WindowCovering::Commands::UpOrOpen::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::WindowCovering::Commands::UpOrOpen::Type; RequestType request; @@ -24516,7 +25186,7 @@ class Test_TC_WNCV_3_2 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -24526,7 +25196,8 @@ class Test_TC_WNCV_3_2 : public TestCommand CHIP_ERROR Test2aThSendsDownOrCloseCommandToDut_1() { - using RequestType = chip::app::Clusters::WindowCovering::Commands::DownOrClose::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::WindowCovering::Commands::DownOrClose::Type; RequestType request; @@ -24538,7 +25209,7 @@ class Test_TC_WNCV_3_2 : public TestCommand (static_cast(context))->OnFailureResponse_1(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -24548,8 +25219,9 @@ class Test_TC_WNCV_3_2 : public TestCommand CHIP_ERROR Test3aThReadsOperationalStatusAttributeFromDut_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2); @@ -24635,7 +25307,8 @@ class Test_TC_WNCV_3_3 : public TestCommand CHIP_ERROR Test1aThAdjustsTheTheDutToANonOpenPosition_0() { - using RequestType = chip::app::Clusters::WindowCovering::Commands::UpOrOpen::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::WindowCovering::Commands::UpOrOpen::Type; RequestType request; @@ -24647,7 +25320,7 @@ class Test_TC_WNCV_3_3 : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -24657,7 +25330,8 @@ class Test_TC_WNCV_3_3 : public TestCommand CHIP_ERROR Test2aThSendsStopMotionCommandToDut_1() { - using RequestType = chip::app::Clusters::WindowCovering::Commands::StopMotion::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::WindowCovering::Commands::StopMotion::Type; RequestType request; @@ -24669,7 +25343,7 @@ class Test_TC_WNCV_3_3 : public TestCommand (static_cast(context))->OnFailureResponse_1(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -24679,8 +25353,9 @@ class Test_TC_WNCV_3_3 : public TestCommand CHIP_ERROR Test2bThReadsOperationalStatusAttributeFromDut_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::WindowCoveringClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2); @@ -24765,8 +25440,9 @@ class TV_TargetNavigatorCluster : public TestCommand CHIP_ERROR TestReadAttributeTargetNavigatorList_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TargetNavigatorClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -24791,7 +25467,8 @@ class TV_TargetNavigatorCluster : public TestCommand CHIP_ERROR TestNavigateTargetCommand_1() { - using RequestType = chip::app::Clusters::TargetNavigator::Commands::NavigateTarget::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TargetNavigator::Commands::NavigateTarget::Type; RequestType request; request.target = 1; @@ -24805,7 +25482,7 @@ class TV_TargetNavigatorCluster : public TestCommand (static_cast(context))->OnFailureResponse_1(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -24888,8 +25565,9 @@ class TV_AudioOutputCluster : public TestCommand CHIP_ERROR TestReadAttributeAudioOutputList_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 2; chip::Controller::AudioOutputClusterTest cluster; - cluster.Associate(mDevice, 2); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -24920,7 +25598,8 @@ class TV_AudioOutputCluster : public TestCommand CHIP_ERROR TestSelectOutputCommand_1() { - using RequestType = chip::app::Clusters::AudioOutput::Commands::SelectOutput::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 2; + using RequestType = chip::app::Clusters::AudioOutput::Commands::SelectOutput::Type; RequestType request; request.index = 1; @@ -24933,7 +25612,7 @@ class TV_AudioOutputCluster : public TestCommand (static_cast(context))->OnFailureResponse_1(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 2, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -24943,7 +25622,8 @@ class TV_AudioOutputCluster : public TestCommand CHIP_ERROR TestRenameOutputCommand_2() { - using RequestType = chip::app::Clusters::AudioOutput::Commands::RenameOutput::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 2; + using RequestType = chip::app::Clusters::AudioOutput::Commands::RenameOutput::Type; RequestType request; request.index = 1; @@ -24957,7 +25637,7 @@ class TV_AudioOutputCluster : public TestCommand (static_cast(context))->OnFailureResponse_2(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 2, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -25061,8 +25741,9 @@ class TV_ApplicationLauncherCluster : public TestCommand CHIP_ERROR TestReadAttributeApplicationLauncherList_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ApplicationLauncherClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -25083,7 +25764,8 @@ class TV_ApplicationLauncherCluster : public TestCommand CHIP_ERROR TestLaunchAppCommand_1() { - using RequestType = chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type; RequestType request; request.data = chip::Span("exampleDatagarbage: not in length on purpose", 11); @@ -25098,7 +25780,7 @@ class TV_ApplicationLauncherCluster : public TestCommand (static_cast(context))->OnFailureResponse_1(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -25112,8 +25794,9 @@ class TV_ApplicationLauncherCluster : public TestCommand CHIP_ERROR TestReadAttributeCatalogVendorId_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ApplicationLauncherClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2); @@ -25129,8 +25812,9 @@ class TV_ApplicationLauncherCluster : public TestCommand CHIP_ERROR TestReadAttributeApplicationId_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ApplicationLauncherClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_3, OnFailureCallback_3); @@ -25198,7 +25882,8 @@ class TV_KeypadInputCluster : public TestCommand CHIP_ERROR TestSendKeyCommand_0() { - using RequestType = chip::app::Clusters::KeypadInput::Commands::SendKey::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::KeypadInput::Commands::SendKey::Type; RequestType request; request.keyCode = static_cast(3); @@ -25211,7 +25896,7 @@ class TV_KeypadInputCluster : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -25277,7 +25962,8 @@ class TV_AccountLoginCluster : public TestCommand CHIP_ERROR TestGetSetupPinCommand_0() { - using RequestType = chip::app::Clusters::AccountLogin::Commands::GetSetupPIN::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; + using RequestType = chip::app::Clusters::AccountLogin::Commands::GetSetupPIN::Type; RequestType request; request.tempAccountIdentifier = chip::Span("asdfgarbage: not in length on purpose", 4); @@ -25290,7 +25976,7 @@ class TV_AccountLoginCluster : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 3, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -25300,7 +25986,8 @@ class TV_AccountLoginCluster : public TestCommand CHIP_ERROR TestLoginCommand_1() { - using RequestType = chip::app::Clusters::AccountLogin::Commands::Login::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; + using RequestType = chip::app::Clusters::AccountLogin::Commands::Login::Type; RequestType request; request.tempAccountIdentifier = chip::Span("asdfgarbage: not in length on purpose", 4); @@ -25314,7 +26001,7 @@ class TV_AccountLoginCluster : public TestCommand (static_cast(context))->OnFailureResponse_1(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 3, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -25386,8 +26073,9 @@ class TV_WakeOnLanCluster : public TestCommand CHIP_ERROR TestReadMacAddress_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::WakeOnLanClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -25497,7 +26185,8 @@ class TV_ApplicationBasicCluster : public TestCommand CHIP_ERROR TestChangeStatusCommand_0() { - using RequestType = chip::app::Clusters::ApplicationBasic::Commands::ChangeStatus::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; + using RequestType = chip::app::Clusters::ApplicationBasic::Commands::ChangeStatus::Type; RequestType request; request.status = static_cast(1); @@ -25510,7 +26199,7 @@ class TV_ApplicationBasicCluster : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 3, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -25520,8 +26209,9 @@ class TV_ApplicationBasicCluster : public TestCommand CHIP_ERROR TestReadAttributeVendorId_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; chip::Controller::ApplicationBasicClusterTest cluster; - cluster.Associate(mDevice, 3); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_1, OnFailureCallback_1); @@ -25537,8 +26227,9 @@ class TV_ApplicationBasicCluster : public TestCommand CHIP_ERROR TestReadAttributeProductId_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; chip::Controller::ApplicationBasicClusterTest cluster; - cluster.Associate(mDevice, 3); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2); @@ -25554,8 +26245,9 @@ class TV_ApplicationBasicCluster : public TestCommand CHIP_ERROR TestReadAttributeCatalogVendorId_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; chip::Controller::ApplicationBasicClusterTest cluster; - cluster.Associate(mDevice, 3); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_3, OnFailureCallback_3); @@ -25663,7 +26355,8 @@ class TV_MediaPlaybackCluster : public TestCommand CHIP_ERROR TestMediaPlaybackPlayCommand_0() { - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaPlay::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; + using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaPlay::Type; RequestType request; @@ -25675,7 +26368,7 @@ class TV_MediaPlaybackCluster : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 3, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -25689,7 +26382,8 @@ class TV_MediaPlaybackCluster : public TestCommand CHIP_ERROR TestMediaPlaybackPauseCommand_1() { - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaPause::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; + using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaPause::Type; RequestType request; @@ -25701,7 +26395,7 @@ class TV_MediaPlaybackCluster : public TestCommand (static_cast(context))->OnFailureResponse_1(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 3, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -25715,7 +26409,8 @@ class TV_MediaPlaybackCluster : public TestCommand CHIP_ERROR TestMediaPlaybackStopCommand_2() { - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaStop::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; + using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaStop::Type; RequestType request; @@ -25727,7 +26422,7 @@ class TV_MediaPlaybackCluster : public TestCommand (static_cast(context))->OnFailureResponse_2(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 3, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -25741,7 +26436,8 @@ class TV_MediaPlaybackCluster : public TestCommand CHIP_ERROR TestMediaPlaybackStartOverCommand_3() { - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaStartOver::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; + using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaStartOver::Type; RequestType request; @@ -25753,7 +26449,7 @@ class TV_MediaPlaybackCluster : public TestCommand (static_cast(context))->OnFailureResponse_3(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 3, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -25767,7 +26463,8 @@ class TV_MediaPlaybackCluster : public TestCommand CHIP_ERROR TestMediaPlaybackPreviousCommand_4() { - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaPrevious::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; + using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaPrevious::Type; RequestType request; @@ -25779,7 +26476,7 @@ class TV_MediaPlaybackCluster : public TestCommand (static_cast(context))->OnFailureResponse_4(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 3, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -25793,7 +26490,8 @@ class TV_MediaPlaybackCluster : public TestCommand CHIP_ERROR TestMediaPlaybackNextCommand_5() { - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaNext::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; + using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaNext::Type; RequestType request; @@ -25805,7 +26503,7 @@ class TV_MediaPlaybackCluster : public TestCommand (static_cast(context))->OnFailureResponse_5(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 3, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -25819,7 +26517,8 @@ class TV_MediaPlaybackCluster : public TestCommand CHIP_ERROR TestMediaPlaybackRewindCommand_6() { - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaRewind::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; + using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaRewind::Type; RequestType request; @@ -25831,7 +26530,7 @@ class TV_MediaPlaybackCluster : public TestCommand (static_cast(context))->OnFailureResponse_6(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 3, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -25845,7 +26544,8 @@ class TV_MediaPlaybackCluster : public TestCommand CHIP_ERROR TestMediaPlaybackFastForwardCommand_7() { - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaFastForward::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; + using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaFastForward::Type; RequestType request; @@ -25857,7 +26557,7 @@ class TV_MediaPlaybackCluster : public TestCommand (static_cast(context))->OnFailureResponse_7(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 3, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -25871,7 +26571,8 @@ class TV_MediaPlaybackCluster : public TestCommand CHIP_ERROR TestMediaPlaybackSkipForwardCommand_8() { - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaSkipForward::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; + using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaSkipForward::Type; RequestType request; request.deltaPositionMilliseconds = 100ULL; @@ -25884,7 +26585,7 @@ class TV_MediaPlaybackCluster : public TestCommand (static_cast(context))->OnFailureResponse_8(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 3, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -25898,7 +26599,8 @@ class TV_MediaPlaybackCluster : public TestCommand CHIP_ERROR TestMediaPlaybackSkipBackwardCommand_9() { - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaSkipBackward::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; + using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaSkipBackward::Type; RequestType request; request.deltaPositionMilliseconds = 100ULL; @@ -25911,7 +26613,7 @@ class TV_MediaPlaybackCluster : public TestCommand (static_cast(context))->OnFailureResponse_9(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 3, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -25925,7 +26627,8 @@ class TV_MediaPlaybackCluster : public TestCommand CHIP_ERROR TestMediaPlaybackSeekCommand_10() { - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaSeek::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; + using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaSeek::Type; RequestType request; request.position = 100ULL; @@ -25938,7 +26641,7 @@ class TV_MediaPlaybackCluster : public TestCommand (static_cast(context))->OnFailureResponse_10(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 3, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -26025,8 +26728,9 @@ class TV_TvChannelCluster : public TestCommand CHIP_ERROR TestReadAttributeTvChannelList_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TvChannelClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_0, OnFailureCallback_0); @@ -26061,7 +26765,8 @@ class TV_TvChannelCluster : public TestCommand CHIP_ERROR TestChangeChannelByNumberCommand_1() { - using RequestType = chip::app::Clusters::TvChannel::Commands::ChangeChannelByNumber::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TvChannel::Commands::ChangeChannelByNumber::Type; RequestType request; request.majorNumber = 1U; @@ -26075,7 +26780,7 @@ class TV_TvChannelCluster : public TestCommand (static_cast(context))->OnFailureResponse_1(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -26085,7 +26790,8 @@ class TV_TvChannelCluster : public TestCommand CHIP_ERROR TestSkipChannelCommand_2() { - using RequestType = chip::app::Clusters::TvChannel::Commands::SkipChannel::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TvChannel::Commands::SkipChannel::Type; RequestType request; request.count = 1U; @@ -26098,7 +26804,7 @@ class TV_TvChannelCluster : public TestCommand (static_cast(context))->OnFailureResponse_2(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -26160,7 +26866,8 @@ class TV_LowPowerCluster : public TestCommand CHIP_ERROR TestSleepInputStatusCommand_0() { - using RequestType = chip::app::Clusters::LowPower::Commands::Sleep::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::LowPower::Commands::Sleep::Type; RequestType request; @@ -26172,7 +26879,7 @@ class TV_LowPowerCluster : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -26277,8 +26984,9 @@ class TV_MediaInputCluster : public TestCommand CHIP_ERROR TestReadAttributeMediaInputList_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::MediaInputClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -26309,7 +27017,8 @@ class TV_MediaInputCluster : public TestCommand CHIP_ERROR TestSelectInputCommand_1() { - using RequestType = chip::app::Clusters::MediaInput::Commands::SelectInput::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::MediaInput::Commands::SelectInput::Type; RequestType request; request.index = 1; @@ -26322,7 +27031,7 @@ class TV_MediaInputCluster : public TestCommand (static_cast(context))->OnFailureResponse_1(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -26332,8 +27041,9 @@ class TV_MediaInputCluster : public TestCommand CHIP_ERROR TestReadCurrentInputList_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::MediaInputClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2); @@ -26349,7 +27059,8 @@ class TV_MediaInputCluster : public TestCommand CHIP_ERROR TestHideInputStatusCommand_3() { - using RequestType = chip::app::Clusters::MediaInput::Commands::HideInputStatus::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::MediaInput::Commands::HideInputStatus::Type; RequestType request; @@ -26361,7 +27072,7 @@ class TV_MediaInputCluster : public TestCommand (static_cast(context))->OnFailureResponse_3(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -26371,7 +27082,8 @@ class TV_MediaInputCluster : public TestCommand CHIP_ERROR TestShowInputStatusCommand_4() { - using RequestType = chip::app::Clusters::MediaInput::Commands::ShowInputStatus::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::MediaInput::Commands::ShowInputStatus::Type; RequestType request; @@ -26383,7 +27095,7 @@ class TV_MediaInputCluster : public TestCommand (static_cast(context))->OnFailureResponse_4(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -26393,7 +27105,8 @@ class TV_MediaInputCluster : public TestCommand CHIP_ERROR TestRenameInputCommand_5() { - using RequestType = chip::app::Clusters::MediaInput::Commands::RenameInput::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::MediaInput::Commands::RenameInput::Type; RequestType request; request.index = 1; @@ -26407,7 +27120,7 @@ class TV_MediaInputCluster : public TestCommand (static_cast(context))->OnFailureResponse_5(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -28003,7 +28716,8 @@ class TestCluster : public TestCommand CHIP_ERROR TestSendTestCommand_0() { - using RequestType = chip::app::Clusters::TestCluster::Commands::Test::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::Test::Type; RequestType request; @@ -28015,7 +28729,7 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -28025,7 +28739,8 @@ class TestCluster : public TestCommand CHIP_ERROR TestSendTestNotHandledCommand_1() { - using RequestType = chip::app::Clusters::TestCluster::Commands::TestNotHandled::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestNotHandled::Type; RequestType request; @@ -28037,7 +28752,7 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_1(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -28047,7 +28762,8 @@ class TestCluster : public TestCommand CHIP_ERROR TestSendTestSpecificCommand_2() { - using RequestType = chip::app::Clusters::TestCluster::Commands::TestSpecific::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestSpecific::Type; RequestType request; @@ -28059,7 +28775,7 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_2(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -28073,7 +28789,8 @@ class TestCluster : public TestCommand CHIP_ERROR TestSendTestAddArgumentsCommand_3() { - using RequestType = chip::app::Clusters::TestCluster::Commands::TestAddArguments::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestAddArguments::Type; RequestType request; request.arg1 = 3; @@ -28087,7 +28804,7 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_3(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -28101,7 +28818,8 @@ class TestCluster : public TestCommand CHIP_ERROR TestSendFailingTestAddArgumentsCommand_4() { - using RequestType = chip::app::Clusters::TestCluster::Commands::TestAddArguments::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestAddArguments::Type; RequestType request; request.arg1 = 250; @@ -28115,7 +28833,7 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_4(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -28125,8 +28843,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeBooleanDefaultValue_5() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_5, OnFailureCallback_5); @@ -28142,8 +28861,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeBooleanTrue_6() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); bool booleanArgument; booleanArgument = 1; @@ -28158,8 +28878,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeBooleanTrue_7() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_7, OnFailureCallback_7); @@ -28175,8 +28896,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeBooleanFalse_8() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); bool booleanArgument; booleanArgument = 0; @@ -28191,8 +28913,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeBooleanFalse_9() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_9, OnFailureCallback_9); @@ -28208,8 +28931,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeBitmap8DefaultValue_10() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_10, OnFailureCallback_10); @@ -28225,8 +28949,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeBitmap8MaxValue_11() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t bitmap8Argument; bitmap8Argument = 255; @@ -28241,8 +28966,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeBitmap8MaxValue_12() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_12, OnFailureCallback_12); @@ -28258,8 +28984,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeBitmap8MinValue_13() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t bitmap8Argument; bitmap8Argument = 0; @@ -28274,8 +29001,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeBitmap8MinValue_14() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_14, OnFailureCallback_14); @@ -28291,8 +29019,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeBitmap16DefaultValue_15() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_15, OnFailureCallback_15); @@ -28308,8 +29037,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeBitmap16MaxValue_16() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t bitmap16Argument; bitmap16Argument = 65535U; @@ -28324,8 +29054,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeBitmap16MaxValue_17() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_17, OnFailureCallback_17); @@ -28341,8 +29072,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeBitmap16MinValue_18() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t bitmap16Argument; bitmap16Argument = 0U; @@ -28357,8 +29089,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeBitmap16MinValue_19() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_19, OnFailureCallback_19); @@ -28374,8 +29107,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeBitmap32DefaultValue_20() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_20, OnFailureCallback_20); @@ -28391,8 +29125,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeBitmap32MaxValue_21() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint32_t bitmap32Argument; bitmap32Argument = 4294967295UL; @@ -28407,8 +29142,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeBitmap32MaxValue_22() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_22, OnFailureCallback_22); @@ -28424,8 +29160,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeBitmap32MinValue_23() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint32_t bitmap32Argument; bitmap32Argument = 0UL; @@ -28440,8 +29177,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeBitmap32MinValue_24() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_24, OnFailureCallback_24); @@ -28457,8 +29195,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeBitmap64DefaultValue_25() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_25, OnFailureCallback_25); @@ -28474,8 +29213,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeBitmap64MaxValue_26() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint64_t bitmap64Argument; bitmap64Argument = 18446744073709551615ULL; @@ -28490,8 +29230,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeBitmap64MaxValue_27() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_27, OnFailureCallback_27); @@ -28507,8 +29248,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeBitmap64MinValue_28() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint64_t bitmap64Argument; bitmap64Argument = 0ULL; @@ -28523,8 +29265,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeBitmap64MinValue_29() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_29, OnFailureCallback_29); @@ -28540,8 +29283,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeInt8uDefaultValue_30() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_30, OnFailureCallback_30); @@ -28557,8 +29301,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeInt8uMaxValue_31() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t int8uArgument; int8uArgument = 255; @@ -28573,8 +29318,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeInt8uMaxValue_32() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_32, OnFailureCallback_32); @@ -28590,8 +29336,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeInt8uMinValue_33() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t int8uArgument; int8uArgument = 0; @@ -28606,8 +29353,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeInt8uMinValue_34() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_34, OnFailureCallback_34); @@ -28623,8 +29371,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeInt16uDefaultValue_35() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_35, OnFailureCallback_35); @@ -28640,8 +29389,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeInt16uMaxValue_36() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t int16uArgument; int16uArgument = 65535U; @@ -28656,8 +29406,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeInt16uMaxValue_37() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_37, OnFailureCallback_37); @@ -28673,8 +29424,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeInt16uMinValue_38() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t int16uArgument; int16uArgument = 0U; @@ -28689,8 +29441,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeInt16uMinValue_39() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_39, OnFailureCallback_39); @@ -28706,8 +29459,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeInt32uDefaultValue_40() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_40, OnFailureCallback_40); @@ -28723,8 +29477,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeInt32uMaxValue_41() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint32_t int32uArgument; int32uArgument = 4294967295UL; @@ -28739,8 +29494,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeInt32uMaxValue_42() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_42, OnFailureCallback_42); @@ -28756,8 +29512,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeInt32uMinValue_43() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint32_t int32uArgument; int32uArgument = 0UL; @@ -28772,8 +29529,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeInt32uMinValue_44() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_44, OnFailureCallback_44); @@ -28789,8 +29547,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeInt64uDefaultValue_45() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_45, OnFailureCallback_45); @@ -28806,8 +29565,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeInt64uMaxValue_46() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint64_t int64uArgument; int64uArgument = 18446744073709551615ULL; @@ -28822,8 +29582,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeInt64uMaxValue_47() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_47, OnFailureCallback_47); @@ -28839,8 +29600,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeInt64uMinValue_48() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint64_t int64uArgument; int64uArgument = 0ULL; @@ -28855,8 +29617,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeInt64uMinValue_49() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_49, OnFailureCallback_49); @@ -28872,8 +29635,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeInt8sDefaultValue_50() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_50, OnFailureCallback_50); @@ -28889,8 +29653,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeInt8sMaxValue_51() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); int8_t int8sArgument; int8sArgument = 127; @@ -28905,8 +29670,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeInt8sMaxValue_52() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_52, OnFailureCallback_52); @@ -28922,8 +29688,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeInt8sMinValue_53() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); int8_t int8sArgument; int8sArgument = -128; @@ -28938,8 +29705,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeInt8sMinValue_54() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_54, OnFailureCallback_54); @@ -28955,8 +29723,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeInt8sDefaultValue_55() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); int8_t int8sArgument; int8sArgument = 0; @@ -28971,8 +29740,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeInt8sDefaultValue_56() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_56, OnFailureCallback_56); @@ -28988,8 +29758,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeInt16sDefaultValue_57() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_57, OnFailureCallback_57); @@ -29005,8 +29776,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeInt16sMaxValue_58() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); int16_t int16sArgument; int16sArgument = 32767; @@ -29021,8 +29793,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeInt16sMaxValue_59() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_59, OnFailureCallback_59); @@ -29038,8 +29811,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeInt16sMinValue_60() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); int16_t int16sArgument; int16sArgument = -32768; @@ -29054,8 +29828,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeInt16sMinValue_61() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_61, OnFailureCallback_61); @@ -29071,8 +29846,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeInt16sDefaultValue_62() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); int16_t int16sArgument; int16sArgument = 0; @@ -29087,8 +29863,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeInt16sDefaultValue_63() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_63, OnFailureCallback_63); @@ -29104,8 +29881,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeInt32sDefaultValue_64() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_64, OnFailureCallback_64); @@ -29121,8 +29899,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeInt32sMaxValue_65() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); int32_t int32sArgument; int32sArgument = 2147483647L; @@ -29137,8 +29916,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeInt32sMaxValue_66() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_66, OnFailureCallback_66); @@ -29154,8 +29934,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeInt32sMinValue_67() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); int32_t int32sArgument; int32sArgument = -2147483648L; @@ -29170,8 +29951,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeInt32sMinValue_68() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_68, OnFailureCallback_68); @@ -29187,8 +29969,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeInt32sDefaultValue_69() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); int32_t int32sArgument; int32sArgument = 0L; @@ -29203,8 +29986,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeInt32sDefaultValue_70() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_70, OnFailureCallback_70); @@ -29220,8 +30004,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeInt64sDefaultValue_71() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_71, OnFailureCallback_71); @@ -29237,8 +30022,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeInt64sMaxValue_72() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); int64_t int64sArgument; int64sArgument = 9223372036854775807LL; @@ -29253,8 +30039,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeInt64sMaxValue_73() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_73, OnFailureCallback_73); @@ -29270,8 +30057,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeInt64sMinValue_74() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); int64_t int64sArgument; int64sArgument = -9223372036854775807LL; @@ -29286,8 +30074,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeInt64sMinValue_75() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_75, OnFailureCallback_75); @@ -29303,8 +30092,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeInt64sDefaultValue_76() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); int64_t int64sArgument; int64sArgument = 0LL; @@ -29319,8 +30109,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeInt64sDefaultValue_77() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_77, OnFailureCallback_77); @@ -29336,8 +30127,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeEnum8DefaultValue_78() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_78, OnFailureCallback_78); @@ -29353,8 +30145,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeEnum8MaxValue_79() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t enum8Argument; enum8Argument = static_cast(255); @@ -29369,8 +30162,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeEnum8MaxValue_80() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_80, OnFailureCallback_80); @@ -29386,8 +30180,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeEnum8MinValue_81() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint8_t enum8Argument; enum8Argument = static_cast(0); @@ -29402,8 +30197,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeEnum8MinValue_82() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_82, OnFailureCallback_82); @@ -29419,8 +30215,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeEnum16DefaultValue_83() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_83, OnFailureCallback_83); @@ -29436,8 +30233,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeEnum16MaxValue_84() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t enum16Argument; enum16Argument = static_cast(65535); @@ -29452,8 +30250,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeEnum16MaxValue_85() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_85, OnFailureCallback_85); @@ -29469,8 +30268,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeEnum16MinValue_86() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t enum16Argument; enum16Argument = static_cast(0); @@ -29485,8 +30285,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeEnum16MinValue_87() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_87, OnFailureCallback_87); @@ -29502,8 +30303,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeOctetStringDefaultValue_88() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_88, OnFailureCallback_88); @@ -29519,8 +30321,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeOctetStringWithEmbeddedNull_89() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); chip::ByteSpan octetStringArgument; octetStringArgument = chip::ByteSpan(chip::Uint8::from_const_char("Tes\x00ti\x00nggarbage: not in length on purpose"), 9); @@ -29535,8 +30338,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeOctetStringWithEmbeddedNull_90() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_90, OnFailureCallback_90); @@ -29553,8 +30357,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeOctetString_91() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); chip::ByteSpan octetStringArgument; octetStringArgument = chip::ByteSpan(chip::Uint8::from_const_char("TestValuegarbage: not in length on purpose"), 9); @@ -29569,8 +30374,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeOctetString_92() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_92, OnFailureCallback_92); @@ -29587,8 +30393,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeOctetString_93() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); chip::ByteSpan octetStringArgument; octetStringArgument = @@ -29604,8 +30411,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeOctetString_94() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_94, OnFailureCallback_94); @@ -29622,8 +30430,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeOctetString_95() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); chip::ByteSpan octetStringArgument; octetStringArgument = chip::ByteSpan(chip::Uint8::from_const_char("garbage: not in length on purpose"), 0); @@ -29638,8 +30447,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeLongOctetStringDefaultValue_96() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_96, OnFailureCallback_96); @@ -29655,8 +30465,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeLongOctetString_97() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); chip::ByteSpan longOctetStringArgument; longOctetStringArgument = chip::ByteSpan( @@ -29676,8 +30487,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeLongOctetString_98() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_98, OnFailureCallback_98); @@ -29700,8 +30512,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeLongOctetString_99() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); chip::ByteSpan longOctetStringArgument; longOctetStringArgument = chip::ByteSpan(chip::Uint8::from_const_char("garbage: not in length on purpose"), 0); @@ -29716,8 +30529,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeCharStringDefaultValue_100() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_100, OnFailureCallback_100); @@ -29733,8 +30547,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeCharString_101() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); chip::CharSpan charStringArgument; charStringArgument = chip::Span("☉T☉garbage: not in length on purpose", 3); @@ -29749,8 +30564,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeCharStringValueTooLong_102() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); chip::CharSpan charStringArgument; charStringArgument = chip::Span("☉TestValueLongerThan10☉garbage: not in length on purpose", 23); @@ -29765,8 +30581,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeCharStringEmpty_103() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); chip::CharSpan charStringArgument; charStringArgument = chip::Span("garbage: not in length on purpose", 0); @@ -29781,8 +30598,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeLongCharStringDefaultValue_104() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_104, OnFailureCallback_104); @@ -29798,8 +30616,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeLongCharString_105() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); chip::CharSpan longCharStringArgument; longCharStringArgument = chip::Span( @@ -29818,8 +30637,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeLongCharString_106() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_106, OnFailureCallback_106); @@ -29840,8 +30660,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeLongCharString_107() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); chip::CharSpan longCharStringArgument; longCharStringArgument = chip::Span("garbage: not in length on purpose", 0); @@ -29856,8 +30677,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeEpochUsDefaultValue_108() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_108, OnFailureCallback_108); @@ -29873,8 +30695,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeEpochUsMaxValue_109() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint64_t epochUsArgument; epochUsArgument = 18446744073709551615ULL; @@ -29889,8 +30712,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeEpochUsMaxValue_110() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_110, OnFailureCallback_110); @@ -29906,8 +30730,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeEpochUsMinValue_111() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint64_t epochUsArgument; epochUsArgument = 0ULL; @@ -29922,8 +30747,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeEpochUsMinValue_112() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_112, OnFailureCallback_112); @@ -29939,8 +30765,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeEpochSDefaultValue_113() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_113, OnFailureCallback_113); @@ -29956,8 +30783,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeEpochSMaxValue_114() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint32_t epochSArgument; epochSArgument = 4294967295UL; @@ -29972,8 +30800,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeEpochSMaxValue_115() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_115, OnFailureCallback_115); @@ -29989,8 +30818,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeEpochSMinValue_116() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint32_t epochSArgument; epochSArgument = 0UL; @@ -30005,8 +30835,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeEpochSMinValue_117() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_117, OnFailureCallback_117); @@ -30022,8 +30853,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeUnsupported_118() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_118, OnFailureCallback_118); @@ -30042,8 +30874,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteattributeUnsupported_119() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); bool unsupportedArgument; unsupportedArgument = 0; @@ -30061,7 +30894,8 @@ class TestCluster : public TestCommand CHIP_ERROR TestSendTestCommandToUnsupportedEndpoint_120() { - using RequestType = chip::app::Clusters::TestCluster::Commands::Test::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 200; + using RequestType = chip::app::Clusters::TestCluster::Commands::Test::Type; RequestType request; @@ -30073,7 +30907,7 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_120(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 200, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -30083,8 +30917,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeVendorIdDefaultValue_121() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_121, OnFailureCallback_121); @@ -30100,8 +30935,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestWriteAttributeVendorId_122() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); chip::VendorId vendorIdArgument; vendorIdArgument = static_cast(17); @@ -30116,8 +30952,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestReadAttributeVendorId_123() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_123, OnFailureCallback_123); @@ -30133,8 +30970,9 @@ class TestCluster : public TestCommand CHIP_ERROR TestRestoreAttributeVendorId_124() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); chip::VendorId vendorIdArgument; vendorIdArgument = static_cast(0); @@ -30149,7 +30987,8 @@ class TestCluster : public TestCommand CHIP_ERROR TestSendACommandWithAVendorIdAndEnum_125() { - using RequestType = chip::app::Clusters::TestCluster::Commands::TestEnumsRequest::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestEnumsRequest::Type; RequestType request; request.arg1 = static_cast(20003); @@ -30163,7 +31002,7 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_125(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -30281,6 +31120,410 @@ class TestClusterComplexTypes : public TestCommand ChipLogProgress(chipTool, " ***** Test Step 16 : Send Test Command with optional arg set to null.\n"); err = TestSendTestCommandWithOptionalArgSetToNull_16(); break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Write attribute NULLABLE_BOOLEAN null\n"); + err = TestWriteAttributeNullableBooleanNull_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Read attribute NULLABLE_BOOLEAN null\n"); + err = TestReadAttributeNullableBooleanNull_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Write attribute NULLABLE_BOOLEAN True\n"); + err = TestWriteAttributeNullableBooleanTrue_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Read attribute NULLABLE_BOOLEAN True\n"); + err = TestReadAttributeNullableBooleanTrue_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Write attribute NULLABLE_BITMAP8 Max Value\n"); + err = TestWriteAttributeNullableBitmap8MaxValue_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Read attribute NULLABLE_BITMAP8 Max Value\n"); + err = TestReadAttributeNullableBitmap8MaxValue_22(); + break; + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : Write attribute NULLABLE_BITMAP8 Invalid Value\n"); + err = TestWriteAttributeNullableBitmap8InvalidValue_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : Read attribute NULLABLE_BITMAP8 unchanged Value\n"); + err = TestReadAttributeNullableBitmap8UnchangedValue_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Write attribute NULLABLE_BITMAP8 null Value\n"); + err = TestWriteAttributeNullableBitmap8NullValue_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Read attribute NULLABLE_BITMAP8 null Value\n"); + err = TestReadAttributeNullableBitmap8NullValue_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Write attribute NULLABLE_BITMAP16 Max Value\n"); + err = TestWriteAttributeNullableBitmap16MaxValue_27(); + break; + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : Read attribute NULLABLE_BITMAP16 Max Value\n"); + err = TestReadAttributeNullableBitmap16MaxValue_28(); + break; + case 29: + ChipLogProgress(chipTool, " ***** Test Step 29 : Write attribute NULLABLE_BITMAP16 Invalid Value\n"); + err = TestWriteAttributeNullableBitmap16InvalidValue_29(); + break; + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : Read attribute NULLABLE_BITMAP16 unchanged Value\n"); + err = TestReadAttributeNullableBitmap16UnchangedValue_30(); + break; + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : Write attribute NULLABLE_BITMAP16 null Value\n"); + err = TestWriteAttributeNullableBitmap16NullValue_31(); + break; + case 32: + ChipLogProgress(chipTool, " ***** Test Step 32 : Read attribute NULLABLE_BITMAP16 null Value\n"); + err = TestReadAttributeNullableBitmap16NullValue_32(); + break; + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : Write attribute NULLABLE_BITMAP32 Max Value\n"); + err = TestWriteAttributeNullableBitmap32MaxValue_33(); + break; + case 34: + ChipLogProgress(chipTool, " ***** Test Step 34 : Read attribute NULLABLE_BITMAP32 Max Value\n"); + err = TestReadAttributeNullableBitmap32MaxValue_34(); + break; + case 35: + ChipLogProgress(chipTool, " ***** Test Step 35 : Write attribute NULLABLE_BITMAP32 Invalid Value\n"); + err = TestWriteAttributeNullableBitmap32InvalidValue_35(); + break; + case 36: + ChipLogProgress(chipTool, " ***** Test Step 36 : Read attribute NULLABLE_BITMAP32 unchanged Value\n"); + err = TestReadAttributeNullableBitmap32UnchangedValue_36(); + break; + case 37: + ChipLogProgress(chipTool, " ***** Test Step 37 : Write attribute NULLABLE_BITMAP32 null Value\n"); + err = TestWriteAttributeNullableBitmap32NullValue_37(); + break; + case 38: + ChipLogProgress(chipTool, " ***** Test Step 38 : Read attribute NULLABLE_BITMAP32 null Value\n"); + err = TestReadAttributeNullableBitmap32NullValue_38(); + break; + case 39: + ChipLogProgress(chipTool, " ***** Test Step 39 : Write attribute NULLABLE_BITMAP64 Max Value\n"); + err = TestWriteAttributeNullableBitmap64MaxValue_39(); + break; + case 40: + ChipLogProgress(chipTool, " ***** Test Step 40 : Read attribute NULLABLE_BITMAP64 Max Value\n"); + err = TestReadAttributeNullableBitmap64MaxValue_40(); + break; + case 41: + ChipLogProgress(chipTool, " ***** Test Step 41 : Write attribute NULLABLE_BITMAP64 Invalid Value\n"); + err = TestWriteAttributeNullableBitmap64InvalidValue_41(); + break; + case 42: + ChipLogProgress(chipTool, " ***** Test Step 42 : Read attribute NULLABLE_BITMAP64 unchanged Value\n"); + err = TestReadAttributeNullableBitmap64UnchangedValue_42(); + break; + case 43: + ChipLogProgress(chipTool, " ***** Test Step 43 : Write attribute NULLABLE_BITMAP64 null Value\n"); + err = TestWriteAttributeNullableBitmap64NullValue_43(); + break; + case 44: + ChipLogProgress(chipTool, " ***** Test Step 44 : Read attribute NULLABLE_BITMAP64 null Value\n"); + err = TestReadAttributeNullableBitmap64NullValue_44(); + break; + case 45: + ChipLogProgress(chipTool, " ***** Test Step 45 : Write attribute NULLABLE_INT8U Max Value\n"); + err = TestWriteAttributeNullableInt8uMaxValue_45(); + break; + case 46: + ChipLogProgress(chipTool, " ***** Test Step 46 : Read attribute NULLABLE_INT8U Max Value\n"); + err = TestReadAttributeNullableInt8uMaxValue_46(); + break; + case 47: + ChipLogProgress(chipTool, " ***** Test Step 47 : Write attribute NULLABLE_INT8U Invalid Value\n"); + err = TestWriteAttributeNullableInt8uInvalidValue_47(); + break; + case 48: + ChipLogProgress(chipTool, " ***** Test Step 48 : Read attribute NULLABLE_INT8U unchanged Value\n"); + err = TestReadAttributeNullableInt8uUnchangedValue_48(); + break; + case 49: + ChipLogProgress(chipTool, " ***** Test Step 49 : Write attribute NULLABLE_INT8U null Value\n"); + err = TestWriteAttributeNullableInt8uNullValue_49(); + break; + case 50: + ChipLogProgress(chipTool, " ***** Test Step 50 : Read attribute NULLABLE_INT8U null Value\n"); + err = TestReadAttributeNullableInt8uNullValue_50(); + break; + case 51: + ChipLogProgress(chipTool, " ***** Test Step 51 : Write attribute NULLABLE_INT16U Max Value\n"); + err = TestWriteAttributeNullableInt16uMaxValue_51(); + break; + case 52: + ChipLogProgress(chipTool, " ***** Test Step 52 : Read attribute NULLABLE_INT16U Max Value\n"); + err = TestReadAttributeNullableInt16uMaxValue_52(); + break; + case 53: + ChipLogProgress(chipTool, " ***** Test Step 53 : Write attribute NULLABLE_INT16U Invalid Value\n"); + err = TestWriteAttributeNullableInt16uInvalidValue_53(); + break; + case 54: + ChipLogProgress(chipTool, " ***** Test Step 54 : Read attribute NULLABLE_INT16U unchanged Value\n"); + err = TestReadAttributeNullableInt16uUnchangedValue_54(); + break; + case 55: + ChipLogProgress(chipTool, " ***** Test Step 55 : Write attribute NULLABLE_INT16U null Value\n"); + err = TestWriteAttributeNullableInt16uNullValue_55(); + break; + case 56: + ChipLogProgress(chipTool, " ***** Test Step 56 : Read attribute NULLABLE_INT16U null Value\n"); + err = TestReadAttributeNullableInt16uNullValue_56(); + break; + case 57: + ChipLogProgress(chipTool, " ***** Test Step 57 : Write attribute NULLABLE_INT32U Max Value\n"); + err = TestWriteAttributeNullableInt32uMaxValue_57(); + break; + case 58: + ChipLogProgress(chipTool, " ***** Test Step 58 : Read attribute NULLABLE_INT32U Max Value\n"); + err = TestReadAttributeNullableInt32uMaxValue_58(); + break; + case 59: + ChipLogProgress(chipTool, " ***** Test Step 59 : Write attribute NULLABLE_INT32U Invalid Value\n"); + err = TestWriteAttributeNullableInt32uInvalidValue_59(); + break; + case 60: + ChipLogProgress(chipTool, " ***** Test Step 60 : Read attribute NULLABLE_INT32U unchanged Value\n"); + err = TestReadAttributeNullableInt32uUnchangedValue_60(); + break; + case 61: + ChipLogProgress(chipTool, " ***** Test Step 61 : Write attribute NULLABLE_INT32U null Value\n"); + err = TestWriteAttributeNullableInt32uNullValue_61(); + break; + case 62: + ChipLogProgress(chipTool, " ***** Test Step 62 : Read attribute NULLABLE_INT32U null Value\n"); + err = TestReadAttributeNullableInt32uNullValue_62(); + break; + case 63: + ChipLogProgress(chipTool, " ***** Test Step 63 : Write attribute NULLABLE_INT64U Max Value\n"); + err = TestWriteAttributeNullableInt64uMaxValue_63(); + break; + case 64: + ChipLogProgress(chipTool, " ***** Test Step 64 : Read attribute NULLABLE_INT64U Max Value\n"); + err = TestReadAttributeNullableInt64uMaxValue_64(); + break; + case 65: + ChipLogProgress(chipTool, " ***** Test Step 65 : Write attribute NULLABLE_INT64U Invalid Value\n"); + err = TestWriteAttributeNullableInt64uInvalidValue_65(); + break; + case 66: + ChipLogProgress(chipTool, " ***** Test Step 66 : Read attribute NULLABLE_INT64U unchanged Value\n"); + err = TestReadAttributeNullableInt64uUnchangedValue_66(); + break; + case 67: + ChipLogProgress(chipTool, " ***** Test Step 67 : Write attribute NULLABLE_INT64U null Value\n"); + err = TestWriteAttributeNullableInt64uNullValue_67(); + break; + case 68: + ChipLogProgress(chipTool, " ***** Test Step 68 : Read attribute NULLABLE_INT64U null Value\n"); + err = TestReadAttributeNullableInt64uNullValue_68(); + break; + case 69: + ChipLogProgress(chipTool, " ***** Test Step 69 : Write attribute NULLABLE_INT8S Min Value\n"); + err = TestWriteAttributeNullableInt8sMinValue_69(); + break; + case 70: + ChipLogProgress(chipTool, " ***** Test Step 70 : Read attribute NULLABLE_INT8S Min Value\n"); + err = TestReadAttributeNullableInt8sMinValue_70(); + break; + case 71: + ChipLogProgress(chipTool, " ***** Test Step 71 : Write attribute NULLABLE_INT8S Invalid Value\n"); + err = TestWriteAttributeNullableInt8sInvalidValue_71(); + break; + case 72: + ChipLogProgress(chipTool, " ***** Test Step 72 : Read attribute NULLABLE_INT8S unchanged Value\n"); + err = TestReadAttributeNullableInt8sUnchangedValue_72(); + break; + case 73: + ChipLogProgress(chipTool, " ***** Test Step 73 : Write attribute NULLABLE_INT8S null Value\n"); + err = TestWriteAttributeNullableInt8sNullValue_73(); + break; + case 74: + ChipLogProgress(chipTool, " ***** Test Step 74 : Read attribute NULLABLE_INT8S null Value\n"); + err = TestReadAttributeNullableInt8sNullValue_74(); + break; + case 75: + ChipLogProgress(chipTool, " ***** Test Step 75 : Write attribute NULLABLE_INT16S Min Value\n"); + err = TestWriteAttributeNullableInt16sMinValue_75(); + break; + case 76: + ChipLogProgress(chipTool, " ***** Test Step 76 : Read attribute NULLABLE_INT16S Min Value\n"); + err = TestReadAttributeNullableInt16sMinValue_76(); + break; + case 77: + ChipLogProgress(chipTool, " ***** Test Step 77 : Write attribute NULLABLE_INT16S Invalid Value\n"); + err = TestWriteAttributeNullableInt16sInvalidValue_77(); + break; + case 78: + ChipLogProgress(chipTool, " ***** Test Step 78 : Read attribute NULLABLE_INT16S unchanged Value\n"); + err = TestReadAttributeNullableInt16sUnchangedValue_78(); + break; + case 79: + ChipLogProgress(chipTool, " ***** Test Step 79 : Write attribute NULLABLE_INT16S null Value\n"); + err = TestWriteAttributeNullableInt16sNullValue_79(); + break; + case 80: + ChipLogProgress(chipTool, " ***** Test Step 80 : Read attribute NULLABLE_INT16S null Value\n"); + err = TestReadAttributeNullableInt16sNullValue_80(); + break; + case 81: + ChipLogProgress(chipTool, " ***** Test Step 81 : Write attribute NULLABLE_INT32S Min Value\n"); + err = TestWriteAttributeNullableInt32sMinValue_81(); + break; + case 82: + ChipLogProgress(chipTool, " ***** Test Step 82 : Read attribute NULLABLE_INT32S Min Value\n"); + err = TestReadAttributeNullableInt32sMinValue_82(); + break; + case 83: + ChipLogProgress(chipTool, " ***** Test Step 83 : Write attribute NULLABLE_INT32S Invalid Value\n"); + err = TestWriteAttributeNullableInt32sInvalidValue_83(); + break; + case 84: + ChipLogProgress(chipTool, " ***** Test Step 84 : Read attribute NULLABLE_INT32S unchanged Value\n"); + err = TestReadAttributeNullableInt32sUnchangedValue_84(); + break; + case 85: + ChipLogProgress(chipTool, " ***** Test Step 85 : Write attribute NULLABLE_INT32S null Value\n"); + err = TestWriteAttributeNullableInt32sNullValue_85(); + break; + case 86: + ChipLogProgress(chipTool, " ***** Test Step 86 : Read attribute NULLABLE_INT32S null Value\n"); + err = TestReadAttributeNullableInt32sNullValue_86(); + break; + case 87: + ChipLogProgress(chipTool, " ***** Test Step 87 : Write attribute NULLABLE_INT64S Min Value\n"); + err = TestWriteAttributeNullableInt64sMinValue_87(); + break; + case 88: + ChipLogProgress(chipTool, " ***** Test Step 88 : Read attribute NULLABLE_INT64S Min Value\n"); + err = TestReadAttributeNullableInt64sMinValue_88(); + break; + case 89: + ChipLogProgress(chipTool, " ***** Test Step 89 : Write attribute NULLABLE_INT64S Invalid Value\n"); + err = TestWriteAttributeNullableInt64sInvalidValue_89(); + break; + case 90: + ChipLogProgress(chipTool, " ***** Test Step 90 : Read attribute NULLABLE_INT64S unchanged Value\n"); + err = TestReadAttributeNullableInt64sUnchangedValue_90(); + break; + case 91: + ChipLogProgress(chipTool, " ***** Test Step 91 : Write attribute NULLABLE_INT64S null Value\n"); + err = TestWriteAttributeNullableInt64sNullValue_91(); + break; + case 92: + ChipLogProgress(chipTool, " ***** Test Step 92 : Read attribute NULLABLE_INT64S null Value\n"); + err = TestReadAttributeNullableInt64sNullValue_92(); + break; + case 93: + ChipLogProgress(chipTool, " ***** Test Step 93 : Write attribute NULLABLE_ENUM8 Max Value\n"); + err = TestWriteAttributeNullableEnum8MaxValue_93(); + break; + case 94: + ChipLogProgress(chipTool, " ***** Test Step 94 : Read attribute NULLABLE_ENUM8 Max Value\n"); + err = TestReadAttributeNullableEnum8MaxValue_94(); + break; + case 95: + ChipLogProgress(chipTool, " ***** Test Step 95 : Write attribute NULLABLE_ENUM8 Invalid Value\n"); + err = TestWriteAttributeNullableEnum8InvalidValue_95(); + break; + case 96: + ChipLogProgress(chipTool, " ***** Test Step 96 : Read attribute NULLABLE_ENUM8 unchanged Value\n"); + err = TestReadAttributeNullableEnum8UnchangedValue_96(); + break; + case 97: + ChipLogProgress(chipTool, " ***** Test Step 97 : Write attribute NULLABLE_ENUM8 null Value\n"); + err = TestWriteAttributeNullableEnum8NullValue_97(); + break; + case 98: + ChipLogProgress(chipTool, " ***** Test Step 98 : Read attribute NULLABLE_ENUM8 null Value\n"); + err = TestReadAttributeNullableEnum8NullValue_98(); + break; + case 99: + ChipLogProgress(chipTool, " ***** Test Step 99 : Write attribute NULLABLE_ENUM16 Max Value\n"); + err = TestWriteAttributeNullableEnum16MaxValue_99(); + break; + case 100: + ChipLogProgress(chipTool, " ***** Test Step 100 : Read attribute NULLABLE_ENUM16 Max Value\n"); + err = TestReadAttributeNullableEnum16MaxValue_100(); + break; + case 101: + ChipLogProgress(chipTool, " ***** Test Step 101 : Write attribute NULLABLE_ENUM16 Invalid Value\n"); + err = TestWriteAttributeNullableEnum16InvalidValue_101(); + break; + case 102: + ChipLogProgress(chipTool, " ***** Test Step 102 : Read attribute NULLABLE_ENUM16 unchanged Value\n"); + err = TestReadAttributeNullableEnum16UnchangedValue_102(); + break; + case 103: + ChipLogProgress(chipTool, " ***** Test Step 103 : Write attribute NULLABLE_ENUM16 null Value\n"); + err = TestWriteAttributeNullableEnum16NullValue_103(); + break; + case 104: + ChipLogProgress(chipTool, " ***** Test Step 104 : Read attribute NULLABLE_ENUM16 null Value\n"); + err = TestReadAttributeNullableEnum16NullValue_104(); + break; + case 105: + ChipLogProgress(chipTool, " ***** Test Step 105 : Read attribute NULLABLE_OCTET_STRING Default Value\n"); + err = TestReadAttributeNullableOctetStringDefaultValue_105(); + break; + case 106: + ChipLogProgress(chipTool, " ***** Test Step 106 : Write attribute NULLABLE_OCTET_STRING\n"); + err = TestWriteAttributeNullableOctetString_106(); + break; + case 107: + ChipLogProgress(chipTool, " ***** Test Step 107 : Read attribute NULLABLE_OCTET_STRING\n"); + err = TestReadAttributeNullableOctetString_107(); + break; + case 108: + ChipLogProgress(chipTool, " ***** Test Step 108 : Write attribute NULLABLE_OCTET_STRING\n"); + err = TestWriteAttributeNullableOctetString_108(); + break; + case 109: + ChipLogProgress(chipTool, " ***** Test Step 109 : Read attribute NULLABLE_OCTET_STRING\n"); + err = TestReadAttributeNullableOctetString_109(); + break; + case 110: + ChipLogProgress(chipTool, " ***** Test Step 110 : Write attribute NULLABLE_OCTET_STRING\n"); + err = TestWriteAttributeNullableOctetString_110(); + break; + case 111: + ChipLogProgress(chipTool, " ***** Test Step 111 : Read attribute NULLABLE_OCTET_STRING\n"); + err = TestReadAttributeNullableOctetString_111(); + break; + case 112: + ChipLogProgress(chipTool, " ***** Test Step 112 : Read attribute NULLABLE_CHAR_STRING Default Value\n"); + err = TestReadAttributeNullableCharStringDefaultValue_112(); + break; + case 113: + ChipLogProgress(chipTool, " ***** Test Step 113 : Write attribute NULLABLE_CHAR_STRING\n"); + err = TestWriteAttributeNullableCharString_113(); + break; + case 114: + ChipLogProgress(chipTool, " ***** Test Step 114 : Write attribute NULLABLE_CHAR_STRING - Value too long\n"); + err = TestWriteAttributeNullableCharStringValueTooLong_114(); + break; + case 115: + ChipLogProgress(chipTool, " ***** Test Step 115 : Read attribute NULLABLE_CHAR_STRING\n"); + err = TestReadAttributeNullableCharString_115(); + break; + case 116: + ChipLogProgress(chipTool, " ***** Test Step 116 : Write attribute NULLABLE_CHAR_STRING - Empty\n"); + err = TestWriteAttributeNullableCharStringEmpty_116(); + break; + case 117: + ChipLogProgress(chipTool, " ***** Test Step 117 : Read attribute NULLABLE_CHAR_STRING\n"); + err = TestReadAttributeNullableCharString_117(); + break; } if (CHIP_NO_ERROR != err) @@ -30292,7 +31535,7 @@ class TestClusterComplexTypes : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 17; + const uint16_t mTestCount = 118; static void OnFailureCallback_8(void * context, EmberAfStatus status) { @@ -30316,631 +31559,3339 @@ class TestClusterComplexTypes : public TestCommand (static_cast(context))->OnFailureResponse_10(chip::to_underlying(status)); } - static void OnSuccessCallback_10(void * context) { (static_cast(context))->OnSuccessResponse_10(); } + static void OnSuccessCallback_10(void * context) { (static_cast(context))->OnSuccessResponse_10(); } + + static void OnFailureCallback_11(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_11(chip::to_underlying(status)); + } + + static void OnSuccessCallback_11(void * context, const chip::app::DataModel::DecodableList & listOctetString) + { + (static_cast(context))->OnSuccessResponse_11(listOctetString); + } + + static void OnFailureCallback_12(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_12(chip::to_underlying(status)); + } + + static void OnSuccessCallback_12(void * context) { (static_cast(context))->OnSuccessResponse_12(); } + + static void OnFailureCallback_13(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_13(chip::to_underlying(status)); + } + + static void OnSuccessCallback_13( + void * context, + const chip::app::DataModel::DecodableList & + listStructOctetString) + { + (static_cast(context))->OnSuccessResponse_13(listStructOctetString); + } + + static void OnFailureCallback_17(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_17(chip::to_underlying(status)); + } + + static void OnSuccessCallback_17(void * context) { (static_cast(context))->OnSuccessResponse_17(); } + + static void OnFailureCallback_18(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_18(chip::to_underlying(status)); + } + + static void OnSuccessCallback_18(void * context, const chip::app::DataModel::Nullable & nullableBoolean) + { + (static_cast(context))->OnSuccessResponse_18(nullableBoolean); + } + + static void OnFailureCallback_19(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_19(chip::to_underlying(status)); + } + + static void OnSuccessCallback_19(void * context) { (static_cast(context))->OnSuccessResponse_19(); } + + static void OnFailureCallback_20(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_20(chip::to_underlying(status)); + } + + static void OnSuccessCallback_20(void * context, const chip::app::DataModel::Nullable & nullableBoolean) + { + (static_cast(context))->OnSuccessResponse_20(nullableBoolean); + } + + static void OnFailureCallback_21(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_21(chip::to_underlying(status)); + } + + static void OnSuccessCallback_21(void * context) { (static_cast(context))->OnSuccessResponse_21(); } + + static void OnFailureCallback_22(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_22(chip::to_underlying(status)); + } + + static void OnSuccessCallback_22(void * context, const chip::app::DataModel::Nullable & nullableBitmap8) + { + (static_cast(context))->OnSuccessResponse_22(nullableBitmap8); + } + + static void OnFailureCallback_23(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_23(chip::to_underlying(status)); + } + + static void OnSuccessCallback_23(void * context) { (static_cast(context))->OnSuccessResponse_23(); } + + static void OnFailureCallback_24(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_24(chip::to_underlying(status)); + } + + static void OnSuccessCallback_24(void * context, const chip::app::DataModel::Nullable & nullableBitmap8) + { + (static_cast(context))->OnSuccessResponse_24(nullableBitmap8); + } + + static void OnFailureCallback_25(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_25(chip::to_underlying(status)); + } + + static void OnSuccessCallback_25(void * context) { (static_cast(context))->OnSuccessResponse_25(); } + + static void OnFailureCallback_26(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_26(chip::to_underlying(status)); + } + + static void OnSuccessCallback_26(void * context, const chip::app::DataModel::Nullable & nullableBitmap8) + { + (static_cast(context))->OnSuccessResponse_26(nullableBitmap8); + } + + static void OnFailureCallback_27(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_27(chip::to_underlying(status)); + } + + static void OnSuccessCallback_27(void * context) { (static_cast(context))->OnSuccessResponse_27(); } + + static void OnFailureCallback_28(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_28(chip::to_underlying(status)); + } + + static void OnSuccessCallback_28(void * context, const chip::app::DataModel::Nullable & nullableBitmap16) + { + (static_cast(context))->OnSuccessResponse_28(nullableBitmap16); + } + + static void OnFailureCallback_29(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_29(chip::to_underlying(status)); + } + + static void OnSuccessCallback_29(void * context) { (static_cast(context))->OnSuccessResponse_29(); } + + static void OnFailureCallback_30(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_30(chip::to_underlying(status)); + } + + static void OnSuccessCallback_30(void * context, const chip::app::DataModel::Nullable & nullableBitmap16) + { + (static_cast(context))->OnSuccessResponse_30(nullableBitmap16); + } + + static void OnFailureCallback_31(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_31(chip::to_underlying(status)); + } + + static void OnSuccessCallback_31(void * context) { (static_cast(context))->OnSuccessResponse_31(); } + + static void OnFailureCallback_32(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_32(chip::to_underlying(status)); + } + + static void OnSuccessCallback_32(void * context, const chip::app::DataModel::Nullable & nullableBitmap16) + { + (static_cast(context))->OnSuccessResponse_32(nullableBitmap16); + } + + static void OnFailureCallback_33(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_33(chip::to_underlying(status)); + } + + static void OnSuccessCallback_33(void * context) { (static_cast(context))->OnSuccessResponse_33(); } + + static void OnFailureCallback_34(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_34(chip::to_underlying(status)); + } + + static void OnSuccessCallback_34(void * context, const chip::app::DataModel::Nullable & nullableBitmap32) + { + (static_cast(context))->OnSuccessResponse_34(nullableBitmap32); + } + + static void OnFailureCallback_35(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_35(chip::to_underlying(status)); + } + + static void OnSuccessCallback_35(void * context) { (static_cast(context))->OnSuccessResponse_35(); } + + static void OnFailureCallback_36(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_36(chip::to_underlying(status)); + } + + static void OnSuccessCallback_36(void * context, const chip::app::DataModel::Nullable & nullableBitmap32) + { + (static_cast(context))->OnSuccessResponse_36(nullableBitmap32); + } + + static void OnFailureCallback_37(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_37(chip::to_underlying(status)); + } + + static void OnSuccessCallback_37(void * context) { (static_cast(context))->OnSuccessResponse_37(); } + + static void OnFailureCallback_38(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_38(chip::to_underlying(status)); + } + + static void OnSuccessCallback_38(void * context, const chip::app::DataModel::Nullable & nullableBitmap32) + { + (static_cast(context))->OnSuccessResponse_38(nullableBitmap32); + } + + static void OnFailureCallback_39(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_39(chip::to_underlying(status)); + } + + static void OnSuccessCallback_39(void * context) { (static_cast(context))->OnSuccessResponse_39(); } + + static void OnFailureCallback_40(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_40(chip::to_underlying(status)); + } + + static void OnSuccessCallback_40(void * context, const chip::app::DataModel::Nullable & nullableBitmap64) + { + (static_cast(context))->OnSuccessResponse_40(nullableBitmap64); + } + + static void OnFailureCallback_41(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_41(chip::to_underlying(status)); + } + + static void OnSuccessCallback_41(void * context) { (static_cast(context))->OnSuccessResponse_41(); } + + static void OnFailureCallback_42(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_42(chip::to_underlying(status)); + } + + static void OnSuccessCallback_42(void * context, const chip::app::DataModel::Nullable & nullableBitmap64) + { + (static_cast(context))->OnSuccessResponse_42(nullableBitmap64); + } + + static void OnFailureCallback_43(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_43(chip::to_underlying(status)); + } + + static void OnSuccessCallback_43(void * context) { (static_cast(context))->OnSuccessResponse_43(); } + + static void OnFailureCallback_44(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_44(chip::to_underlying(status)); + } + + static void OnSuccessCallback_44(void * context, const chip::app::DataModel::Nullable & nullableBitmap64) + { + (static_cast(context))->OnSuccessResponse_44(nullableBitmap64); + } + + static void OnFailureCallback_45(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_45(chip::to_underlying(status)); + } + + static void OnSuccessCallback_45(void * context) { (static_cast(context))->OnSuccessResponse_45(); } + + static void OnFailureCallback_46(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_46(chip::to_underlying(status)); + } + + static void OnSuccessCallback_46(void * context, const chip::app::DataModel::Nullable & nullableInt8u) + { + (static_cast(context))->OnSuccessResponse_46(nullableInt8u); + } + + static void OnFailureCallback_47(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_47(chip::to_underlying(status)); + } + + static void OnSuccessCallback_47(void * context) { (static_cast(context))->OnSuccessResponse_47(); } + + static void OnFailureCallback_48(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_48(chip::to_underlying(status)); + } + + static void OnSuccessCallback_48(void * context, const chip::app::DataModel::Nullable & nullableInt8u) + { + (static_cast(context))->OnSuccessResponse_48(nullableInt8u); + } + + static void OnFailureCallback_49(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_49(chip::to_underlying(status)); + } + + static void OnSuccessCallback_49(void * context) { (static_cast(context))->OnSuccessResponse_49(); } + + static void OnFailureCallback_50(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_50(chip::to_underlying(status)); + } + + static void OnSuccessCallback_50(void * context, const chip::app::DataModel::Nullable & nullableInt8u) + { + (static_cast(context))->OnSuccessResponse_50(nullableInt8u); + } + + static void OnFailureCallback_51(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_51(chip::to_underlying(status)); + } + + static void OnSuccessCallback_51(void * context) { (static_cast(context))->OnSuccessResponse_51(); } + + static void OnFailureCallback_52(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_52(chip::to_underlying(status)); + } + + static void OnSuccessCallback_52(void * context, const chip::app::DataModel::Nullable & nullableInt16u) + { + (static_cast(context))->OnSuccessResponse_52(nullableInt16u); + } + + static void OnFailureCallback_53(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_53(chip::to_underlying(status)); + } + + static void OnSuccessCallback_53(void * context) { (static_cast(context))->OnSuccessResponse_53(); } + + static void OnFailureCallback_54(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_54(chip::to_underlying(status)); + } + + static void OnSuccessCallback_54(void * context, const chip::app::DataModel::Nullable & nullableInt16u) + { + (static_cast(context))->OnSuccessResponse_54(nullableInt16u); + } + + static void OnFailureCallback_55(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_55(chip::to_underlying(status)); + } + + static void OnSuccessCallback_55(void * context) { (static_cast(context))->OnSuccessResponse_55(); } + + static void OnFailureCallback_56(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_56(chip::to_underlying(status)); + } + + static void OnSuccessCallback_56(void * context, const chip::app::DataModel::Nullable & nullableInt16u) + { + (static_cast(context))->OnSuccessResponse_56(nullableInt16u); + } + + static void OnFailureCallback_57(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_57(chip::to_underlying(status)); + } + + static void OnSuccessCallback_57(void * context) { (static_cast(context))->OnSuccessResponse_57(); } + + static void OnFailureCallback_58(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_58(chip::to_underlying(status)); + } + + static void OnSuccessCallback_58(void * context, const chip::app::DataModel::Nullable & nullableInt32u) + { + (static_cast(context))->OnSuccessResponse_58(nullableInt32u); + } + + static void OnFailureCallback_59(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_59(chip::to_underlying(status)); + } + + static void OnSuccessCallback_59(void * context) { (static_cast(context))->OnSuccessResponse_59(); } + + static void OnFailureCallback_60(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_60(chip::to_underlying(status)); + } + + static void OnSuccessCallback_60(void * context, const chip::app::DataModel::Nullable & nullableInt32u) + { + (static_cast(context))->OnSuccessResponse_60(nullableInt32u); + } + + static void OnFailureCallback_61(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_61(chip::to_underlying(status)); + } + + static void OnSuccessCallback_61(void * context) { (static_cast(context))->OnSuccessResponse_61(); } + + static void OnFailureCallback_62(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_62(chip::to_underlying(status)); + } + + static void OnSuccessCallback_62(void * context, const chip::app::DataModel::Nullable & nullableInt32u) + { + (static_cast(context))->OnSuccessResponse_62(nullableInt32u); + } + + static void OnFailureCallback_63(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_63(chip::to_underlying(status)); + } + + static void OnSuccessCallback_63(void * context) { (static_cast(context))->OnSuccessResponse_63(); } + + static void OnFailureCallback_64(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_64(chip::to_underlying(status)); + } + + static void OnSuccessCallback_64(void * context, const chip::app::DataModel::Nullable & nullableInt64u) + { + (static_cast(context))->OnSuccessResponse_64(nullableInt64u); + } + + static void OnFailureCallback_65(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_65(chip::to_underlying(status)); + } + + static void OnSuccessCallback_65(void * context) { (static_cast(context))->OnSuccessResponse_65(); } + + static void OnFailureCallback_66(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_66(chip::to_underlying(status)); + } + + static void OnSuccessCallback_66(void * context, const chip::app::DataModel::Nullable & nullableInt64u) + { + (static_cast(context))->OnSuccessResponse_66(nullableInt64u); + } + + static void OnFailureCallback_67(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_67(chip::to_underlying(status)); + } + + static void OnSuccessCallback_67(void * context) { (static_cast(context))->OnSuccessResponse_67(); } + + static void OnFailureCallback_68(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_68(chip::to_underlying(status)); + } + + static void OnSuccessCallback_68(void * context, const chip::app::DataModel::Nullable & nullableInt64u) + { + (static_cast(context))->OnSuccessResponse_68(nullableInt64u); + } + + static void OnFailureCallback_69(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_69(chip::to_underlying(status)); + } + + static void OnSuccessCallback_69(void * context) { (static_cast(context))->OnSuccessResponse_69(); } + + static void OnFailureCallback_70(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_70(chip::to_underlying(status)); + } + + static void OnSuccessCallback_70(void * context, const chip::app::DataModel::Nullable & nullableInt8s) + { + (static_cast(context))->OnSuccessResponse_70(nullableInt8s); + } + + static void OnFailureCallback_71(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_71(chip::to_underlying(status)); + } + + static void OnSuccessCallback_71(void * context) { (static_cast(context))->OnSuccessResponse_71(); } + + static void OnFailureCallback_72(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_72(chip::to_underlying(status)); + } + + static void OnSuccessCallback_72(void * context, const chip::app::DataModel::Nullable & nullableInt8s) + { + (static_cast(context))->OnSuccessResponse_72(nullableInt8s); + } + + static void OnFailureCallback_73(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_73(chip::to_underlying(status)); + } + + static void OnSuccessCallback_73(void * context) { (static_cast(context))->OnSuccessResponse_73(); } + + static void OnFailureCallback_74(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_74(chip::to_underlying(status)); + } + + static void OnSuccessCallback_74(void * context, const chip::app::DataModel::Nullable & nullableInt8s) + { + (static_cast(context))->OnSuccessResponse_74(nullableInt8s); + } + + static void OnFailureCallback_75(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_75(chip::to_underlying(status)); + } + + static void OnSuccessCallback_75(void * context) { (static_cast(context))->OnSuccessResponse_75(); } + + static void OnFailureCallback_76(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_76(chip::to_underlying(status)); + } + + static void OnSuccessCallback_76(void * context, const chip::app::DataModel::Nullable & nullableInt16s) + { + (static_cast(context))->OnSuccessResponse_76(nullableInt16s); + } + + static void OnFailureCallback_77(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_77(chip::to_underlying(status)); + } + + static void OnSuccessCallback_77(void * context) { (static_cast(context))->OnSuccessResponse_77(); } + + static void OnFailureCallback_78(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_78(chip::to_underlying(status)); + } + + static void OnSuccessCallback_78(void * context, const chip::app::DataModel::Nullable & nullableInt16s) + { + (static_cast(context))->OnSuccessResponse_78(nullableInt16s); + } + + static void OnFailureCallback_79(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_79(chip::to_underlying(status)); + } + + static void OnSuccessCallback_79(void * context) { (static_cast(context))->OnSuccessResponse_79(); } + + static void OnFailureCallback_80(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_80(chip::to_underlying(status)); + } + + static void OnSuccessCallback_80(void * context, const chip::app::DataModel::Nullable & nullableInt16s) + { + (static_cast(context))->OnSuccessResponse_80(nullableInt16s); + } + + static void OnFailureCallback_81(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_81(chip::to_underlying(status)); + } + + static void OnSuccessCallback_81(void * context) { (static_cast(context))->OnSuccessResponse_81(); } + + static void OnFailureCallback_82(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_82(chip::to_underlying(status)); + } + + static void OnSuccessCallback_82(void * context, const chip::app::DataModel::Nullable & nullableInt32s) + { + (static_cast(context))->OnSuccessResponse_82(nullableInt32s); + } + + static void OnFailureCallback_83(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_83(chip::to_underlying(status)); + } + + static void OnSuccessCallback_83(void * context) { (static_cast(context))->OnSuccessResponse_83(); } + + static void OnFailureCallback_84(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_84(chip::to_underlying(status)); + } + + static void OnSuccessCallback_84(void * context, const chip::app::DataModel::Nullable & nullableInt32s) + { + (static_cast(context))->OnSuccessResponse_84(nullableInt32s); + } + + static void OnFailureCallback_85(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_85(chip::to_underlying(status)); + } + + static void OnSuccessCallback_85(void * context) { (static_cast(context))->OnSuccessResponse_85(); } + + static void OnFailureCallback_86(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_86(chip::to_underlying(status)); + } + + static void OnSuccessCallback_86(void * context, const chip::app::DataModel::Nullable & nullableInt32s) + { + (static_cast(context))->OnSuccessResponse_86(nullableInt32s); + } + + static void OnFailureCallback_87(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_87(chip::to_underlying(status)); + } + + static void OnSuccessCallback_87(void * context) { (static_cast(context))->OnSuccessResponse_87(); } + + static void OnFailureCallback_88(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_88(chip::to_underlying(status)); + } + + static void OnSuccessCallback_88(void * context, const chip::app::DataModel::Nullable & nullableInt64s) + { + (static_cast(context))->OnSuccessResponse_88(nullableInt64s); + } + + static void OnFailureCallback_89(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_89(chip::to_underlying(status)); + } + + static void OnSuccessCallback_89(void * context) { (static_cast(context))->OnSuccessResponse_89(); } + + static void OnFailureCallback_90(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_90(chip::to_underlying(status)); + } + + static void OnSuccessCallback_90(void * context, const chip::app::DataModel::Nullable & nullableInt64s) + { + (static_cast(context))->OnSuccessResponse_90(nullableInt64s); + } + + static void OnFailureCallback_91(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_91(chip::to_underlying(status)); + } + + static void OnSuccessCallback_91(void * context) { (static_cast(context))->OnSuccessResponse_91(); } + + static void OnFailureCallback_92(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_92(chip::to_underlying(status)); + } + + static void OnSuccessCallback_92(void * context, const chip::app::DataModel::Nullable & nullableInt64s) + { + (static_cast(context))->OnSuccessResponse_92(nullableInt64s); + } + + static void OnFailureCallback_93(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_93(chip::to_underlying(status)); + } + + static void OnSuccessCallback_93(void * context) { (static_cast(context))->OnSuccessResponse_93(); } + + static void OnFailureCallback_94(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_94(chip::to_underlying(status)); + } + + static void OnSuccessCallback_94(void * context, const chip::app::DataModel::Nullable & nullableEnum8) + { + (static_cast(context))->OnSuccessResponse_94(nullableEnum8); + } + + static void OnFailureCallback_95(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_95(chip::to_underlying(status)); + } + + static void OnSuccessCallback_95(void * context) { (static_cast(context))->OnSuccessResponse_95(); } + + static void OnFailureCallback_96(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_96(chip::to_underlying(status)); + } + + static void OnSuccessCallback_96(void * context, const chip::app::DataModel::Nullable & nullableEnum8) + { + (static_cast(context))->OnSuccessResponse_96(nullableEnum8); + } + + static void OnFailureCallback_97(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_97(chip::to_underlying(status)); + } + + static void OnSuccessCallback_97(void * context) { (static_cast(context))->OnSuccessResponse_97(); } + + static void OnFailureCallback_98(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_98(chip::to_underlying(status)); + } + + static void OnSuccessCallback_98(void * context, const chip::app::DataModel::Nullable & nullableEnum8) + { + (static_cast(context))->OnSuccessResponse_98(nullableEnum8); + } + + static void OnFailureCallback_99(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_99(chip::to_underlying(status)); + } + + static void OnSuccessCallback_99(void * context) { (static_cast(context))->OnSuccessResponse_99(); } + + static void OnFailureCallback_100(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_100(chip::to_underlying(status)); + } + + static void OnSuccessCallback_100(void * context, const chip::app::DataModel::Nullable & nullableEnum16) + { + (static_cast(context))->OnSuccessResponse_100(nullableEnum16); + } + + static void OnFailureCallback_101(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_101(chip::to_underlying(status)); + } + + static void OnSuccessCallback_101(void * context) + { + (static_cast(context))->OnSuccessResponse_101(); + } + + static void OnFailureCallback_102(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_102(chip::to_underlying(status)); + } + + static void OnSuccessCallback_102(void * context, const chip::app::DataModel::Nullable & nullableEnum16) + { + (static_cast(context))->OnSuccessResponse_102(nullableEnum16); + } + + static void OnFailureCallback_103(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_103(chip::to_underlying(status)); + } + + static void OnSuccessCallback_103(void * context) + { + (static_cast(context))->OnSuccessResponse_103(); + } + + static void OnFailureCallback_104(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_104(chip::to_underlying(status)); + } + + static void OnSuccessCallback_104(void * context, const chip::app::DataModel::Nullable & nullableEnum16) + { + (static_cast(context))->OnSuccessResponse_104(nullableEnum16); + } + + static void OnFailureCallback_105(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_105(chip::to_underlying(status)); + } + + static void OnSuccessCallback_105(void * context, const chip::app::DataModel::Nullable & nullableOctetString) + { + (static_cast(context))->OnSuccessResponse_105(nullableOctetString); + } + + static void OnFailureCallback_106(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_106(chip::to_underlying(status)); + } + + static void OnSuccessCallback_106(void * context) + { + (static_cast(context))->OnSuccessResponse_106(); + } + + static void OnFailureCallback_107(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_107(chip::to_underlying(status)); + } + + static void OnSuccessCallback_107(void * context, const chip::app::DataModel::Nullable & nullableOctetString) + { + (static_cast(context))->OnSuccessResponse_107(nullableOctetString); + } + + static void OnFailureCallback_108(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_108(chip::to_underlying(status)); + } + + static void OnSuccessCallback_108(void * context) + { + (static_cast(context))->OnSuccessResponse_108(); + } + + static void OnFailureCallback_109(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_109(chip::to_underlying(status)); + } + + static void OnSuccessCallback_109(void * context, const chip::app::DataModel::Nullable & nullableOctetString) + { + (static_cast(context))->OnSuccessResponse_109(nullableOctetString); + } + + static void OnFailureCallback_110(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_110(chip::to_underlying(status)); + } + + static void OnSuccessCallback_110(void * context) + { + (static_cast(context))->OnSuccessResponse_110(); + } + + static void OnFailureCallback_111(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_111(chip::to_underlying(status)); + } + + static void OnSuccessCallback_111(void * context, const chip::app::DataModel::Nullable & nullableOctetString) + { + (static_cast(context))->OnSuccessResponse_111(nullableOctetString); + } + + static void OnFailureCallback_112(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_112(chip::to_underlying(status)); + } + + static void OnSuccessCallback_112(void * context, const chip::app::DataModel::Nullable & nullableCharString) + { + (static_cast(context))->OnSuccessResponse_112(nullableCharString); + } + + static void OnFailureCallback_113(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_113(chip::to_underlying(status)); + } + + static void OnSuccessCallback_113(void * context) + { + (static_cast(context))->OnSuccessResponse_113(); + } + + static void OnFailureCallback_114(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_114(chip::to_underlying(status)); + } + + static void OnSuccessCallback_114(void * context) + { + (static_cast(context))->OnSuccessResponse_114(); + } + + static void OnFailureCallback_115(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_115(chip::to_underlying(status)); + } + + static void OnSuccessCallback_115(void * context, const chip::app::DataModel::Nullable & nullableCharString) + { + (static_cast(context))->OnSuccessResponse_115(nullableCharString); + } + + static void OnFailureCallback_116(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_116(chip::to_underlying(status)); + } + + static void OnSuccessCallback_116(void * context) + { + (static_cast(context))->OnSuccessResponse_116(); + } + + static void OnFailureCallback_117(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_117(chip::to_underlying(status)); + } + + static void OnSuccessCallback_117(void * context, const chip::app::DataModel::Nullable & nullableCharString) + { + (static_cast(context))->OnSuccessResponse_117(nullableCharString); + } + + // + // Tests methods + // + + CHIP_ERROR TestSendTestCommandWithStructArgumentAndArg1bIsTrue_0() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestStructArgumentRequest::Type; + + RequestType request; + + request.arg1.a = 0; + request.arg1.b = true; + request.arg1.c = static_cast(2); + request.arg1.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); + request.arg1.e = chip::Span("char_stringgarbage: not in length on purpose", 11); + request.arg1.f = static_cast>(1); + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_0(data.value); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_0(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0(bool value) + { + VerifyOrReturn(CheckValue("value", value, true)); + NextTest(); + } + + CHIP_ERROR TestSendTestCommandWithStructArgumentAndArg1bIsFalse_1() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestStructArgumentRequest::Type; + + RequestType request; + + request.arg1.a = 0; + request.arg1.b = false; + request.arg1.c = static_cast(2); + request.arg1.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); + request.arg1.e = chip::Span("char_stringgarbage: not in length on purpose", 11); + request.arg1.f = static_cast>(1); + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_1(data.value); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_1(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(bool value) + { + VerifyOrReturn(CheckValue("value", value, false)); + NextTest(); + } + + CHIP_ERROR TestSendTestCommandWithListOfInt8uAndNoneOfThemIsSetTo0_2() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestListInt8UArgumentRequest::Type; + + RequestType request; + + uint8_t arg1List[9]; + arg1List[0] = 1; + arg1List[1] = 2; + arg1List[2] = 3; + arg1List[3] = 4; + arg1List[4] = 5; + arg1List[5] = 6; + arg1List[6] = 7; + arg1List[7] = 8; + arg1List[8] = 9; + request.arg1 = arg1List; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_2(data.value); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_2(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(bool value) + { + VerifyOrReturn(CheckValue("value", value, true)); + NextTest(); + } + + CHIP_ERROR TestSendTestCommandWithListOfInt8uAndOneOfThemIsSetTo0_3() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestListInt8UArgumentRequest::Type; + + RequestType request; + + uint8_t arg1List[10]; + arg1List[0] = 1; + arg1List[1] = 2; + arg1List[2] = 3; + arg1List[3] = 4; + arg1List[4] = 5; + arg1List[5] = 6; + arg1List[6] = 7; + arg1List[7] = 8; + arg1List[8] = 9; + arg1List[9] = 0; + request.arg1 = arg1List; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_3(data.value); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_3(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3(bool value) + { + VerifyOrReturn(CheckValue("value", value, false)); + NextTest(); + } + + CHIP_ERROR TestSendTestCommandWithListOfInt8uAndGetItReversed_4() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestListInt8UReverseRequest::Type; + + RequestType request; + + uint8_t arg1List[9]; + arg1List[0] = 1; + arg1List[1] = 2; + arg1List[2] = 3; + arg1List[3] = 4; + arg1List[4] = 5; + arg1List[5] = 6; + arg1List[6] = 7; + arg1List[7] = 8; + arg1List[8] = 9; + request.arg1 = arg1List; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_4(data.arg1); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_4(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4(const chip::app::DataModel::DecodableList & arg1) + { + auto iter = arg1.begin(); + VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 0)); + VerifyOrReturn(CheckValue("arg1[0]", iter.GetValue(), 9)); + VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 1)); + VerifyOrReturn(CheckValue("arg1[1]", iter.GetValue(), 8)); + VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 2)); + VerifyOrReturn(CheckValue("arg1[2]", iter.GetValue(), 7)); + VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 3)); + VerifyOrReturn(CheckValue("arg1[3]", iter.GetValue(), 6)); + VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 4)); + VerifyOrReturn(CheckValue("arg1[4]", iter.GetValue(), 5)); + VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 5)); + VerifyOrReturn(CheckValue("arg1[5]", iter.GetValue(), 4)); + VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 6)); + VerifyOrReturn(CheckValue("arg1[6]", iter.GetValue(), 3)); + VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 7)); + VerifyOrReturn(CheckValue("arg1[7]", iter.GetValue(), 2)); + VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 8)); + VerifyOrReturn(CheckValue("arg1[8]", iter.GetValue(), 1)); + VerifyOrReturn(CheckNoMoreListItems("arg1", iter, 9)); + NextTest(); + } + + CHIP_ERROR TestSendTestCommandWithEmptyListOfInt8uAndGetAnEmptyListBack_5() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestListInt8UReverseRequest::Type; + + RequestType request; + + request.arg1 = chip::app::DataModel::List(); + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_5(data.arg1); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_5(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_5(const chip::app::DataModel::DecodableList & arg1) + { + auto iter = arg1.begin(); + VerifyOrReturn(CheckNoMoreListItems("arg1", iter, 0)); + NextTest(); + } + + CHIP_ERROR TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsTrue_6() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestListStructArgumentRequest::Type; + + RequestType request; + + chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type arg1List[2]; + + arg1List[0].a = 0; + arg1List[0].b = true; + arg1List[0].c = static_cast(2); + arg1List[0].d = chip::ByteSpan(chip::Uint8::from_const_char("first_octet_stringgarbage: not in length on purpose"), 18); + arg1List[0].e = chip::Span("first_char_stringgarbage: not in length on purpose", 17); + arg1List[0].f = static_cast>(1); + + arg1List[1].a = 1; + arg1List[1].b = true; + arg1List[1].c = static_cast(3); + arg1List[1].d = chip::ByteSpan(chip::Uint8::from_const_char("second_octet_stringgarbage: not in length on purpose"), 19); + arg1List[1].e = chip::Span("second_char_stringgarbage: not in length on purpose", 18); + arg1List[1].f = static_cast>(1); + + request.arg1 = arg1List; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_6(data.value); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_6(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_6(bool value) + { + VerifyOrReturn(CheckValue("value", value, true)); + NextTest(); + } + + CHIP_ERROR TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsFalse_7() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestListStructArgumentRequest::Type; + + RequestType request; + + chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type arg1List[2]; + + arg1List[0].a = 1; + arg1List[0].b = true; + arg1List[0].c = static_cast(3); + arg1List[0].d = chip::ByteSpan(chip::Uint8::from_const_char("second_octet_stringgarbage: not in length on purpose"), 19); + arg1List[0].e = chip::Span("second_char_stringgarbage: not in length on purpose", 18); + arg1List[0].f = static_cast>(1); + + arg1List[1].a = 0; + arg1List[1].b = false; + arg1List[1].c = static_cast(2); + arg1List[1].d = chip::ByteSpan(chip::Uint8::from_const_char("first_octet_stringgarbage: not in length on purpose"), 18); + arg1List[1].e = chip::Span("first_char_stringgarbage: not in length on purpose", 17); + arg1List[1].f = static_cast>(1); + + request.arg1 = arg1List; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_7(data.value); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_7(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_7(bool value) + { + VerifyOrReturn(CheckValue("value", value, false)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeListWithListOfInt8uAndNoneOfThemIsSetTo0_8() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::List listInt8uArgument; + + uint8_t listInt8uList[4]; + listInt8uList[0] = 1; + listInt8uList[1] = 2; + listInt8uList[2] = 3; + listInt8uList[3] = 4; + listInt8uArgument = listInt8uList; + + return cluster.WriteAttribute( + listInt8uArgument, this, OnSuccessCallback_8, OnFailureCallback_8); + } + + void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_8() { NextTest(); } + + CHIP_ERROR TestReadAttributeListWithListOfInt8u_9() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute(this, OnSuccessCallback_9, + OnFailureCallback_9); + } + + void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_9(const chip::app::DataModel::DecodableList & listInt8u) + { + auto iter = listInt8u.begin(); + VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 0)); + VerifyOrReturn(CheckValue("listInt8u[0]", iter.GetValue(), 1)); + VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 1)); + VerifyOrReturn(CheckValue("listInt8u[1]", iter.GetValue(), 2)); + VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 2)); + VerifyOrReturn(CheckValue("listInt8u[2]", iter.GetValue(), 3)); + VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 3)); + VerifyOrReturn(CheckValue("listInt8u[3]", iter.GetValue(), 4)); + VerifyOrReturn(CheckNoMoreListItems("listInt8u", iter, 4)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeListWithListOfOctetString_10() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::List listOctetStringArgument; + + chip::ByteSpan listOctetStringList[4]; + listOctetStringList[0] = chip::ByteSpan(chip::Uint8::from_const_char("Test0garbage: not in length on purpose"), 5); + listOctetStringList[1] = chip::ByteSpan(chip::Uint8::from_const_char("Test1garbage: not in length on purpose"), 5); + listOctetStringList[2] = chip::ByteSpan(chip::Uint8::from_const_char("Test2garbage: not in length on purpose"), 5); + listOctetStringList[3] = chip::ByteSpan(chip::Uint8::from_const_char("Test3garbage: not in length on purpose"), 5); + listOctetStringArgument = listOctetStringList; + + return cluster.WriteAttribute( + listOctetStringArgument, this, OnSuccessCallback_10, OnFailureCallback_10); + } + + void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_10() { NextTest(); } + + CHIP_ERROR TestReadAttributeListWithListOfOctetString_11() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_11, OnFailureCallback_11); + } + + void OnFailureResponse_11(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_11(const chip::app::DataModel::DecodableList & listOctetString) + { + auto iter = listOctetString.begin(); + VerifyOrReturn(CheckNextListItemDecodes("listOctetString", iter, 0)); + VerifyOrReturn( + CheckValueAsString("listOctetString[0]", iter.GetValue(), chip::ByteSpan(chip::Uint8::from_const_char("Test0"), 5))); + VerifyOrReturn(CheckNextListItemDecodes("listOctetString", iter, 1)); + VerifyOrReturn( + CheckValueAsString("listOctetString[1]", iter.GetValue(), chip::ByteSpan(chip::Uint8::from_const_char("Test1"), 5))); + VerifyOrReturn(CheckNextListItemDecodes("listOctetString", iter, 2)); + VerifyOrReturn( + CheckValueAsString("listOctetString[2]", iter.GetValue(), chip::ByteSpan(chip::Uint8::from_const_char("Test2"), 5))); + VerifyOrReturn(CheckNextListItemDecodes("listOctetString", iter, 3)); + VerifyOrReturn( + CheckValueAsString("listOctetString[3]", iter.GetValue(), chip::ByteSpan(chip::Uint8::from_const_char("Test3"), 5))); + VerifyOrReturn(CheckNoMoreListItems("listOctetString", iter, 4)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeListWithListOfListStructOctetString_12() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::List + listStructOctetStringArgument; + + chip::app::Clusters::TestCluster::Structs::TestListStructOctet::Type listStructOctetStringList[4]; + + listStructOctetStringList[0].fabricIndex = 0ULL; + listStructOctetStringList[0].operationalCert = + chip::ByteSpan(chip::Uint8::from_const_char("Test0garbage: not in length on purpose"), 5); + + listStructOctetStringList[1].fabricIndex = 1ULL; + listStructOctetStringList[1].operationalCert = + chip::ByteSpan(chip::Uint8::from_const_char("Test1garbage: not in length on purpose"), 5); + + listStructOctetStringList[2].fabricIndex = 2ULL; + listStructOctetStringList[2].operationalCert = + chip::ByteSpan(chip::Uint8::from_const_char("Test2garbage: not in length on purpose"), 5); + + listStructOctetStringList[3].fabricIndex = 3ULL; + listStructOctetStringList[3].operationalCert = + chip::ByteSpan(chip::Uint8::from_const_char("Test3garbage: not in length on purpose"), 5); + + listStructOctetStringArgument = listStructOctetStringList; + + return cluster.WriteAttribute( + listStructOctetStringArgument, this, OnSuccessCallback_12, OnFailureCallback_12); + } + + void OnFailureResponse_12(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_12() { NextTest(); } + + CHIP_ERROR TestReadAttributeListWithListOfListStructOctetString_13() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_13, OnFailureCallback_13); + } + + void OnFailureResponse_13(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_13( + const chip::app::DataModel::DecodableList & + listStructOctetString) + { + auto iter = listStructOctetString.begin(); + VerifyOrReturn(CheckNextListItemDecodes("listStructOctetString", iter, 0)); + VerifyOrReturn(CheckValue<>("listStructOctetString[0].fabricIndex", iter.GetValue().fabricIndex, 0ULL)); + VerifyOrReturn(CheckValueAsString("listStructOctetString[0].operationalCert", iter.GetValue().operationalCert, + chip::ByteSpan(chip::Uint8::from_const_char("Test0"), 5))); + VerifyOrReturn(CheckNextListItemDecodes("listStructOctetString", iter, 1)); + VerifyOrReturn(CheckValue<>("listStructOctetString[1].fabricIndex", iter.GetValue().fabricIndex, 1ULL)); + VerifyOrReturn(CheckValueAsString("listStructOctetString[1].operationalCert", iter.GetValue().operationalCert, + chip::ByteSpan(chip::Uint8::from_const_char("Test1"), 5))); + VerifyOrReturn(CheckNextListItemDecodes("listStructOctetString", iter, 2)); + VerifyOrReturn(CheckValue<>("listStructOctetString[2].fabricIndex", iter.GetValue().fabricIndex, 2ULL)); + VerifyOrReturn(CheckValueAsString("listStructOctetString[2].operationalCert", iter.GetValue().operationalCert, + chip::ByteSpan(chip::Uint8::from_const_char("Test2"), 5))); + VerifyOrReturn(CheckNextListItemDecodes("listStructOctetString", iter, 3)); + VerifyOrReturn(CheckValue<>("listStructOctetString[3].fabricIndex", iter.GetValue().fabricIndex, 3ULL)); + VerifyOrReturn(CheckValueAsString("listStructOctetString[3].operationalCert", iter.GetValue().operationalCert, + chip::ByteSpan(chip::Uint8::from_const_char("Test3"), 5))); + VerifyOrReturn(CheckNoMoreListItems("listStructOctetString", iter, 4)); + NextTest(); + } + + CHIP_ERROR TestSendTestCommandWithOptionalArgSet_14() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestNullableOptionalRequest::Type; + + RequestType request; + request.arg1.Emplace().SetNonNull() = 5; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context)) + ->OnSuccessResponse_14(data.wasPresent, data.wasNull, data.value, data.originalValue); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_14(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_14(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_14(bool wasPresent, const chip::Optional & wasNull, const chip::Optional & value, + const chip::Optional> & originalValue) + { + VerifyOrReturn(CheckValue("wasPresent", wasPresent, true)); + + VerifyOrReturn(CheckValuePresent("wasNull", wasNull)); + VerifyOrReturn(CheckValue("wasNull.Value()", wasNull.Value(), false)); + + VerifyOrReturn(CheckValuePresent("value", value)); + VerifyOrReturn(CheckValue("value.Value()", value.Value(), 5)); + + VerifyOrReturn(CheckValuePresent("originalValue", originalValue)); + VerifyOrReturn(CheckValueNonNull("originalValue.Value()", originalValue.Value())); + VerifyOrReturn(CheckValue("originalValue.Value().Value()", originalValue.Value().Value(), 5)); + NextTest(); + } + + CHIP_ERROR TestSendTestCommandWithoutItsOptionalArg_15() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestNullableOptionalRequest::Type; + + RequestType request; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context)) + ->OnSuccessResponse_15(data.wasPresent, data.wasNull, data.value, data.originalValue); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_15(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_15(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_15(bool wasPresent, const chip::Optional & wasNull, const chip::Optional & value, + const chip::Optional> & originalValue) + { + VerifyOrReturn(CheckValue("wasPresent", wasPresent, false)); + + NextTest(); + } + + CHIP_ERROR TestSendTestCommandWithOptionalArgSetToNull_16() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestNullableOptionalRequest::Type; + + RequestType request; + request.arg1.Emplace().SetNull(); + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context)) + ->OnSuccessResponse_16(data.wasPresent, data.wasNull, data.value, data.originalValue); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_16(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_16(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_16(bool wasPresent, const chip::Optional & wasNull, const chip::Optional & value, + const chip::Optional> & originalValue) + { + VerifyOrReturn(CheckValue("wasPresent", wasPresent, true)); + + VerifyOrReturn(CheckValuePresent("wasNull", wasNull)); + VerifyOrReturn(CheckValue("wasNull.Value()", wasNull.Value(), true)); + + VerifyOrReturn(CheckValuePresent("originalValue", originalValue)); + VerifyOrReturn(CheckValueNull("originalValue.Value()", originalValue.Value())); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableBooleanNull_17() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableBooleanArgument; + nullableBooleanArgument.SetNull(); + + return cluster.WriteAttribute( + nullableBooleanArgument, this, OnSuccessCallback_17, OnFailureCallback_17); + } + + void OnFailureResponse_17(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_17() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableBooleanNull_18() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_18, OnFailureCallback_18); + } + + void OnFailureResponse_18(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_18(const chip::app::DataModel::Nullable & nullableBoolean) + { + VerifyOrReturn(CheckValueNull("nullableBoolean", nullableBoolean)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableBooleanTrue_19() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableBooleanArgument; + nullableBooleanArgument.SetNonNull() = true; + + return cluster.WriteAttribute( + nullableBooleanArgument, this, OnSuccessCallback_19, OnFailureCallback_19); + } + + void OnFailureResponse_19(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_19() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableBooleanTrue_20() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_20, OnFailureCallback_20); + } + + void OnFailureResponse_20(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_20(const chip::app::DataModel::Nullable & nullableBoolean) + { + VerifyOrReturn(CheckValueNonNull("nullableBoolean", nullableBoolean)); + VerifyOrReturn(CheckValue("nullableBoolean.Value()", nullableBoolean.Value(), true)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableBitmap8MaxValue_21() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableBitmap8Argument; + nullableBitmap8Argument.SetNonNull() = 254; + + return cluster.WriteAttribute( + nullableBitmap8Argument, this, OnSuccessCallback_21, OnFailureCallback_21); + } + + void OnFailureResponse_21(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_21() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableBitmap8MaxValue_22() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_22, OnFailureCallback_22); + } + + void OnFailureResponse_22(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_22(const chip::app::DataModel::Nullable & nullableBitmap8) + { + VerifyOrReturn(CheckValueNonNull("nullableBitmap8", nullableBitmap8)); + VerifyOrReturn(CheckValue("nullableBitmap8.Value()", nullableBitmap8.Value(), 254)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableBitmap8InvalidValue_23() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableBitmap8Argument; + nullableBitmap8Argument.SetNonNull() = 255; + + return cluster.WriteAttribute( + nullableBitmap8Argument, this, OnSuccessCallback_23, OnFailureCallback_23); + } + + void OnFailureResponse_23(uint8_t status) { NextTest(); } + + void OnSuccessResponse_23() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadAttributeNullableBitmap8UnchangedValue_24() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_24, OnFailureCallback_24); + } + + void OnFailureResponse_24(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_24(const chip::app::DataModel::Nullable & nullableBitmap8) + { + VerifyOrReturn(CheckValueNonNull("nullableBitmap8", nullableBitmap8)); + VerifyOrReturn(CheckValue("nullableBitmap8.Value()", nullableBitmap8.Value(), 254)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableBitmap8NullValue_25() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableBitmap8Argument; + nullableBitmap8Argument.SetNull(); + + return cluster.WriteAttribute( + nullableBitmap8Argument, this, OnSuccessCallback_25, OnFailureCallback_25); + } + + void OnFailureResponse_25(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_25() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableBitmap8NullValue_26() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_26, OnFailureCallback_26); + } + + void OnFailureResponse_26(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_26(const chip::app::DataModel::Nullable & nullableBitmap8) + { + VerifyOrReturn(CheckValueNull("nullableBitmap8", nullableBitmap8)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableBitmap16MaxValue_27() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableBitmap16Argument; + nullableBitmap16Argument.SetNonNull() = 65534U; + + return cluster.WriteAttribute( + nullableBitmap16Argument, this, OnSuccessCallback_27, OnFailureCallback_27); + } + + void OnFailureResponse_27(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_27() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableBitmap16MaxValue_28() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_28, OnFailureCallback_28); + } + + void OnFailureResponse_28(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_28(const chip::app::DataModel::Nullable & nullableBitmap16) + { + VerifyOrReturn(CheckValueNonNull("nullableBitmap16", nullableBitmap16)); + VerifyOrReturn(CheckValue("nullableBitmap16.Value()", nullableBitmap16.Value(), 65534U)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableBitmap16InvalidValue_29() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableBitmap16Argument; + nullableBitmap16Argument.SetNonNull() = 65535U; + + return cluster.WriteAttribute( + nullableBitmap16Argument, this, OnSuccessCallback_29, OnFailureCallback_29); + } + + void OnFailureResponse_29(uint8_t status) { NextTest(); } + + void OnSuccessResponse_29() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadAttributeNullableBitmap16UnchangedValue_30() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_30, OnFailureCallback_30); + } + + void OnFailureResponse_30(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_30(const chip::app::DataModel::Nullable & nullableBitmap16) + { + VerifyOrReturn(CheckValueNonNull("nullableBitmap16", nullableBitmap16)); + VerifyOrReturn(CheckValue("nullableBitmap16.Value()", nullableBitmap16.Value(), 65534U)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableBitmap16NullValue_31() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableBitmap16Argument; + nullableBitmap16Argument.SetNull(); + + return cluster.WriteAttribute( + nullableBitmap16Argument, this, OnSuccessCallback_31, OnFailureCallback_31); + } + + void OnFailureResponse_31(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_31() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableBitmap16NullValue_32() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_32, OnFailureCallback_32); + } + + void OnFailureResponse_32(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_32(const chip::app::DataModel::Nullable & nullableBitmap16) + { + VerifyOrReturn(CheckValueNull("nullableBitmap16", nullableBitmap16)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableBitmap32MaxValue_33() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableBitmap32Argument; + nullableBitmap32Argument.SetNonNull() = 4294967294UL; + + return cluster.WriteAttribute( + nullableBitmap32Argument, this, OnSuccessCallback_33, OnFailureCallback_33); + } + + void OnFailureResponse_33(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_33() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableBitmap32MaxValue_34() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_34, OnFailureCallback_34); + } + + void OnFailureResponse_34(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_34(const chip::app::DataModel::Nullable & nullableBitmap32) + { + VerifyOrReturn(CheckValueNonNull("nullableBitmap32", nullableBitmap32)); + VerifyOrReturn(CheckValue("nullableBitmap32.Value()", nullableBitmap32.Value(), 4294967294UL)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableBitmap32InvalidValue_35() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableBitmap32Argument; + nullableBitmap32Argument.SetNonNull() = 4294967295UL; + + return cluster.WriteAttribute( + nullableBitmap32Argument, this, OnSuccessCallback_35, OnFailureCallback_35); + } + + void OnFailureResponse_35(uint8_t status) { NextTest(); } + + void OnSuccessResponse_35() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadAttributeNullableBitmap32UnchangedValue_36() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_36, OnFailureCallback_36); + } + + void OnFailureResponse_36(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_36(const chip::app::DataModel::Nullable & nullableBitmap32) + { + VerifyOrReturn(CheckValueNonNull("nullableBitmap32", nullableBitmap32)); + VerifyOrReturn(CheckValue("nullableBitmap32.Value()", nullableBitmap32.Value(), 4294967294UL)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableBitmap32NullValue_37() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableBitmap32Argument; + nullableBitmap32Argument.SetNull(); + + return cluster.WriteAttribute( + nullableBitmap32Argument, this, OnSuccessCallback_37, OnFailureCallback_37); + } + + void OnFailureResponse_37(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_37() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableBitmap32NullValue_38() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_38, OnFailureCallback_38); + } + + void OnFailureResponse_38(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_38(const chip::app::DataModel::Nullable & nullableBitmap32) + { + VerifyOrReturn(CheckValueNull("nullableBitmap32", nullableBitmap32)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableBitmap64MaxValue_39() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableBitmap64Argument; + nullableBitmap64Argument.SetNonNull() = 18446744073709551614ULL; + + return cluster.WriteAttribute( + nullableBitmap64Argument, this, OnSuccessCallback_39, OnFailureCallback_39); + } + + void OnFailureResponse_39(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_39() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableBitmap64MaxValue_40() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_40, OnFailureCallback_40); + } + + void OnFailureResponse_40(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_40(const chip::app::DataModel::Nullable & nullableBitmap64) + { + VerifyOrReturn(CheckValueNonNull("nullableBitmap64", nullableBitmap64)); + VerifyOrReturn(CheckValue("nullableBitmap64.Value()", nullableBitmap64.Value(), 18446744073709551614ULL)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableBitmap64InvalidValue_41() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableBitmap64Argument; + nullableBitmap64Argument.SetNonNull() = 18446744073709551615ULL; + + return cluster.WriteAttribute( + nullableBitmap64Argument, this, OnSuccessCallback_41, OnFailureCallback_41); + } + + void OnFailureResponse_41(uint8_t status) { NextTest(); } + + void OnSuccessResponse_41() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadAttributeNullableBitmap64UnchangedValue_42() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_42, OnFailureCallback_42); + } + + void OnFailureResponse_42(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_42(const chip::app::DataModel::Nullable & nullableBitmap64) + { + VerifyOrReturn(CheckValueNonNull("nullableBitmap64", nullableBitmap64)); + VerifyOrReturn(CheckValue("nullableBitmap64.Value()", nullableBitmap64.Value(), 18446744073709551614ULL)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableBitmap64NullValue_43() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableBitmap64Argument; + nullableBitmap64Argument.SetNull(); + + return cluster.WriteAttribute( + nullableBitmap64Argument, this, OnSuccessCallback_43, OnFailureCallback_43); + } + + void OnFailureResponse_43(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_43() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableBitmap64NullValue_44() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_44, OnFailureCallback_44); + } + + void OnFailureResponse_44(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_44(const chip::app::DataModel::Nullable & nullableBitmap64) + { + VerifyOrReturn(CheckValueNull("nullableBitmap64", nullableBitmap64)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt8uMaxValue_45() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableInt8uArgument; + nullableInt8uArgument.SetNonNull() = 254; + + return cluster.WriteAttribute( + nullableInt8uArgument, this, OnSuccessCallback_45, OnFailureCallback_45); + } + + void OnFailureResponse_45(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_45() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt8uMaxValue_46() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_46, OnFailureCallback_46); + } + + void OnFailureResponse_46(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_46(const chip::app::DataModel::Nullable & nullableInt8u) + { + VerifyOrReturn(CheckValueNonNull("nullableInt8u", nullableInt8u)); + VerifyOrReturn(CheckValue("nullableInt8u.Value()", nullableInt8u.Value(), 254)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt8uInvalidValue_47() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableInt8uArgument; + nullableInt8uArgument.SetNonNull() = 255; + + return cluster.WriteAttribute( + nullableInt8uArgument, this, OnSuccessCallback_47, OnFailureCallback_47); + } + + void OnFailureResponse_47(uint8_t status) { NextTest(); } + + void OnSuccessResponse_47() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadAttributeNullableInt8uUnchangedValue_48() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_48, OnFailureCallback_48); + } + + void OnFailureResponse_48(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_48(const chip::app::DataModel::Nullable & nullableInt8u) + { + VerifyOrReturn(CheckValueNonNull("nullableInt8u", nullableInt8u)); + VerifyOrReturn(CheckValue("nullableInt8u.Value()", nullableInt8u.Value(), 254)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt8uNullValue_49() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableInt8uArgument; + nullableInt8uArgument.SetNull(); + + return cluster.WriteAttribute( + nullableInt8uArgument, this, OnSuccessCallback_49, OnFailureCallback_49); + } + + void OnFailureResponse_49(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_49() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt8uNullValue_50() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_50, OnFailureCallback_50); + } + + void OnFailureResponse_50(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_50(const chip::app::DataModel::Nullable & nullableInt8u) + { + VerifyOrReturn(CheckValueNull("nullableInt8u", nullableInt8u)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt16uMaxValue_51() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableInt16uArgument; + nullableInt16uArgument.SetNonNull() = 65534U; + + return cluster.WriteAttribute( + nullableInt16uArgument, this, OnSuccessCallback_51, OnFailureCallback_51); + } + + void OnFailureResponse_51(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_51() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt16uMaxValue_52() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_52, OnFailureCallback_52); + } + + void OnFailureResponse_52(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_52(const chip::app::DataModel::Nullable & nullableInt16u) + { + VerifyOrReturn(CheckValueNonNull("nullableInt16u", nullableInt16u)); + VerifyOrReturn(CheckValue("nullableInt16u.Value()", nullableInt16u.Value(), 65534U)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt16uInvalidValue_53() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableInt16uArgument; + nullableInt16uArgument.SetNonNull() = 65535U; + + return cluster.WriteAttribute( + nullableInt16uArgument, this, OnSuccessCallback_53, OnFailureCallback_53); + } + + void OnFailureResponse_53(uint8_t status) { NextTest(); } + + void OnSuccessResponse_53() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadAttributeNullableInt16uUnchangedValue_54() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_54, OnFailureCallback_54); + } + + void OnFailureResponse_54(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_54(const chip::app::DataModel::Nullable & nullableInt16u) + { + VerifyOrReturn(CheckValueNonNull("nullableInt16u", nullableInt16u)); + VerifyOrReturn(CheckValue("nullableInt16u.Value()", nullableInt16u.Value(), 65534U)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt16uNullValue_55() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableInt16uArgument; + nullableInt16uArgument.SetNull(); + + return cluster.WriteAttribute( + nullableInt16uArgument, this, OnSuccessCallback_55, OnFailureCallback_55); + } + + void OnFailureResponse_55(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_55() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt16uNullValue_56() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_56, OnFailureCallback_56); + } + + void OnFailureResponse_56(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_56(const chip::app::DataModel::Nullable & nullableInt16u) + { + VerifyOrReturn(CheckValueNull("nullableInt16u", nullableInt16u)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt32uMaxValue_57() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableInt32uArgument; + nullableInt32uArgument.SetNonNull() = 4294967294UL; + + return cluster.WriteAttribute( + nullableInt32uArgument, this, OnSuccessCallback_57, OnFailureCallback_57); + } + + void OnFailureResponse_57(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_57() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt32uMaxValue_58() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_58, OnFailureCallback_58); + } + + void OnFailureResponse_58(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_58(const chip::app::DataModel::Nullable & nullableInt32u) + { + VerifyOrReturn(CheckValueNonNull("nullableInt32u", nullableInt32u)); + VerifyOrReturn(CheckValue("nullableInt32u.Value()", nullableInt32u.Value(), 4294967294UL)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt32uInvalidValue_59() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableInt32uArgument; + nullableInt32uArgument.SetNonNull() = 4294967295UL; + + return cluster.WriteAttribute( + nullableInt32uArgument, this, OnSuccessCallback_59, OnFailureCallback_59); + } + + void OnFailureResponse_59(uint8_t status) { NextTest(); } + + void OnSuccessResponse_59() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadAttributeNullableInt32uUnchangedValue_60() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_60, OnFailureCallback_60); + } + + void OnFailureResponse_60(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_60(const chip::app::DataModel::Nullable & nullableInt32u) + { + VerifyOrReturn(CheckValueNonNull("nullableInt32u", nullableInt32u)); + VerifyOrReturn(CheckValue("nullableInt32u.Value()", nullableInt32u.Value(), 4294967294UL)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt32uNullValue_61() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableInt32uArgument; + nullableInt32uArgument.SetNull(); + + return cluster.WriteAttribute( + nullableInt32uArgument, this, OnSuccessCallback_61, OnFailureCallback_61); + } + + void OnFailureResponse_61(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_61() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt32uNullValue_62() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_62, OnFailureCallback_62); + } + + void OnFailureResponse_62(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_62(const chip::app::DataModel::Nullable & nullableInt32u) + { + VerifyOrReturn(CheckValueNull("nullableInt32u", nullableInt32u)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt64uMaxValue_63() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableInt64uArgument; + nullableInt64uArgument.SetNonNull() = 18446744073709551614ULL; + + return cluster.WriteAttribute( + nullableInt64uArgument, this, OnSuccessCallback_63, OnFailureCallback_63); + } + + void OnFailureResponse_63(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_63() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt64uMaxValue_64() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_64, OnFailureCallback_64); + } + + void OnFailureResponse_64(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_64(const chip::app::DataModel::Nullable & nullableInt64u) + { + VerifyOrReturn(CheckValueNonNull("nullableInt64u", nullableInt64u)); + VerifyOrReturn(CheckValue("nullableInt64u.Value()", nullableInt64u.Value(), 18446744073709551614ULL)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt64uInvalidValue_65() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableInt64uArgument; + nullableInt64uArgument.SetNonNull() = 18446744073709551615ULL; + + return cluster.WriteAttribute( + nullableInt64uArgument, this, OnSuccessCallback_65, OnFailureCallback_65); + } + + void OnFailureResponse_65(uint8_t status) { NextTest(); } + + void OnSuccessResponse_65() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadAttributeNullableInt64uUnchangedValue_66() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_66, OnFailureCallback_66); + } + + void OnFailureResponse_66(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_66(const chip::app::DataModel::Nullable & nullableInt64u) + { + VerifyOrReturn(CheckValueNonNull("nullableInt64u", nullableInt64u)); + VerifyOrReturn(CheckValue("nullableInt64u.Value()", nullableInt64u.Value(), 18446744073709551614ULL)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt64uNullValue_67() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableInt64uArgument; + nullableInt64uArgument.SetNull(); + + return cluster.WriteAttribute( + nullableInt64uArgument, this, OnSuccessCallback_67, OnFailureCallback_67); + } + + void OnFailureResponse_67(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_67() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt64uNullValue_68() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_68, OnFailureCallback_68); + } + + void OnFailureResponse_68(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_68(const chip::app::DataModel::Nullable & nullableInt64u) + { + VerifyOrReturn(CheckValueNull("nullableInt64u", nullableInt64u)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt8sMinValue_69() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableInt8sArgument; + nullableInt8sArgument.SetNonNull() = -127; + + return cluster.WriteAttribute( + nullableInt8sArgument, this, OnSuccessCallback_69, OnFailureCallback_69); + } + + void OnFailureResponse_69(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_69() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt8sMinValue_70() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_70, OnFailureCallback_70); + } + + void OnFailureResponse_70(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_70(const chip::app::DataModel::Nullable & nullableInt8s) + { + VerifyOrReturn(CheckValueNonNull("nullableInt8s", nullableInt8s)); + VerifyOrReturn(CheckValue("nullableInt8s.Value()", nullableInt8s.Value(), -127)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt8sInvalidValue_71() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableInt8sArgument; + nullableInt8sArgument.SetNonNull() = -128; + + return cluster.WriteAttribute( + nullableInt8sArgument, this, OnSuccessCallback_71, OnFailureCallback_71); + } + + void OnFailureResponse_71(uint8_t status) { NextTest(); } + + void OnSuccessResponse_71() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadAttributeNullableInt8sUnchangedValue_72() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_72, OnFailureCallback_72); + } + + void OnFailureResponse_72(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_72(const chip::app::DataModel::Nullable & nullableInt8s) + { + VerifyOrReturn(CheckValueNonNull("nullableInt8s", nullableInt8s)); + VerifyOrReturn(CheckValue("nullableInt8s.Value()", nullableInt8s.Value(), -127)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt8sNullValue_73() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableInt8sArgument; + nullableInt8sArgument.SetNull(); + + return cluster.WriteAttribute( + nullableInt8sArgument, this, OnSuccessCallback_73, OnFailureCallback_73); + } + + void OnFailureResponse_73(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_73() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt8sNullValue_74() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_74, OnFailureCallback_74); + } + + void OnFailureResponse_74(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_74(const chip::app::DataModel::Nullable & nullableInt8s) + { + VerifyOrReturn(CheckValueNull("nullableInt8s", nullableInt8s)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt16sMinValue_75() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableInt16sArgument; + nullableInt16sArgument.SetNonNull() = -32767; + + return cluster.WriteAttribute( + nullableInt16sArgument, this, OnSuccessCallback_75, OnFailureCallback_75); + } + + void OnFailureResponse_75(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_75() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt16sMinValue_76() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_76, OnFailureCallback_76); + } + + void OnFailureResponse_76(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_76(const chip::app::DataModel::Nullable & nullableInt16s) + { + VerifyOrReturn(CheckValueNonNull("nullableInt16s", nullableInt16s)); + VerifyOrReturn(CheckValue("nullableInt16s.Value()", nullableInt16s.Value(), -32767)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt16sInvalidValue_77() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableInt16sArgument; + nullableInt16sArgument.SetNonNull() = -32768; + + return cluster.WriteAttribute( + nullableInt16sArgument, this, OnSuccessCallback_77, OnFailureCallback_77); + } + + void OnFailureResponse_77(uint8_t status) { NextTest(); } + + void OnSuccessResponse_77() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadAttributeNullableInt16sUnchangedValue_78() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_78, OnFailureCallback_78); + } + + void OnFailureResponse_78(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_78(const chip::app::DataModel::Nullable & nullableInt16s) + { + VerifyOrReturn(CheckValueNonNull("nullableInt16s", nullableInt16s)); + VerifyOrReturn(CheckValue("nullableInt16s.Value()", nullableInt16s.Value(), -32767)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt16sNullValue_79() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableInt16sArgument; + nullableInt16sArgument.SetNull(); + + return cluster.WriteAttribute( + nullableInt16sArgument, this, OnSuccessCallback_79, OnFailureCallback_79); + } + + void OnFailureResponse_79(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_79() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt16sNullValue_80() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_80, OnFailureCallback_80); + } + + void OnFailureResponse_80(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_80(const chip::app::DataModel::Nullable & nullableInt16s) + { + VerifyOrReturn(CheckValueNull("nullableInt16s", nullableInt16s)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt32sMinValue_81() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableInt32sArgument; + nullableInt32sArgument.SetNonNull() = -2147483647L; + + return cluster.WriteAttribute( + nullableInt32sArgument, this, OnSuccessCallback_81, OnFailureCallback_81); + } + + void OnFailureResponse_81(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_81() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt32sMinValue_82() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_82, OnFailureCallback_82); + } + + void OnFailureResponse_82(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_82(const chip::app::DataModel::Nullable & nullableInt32s) + { + VerifyOrReturn(CheckValueNonNull("nullableInt32s", nullableInt32s)); + VerifyOrReturn(CheckValue("nullableInt32s.Value()", nullableInt32s.Value(), -2147483647L)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt32sInvalidValue_83() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableInt32sArgument; + nullableInt32sArgument.SetNonNull() = -2147483648L; + + return cluster.WriteAttribute( + nullableInt32sArgument, this, OnSuccessCallback_83, OnFailureCallback_83); + } + + void OnFailureResponse_83(uint8_t status) { NextTest(); } + + void OnSuccessResponse_83() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadAttributeNullableInt32sUnchangedValue_84() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_84, OnFailureCallback_84); + } + + void OnFailureResponse_84(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_84(const chip::app::DataModel::Nullable & nullableInt32s) + { + VerifyOrReturn(CheckValueNonNull("nullableInt32s", nullableInt32s)); + VerifyOrReturn(CheckValue("nullableInt32s.Value()", nullableInt32s.Value(), -2147483647L)); + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt32sNullValue_85() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableInt32sArgument; + nullableInt32sArgument.SetNull(); + + return cluster.WriteAttribute( + nullableInt32sArgument, this, OnSuccessCallback_85, OnFailureCallback_85); + } + + void OnFailureResponse_85(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_11(void * context, EmberAfStatus status) + void OnSuccessResponse_85() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt32sNullValue_86() { - (static_cast(context))->OnFailureResponse_11(chip::to_underlying(status)); + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_86, OnFailureCallback_86); } - static void OnSuccessCallback_11(void * context, const chip::app::DataModel::DecodableList & listOctetString) + void OnFailureResponse_86(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_86(const chip::app::DataModel::Nullable & nullableInt32s) { - (static_cast(context))->OnSuccessResponse_11(listOctetString); + VerifyOrReturn(CheckValueNull("nullableInt32s", nullableInt32s)); + NextTest(); } - static void OnFailureCallback_12(void * context, EmberAfStatus status) + CHIP_ERROR TestWriteAttributeNullableInt64sMinValue_87() { - (static_cast(context))->OnFailureResponse_12(chip::to_underlying(status)); + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + chip::app::DataModel::Nullable nullableInt64sArgument; + nullableInt64sArgument.SetNonNull() = -9223372036854775807LL; + + return cluster.WriteAttribute( + nullableInt64sArgument, this, OnSuccessCallback_87, OnFailureCallback_87); } - static void OnSuccessCallback_12(void * context) { (static_cast(context))->OnSuccessResponse_12(); } + void OnFailureResponse_87(uint8_t status) { ThrowFailureResponse(); } - static void OnFailureCallback_13(void * context, EmberAfStatus status) + void OnSuccessResponse_87() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt64sMinValue_88() { - (static_cast(context))->OnFailureResponse_13(chip::to_underlying(status)); + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_88, OnFailureCallback_88); } - static void OnSuccessCallback_13( - void * context, - const chip::app::DataModel::DecodableList & - listStructOctetString) + void OnFailureResponse_88(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_88(const chip::app::DataModel::Nullable & nullableInt64s) { - (static_cast(context))->OnSuccessResponse_13(listStructOctetString); + VerifyOrReturn(CheckValueNonNull("nullableInt64s", nullableInt64s)); + VerifyOrReturn(CheckValue("nullableInt64s.Value()", nullableInt64s.Value(), -9223372036854775807LL)); + NextTest(); } - // - // Tests methods - // - - CHIP_ERROR TestSendTestCommandWithStructArgumentAndArg1bIsTrue_0() + CHIP_ERROR TestWriteAttributeNullableInt64sInvalidValue_89() { - using RequestType = chip::app::Clusters::TestCluster::Commands::TestStructArgumentRequest::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); - RequestType request; + chip::app::DataModel::Nullable nullableInt64sArgument; + nullableInt64sArgument.SetNonNull() = -9223372036854775807LL - 1LL; - request.arg1.a = 0; - request.arg1.b = true; - request.arg1.c = static_cast(2); - request.arg1.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); - request.arg1.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - request.arg1.f = static_cast>(1); + return cluster.WriteAttribute( + nullableInt64sArgument, this, OnSuccessCallback_89, OnFailureCallback_89); + } - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_0(data.value); - }; + void OnFailureResponse_89(uint8_t status) { NextTest(); } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_0(status); - }; + void OnSuccessResponse_89() { ThrowSuccessResponse(); } - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); - return CHIP_NO_ERROR; + CHIP_ERROR TestReadAttributeNullableInt64sUnchangedValue_90() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_90, OnFailureCallback_90); } - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_90(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0(bool value) + void OnSuccessResponse_90(const chip::app::DataModel::Nullable & nullableInt64s) { - VerifyOrReturn(CheckValue("value", value, true)); + VerifyOrReturn(CheckValueNonNull("nullableInt64s", nullableInt64s)); + VerifyOrReturn(CheckValue("nullableInt64s.Value()", nullableInt64s.Value(), -9223372036854775807LL)); NextTest(); } - CHIP_ERROR TestSendTestCommandWithStructArgumentAndArg1bIsFalse_1() + CHIP_ERROR TestWriteAttributeNullableInt64sNullValue_91() { - using RequestType = chip::app::Clusters::TestCluster::Commands::TestStructArgumentRequest::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); - RequestType request; + chip::app::DataModel::Nullable nullableInt64sArgument; + nullableInt64sArgument.SetNull(); - request.arg1.a = 0; - request.arg1.b = false; - request.arg1.c = static_cast(2); - request.arg1.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); - request.arg1.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - request.arg1.f = static_cast>(1); + return cluster.WriteAttribute( + nullableInt64sArgument, this, OnSuccessCallback_91, OnFailureCallback_91); + } - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(data.value); - }; + void OnFailureResponse_91(uint8_t status) { ThrowFailureResponse(); } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; + void OnSuccessResponse_91() { NextTest(); } - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); - return CHIP_NO_ERROR; + CHIP_ERROR TestReadAttributeNullableInt64sNullValue_92() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_92, OnFailureCallback_92); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_92(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(bool value) + void OnSuccessResponse_92(const chip::app::DataModel::Nullable & nullableInt64s) { - VerifyOrReturn(CheckValue("value", value, false)); + VerifyOrReturn(CheckValueNull("nullableInt64s", nullableInt64s)); NextTest(); } - CHIP_ERROR TestSendTestCommandWithListOfInt8uAndNoneOfThemIsSetTo0_2() + CHIP_ERROR TestWriteAttributeNullableEnum8MaxValue_93() { - using RequestType = chip::app::Clusters::TestCluster::Commands::TestListInt8UArgumentRequest::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); - RequestType request; + chip::app::DataModel::Nullable nullableEnum8Argument; + nullableEnum8Argument.SetNonNull() = static_cast(254); - uint8_t arg1List[9]; - arg1List[0] = 1; - arg1List[1] = 2; - arg1List[2] = 3; - arg1List[3] = 4; - arg1List[4] = 5; - arg1List[5] = 6; - arg1List[6] = 7; - arg1List[7] = 8; - arg1List[8] = 9; - request.arg1 = arg1List; + return cluster.WriteAttribute( + nullableEnum8Argument, this, OnSuccessCallback_93, OnFailureCallback_93); + } - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_2(data.value); - }; + void OnFailureResponse_93(uint8_t status) { ThrowFailureResponse(); } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_2(status); - }; + void OnSuccessResponse_93() { NextTest(); } - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); - return CHIP_NO_ERROR; + CHIP_ERROR TestReadAttributeNullableEnum8MaxValue_94() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_94, OnFailureCallback_94); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_94(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2(bool value) + void OnSuccessResponse_94(const chip::app::DataModel::Nullable & nullableEnum8) { - VerifyOrReturn(CheckValue("value", value, true)); + VerifyOrReturn(CheckValueNonNull("nullableEnum8", nullableEnum8)); + VerifyOrReturn(CheckValue("nullableEnum8.Value()", nullableEnum8.Value(), 254)); NextTest(); } - CHIP_ERROR TestSendTestCommandWithListOfInt8uAndOneOfThemIsSetTo0_3() + CHIP_ERROR TestWriteAttributeNullableEnum8InvalidValue_95() { - using RequestType = chip::app::Clusters::TestCluster::Commands::TestListInt8UArgumentRequest::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); - RequestType request; + chip::app::DataModel::Nullable nullableEnum8Argument; + nullableEnum8Argument.SetNonNull() = static_cast(255); - uint8_t arg1List[10]; - arg1List[0] = 1; - arg1List[1] = 2; - arg1List[2] = 3; - arg1List[3] = 4; - arg1List[4] = 5; - arg1List[5] = 6; - arg1List[6] = 7; - arg1List[7] = 8; - arg1List[8] = 9; - arg1List[9] = 0; - request.arg1 = arg1List; + return cluster.WriteAttribute( + nullableEnum8Argument, this, OnSuccessCallback_95, OnFailureCallback_95); + } - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(data.value); - }; + void OnFailureResponse_95(uint8_t status) { NextTest(); } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; + void OnSuccessResponse_95() { ThrowSuccessResponse(); } - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); - return CHIP_NO_ERROR; + CHIP_ERROR TestReadAttributeNullableEnum8UnchangedValue_96() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_96, OnFailureCallback_96); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_96(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_3(bool value) + void OnSuccessResponse_96(const chip::app::DataModel::Nullable & nullableEnum8) { - VerifyOrReturn(CheckValue("value", value, false)); + VerifyOrReturn(CheckValueNonNull("nullableEnum8", nullableEnum8)); + VerifyOrReturn(CheckValue("nullableEnum8.Value()", nullableEnum8.Value(), 254)); NextTest(); } - CHIP_ERROR TestSendTestCommandWithListOfInt8uAndGetItReversed_4() + CHIP_ERROR TestWriteAttributeNullableEnum8NullValue_97() { - using RequestType = chip::app::Clusters::TestCluster::Commands::TestListInt8UReverseRequest::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); - RequestType request; + chip::app::DataModel::Nullable nullableEnum8Argument; + nullableEnum8Argument.SetNull(); - uint8_t arg1List[9]; - arg1List[0] = 1; - arg1List[1] = 2; - arg1List[2] = 3; - arg1List[3] = 4; - arg1List[4] = 5; - arg1List[5] = 6; - arg1List[6] = 7; - arg1List[7] = 8; - arg1List[8] = 9; - request.arg1 = arg1List; + return cluster.WriteAttribute( + nullableEnum8Argument, this, OnSuccessCallback_97, OnFailureCallback_97); + } - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(data.arg1); - }; + void OnFailureResponse_97(uint8_t status) { ThrowFailureResponse(); } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; + void OnSuccessResponse_97() { NextTest(); } - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); - return CHIP_NO_ERROR; + CHIP_ERROR TestReadAttributeNullableEnum8NullValue_98() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_98, OnFailureCallback_98); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_98(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_4(const chip::app::DataModel::DecodableList & arg1) + void OnSuccessResponse_98(const chip::app::DataModel::Nullable & nullableEnum8) { - auto iter = arg1.begin(); - VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 0)); - VerifyOrReturn(CheckValue("arg1[0]", iter.GetValue(), 9)); - VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 1)); - VerifyOrReturn(CheckValue("arg1[1]", iter.GetValue(), 8)); - VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 2)); - VerifyOrReturn(CheckValue("arg1[2]", iter.GetValue(), 7)); - VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 3)); - VerifyOrReturn(CheckValue("arg1[3]", iter.GetValue(), 6)); - VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 4)); - VerifyOrReturn(CheckValue("arg1[4]", iter.GetValue(), 5)); - VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 5)); - VerifyOrReturn(CheckValue("arg1[5]", iter.GetValue(), 4)); - VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 6)); - VerifyOrReturn(CheckValue("arg1[6]", iter.GetValue(), 3)); - VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 7)); - VerifyOrReturn(CheckValue("arg1[7]", iter.GetValue(), 2)); - VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 8)); - VerifyOrReturn(CheckValue("arg1[8]", iter.GetValue(), 1)); - VerifyOrReturn(CheckNoMoreListItems("arg1", iter, 9)); + VerifyOrReturn(CheckValueNull("nullableEnum8", nullableEnum8)); NextTest(); } - CHIP_ERROR TestSendTestCommandWithEmptyListOfInt8uAndGetAnEmptyListBack_5() + CHIP_ERROR TestWriteAttributeNullableEnum16MaxValue_99() { - using RequestType = chip::app::Clusters::TestCluster::Commands::TestListInt8UReverseRequest::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); - RequestType request; + chip::app::DataModel::Nullable nullableEnum16Argument; + nullableEnum16Argument.SetNonNull() = static_cast(65534); - request.arg1 = chip::app::DataModel::List(); + return cluster.WriteAttribute( + nullableEnum16Argument, this, OnSuccessCallback_99, OnFailureCallback_99); + } - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_5(data.arg1); - }; + void OnFailureResponse_99(uint8_t status) { ThrowFailureResponse(); } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_5(status); - }; + void OnSuccessResponse_99() { NextTest(); } - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); - return CHIP_NO_ERROR; + CHIP_ERROR TestReadAttributeNullableEnum16MaxValue_100() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_100, OnFailureCallback_100); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_100(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_5(const chip::app::DataModel::DecodableList & arg1) + void OnSuccessResponse_100(const chip::app::DataModel::Nullable & nullableEnum16) { - auto iter = arg1.begin(); - VerifyOrReturn(CheckNoMoreListItems("arg1", iter, 0)); + VerifyOrReturn(CheckValueNonNull("nullableEnum16", nullableEnum16)); + VerifyOrReturn(CheckValue("nullableEnum16.Value()", nullableEnum16.Value(), 65534U)); NextTest(); } - CHIP_ERROR TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsTrue_6() + CHIP_ERROR TestWriteAttributeNullableEnum16InvalidValue_101() { - using RequestType = chip::app::Clusters::TestCluster::Commands::TestListStructArgumentRequest::Type; - - RequestType request; - - chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type arg1List[2]; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); - arg1List[0].a = 0; - arg1List[0].b = true; - arg1List[0].c = static_cast(2); - arg1List[0].d = chip::ByteSpan(chip::Uint8::from_const_char("first_octet_stringgarbage: not in length on purpose"), 18); - arg1List[0].e = chip::Span("first_char_stringgarbage: not in length on purpose", 17); - arg1List[0].f = static_cast>(1); + chip::app::DataModel::Nullable nullableEnum16Argument; + nullableEnum16Argument.SetNonNull() = static_cast(65535); - arg1List[1].a = 1; - arg1List[1].b = true; - arg1List[1].c = static_cast(3); - arg1List[1].d = chip::ByteSpan(chip::Uint8::from_const_char("second_octet_stringgarbage: not in length on purpose"), 19); - arg1List[1].e = chip::Span("second_char_stringgarbage: not in length on purpose", 18); - arg1List[1].f = static_cast>(1); + return cluster.WriteAttribute( + nullableEnum16Argument, this, OnSuccessCallback_101, OnFailureCallback_101); + } - request.arg1 = arg1List; + void OnFailureResponse_101(uint8_t status) { NextTest(); } - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_6(data.value); - }; + void OnSuccessResponse_101() { ThrowSuccessResponse(); } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_6(status); - }; + CHIP_ERROR TestReadAttributeNullableEnum16UnchangedValue_102() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); - return CHIP_NO_ERROR; + return cluster.ReadAttribute( + this, OnSuccessCallback_102, OnFailureCallback_102); } - void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_102(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_6(bool value) + void OnSuccessResponse_102(const chip::app::DataModel::Nullable & nullableEnum16) { - VerifyOrReturn(CheckValue("value", value, true)); + VerifyOrReturn(CheckValueNonNull("nullableEnum16", nullableEnum16)); + VerifyOrReturn(CheckValue("nullableEnum16.Value()", nullableEnum16.Value(), 65534U)); NextTest(); } - CHIP_ERROR TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsFalse_7() + CHIP_ERROR TestWriteAttributeNullableEnum16NullValue_103() { - using RequestType = chip::app::Clusters::TestCluster::Commands::TestListStructArgumentRequest::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); - RequestType request; + chip::app::DataModel::Nullable nullableEnum16Argument; + nullableEnum16Argument.SetNull(); - chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type arg1List[2]; + return cluster.WriteAttribute( + nullableEnum16Argument, this, OnSuccessCallback_103, OnFailureCallback_103); + } - arg1List[0].a = 1; - arg1List[0].b = true; - arg1List[0].c = static_cast(3); - arg1List[0].d = chip::ByteSpan(chip::Uint8::from_const_char("second_octet_stringgarbage: not in length on purpose"), 19); - arg1List[0].e = chip::Span("second_char_stringgarbage: not in length on purpose", 18); - arg1List[0].f = static_cast>(1); + void OnFailureResponse_103(uint8_t status) { ThrowFailureResponse(); } - arg1List[1].a = 0; - arg1List[1].b = false; - arg1List[1].c = static_cast(2); - arg1List[1].d = chip::ByteSpan(chip::Uint8::from_const_char("first_octet_stringgarbage: not in length on purpose"), 18); - arg1List[1].e = chip::Span("first_char_stringgarbage: not in length on purpose", 17); - arg1List[1].f = static_cast>(1); + void OnSuccessResponse_103() { NextTest(); } - request.arg1 = arg1List; + CHIP_ERROR TestReadAttributeNullableEnum16NullValue_104() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_7(data.value); - }; + return cluster.ReadAttribute( + this, OnSuccessCallback_104, OnFailureCallback_104); + } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_7(status); - }; + void OnFailureResponse_104(uint8_t status) { ThrowFailureResponse(); } - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); - return CHIP_NO_ERROR; + void OnSuccessResponse_104(const chip::app::DataModel::Nullable & nullableEnum16) + { + VerifyOrReturn(CheckValueNull("nullableEnum16", nullableEnum16)); + NextTest(); } - void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + CHIP_ERROR TestReadAttributeNullableOctetStringDefaultValue_105() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); - void OnSuccessResponse_7(bool value) + return cluster.ReadAttribute( + this, OnSuccessCallback_105, OnFailureCallback_105); + } + + void OnFailureResponse_105(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_105(const chip::app::DataModel::Nullable & nullableOctetString) { - VerifyOrReturn(CheckValue("value", value, false)); + VerifyOrReturn(CheckValueNonNull("nullableOctetString", nullableOctetString)); + VerifyOrReturn(CheckValueAsString("nullableOctetString.Value()", nullableOctetString.Value(), + chip::ByteSpan(chip::Uint8::from_const_char(""), 0))); NextTest(); } - CHIP_ERROR TestWriteAttributeListWithListOfInt8uAndNoneOfThemIsSetTo0_8() + CHIP_ERROR TestWriteAttributeNullableOctetString_106() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - chip::app::DataModel::List listInt8uArgument; + cluster.Associate(mDevice, endpoint); - uint8_t listInt8uList[4]; - listInt8uList[0] = 1; - listInt8uList[1] = 2; - listInt8uList[2] = 3; - listInt8uList[3] = 4; - listInt8uArgument = listInt8uList; + chip::app::DataModel::Nullable nullableOctetStringArgument; + nullableOctetStringArgument.SetNonNull() = + chip::ByteSpan(chip::Uint8::from_const_char("TestValuegarbage: not in length on purpose"), 9); - return cluster.WriteAttribute( - listInt8uArgument, this, OnSuccessCallback_8, OnFailureCallback_8); + return cluster.WriteAttribute( + nullableOctetStringArgument, this, OnSuccessCallback_106, OnFailureCallback_106); } - void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_106(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_8() { NextTest(); } + void OnSuccessResponse_106() { NextTest(); } - CHIP_ERROR TestReadAttributeListWithListOfInt8u_9() + CHIP_ERROR TestReadAttributeNullableOctetString_107() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); - return cluster.ReadAttribute(this, OnSuccessCallback_9, - OnFailureCallback_9); + return cluster.ReadAttribute( + this, OnSuccessCallback_107, OnFailureCallback_107); } - void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_107(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_9(const chip::app::DataModel::DecodableList & listInt8u) + void OnSuccessResponse_107(const chip::app::DataModel::Nullable & nullableOctetString) { - auto iter = listInt8u.begin(); - VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 0)); - VerifyOrReturn(CheckValue("listInt8u[0]", iter.GetValue(), 1)); - VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 1)); - VerifyOrReturn(CheckValue("listInt8u[1]", iter.GetValue(), 2)); - VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 2)); - VerifyOrReturn(CheckValue("listInt8u[2]", iter.GetValue(), 3)); - VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 3)); - VerifyOrReturn(CheckValue("listInt8u[3]", iter.GetValue(), 4)); - VerifyOrReturn(CheckNoMoreListItems("listInt8u", iter, 4)); + VerifyOrReturn(CheckValueNonNull("nullableOctetString", nullableOctetString)); + VerifyOrReturn(CheckValueAsString("nullableOctetString.Value()", nullableOctetString.Value(), + chip::ByteSpan(chip::Uint8::from_const_char("TestValue"), 9))); NextTest(); } - CHIP_ERROR TestWriteAttributeListWithListOfOctetString_10() + CHIP_ERROR TestWriteAttributeNullableOctetString_108() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - chip::app::DataModel::List listOctetStringArgument; + cluster.Associate(mDevice, endpoint); - chip::ByteSpan listOctetStringList[4]; - listOctetStringList[0] = chip::ByteSpan(chip::Uint8::from_const_char("Test0garbage: not in length on purpose"), 5); - listOctetStringList[1] = chip::ByteSpan(chip::Uint8::from_const_char("Test1garbage: not in length on purpose"), 5); - listOctetStringList[2] = chip::ByteSpan(chip::Uint8::from_const_char("Test2garbage: not in length on purpose"), 5); - listOctetStringList[3] = chip::ByteSpan(chip::Uint8::from_const_char("Test3garbage: not in length on purpose"), 5); - listOctetStringArgument = listOctetStringList; + chip::app::DataModel::Nullable nullableOctetStringArgument; + nullableOctetStringArgument.SetNull(); - return cluster.WriteAttribute( - listOctetStringArgument, this, OnSuccessCallback_10, OnFailureCallback_10); + return cluster.WriteAttribute( + nullableOctetStringArgument, this, OnSuccessCallback_108, OnFailureCallback_108); } - void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_108(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_10() { NextTest(); } + void OnSuccessResponse_108() { NextTest(); } - CHIP_ERROR TestReadAttributeListWithListOfOctetString_11() + CHIP_ERROR TestReadAttributeNullableOctetString_109() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); - return cluster.ReadAttribute( - this, OnSuccessCallback_11, OnFailureCallback_11); + return cluster.ReadAttribute( + this, OnSuccessCallback_109, OnFailureCallback_109); } - void OnFailureResponse_11(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_109(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_11(const chip::app::DataModel::DecodableList & listOctetString) + void OnSuccessResponse_109(const chip::app::DataModel::Nullable & nullableOctetString) { - auto iter = listOctetString.begin(); - VerifyOrReturn(CheckNextListItemDecodes("listOctetString", iter, 0)); - VerifyOrReturn( - CheckValueAsString("listOctetString[0]", iter.GetValue(), chip::ByteSpan(chip::Uint8::from_const_char("Test0"), 5))); - VerifyOrReturn(CheckNextListItemDecodes("listOctetString", iter, 1)); - VerifyOrReturn( - CheckValueAsString("listOctetString[1]", iter.GetValue(), chip::ByteSpan(chip::Uint8::from_const_char("Test1"), 5))); - VerifyOrReturn(CheckNextListItemDecodes("listOctetString", iter, 2)); - VerifyOrReturn( - CheckValueAsString("listOctetString[2]", iter.GetValue(), chip::ByteSpan(chip::Uint8::from_const_char("Test2"), 5))); - VerifyOrReturn(CheckNextListItemDecodes("listOctetString", iter, 3)); - VerifyOrReturn( - CheckValueAsString("listOctetString[3]", iter.GetValue(), chip::ByteSpan(chip::Uint8::from_const_char("Test3"), 5))); - VerifyOrReturn(CheckNoMoreListItems("listOctetString", iter, 4)); + VerifyOrReturn(CheckValueNull("nullableOctetString", nullableOctetString)); NextTest(); } - CHIP_ERROR TestWriteAttributeListWithListOfListStructOctetString_12() + CHIP_ERROR TestWriteAttributeNullableOctetString_110() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); - - chip::app::DataModel::List - listStructOctetStringArgument; - - chip::app::Clusters::TestCluster::Structs::TestListStructOctet::Type listStructOctetStringList[4]; + cluster.Associate(mDevice, endpoint); - listStructOctetStringList[0].fabricIndex = 0ULL; - listStructOctetStringList[0].operationalCert = - chip::ByteSpan(chip::Uint8::from_const_char("Test0garbage: not in length on purpose"), 5); + chip::app::DataModel::Nullable nullableOctetStringArgument; + nullableOctetStringArgument.SetNonNull() = + chip::ByteSpan(chip::Uint8::from_const_char("garbage: not in length on purpose"), 0); - listStructOctetStringList[1].fabricIndex = 1ULL; - listStructOctetStringList[1].operationalCert = - chip::ByteSpan(chip::Uint8::from_const_char("Test1garbage: not in length on purpose"), 5); + return cluster.WriteAttribute( + nullableOctetStringArgument, this, OnSuccessCallback_110, OnFailureCallback_110); + } - listStructOctetStringList[2].fabricIndex = 2ULL; - listStructOctetStringList[2].operationalCert = - chip::ByteSpan(chip::Uint8::from_const_char("Test2garbage: not in length on purpose"), 5); + void OnFailureResponse_110(uint8_t status) { ThrowFailureResponse(); } - listStructOctetStringList[3].fabricIndex = 3ULL; - listStructOctetStringList[3].operationalCert = - chip::ByteSpan(chip::Uint8::from_const_char("Test3garbage: not in length on purpose"), 5); + void OnSuccessResponse_110() { NextTest(); } - listStructOctetStringArgument = listStructOctetStringList; + CHIP_ERROR TestReadAttributeNullableOctetString_111() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); - return cluster.WriteAttribute( - listStructOctetStringArgument, this, OnSuccessCallback_12, OnFailureCallback_12); + return cluster.ReadAttribute( + this, OnSuccessCallback_111, OnFailureCallback_111); } - void OnFailureResponse_12(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_111(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_12() { NextTest(); } + void OnSuccessResponse_111(const chip::app::DataModel::Nullable & nullableOctetString) + { + VerifyOrReturn(CheckValueNonNull("nullableOctetString", nullableOctetString)); + VerifyOrReturn(CheckValueAsString("nullableOctetString.Value()", nullableOctetString.Value(), + chip::ByteSpan(chip::Uint8::from_const_char(""), 0))); + NextTest(); + } - CHIP_ERROR TestReadAttributeListWithListOfListStructOctetString_13() + CHIP_ERROR TestReadAttributeNullableCharStringDefaultValue_112() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); - return cluster.ReadAttribute( - this, OnSuccessCallback_13, OnFailureCallback_13); + return cluster.ReadAttribute( + this, OnSuccessCallback_112, OnFailureCallback_112); } - void OnFailureResponse_13(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_112(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_13( - const chip::app::DataModel::DecodableList & - listStructOctetString) + void OnSuccessResponse_112(const chip::app::DataModel::Nullable & nullableCharString) { - auto iter = listStructOctetString.begin(); - VerifyOrReturn(CheckNextListItemDecodes("listStructOctetString", iter, 0)); - VerifyOrReturn(CheckValue<>("listStructOctetString[0].fabricIndex", iter.GetValue().fabricIndex, 0ULL)); - VerifyOrReturn(CheckValueAsString("listStructOctetString[0].operationalCert", iter.GetValue().operationalCert, - chip::ByteSpan(chip::Uint8::from_const_char("Test0"), 5))); - VerifyOrReturn(CheckNextListItemDecodes("listStructOctetString", iter, 1)); - VerifyOrReturn(CheckValue<>("listStructOctetString[1].fabricIndex", iter.GetValue().fabricIndex, 1ULL)); - VerifyOrReturn(CheckValueAsString("listStructOctetString[1].operationalCert", iter.GetValue().operationalCert, - chip::ByteSpan(chip::Uint8::from_const_char("Test1"), 5))); - VerifyOrReturn(CheckNextListItemDecodes("listStructOctetString", iter, 2)); - VerifyOrReturn(CheckValue<>("listStructOctetString[2].fabricIndex", iter.GetValue().fabricIndex, 2ULL)); - VerifyOrReturn(CheckValueAsString("listStructOctetString[2].operationalCert", iter.GetValue().operationalCert, - chip::ByteSpan(chip::Uint8::from_const_char("Test2"), 5))); - VerifyOrReturn(CheckNextListItemDecodes("listStructOctetString", iter, 3)); - VerifyOrReturn(CheckValue<>("listStructOctetString[3].fabricIndex", iter.GetValue().fabricIndex, 3ULL)); - VerifyOrReturn(CheckValueAsString("listStructOctetString[3].operationalCert", iter.GetValue().operationalCert, - chip::ByteSpan(chip::Uint8::from_const_char("Test3"), 5))); - VerifyOrReturn(CheckNoMoreListItems("listStructOctetString", iter, 4)); + VerifyOrReturn(CheckValueNonNull("nullableCharString", nullableCharString)); + VerifyOrReturn(CheckValueAsString("nullableCharString.Value()", nullableCharString.Value(), chip::CharSpan("", 0))); NextTest(); } - CHIP_ERROR TestSendTestCommandWithOptionalArgSet_14() + CHIP_ERROR TestWriteAttributeNullableCharString_113() { - using RequestType = chip::app::Clusters::TestCluster::Commands::TestNullableOptionalRequest::Type; - - RequestType request; - request.arg1.Emplace().SetNonNull() = 5; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context)) - ->OnSuccessResponse_14(data.wasPresent, data.wasNull, data.value, data.originalValue); - }; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_14(status); - }; + chip::app::DataModel::Nullable nullableCharStringArgument; + nullableCharStringArgument.SetNonNull() = chip::Span("☉T☉garbage: not in length on purpose", 3); - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); - return CHIP_NO_ERROR; + return cluster.WriteAttribute( + nullableCharStringArgument, this, OnSuccessCallback_113, OnFailureCallback_113); } - void OnFailureResponse_14(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_113(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_14(bool wasPresent, const chip::Optional & wasNull, const chip::Optional & value, - const chip::Optional> & originalValue) - { - VerifyOrReturn(CheckValue("wasPresent", wasPresent, true)); + void OnSuccessResponse_113() { NextTest(); } - VerifyOrReturn(CheckValuePresent("wasNull", wasNull)); - VerifyOrReturn(CheckValue("wasNull.Value()", wasNull.Value(), false)); + CHIP_ERROR TestWriteAttributeNullableCharStringValueTooLong_114() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); - VerifyOrReturn(CheckValuePresent("value", value)); - VerifyOrReturn(CheckValue("value.Value()", value.Value(), 5)); + chip::app::DataModel::Nullable nullableCharStringArgument; + nullableCharStringArgument.SetNull(); - VerifyOrReturn(CheckValuePresent("originalValue", originalValue)); - VerifyOrReturn(CheckValueNonNull("originalValue.Value()", originalValue.Value())); - VerifyOrReturn(CheckValue("originalValue.Value().Value()", originalValue.Value().Value(), 5)); - NextTest(); + return cluster.WriteAttribute( + nullableCharStringArgument, this, OnSuccessCallback_114, OnFailureCallback_114); } - CHIP_ERROR TestSendTestCommandWithoutItsOptionalArg_15() - { - using RequestType = chip::app::Clusters::TestCluster::Commands::TestNullableOptionalRequest::Type; - - RequestType request; + void OnFailureResponse_114(uint8_t status) { ThrowFailureResponse(); } - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context)) - ->OnSuccessResponse_15(data.wasPresent, data.wasNull, data.value, data.originalValue); - }; + void OnSuccessResponse_114() { NextTest(); } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_15(status); - }; + CHIP_ERROR TestReadAttributeNullableCharString_115() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); - return CHIP_NO_ERROR; + return cluster.ReadAttribute( + this, OnSuccessCallback_115, OnFailureCallback_115); } - void OnFailureResponse_15(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_115(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_15(bool wasPresent, const chip::Optional & wasNull, const chip::Optional & value, - const chip::Optional> & originalValue) + void OnSuccessResponse_115(const chip::app::DataModel::Nullable & nullableCharString) { - VerifyOrReturn(CheckValue("wasPresent", wasPresent, false)); - + VerifyOrReturn(CheckValueNull("nullableCharString", nullableCharString)); NextTest(); } - CHIP_ERROR TestSendTestCommandWithOptionalArgSetToNull_16() + CHIP_ERROR TestWriteAttributeNullableCharStringEmpty_116() { - using RequestType = chip::app::Clusters::TestCluster::Commands::TestNullableOptionalRequest::Type; - - RequestType request; - request.arg1.Emplace().SetNull(); - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context)) - ->OnSuccessResponse_16(data.wasPresent, data.wasNull, data.value, data.originalValue); - }; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_16(status); - }; + chip::app::DataModel::Nullable nullableCharStringArgument; + nullableCharStringArgument.SetNonNull() = chip::Span("garbage: not in length on purpose", 0); - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); - return CHIP_NO_ERROR; + return cluster.WriteAttribute( + nullableCharStringArgument, this, OnSuccessCallback_116, OnFailureCallback_116); } - void OnFailureResponse_16(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_116(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_16(bool wasPresent, const chip::Optional & wasNull, const chip::Optional & value, - const chip::Optional> & originalValue) + void OnSuccessResponse_116() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableCharString_117() { - VerifyOrReturn(CheckValue("wasPresent", wasPresent, true)); + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, endpoint); - VerifyOrReturn(CheckValuePresent("wasNull", wasNull)); - VerifyOrReturn(CheckValue("wasNull.Value()", wasNull.Value(), true)); + return cluster.ReadAttribute( + this, OnSuccessCallback_117, OnFailureCallback_117); + } - VerifyOrReturn(CheckValuePresent("originalValue", originalValue)); - VerifyOrReturn(CheckValueNull("originalValue.Value()", originalValue.Value())); + void OnFailureResponse_117(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_117(const chip::app::DataModel::Nullable & nullableCharString) + { + VerifyOrReturn(CheckValueNonNull("nullableCharString", nullableCharString)); + VerifyOrReturn(CheckValueAsString("nullableCharString.Value()", nullableCharString.Value(), chip::CharSpan("", 0))); NextTest(); } }; @@ -31047,8 +34998,9 @@ class TestConstraints : public TestCommand CHIP_ERROR TestWriteAttributeInt32uValue_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint32_t int32uArgument; int32uArgument = 5UL; @@ -31063,8 +35015,9 @@ class TestConstraints : public TestCommand CHIP_ERROR TestReadAttributeInt32uValueMinValueConstraints_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -31080,8 +35033,9 @@ class TestConstraints : public TestCommand CHIP_ERROR TestReadAttributeInt32uValueMaxValueConstraints_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_2, OnFailureCallback_2); @@ -31097,8 +35051,9 @@ class TestConstraints : public TestCommand CHIP_ERROR TestReadAttributeInt32uValueNotValueConstraints_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_3, OnFailureCallback_3); @@ -31328,8 +35283,9 @@ class TestDescriptorCluster : public TestCommand CHIP_ERROR TestReadAttributeDeviceList_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::DescriptorClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_0, OnFailureCallback_0); @@ -31350,8 +35306,9 @@ class TestDescriptorCluster : public TestCommand CHIP_ERROR TestReadAttributeServerList_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::DescriptorClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -31404,8 +35361,9 @@ class TestDescriptorCluster : public TestCommand CHIP_ERROR TestReadAttributeClientList_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::DescriptorClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_2, OnFailureCallback_2); @@ -31422,8 +35380,9 @@ class TestDescriptorCluster : public TestCommand CHIP_ERROR TestReadAttributePartsList_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::DescriptorClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_3, OnFailureCallback_3); @@ -31542,8 +35501,9 @@ class TestBasicInformation : public TestCommand CHIP_ERROR TestReadLocation_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_0, OnFailureCallback_0); @@ -31559,8 +35519,9 @@ class TestBasicInformation : public TestCommand CHIP_ERROR TestWriteLocation_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); chip::CharSpan locationArgument; locationArgument = chip::Span("usgarbage: not in length on purpose", 2); @@ -31575,8 +35536,9 @@ class TestBasicInformation : public TestCommand CHIP_ERROR TestReadBackLocation_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_2, OnFailureCallback_2); @@ -31592,8 +35554,9 @@ class TestBasicInformation : public TestCommand CHIP_ERROR TestRestoreInitialLocationValue_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); chip::CharSpan locationArgument; locationArgument = chip::Span("garbage: not in length on purpose", 0); @@ -31660,7 +35623,8 @@ class TestIdentifyCluster : public TestCommand CHIP_ERROR TestSendIdentifyCommandAndExpectSuccessResponse_0() { - using RequestType = chip::app::Clusters::Identify::Commands::Identify::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; + using RequestType = chip::app::Clusters::Identify::Commands::Identify::Type; RequestType request; request.identifyTime = 0U; @@ -31673,7 +35637,7 @@ class TestIdentifyCluster : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 0, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -31773,8 +35737,9 @@ class TestOperationalCredentialsCluster : public TestCommand CHIP_ERROR TestReadNumberOfSupportedFabrics_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::OperationalCredentialsClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -31791,8 +35756,9 @@ class TestOperationalCredentialsCluster : public TestCommand CHIP_ERROR TestReadNumberOfCommissionedFabrics_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::OperationalCredentialsClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_1, OnFailureCallback_1); @@ -31809,8 +35775,9 @@ class TestOperationalCredentialsCluster : public TestCommand CHIP_ERROR TestReadCurrentFabricIndex_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::OperationalCredentialsClusterTest cluster; - cluster.Associate(mDevice, 0); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2); @@ -31970,8 +35937,9 @@ class TestModeSelectCluster : public TestCommand CHIP_ERROR TestReadCurrentMode_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ModeSelectClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_0, OnFailureCallback_0); @@ -31987,8 +35955,9 @@ class TestModeSelectCluster : public TestCommand CHIP_ERROR TestReadOnMode_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ModeSelectClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_1, OnFailureCallback_1); @@ -32004,8 +35973,9 @@ class TestModeSelectCluster : public TestCommand CHIP_ERROR TestReadStartUpMode_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ModeSelectClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_2, OnFailureCallback_2); @@ -32021,8 +35991,9 @@ class TestModeSelectCluster : public TestCommand CHIP_ERROR TestReadDescription_3() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ModeSelectClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_3, OnFailureCallback_3); @@ -32038,8 +36009,9 @@ class TestModeSelectCluster : public TestCommand CHIP_ERROR TestReadSupportedModes_4() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ModeSelectClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_4, OnFailureCallback_4); @@ -32070,7 +36042,8 @@ class TestModeSelectCluster : public TestCommand CHIP_ERROR TestChangeToSupportedMode_5() { - using RequestType = chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type; RequestType request; request.newMode = 4; @@ -32083,7 +36056,7 @@ class TestModeSelectCluster : public TestCommand (static_cast(context))->OnFailureResponse_5(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -32093,8 +36066,9 @@ class TestModeSelectCluster : public TestCommand CHIP_ERROR TestVerifyCurrentModeChange_6() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ModeSelectClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute(this, OnSuccessCallback_6, OnFailureCallback_6); @@ -32110,7 +36084,8 @@ class TestModeSelectCluster : public TestCommand CHIP_ERROR TestChangeToUnsupportedMode_7() { - using RequestType = chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type; RequestType request; request.newMode = 2; @@ -32123,7 +36098,7 @@ class TestModeSelectCluster : public TestCommand (static_cast(context))->OnFailureResponse_7(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -32223,8 +36198,9 @@ class Test_TC_DIAGSW_1_1 : public TestCommand CHIP_ERROR TestReadsCurrentHeapFreeNonGlobalAttributeValueFromDut_0() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::SoftwareDiagnosticsClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_0, OnFailureCallback_0); @@ -32243,8 +36219,9 @@ class Test_TC_DIAGSW_1_1 : public TestCommand CHIP_ERROR TestReadsCurrentHeapUsedNonGlobalAttributeValueFromDut_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::SoftwareDiagnosticsClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_1, OnFailureCallback_1); @@ -32263,8 +36240,9 @@ class Test_TC_DIAGSW_1_1 : public TestCommand CHIP_ERROR TestReadsCurrentHeapHighWaterMarkNonGlobalAttributeValueFromDut_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::SoftwareDiagnosticsClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2); @@ -32414,7 +36392,8 @@ class TestSubscribe_OnOff : public TestCommand CHIP_ERROR TestSetOnOffAttributeToFalse_0() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -32426,7 +36405,7 @@ class TestSubscribe_OnOff : public TestCommand (static_cast(context))->OnFailureResponse_0(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -32436,8 +36415,9 @@ class TestSubscribe_OnOff : public TestCommand CHIP_ERROR TestReportSubscribeOnOffAttribute_1() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); ReturnErrorOnFailure(cluster.ReportAttributeOnOff(mOnSuccessCallback_1.Cancel())); @@ -32456,8 +36436,9 @@ class TestSubscribe_OnOff : public TestCommand CHIP_ERROR TestSubscribeOnOffAttribute_2() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); uint16_t minIntervalArgument; minIntervalArgument = 2U; @@ -32479,7 +36460,8 @@ class TestSubscribe_OnOff : public TestCommand CHIP_ERROR TestTurnOnTheLightToSeeAttributeChange_3() { - using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::On::Type; RequestType request; @@ -32491,7 +36473,7 @@ class TestSubscribe_OnOff : public TestCommand (static_cast(context))->OnFailureResponse_3(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -32501,8 +36483,9 @@ class TestSubscribe_OnOff : public TestCommand CHIP_ERROR TestCheckForAttributeReport_4() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReportAttributeOnOff(mOnSuccessCallback_4.Cancel()); } @@ -32520,7 +36503,8 @@ class TestSubscribe_OnOff : public TestCommand CHIP_ERROR TestTurnOffTheLightToSeeAttributeChange_5() { - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; RequestType request; @@ -32532,7 +36516,7 @@ class TestSubscribe_OnOff : public TestCommand (static_cast(context))->OnFailureResponse_5(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, 1, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -32542,8 +36526,9 @@ class TestSubscribe_OnOff : public TestCommand CHIP_ERROR TestCheckForAttributeReport_6() { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + cluster.Associate(mDevice, endpoint); return cluster.ReportAttributeOnOff(mOnSuccessCallback_6.Cancel()); } diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp index f3fcb1a93ea00d..5928dba85475dd 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp @@ -561,6 +561,27 @@ void PowerSourceClusterActiveBatteryFaultsListAttributeFilter(TLV::TLVReader * t cb->mCall(cb->mContext, list); } +void SoftwareDiagnosticsClusterThreadMetricsListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + void TvChannelClusterTvChannelListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h index 21378c4acd0644..355c5bd8bffbed 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h @@ -260,6 +260,13 @@ void PowerSourceClusterActiveBatteryFaultsListAttributeFilter(chip::TLV::TLVRead chip::Callback::Cancelable * onFailureCallback); typedef void (*PowerSourceActiveBatteryFaultsListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); +void SoftwareDiagnosticsClusterThreadMetricsListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*SoftwareDiagnosticsThreadMetricsListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & + data); void TvChannelClusterTvChannelListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, chip::Callback::Cancelable * onFailureCallback); typedef void (*TvChannelTvChannelListListAttributeCallback)( diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp index fd72988768c7a9..d80431920d8eb5 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp @@ -10455,6 +10455,17 @@ CHIP_ERROR SoftwareDiagnosticsCluster::ResetWatermarks(Callback::Cancelable * on } // SoftwareDiagnostics Cluster Attributes +CHIP_ERROR SoftwareDiagnosticsCluster::ReadAttributeThreadMetrics(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mAttributeId = 0x00000000; + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + SoftwareDiagnosticsClusterThreadMetricsListAttributeFilter); +} + CHIP_ERROR SoftwareDiagnosticsCluster::ReadAttributeCurrentHeapFree(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { @@ -11926,6 +11937,380 @@ CHIP_ERROR TestClusterCluster::WriteAttributeUnsupported(Callback::Cancelable * return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); } +CHIP_ERROR TestClusterCluster::ReadAttributeNullableBoolean(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mAttributeId = 0x00008000; + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeNullableBoolean(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, bool value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, TestCluster::Attributes::NullableBoolean::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeNullableBitmap8(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mAttributeId = 0x00008001; + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeNullableBitmap8(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, TestCluster::Attributes::NullableBitmap8::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeNullableBitmap16(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mAttributeId = 0x00008002; + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeNullableBitmap16(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, TestCluster::Attributes::NullableBitmap16::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeNullableBitmap32(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mAttributeId = 0x00008003; + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeNullableBitmap32(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint32_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, TestCluster::Attributes::NullableBitmap32::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeNullableBitmap64(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mAttributeId = 0x00008004; + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeNullableBitmap64(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint64_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, TestCluster::Attributes::NullableBitmap64::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeNullableInt8u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mAttributeId = 0x00008005; + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeNullableInt8u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, TestCluster::Attributes::NullableInt8u::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeNullableInt16u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mAttributeId = 0x00008006; + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeNullableInt16u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, TestCluster::Attributes::NullableInt16u::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeNullableInt32u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mAttributeId = 0x00008008; + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeNullableInt32u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint32_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, TestCluster::Attributes::NullableInt32u::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeNullableInt64u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mAttributeId = 0x0000800C; + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeNullableInt64u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint64_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, TestCluster::Attributes::NullableInt64u::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeNullableInt8s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mAttributeId = 0x0000800D; + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeNullableInt8s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, int8_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, TestCluster::Attributes::NullableInt8s::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeNullableInt16s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mAttributeId = 0x0000800E; + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeNullableInt16s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, int16_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, TestCluster::Attributes::NullableInt16s::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeNullableInt32s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mAttributeId = 0x00008010; + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeNullableInt32s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, int32_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, TestCluster::Attributes::NullableInt32s::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeNullableInt64s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mAttributeId = 0x00008014; + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeNullableInt64s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, int64_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, TestCluster::Attributes::NullableInt64s::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeNullableEnum8(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mAttributeId = 0x00008015; + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeNullableEnum8(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, TestCluster::Attributes::NullableEnum8::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeNullableEnum16(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mAttributeId = 0x00008016; + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeNullableEnum16(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, TestCluster::Attributes::NullableEnum16::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeNullableOctetString(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mAttributeId = 0x00008019; + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeNullableOctetString(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::ByteSpan value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, TestCluster::Attributes::NullableOctetString::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeNullableCharString(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mAttributeId = 0x0000801E; + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeNullableCharString(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::CharSpan value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, TestCluster::Attributes::NullableCharString::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} + CHIP_ERROR TestClusterCluster::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h index 72c6c5bf00a1cd..32e38e104906b8 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h @@ -1272,6 +1272,7 @@ class DLL_EXPORT SoftwareDiagnosticsCluster : public ClusterBase CHIP_ERROR ResetWatermarks(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); // Cluster Attributes + CHIP_ERROR ReadAttributeThreadMetrics(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeCurrentHeapFree(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeCurrentHeapUsed(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeCurrentHeapHighWatermark(Callback::Cancelable * onSuccessCallback, @@ -1413,6 +1414,23 @@ class DLL_EXPORT TestClusterCluster : public ClusterBase CHIP_ERROR ReadAttributeListNullablesAndOptionalsStruct(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeUnsupported(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeNullableBoolean(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeNullableBitmap8(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeNullableBitmap16(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeNullableBitmap32(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeNullableBitmap64(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeNullableInt8u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeNullableInt16u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeNullableInt32u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeNullableInt64u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeNullableInt8s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeNullableInt16s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeNullableInt32s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeNullableInt64s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeNullableEnum8(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeNullableEnum16(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeNullableOctetString(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeNullableCharString(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR WriteAttributeBoolean(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, bool value); @@ -1460,6 +1478,40 @@ class DLL_EXPORT TestClusterCluster : public ClusterBase chip::VendorId value); CHIP_ERROR WriteAttributeUnsupported(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, bool value); + CHIP_ERROR WriteAttributeNullableBoolean(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + bool value); + CHIP_ERROR WriteAttributeNullableBitmap8(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t value); + CHIP_ERROR WriteAttributeNullableBitmap16(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t value); + CHIP_ERROR WriteAttributeNullableBitmap32(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint32_t value); + CHIP_ERROR WriteAttributeNullableBitmap64(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint64_t value); + CHIP_ERROR WriteAttributeNullableInt8u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t value); + CHIP_ERROR WriteAttributeNullableInt16u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t value); + CHIP_ERROR WriteAttributeNullableInt32u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint32_t value); + CHIP_ERROR WriteAttributeNullableInt64u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint64_t value); + CHIP_ERROR WriteAttributeNullableInt8s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + int8_t value); + CHIP_ERROR WriteAttributeNullableInt16s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + int16_t value); + CHIP_ERROR WriteAttributeNullableInt32s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + int32_t value); + CHIP_ERROR WriteAttributeNullableInt64s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + int64_t value); + CHIP_ERROR WriteAttributeNullableEnum8(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t value); + CHIP_ERROR WriteAttributeNullableEnum16(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t value); + CHIP_ERROR WriteAttributeNullableOctetString(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::ByteSpan value); + CHIP_ERROR WriteAttributeNullableCharString(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::CharSpan value); private: }; diff --git a/zzz_generated/lighting-app/zap-generated/attribute-size.cpp b/zzz_generated/lighting-app/zap-generated/attribute-size.cpp index ff942e42785082..9a1d2219a9e984 100644 --- a/zzz_generated/lighting-app/zap-generated/attribute-size.cpp +++ b/zzz_generated/lighting-app/zap-generated/attribute-size.cpp @@ -287,6 +287,44 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo } break; } + case 0x0034: // Software Diagnostics Cluster + { + uint16_t entryOffset = kSizeLengthInBytes; + switch (am->attributeId) + { + case 0x0000: // ThreadMetrics + { + entryLength = 30; + if (((index - 1) * entryLength) > (am->size - entryLength)) + { + ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); + return 0; + } + entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); + // Struct _ThreadMetrics + _ThreadMetrics * entry = reinterpret_cast<_ThreadMetrics *>(write ? src : dest); + copyListMember(write ? dest : (uint8_t *) &entry->Id, write ? (uint8_t *) &entry->Id : src, write, &entryOffset, + sizeof(entry->Id)); // INT64U + ByteSpan NameSpanStorage(Uint8::from_const_char(entry->Name.data()), entry->Name.size()); // CHAR_STRING + ByteSpan * NameSpan = &NameSpanStorage; + if (CHIP_NO_ERROR != + (write ? WriteByteSpan(dest + entryOffset, 10, NameSpan) : ReadByteSpan(src + entryOffset, 10, NameSpan))) + { + ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); + return 0; + } + entryOffset = static_cast(entryOffset + 10); + copyListMember(write ? dest : (uint8_t *) &entry->StackFreeCurrent, write ? (uint8_t *) &entry->StackFreeCurrent : src, + write, &entryOffset, sizeof(entry->StackFreeCurrent)); // INT32U + copyListMember(write ? dest : (uint8_t *) &entry->StackFreeMinimum, write ? (uint8_t *) &entry->StackFreeMinimum : src, + write, &entryOffset, sizeof(entry->StackFreeMinimum)); // INT32U + copyListMember(write ? dest : (uint8_t *) &entry->StackSize, write ? (uint8_t *) &entry->StackSize : src, write, + &entryOffset, sizeof(entry->StackSize)); // INT32U + break; + } + } + break; + } case 0x0035: // Thread Network Diagnostics Cluster { uint16_t entryOffset = kSizeLengthInBytes; @@ -513,6 +551,15 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut break; } break; + case 0x0034: // Software Diagnostics Cluster + switch (attributeId) + { + case 0x0000: // ThreadMetrics + // Struct _ThreadMetrics + entryLength = 30; + break; + } + break; case 0x0035: // Thread Network Diagnostics Cluster switch (attributeId) { diff --git a/zzz_generated/lighting-app/zap-generated/endpoint_config.h b/zzz_generated/lighting-app/zap-generated/endpoint_config.h index 83881ec7ff4fc1..35c063e4722f9c 100644 --- a/zzz_generated/lighting-app/zap-generated/endpoint_config.h +++ b/zzz_generated/lighting-app/zap-generated/endpoint_config.h @@ -80,24 +80,24 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 543 - ProductLabel, */ \ + /* 544 - ProductLabel, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 608 - SerialNumber, */ \ + /* 609 - SerialNumber, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Commissioning (server), big-endian */ \ \ - /* 641 - Breadcrumb, */ \ + /* 642 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 649 - BasicCommissioningInfoList, */ \ + /* 650 - BasicCommissioningInfoList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -115,38 +115,38 @@ \ /* Endpoint: 0, Cluster: General Diagnostics (server), big-endian */ \ \ - /* 903 - UpTime, */ \ + /* 904 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 911 - TotalOperationalHours, */ \ + /* 912 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), big-endian */ \ \ - /* 915 - CurrentHeapFree, */ \ + /* 916 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 923 - CurrentHeapUsed, */ \ + /* 924 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 931 - CurrentHeapHighWatermark, */ \ + /* 932 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), big-endian */ \ \ - /* 939 - NetworkName, */ \ + /* 940 - NetworkName, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 956 - ExtendedPanId, */ \ + /* 957 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 964 - MeshLocalPrefix, */ \ + /* 965 - MeshLocalPrefix, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 982 - OverrunCount, */ \ + /* 983 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 990 - NeighborTableList, */ \ + /* 991 - NeighborTableList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -162,7 +162,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1244 - RouteTableList, */ \ + /* 1245 - RouteTableList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -178,184 +178,184 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1498 - PartitionId, */ \ + /* 1499 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1502 - TxTotalCount, */ \ + /* 1503 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1506 - TxUnicastCount, */ \ + /* 1507 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1510 - TxBroadcastCount, */ \ + /* 1511 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1514 - TxAckRequestedCount, */ \ + /* 1515 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1518 - TxAckedCount, */ \ + /* 1519 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1522 - TxNoAckRequestedCount, */ \ + /* 1523 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1526 - TxDataCount, */ \ + /* 1527 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1530 - TxDataPollCount, */ \ + /* 1531 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1534 - TxBeaconCount, */ \ + /* 1535 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1538 - TxBeaconRequestCount, */ \ + /* 1539 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1542 - TxOtherCount, */ \ + /* 1543 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1546 - TxRetryCount, */ \ + /* 1547 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1550 - TxDirectMaxRetryExpiryCount, */ \ + /* 1551 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1554 - TxIndirectMaxRetryExpiryCount, */ \ + /* 1555 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1558 - TxErrCcaCount, */ \ + /* 1559 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1562 - TxErrAbortCount, */ \ + /* 1563 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1566 - TxErrBusyChannelCount, */ \ + /* 1567 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1570 - RxTotalCount, */ \ + /* 1571 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1574 - RxUnicastCount, */ \ + /* 1575 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1578 - RxBroadcastCount, */ \ + /* 1579 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1582 - RxDataCount, */ \ + /* 1583 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1586 - RxDataPollCount, */ \ + /* 1587 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1590 - RxBeaconCount, */ \ + /* 1591 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1594 - RxBeaconRequestCount, */ \ + /* 1595 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1598 - RxOtherCount, */ \ + /* 1599 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1602 - RxAddressFilteredCount, */ \ + /* 1603 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1606 - RxDestAddrFilteredCount, */ \ + /* 1607 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1610 - RxDuplicatedCount, */ \ + /* 1611 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1614 - RxErrNoFrameCount, */ \ + /* 1615 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1618 - RxErrUnknownNeighborCount, */ \ + /* 1619 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1622 - RxErrInvalidSrcAddrCount, */ \ + /* 1623 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1626 - RxErrSecCount, */ \ + /* 1627 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1630 - RxErrFcsCount, */ \ + /* 1631 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1634 - RxErrOtherCount, */ \ + /* 1635 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1638 - ActiveTimestamp, */ \ + /* 1639 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1646 - PendingTimestamp, */ \ + /* 1647 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1654 - delay, */ \ + /* 1655 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1658 - SecurityPolicy, */ \ + /* 1659 - SecurityPolicy, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1664 - ChannelMask, */ \ + /* 1665 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1669 - OperationalDatasetComponents, */ \ + /* 1670 - OperationalDatasetComponents, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1683 - ActiveNetworkFaultsList, */ \ + /* 1684 - ActiveNetworkFaultsList, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), big-endian */ \ \ - /* 1687 - bssid, */ \ + /* 1688 - bssid, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1694 - BeaconLostCount, */ \ + /* 1695 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1698 - BeaconRxCount, */ \ + /* 1699 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1702 - PacketMulticastRxCount, */ \ + /* 1703 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1706 - PacketMulticastTxCount, */ \ + /* 1707 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1710 - PacketUnicastRxCount, */ \ + /* 1711 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1714 - PacketUnicastTxCount, */ \ + /* 1715 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1718 - CurrentMaxRate, */ \ + /* 1719 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1726 - OverrunCount, */ \ + /* 1727 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), big-endian */ \ \ - /* 1734 - PacketRxCount, */ \ + /* 1735 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1742 - PacketTxCount, */ \ + /* 1743 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1750 - TxErrCount, */ \ + /* 1751 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1758 - CollisionCount, */ \ + /* 1759 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1766 - OverrunCount, */ \ + /* 1767 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1774 - TimeSinceReset, */ \ + /* 1775 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: On/Off (server), big-endian */ \ \ - /* 1782 - FeatureMap, */ \ + /* 1783 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ } @@ -416,24 +416,24 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 543 - ProductLabel, */ \ + /* 544 - ProductLabel, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 608 - SerialNumber, */ \ + /* 609 - SerialNumber, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Commissioning (server), little-endian */ \ \ - /* 641 - Breadcrumb, */ \ + /* 642 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 649 - BasicCommissioningInfoList, */ \ + /* 650 - BasicCommissioningInfoList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -451,38 +451,38 @@ \ /* Endpoint: 0, Cluster: General Diagnostics (server), little-endian */ \ \ - /* 903 - UpTime, */ \ + /* 904 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 911 - TotalOperationalHours, */ \ + /* 912 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), little-endian */ \ \ - /* 915 - CurrentHeapFree, */ \ + /* 916 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 923 - CurrentHeapUsed, */ \ + /* 924 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 931 - CurrentHeapHighWatermark, */ \ + /* 932 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), little-endian */ \ \ - /* 939 - NetworkName, */ \ + /* 940 - NetworkName, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 956 - ExtendedPanId, */ \ + /* 957 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 964 - MeshLocalPrefix, */ \ + /* 965 - MeshLocalPrefix, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 982 - OverrunCount, */ \ + /* 983 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 990 - NeighborTableList, */ \ + /* 991 - NeighborTableList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -498,7 +498,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1244 - RouteTableList, */ \ + /* 1245 - RouteTableList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -514,184 +514,184 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1498 - PartitionId, */ \ + /* 1499 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1502 - TxTotalCount, */ \ + /* 1503 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1506 - TxUnicastCount, */ \ + /* 1507 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1510 - TxBroadcastCount, */ \ + /* 1511 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1514 - TxAckRequestedCount, */ \ + /* 1515 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1518 - TxAckedCount, */ \ + /* 1519 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1522 - TxNoAckRequestedCount, */ \ + /* 1523 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1526 - TxDataCount, */ \ + /* 1527 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1530 - TxDataPollCount, */ \ + /* 1531 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1534 - TxBeaconCount, */ \ + /* 1535 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1538 - TxBeaconRequestCount, */ \ + /* 1539 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1542 - TxOtherCount, */ \ + /* 1543 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1546 - TxRetryCount, */ \ + /* 1547 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1550 - TxDirectMaxRetryExpiryCount, */ \ + /* 1551 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1554 - TxIndirectMaxRetryExpiryCount, */ \ + /* 1555 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1558 - TxErrCcaCount, */ \ + /* 1559 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1562 - TxErrAbortCount, */ \ + /* 1563 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1566 - TxErrBusyChannelCount, */ \ + /* 1567 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1570 - RxTotalCount, */ \ + /* 1571 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1574 - RxUnicastCount, */ \ + /* 1575 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1578 - RxBroadcastCount, */ \ + /* 1579 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1582 - RxDataCount, */ \ + /* 1583 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1586 - RxDataPollCount, */ \ + /* 1587 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1590 - RxBeaconCount, */ \ + /* 1591 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1594 - RxBeaconRequestCount, */ \ + /* 1595 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1598 - RxOtherCount, */ \ + /* 1599 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1602 - RxAddressFilteredCount, */ \ + /* 1603 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1606 - RxDestAddrFilteredCount, */ \ + /* 1607 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1610 - RxDuplicatedCount, */ \ + /* 1611 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1614 - RxErrNoFrameCount, */ \ + /* 1615 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1618 - RxErrUnknownNeighborCount, */ \ + /* 1619 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1622 - RxErrInvalidSrcAddrCount, */ \ + /* 1623 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1626 - RxErrSecCount, */ \ + /* 1627 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1630 - RxErrFcsCount, */ \ + /* 1631 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1634 - RxErrOtherCount, */ \ + /* 1635 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1638 - ActiveTimestamp, */ \ + /* 1639 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1646 - PendingTimestamp, */ \ + /* 1647 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1654 - delay, */ \ + /* 1655 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1658 - SecurityPolicy, */ \ + /* 1659 - SecurityPolicy, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1664 - ChannelMask, */ \ + /* 1665 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1669 - OperationalDatasetComponents, */ \ + /* 1670 - OperationalDatasetComponents, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1683 - ActiveNetworkFaultsList, */ \ + /* 1684 - ActiveNetworkFaultsList, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), little-endian */ \ \ - /* 1687 - bssid, */ \ + /* 1688 - bssid, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1694 - BeaconLostCount, */ \ + /* 1695 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1698 - BeaconRxCount, */ \ + /* 1699 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1702 - PacketMulticastRxCount, */ \ + /* 1703 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1706 - PacketMulticastTxCount, */ \ + /* 1707 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1710 - PacketUnicastRxCount, */ \ + /* 1711 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1714 - PacketUnicastTxCount, */ \ + /* 1715 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1718 - CurrentMaxRate, */ \ + /* 1719 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1726 - OverrunCount, */ \ + /* 1727 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), little-endian */ \ \ - /* 1734 - PacketRxCount, */ \ + /* 1735 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1742 - PacketTxCount, */ \ + /* 1743 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1750 - TxErrCount, */ \ + /* 1751 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1758 - CollisionCount, */ \ + /* 1759 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1766 - OverrunCount, */ \ + /* 1767 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1774 - TimeSinceReset, */ \ + /* 1775 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: On/Off (server), little-endian */ \ \ - /* 1782 - FeatureMap, */ \ + /* 1783 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ } @@ -725,7 +725,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 193 +#define GENERATED_ATTRIBUTE_COUNT 194 #define GENERATED_ATTRIBUTES \ { \ \ @@ -754,18 +754,19 @@ ZAP_LONG_DEFAULTS_INDEX(171) }, /* SoftwareVersionString */ \ { 0x000B, ZAP_TYPE(CHAR_STRING), 17, ZAP_ATTRIBUTE_MASK(SINGLETON), \ ZAP_LONG_DEFAULTS_INDEX(236) }, /* ManufacturingDate */ \ - { 0x000C, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(253) }, /* PartNumber */ \ - { 0x000D, ZAP_TYPE(CHAR_STRING), 257, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(286) }, /* ProductURL */ \ - { 0x000E, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(543) }, /* ProductLabel */ \ - { 0x000F, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(608) }, /* SerialNumber */ \ + { 0x000C, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(253) }, /* PartNumber */ \ + { 0x000D, ZAP_TYPE(LONG_CHAR_STRING), 258, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_LONG_DEFAULTS_INDEX(286) }, /* ProductURL */ \ + { 0x000E, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(544) }, /* ProductLabel */ \ + { 0x000F, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(609) }, /* SerialNumber */ \ { 0x0010, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* LocalConfigDisabled */ \ { 0x0011, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(1) }, /* Reachable */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x0000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(641) }, /* Breadcrumb */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(649) }, /* BasicCommissioningInfoList */ \ + { 0x0000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(642) }, /* Breadcrumb */ \ + { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(650) }, /* BasicCommissioningInfoList */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ @@ -774,28 +775,29 @@ /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NetworkInterfaces */ \ { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* RebootCount */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(903) }, /* UpTime */ \ - { 0x0003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(911) }, /* TotalOperationalHours */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(904) }, /* UpTime */ \ + { 0x0003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(912) }, /* TotalOperationalHours */ \ { 0x0004, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BootReasons */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(915) }, /* CurrentHeapFree */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(923) }, /* CurrentHeapUsed */ \ - { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(931) }, /* CurrentHeapHighWatermark */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ThreadMetrics */ \ + { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(916) }, /* CurrentHeapFree */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(924) }, /* CurrentHeapUsed */ \ + { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(932) }, /* CurrentHeapHighWatermark */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ - { 0x0002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(939) }, /* NetworkName */ \ + { 0x0002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(940) }, /* NetworkName */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ - { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(956) }, /* ExtendedPanId */ \ - { 0x0005, ZAP_TYPE(OCTET_STRING), 18, 0, ZAP_LONG_DEFAULTS_INDEX(964) }, /* MeshLocalPrefix */ \ - { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(982) }, /* OverrunCount */ \ - { 0x0007, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(990) }, /* NeighborTableList */ \ - { 0x0008, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1244) }, /* RouteTableList */ \ - { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1498) }, /* PartitionId */ \ + { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(957) }, /* ExtendedPanId */ \ + { 0x0005, ZAP_TYPE(OCTET_STRING), 18, 0, ZAP_LONG_DEFAULTS_INDEX(965) }, /* MeshLocalPrefix */ \ + { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(983) }, /* OverrunCount */ \ + { 0x0007, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(991) }, /* NeighborTableList */ \ + { 0x0008, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1245) }, /* RouteTableList */ \ + { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1499) }, /* PartitionId */ \ { 0x000A, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* weighting */ \ { 0x000B, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* DataVersion */ \ { 0x000C, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* StableDataVersion */ \ @@ -808,75 +810,75 @@ { 0x0013, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PartitionIdChangeCount */ \ { 0x0014, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* BetterPartitionAttachAttemptCount */ \ { 0x0015, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ParentChangeCount */ \ - { 0x0016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1502) }, /* TxTotalCount */ \ - { 0x0017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1506) }, /* TxUnicastCount */ \ - { 0x0018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1510) }, /* TxBroadcastCount */ \ - { 0x0019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1514) }, /* TxAckRequestedCount */ \ - { 0x001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1518) }, /* TxAckedCount */ \ - { 0x001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1522) }, /* TxNoAckRequestedCount */ \ - { 0x001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1526) }, /* TxDataCount */ \ - { 0x001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1530) }, /* TxDataPollCount */ \ - { 0x001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1534) }, /* TxBeaconCount */ \ - { 0x001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1538) }, /* TxBeaconRequestCount */ \ - { 0x0020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1542) }, /* TxOtherCount */ \ - { 0x0021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1546) }, /* TxRetryCount */ \ - { 0x0022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1550) }, /* TxDirectMaxRetryExpiryCount */ \ - { 0x0023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1554) }, /* TxIndirectMaxRetryExpiryCount */ \ - { 0x0024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1558) }, /* TxErrCcaCount */ \ - { 0x0025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1562) }, /* TxErrAbortCount */ \ - { 0x0026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1566) }, /* TxErrBusyChannelCount */ \ - { 0x0027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1570) }, /* RxTotalCount */ \ - { 0x0028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1574) }, /* RxUnicastCount */ \ - { 0x0029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1578) }, /* RxBroadcastCount */ \ - { 0x002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1582) }, /* RxDataCount */ \ - { 0x002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1586) }, /* RxDataPollCount */ \ - { 0x002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1590) }, /* RxBeaconCount */ \ - { 0x002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1594) }, /* RxBeaconRequestCount */ \ - { 0x002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1598) }, /* RxOtherCount */ \ - { 0x002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1602) }, /* RxAddressFilteredCount */ \ - { 0x0030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1606) }, /* RxDestAddrFilteredCount */ \ - { 0x0031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1610) }, /* RxDuplicatedCount */ \ - { 0x0032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1614) }, /* RxErrNoFrameCount */ \ - { 0x0033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1618) }, /* RxErrUnknownNeighborCount */ \ - { 0x0034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1622) }, /* RxErrInvalidSrcAddrCount */ \ - { 0x0035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1626) }, /* RxErrSecCount */ \ - { 0x0036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1630) }, /* RxErrFcsCount */ \ - { 0x0037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1634) }, /* RxErrOtherCount */ \ - { 0x0038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1638) }, /* ActiveTimestamp */ \ - { 0x0039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1646) }, /* PendingTimestamp */ \ - { 0x003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1654) }, /* delay */ \ - { 0x003B, ZAP_TYPE(ARRAY), 6, 0, ZAP_LONG_DEFAULTS_INDEX(1658) }, /* SecurityPolicy */ \ - { 0x003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(1664) }, /* ChannelMask */ \ - { 0x003D, ZAP_TYPE(ARRAY), 14, 0, ZAP_LONG_DEFAULTS_INDEX(1669) }, /* OperationalDatasetComponents */ \ - { 0x003E, ZAP_TYPE(ARRAY), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1683) }, /* ActiveNetworkFaultsList */ \ + { 0x0016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1503) }, /* TxTotalCount */ \ + { 0x0017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1507) }, /* TxUnicastCount */ \ + { 0x0018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1511) }, /* TxBroadcastCount */ \ + { 0x0019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1515) }, /* TxAckRequestedCount */ \ + { 0x001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1519) }, /* TxAckedCount */ \ + { 0x001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1523) }, /* TxNoAckRequestedCount */ \ + { 0x001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1527) }, /* TxDataCount */ \ + { 0x001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1531) }, /* TxDataPollCount */ \ + { 0x001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1535) }, /* TxBeaconCount */ \ + { 0x001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1539) }, /* TxBeaconRequestCount */ \ + { 0x0020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1543) }, /* TxOtherCount */ \ + { 0x0021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1547) }, /* TxRetryCount */ \ + { 0x0022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1551) }, /* TxDirectMaxRetryExpiryCount */ \ + { 0x0023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1555) }, /* TxIndirectMaxRetryExpiryCount */ \ + { 0x0024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1559) }, /* TxErrCcaCount */ \ + { 0x0025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1563) }, /* TxErrAbortCount */ \ + { 0x0026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1567) }, /* TxErrBusyChannelCount */ \ + { 0x0027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1571) }, /* RxTotalCount */ \ + { 0x0028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1575) }, /* RxUnicastCount */ \ + { 0x0029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1579) }, /* RxBroadcastCount */ \ + { 0x002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1583) }, /* RxDataCount */ \ + { 0x002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1587) }, /* RxDataPollCount */ \ + { 0x002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1591) }, /* RxBeaconCount */ \ + { 0x002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1595) }, /* RxBeaconRequestCount */ \ + { 0x002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1599) }, /* RxOtherCount */ \ + { 0x002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1603) }, /* RxAddressFilteredCount */ \ + { 0x0030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1607) }, /* RxDestAddrFilteredCount */ \ + { 0x0031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1611) }, /* RxDuplicatedCount */ \ + { 0x0032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1615) }, /* RxErrNoFrameCount */ \ + { 0x0033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1619) }, /* RxErrUnknownNeighborCount */ \ + { 0x0034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1623) }, /* RxErrInvalidSrcAddrCount */ \ + { 0x0035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1627) }, /* RxErrSecCount */ \ + { 0x0036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1631) }, /* RxErrFcsCount */ \ + { 0x0037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1635) }, /* RxErrOtherCount */ \ + { 0x0038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1639) }, /* ActiveTimestamp */ \ + { 0x0039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1647) }, /* PendingTimestamp */ \ + { 0x003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1655) }, /* delay */ \ + { 0x003B, ZAP_TYPE(ARRAY), 6, 0, ZAP_LONG_DEFAULTS_INDEX(1659) }, /* SecurityPolicy */ \ + { 0x003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(1665) }, /* ChannelMask */ \ + { 0x003D, ZAP_TYPE(ARRAY), 14, 0, ZAP_LONG_DEFAULTS_INDEX(1670) }, /* OperationalDatasetComponents */ \ + { 0x003E, ZAP_TYPE(ARRAY), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1684) }, /* ActiveNetworkFaultsList */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ - { 0x0000, ZAP_TYPE(OCTET_STRING), 7, 0, ZAP_LONG_DEFAULTS_INDEX(1687) }, /* bssid */ \ + { 0x0000, ZAP_TYPE(OCTET_STRING), 7, 0, ZAP_LONG_DEFAULTS_INDEX(1688) }, /* bssid */ \ { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SecurityType */ \ { 0x0002, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* WiFiVersion */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ChannelNumber */ \ { 0x0004, ZAP_TYPE(INT8S), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Rssi */ \ - { 0x0005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1694) }, /* BeaconLostCount */ \ - { 0x0006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1698) }, /* BeaconRxCount */ \ - { 0x0007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1702) }, /* PacketMulticastRxCount */ \ - { 0x0008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1706) }, /* PacketMulticastTxCount */ \ - { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1710) }, /* PacketUnicastRxCount */ \ - { 0x000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1714) }, /* PacketUnicastTxCount */ \ - { 0x000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1718) }, /* CurrentMaxRate */ \ - { 0x000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1726) }, /* OverrunCount */ \ + { 0x0005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1695) }, /* BeaconLostCount */ \ + { 0x0006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1699) }, /* BeaconRxCount */ \ + { 0x0007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1703) }, /* PacketMulticastRxCount */ \ + { 0x0008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1707) }, /* PacketMulticastTxCount */ \ + { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1711) }, /* PacketUnicastRxCount */ \ + { 0x000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1715) }, /* PacketUnicastTxCount */ \ + { 0x000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1719) }, /* CurrentMaxRate */ \ + { 0x000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1727) }, /* OverrunCount */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* PHYRate */ \ { 0x0001, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* FullDuplex */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1734) }, /* PacketRxCount */ \ - { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1742) }, /* PacketTxCount */ \ - { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1750) }, /* TxErrCount */ \ - { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1758) }, /* CollisionCount */ \ - { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1766) }, /* OverrunCount */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1735) }, /* PacketRxCount */ \ + { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1743) }, /* PacketTxCount */ \ + { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1751) }, /* TxErrCount */ \ + { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1759) }, /* CollisionCount */ \ + { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1767) }, /* OverrunCount */ \ { 0x0007, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* CarrierDetect */ \ - { 0x0008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1774) }, /* TimeSinceReset */ \ + { 0x0008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1775) }, /* TimeSinceReset */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ @@ -903,7 +905,7 @@ { 0x4001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OnTime */ \ { 0x4002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OffWaitTime */ \ { 0x4003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* StartUpOnOff */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1782) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1783) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Level Control (server) */ \ @@ -1004,7 +1006,7 @@ { 0x0028, \ ZAP_ATTRIBUTE_INDEX(5), \ 19, \ - 653, \ + 654, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayBasicServer }, /* Endpoint: 0, Cluster: Basic (server) */ \ { \ @@ -1020,61 +1022,61 @@ 0x0033, ZAP_ATTRIBUTE_INDEX(28), 6, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { \ - 0x0034, ZAP_ATTRIBUTE_INDEX(34), 4, 26, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0034, ZAP_ATTRIBUTE_INDEX(34), 5, 26, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(38), 64, 774, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0035, ZAP_ATTRIBUTE_INDEX(39), 64, 774, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { \ - 0x0036, ZAP_ATTRIBUTE_INDEX(102), 14, 54, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0036, ZAP_ATTRIBUTE_INDEX(103), 14, 54, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ { \ - 0x0037, ZAP_ATTRIBUTE_INDEX(116), 10, 53, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0037, ZAP_ATTRIBUTE_INDEX(117), 10, 53, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { \ - 0x003C, ZAP_ATTRIBUTE_INDEX(126), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003C, ZAP_ATTRIBUTE_INDEX(127), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { \ - 0x003E, ZAP_ATTRIBUTE_INDEX(127), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003E, ZAP_ATTRIBUTE_INDEX(128), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x0003, \ - ZAP_ATTRIBUTE_INDEX(133), \ + ZAP_ATTRIBUTE_INDEX(134), \ 3, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayIdentifyServer }, /* Endpoint: 1, Cluster: Identify (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(136), \ + ZAP_ATTRIBUTE_INDEX(137), \ 7, \ 13, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ { 0x0008, \ - ZAP_ATTRIBUTE_INDEX(143), \ + ZAP_ATTRIBUTE_INDEX(144), \ 15, \ 23, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(158), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(159), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ { 0x0300, \ - ZAP_ATTRIBUTE_INDEX(163), \ + ZAP_ATTRIBUTE_INDEX(164), \ 22, \ 36, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayColorControlServer }, /* Endpoint: 1, Cluster: Color Control (server) */ \ { 0x0406, \ - ZAP_ATTRIBUTE_INDEX(185), \ + ZAP_ATTRIBUTE_INDEX(186), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOccupancySensingServer }, /* Endpoint: 1, Cluster: Occupancy Sensing (server) */ \ { \ - 0x0006, ZAP_ATTRIBUTE_INDEX(189), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0006, ZAP_ATTRIBUTE_INDEX(190), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 2, Cluster: On/Off (client) */ \ { \ - 0x0007, ZAP_ATTRIBUTE_INDEX(190), 3, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0007, ZAP_ATTRIBUTE_INDEX(191), 3, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 2, Cluster: On/off Switch Configuration (server) */ \ } @@ -1083,17 +1085,17 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 12, 1849 }, { ZAP_CLUSTER_INDEX(12), 6, 82 }, { ZAP_CLUSTER_INDEX(18), 2, 6 }, \ + { ZAP_CLUSTER_INDEX(0), 12, 1850 }, { ZAP_CLUSTER_INDEX(12), 6, 82 }, { ZAP_CLUSTER_INDEX(18), 2, 6 }, \ } // Largest attribute size is needed for various buffers #define ATTRIBUTE_LARGEST (401) // Total size of singleton attributes -#define ATTRIBUTE_SINGLETONS_SIZE (653) +#define ATTRIBUTE_SINGLETONS_SIZE (654) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (1937) +#define ATTRIBUTE_MAX_SIZE (1938) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (3) diff --git a/zzz_generated/lock-app/zap-generated/attribute-size.cpp b/zzz_generated/lock-app/zap-generated/attribute-size.cpp index ff942e42785082..9a1d2219a9e984 100644 --- a/zzz_generated/lock-app/zap-generated/attribute-size.cpp +++ b/zzz_generated/lock-app/zap-generated/attribute-size.cpp @@ -287,6 +287,44 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo } break; } + case 0x0034: // Software Diagnostics Cluster + { + uint16_t entryOffset = kSizeLengthInBytes; + switch (am->attributeId) + { + case 0x0000: // ThreadMetrics + { + entryLength = 30; + if (((index - 1) * entryLength) > (am->size - entryLength)) + { + ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); + return 0; + } + entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); + // Struct _ThreadMetrics + _ThreadMetrics * entry = reinterpret_cast<_ThreadMetrics *>(write ? src : dest); + copyListMember(write ? dest : (uint8_t *) &entry->Id, write ? (uint8_t *) &entry->Id : src, write, &entryOffset, + sizeof(entry->Id)); // INT64U + ByteSpan NameSpanStorage(Uint8::from_const_char(entry->Name.data()), entry->Name.size()); // CHAR_STRING + ByteSpan * NameSpan = &NameSpanStorage; + if (CHIP_NO_ERROR != + (write ? WriteByteSpan(dest + entryOffset, 10, NameSpan) : ReadByteSpan(src + entryOffset, 10, NameSpan))) + { + ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); + return 0; + } + entryOffset = static_cast(entryOffset + 10); + copyListMember(write ? dest : (uint8_t *) &entry->StackFreeCurrent, write ? (uint8_t *) &entry->StackFreeCurrent : src, + write, &entryOffset, sizeof(entry->StackFreeCurrent)); // INT32U + copyListMember(write ? dest : (uint8_t *) &entry->StackFreeMinimum, write ? (uint8_t *) &entry->StackFreeMinimum : src, + write, &entryOffset, sizeof(entry->StackFreeMinimum)); // INT32U + copyListMember(write ? dest : (uint8_t *) &entry->StackSize, write ? (uint8_t *) &entry->StackSize : src, write, + &entryOffset, sizeof(entry->StackSize)); // INT32U + break; + } + } + break; + } case 0x0035: // Thread Network Diagnostics Cluster { uint16_t entryOffset = kSizeLengthInBytes; @@ -513,6 +551,15 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut break; } break; + case 0x0034: // Software Diagnostics Cluster + switch (attributeId) + { + case 0x0000: // ThreadMetrics + // Struct _ThreadMetrics + entryLength = 30; + break; + } + break; case 0x0035: // Thread Network Diagnostics Cluster switch (attributeId) { diff --git a/zzz_generated/lock-app/zap-generated/endpoint_config.h b/zzz_generated/lock-app/zap-generated/endpoint_config.h index 27583c23ff27be..89cda7c15df473 100644 --- a/zzz_generated/lock-app/zap-generated/endpoint_config.h +++ b/zzz_generated/lock-app/zap-generated/endpoint_config.h @@ -659,7 +659,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 138 +#define GENERATED_ATTRIBUTE_COUNT 139 #define GENERATED_ATTRIBUTES \ { \ \ @@ -705,8 +705,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(510) }, /* CurrentHeapFree */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(518) }, /* CurrentHeapUsed */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ThreadMetrics */ \ + { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(510) }, /* CurrentHeapFree */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(518) }, /* CurrentHeapUsed */ \ { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(526) }, /* CurrentHeapHighWatermark */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ @@ -870,31 +871,31 @@ 0x0033, ZAP_ATTRIBUTE_INDEX(21), 6, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { \ - 0x0034, ZAP_ATTRIBUTE_INDEX(27), 4, 26, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0034, ZAP_ATTRIBUTE_INDEX(27), 5, 26, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(31), 64, 774, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0035, ZAP_ATTRIBUTE_INDEX(32), 64, 774, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { \ - 0x0036, ZAP_ATTRIBUTE_INDEX(95), 14, 54, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0036, ZAP_ATTRIBUTE_INDEX(96), 14, 54, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ { \ - 0x0037, ZAP_ATTRIBUTE_INDEX(109), 10, 53, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0037, ZAP_ATTRIBUTE_INDEX(110), 10, 53, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { \ - 0x003C, ZAP_ATTRIBUTE_INDEX(119), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003C, ZAP_ATTRIBUTE_INDEX(120), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { \ - 0x003E, ZAP_ATTRIBUTE_INDEX(120), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003E, ZAP_ATTRIBUTE_INDEX(121), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(126), \ + ZAP_ATTRIBUTE_INDEX(127), \ 7, \ 13, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(133), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(134), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ } diff --git a/zzz_generated/pump-app/zap-generated/attribute-size.cpp b/zzz_generated/pump-app/zap-generated/attribute-size.cpp index ff942e42785082..9a1d2219a9e984 100644 --- a/zzz_generated/pump-app/zap-generated/attribute-size.cpp +++ b/zzz_generated/pump-app/zap-generated/attribute-size.cpp @@ -287,6 +287,44 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo } break; } + case 0x0034: // Software Diagnostics Cluster + { + uint16_t entryOffset = kSizeLengthInBytes; + switch (am->attributeId) + { + case 0x0000: // ThreadMetrics + { + entryLength = 30; + if (((index - 1) * entryLength) > (am->size - entryLength)) + { + ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); + return 0; + } + entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); + // Struct _ThreadMetrics + _ThreadMetrics * entry = reinterpret_cast<_ThreadMetrics *>(write ? src : dest); + copyListMember(write ? dest : (uint8_t *) &entry->Id, write ? (uint8_t *) &entry->Id : src, write, &entryOffset, + sizeof(entry->Id)); // INT64U + ByteSpan NameSpanStorage(Uint8::from_const_char(entry->Name.data()), entry->Name.size()); // CHAR_STRING + ByteSpan * NameSpan = &NameSpanStorage; + if (CHIP_NO_ERROR != + (write ? WriteByteSpan(dest + entryOffset, 10, NameSpan) : ReadByteSpan(src + entryOffset, 10, NameSpan))) + { + ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); + return 0; + } + entryOffset = static_cast(entryOffset + 10); + copyListMember(write ? dest : (uint8_t *) &entry->StackFreeCurrent, write ? (uint8_t *) &entry->StackFreeCurrent : src, + write, &entryOffset, sizeof(entry->StackFreeCurrent)); // INT32U + copyListMember(write ? dest : (uint8_t *) &entry->StackFreeMinimum, write ? (uint8_t *) &entry->StackFreeMinimum : src, + write, &entryOffset, sizeof(entry->StackFreeMinimum)); // INT32U + copyListMember(write ? dest : (uint8_t *) &entry->StackSize, write ? (uint8_t *) &entry->StackSize : src, write, + &entryOffset, sizeof(entry->StackSize)); // INT32U + break; + } + } + break; + } case 0x0035: // Thread Network Diagnostics Cluster { uint16_t entryOffset = kSizeLengthInBytes; @@ -513,6 +551,15 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut break; } break; + case 0x0034: // Software Diagnostics Cluster + switch (attributeId) + { + case 0x0000: // ThreadMetrics + // Struct _ThreadMetrics + entryLength = 30; + break; + } + break; case 0x0035: // Thread Network Diagnostics Cluster switch (attributeId) { diff --git a/zzz_generated/pump-app/zap-generated/endpoint_config.h b/zzz_generated/pump-app/zap-generated/endpoint_config.h index 7067f4a483c55c..ae85817c2572f7 100644 --- a/zzz_generated/pump-app/zap-generated/endpoint_config.h +++ b/zzz_generated/pump-app/zap-generated/endpoint_config.h @@ -677,7 +677,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 176 +#define GENERATED_ATTRIBUTE_COUNT 177 #define GENERATED_ATTRIBUTES \ { \ \ @@ -723,8 +723,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(510) }, /* CurrentHeapFree */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(518) }, /* CurrentHeapUsed */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ThreadMetrics */ \ + { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(510) }, /* CurrentHeapFree */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(518) }, /* CurrentHeapUsed */ \ { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(526) }, /* CurrentHeapHighWatermark */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ @@ -950,63 +951,63 @@ 0x0033, ZAP_ATTRIBUTE_INDEX(21), 6, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { \ - 0x0034, ZAP_ATTRIBUTE_INDEX(27), 4, 26, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0034, ZAP_ATTRIBUTE_INDEX(27), 5, 26, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(31), 64, 774, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0035, ZAP_ATTRIBUTE_INDEX(32), 64, 774, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { \ - 0x0036, ZAP_ATTRIBUTE_INDEX(95), 14, 54, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0036, ZAP_ATTRIBUTE_INDEX(96), 14, 54, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ { \ - 0x0037, ZAP_ATTRIBUTE_INDEX(109), 10, 53, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0037, ZAP_ATTRIBUTE_INDEX(110), 10, 53, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { \ - 0x003C, ZAP_ATTRIBUTE_INDEX(119), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003C, ZAP_ATTRIBUTE_INDEX(120), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { \ - 0x003E, ZAP_ATTRIBUTE_INDEX(120), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003E, ZAP_ATTRIBUTE_INDEX(121), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(126), \ + ZAP_ATTRIBUTE_INDEX(127), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ { 0x0008, \ - ZAP_ATTRIBUTE_INDEX(128), \ + ZAP_ATTRIBUTE_INDEX(129), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(130), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(131), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ { \ 0x0200, \ - ZAP_ATTRIBUTE_INDEX(135), \ + ZAP_ATTRIBUTE_INDEX(136), \ 26, \ 54, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayPumpConfigurationAndControlServer \ }, /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ { \ - 0x0402, ZAP_ATTRIBUTE_INDEX(161), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0402, ZAP_ATTRIBUTE_INDEX(162), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Temperature Measurement (client) */ \ { \ - 0x0402, ZAP_ATTRIBUTE_INDEX(162), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0402, ZAP_ATTRIBUTE_INDEX(163), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ { \ - 0x0403, ZAP_ATTRIBUTE_INDEX(166), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0403, ZAP_ATTRIBUTE_INDEX(167), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Pressure Measurement (client) */ \ { \ - 0x0403, ZAP_ATTRIBUTE_INDEX(167), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0403, ZAP_ATTRIBUTE_INDEX(168), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ { \ - 0x0404, ZAP_ATTRIBUTE_INDEX(171), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0404, ZAP_ATTRIBUTE_INDEX(172), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Flow Measurement (client) */ \ { \ - 0x0404, ZAP_ATTRIBUTE_INDEX(172), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0404, ZAP_ATTRIBUTE_INDEX(173), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ } diff --git a/zzz_generated/pump-controller-app/zap-generated/attribute-size.cpp b/zzz_generated/pump-controller-app/zap-generated/attribute-size.cpp index ff942e42785082..9a1d2219a9e984 100644 --- a/zzz_generated/pump-controller-app/zap-generated/attribute-size.cpp +++ b/zzz_generated/pump-controller-app/zap-generated/attribute-size.cpp @@ -287,6 +287,44 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo } break; } + case 0x0034: // Software Diagnostics Cluster + { + uint16_t entryOffset = kSizeLengthInBytes; + switch (am->attributeId) + { + case 0x0000: // ThreadMetrics + { + entryLength = 30; + if (((index - 1) * entryLength) > (am->size - entryLength)) + { + ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); + return 0; + } + entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); + // Struct _ThreadMetrics + _ThreadMetrics * entry = reinterpret_cast<_ThreadMetrics *>(write ? src : dest); + copyListMember(write ? dest : (uint8_t *) &entry->Id, write ? (uint8_t *) &entry->Id : src, write, &entryOffset, + sizeof(entry->Id)); // INT64U + ByteSpan NameSpanStorage(Uint8::from_const_char(entry->Name.data()), entry->Name.size()); // CHAR_STRING + ByteSpan * NameSpan = &NameSpanStorage; + if (CHIP_NO_ERROR != + (write ? WriteByteSpan(dest + entryOffset, 10, NameSpan) : ReadByteSpan(src + entryOffset, 10, NameSpan))) + { + ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); + return 0; + } + entryOffset = static_cast(entryOffset + 10); + copyListMember(write ? dest : (uint8_t *) &entry->StackFreeCurrent, write ? (uint8_t *) &entry->StackFreeCurrent : src, + write, &entryOffset, sizeof(entry->StackFreeCurrent)); // INT32U + copyListMember(write ? dest : (uint8_t *) &entry->StackFreeMinimum, write ? (uint8_t *) &entry->StackFreeMinimum : src, + write, &entryOffset, sizeof(entry->StackFreeMinimum)); // INT32U + copyListMember(write ? dest : (uint8_t *) &entry->StackSize, write ? (uint8_t *) &entry->StackSize : src, write, + &entryOffset, sizeof(entry->StackSize)); // INT32U + break; + } + } + break; + } case 0x0035: // Thread Network Diagnostics Cluster { uint16_t entryOffset = kSizeLengthInBytes; @@ -513,6 +551,15 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut break; } break; + case 0x0034: // Software Diagnostics Cluster + switch (attributeId) + { + case 0x0000: // ThreadMetrics + // Struct _ThreadMetrics + entryLength = 30; + break; + } + break; case 0x0035: // Thread Network Diagnostics Cluster switch (attributeId) { diff --git a/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h b/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h index 52ed02fd15e032..73e00f49a505c4 100644 --- a/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h +++ b/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h @@ -649,7 +649,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 137 +#define GENERATED_ATTRIBUTE_COUNT 138 #define GENERATED_ATTRIBUTES \ { \ \ @@ -698,8 +698,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(510) }, /* CurrentHeapFree */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(518) }, /* CurrentHeapUsed */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ThreadMetrics */ \ + { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(510) }, /* CurrentHeapFree */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(518) }, /* CurrentHeapUsed */ \ { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(526) }, /* CurrentHeapHighWatermark */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ @@ -871,40 +872,40 @@ 0x0033, ZAP_ATTRIBUTE_INDEX(22), 6, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { \ - 0x0034, ZAP_ATTRIBUTE_INDEX(28), 4, 26, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0034, ZAP_ATTRIBUTE_INDEX(28), 5, 26, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(32), 64, 774, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0035, ZAP_ATTRIBUTE_INDEX(33), 64, 774, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { \ - 0x0036, ZAP_ATTRIBUTE_INDEX(96), 14, 54, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0036, ZAP_ATTRIBUTE_INDEX(97), 14, 54, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ { \ - 0x0037, ZAP_ATTRIBUTE_INDEX(110), 10, 53, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0037, ZAP_ATTRIBUTE_INDEX(111), 10, 53, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { \ - 0x003C, ZAP_ATTRIBUTE_INDEX(120), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003C, ZAP_ATTRIBUTE_INDEX(121), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { \ - 0x003E, ZAP_ATTRIBUTE_INDEX(121), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003E, ZAP_ATTRIBUTE_INDEX(122), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x0006, ZAP_ATTRIBUTE_INDEX(127), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0006, ZAP_ATTRIBUTE_INDEX(128), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: On/Off (client) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(128), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(129), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ { \ - 0x0200, ZAP_ATTRIBUTE_INDEX(133), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0200, ZAP_ATTRIBUTE_INDEX(134), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Pump Configuration and Control (client) */ \ { \ - 0x0402, ZAP_ATTRIBUTE_INDEX(134), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0402, ZAP_ATTRIBUTE_INDEX(135), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Temperature Measurement (client) */ \ { \ - 0x0403, ZAP_ATTRIBUTE_INDEX(135), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0403, ZAP_ATTRIBUTE_INDEX(136), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Pressure Measurement (client) */ \ { \ - 0x0404, ZAP_ATTRIBUTE_INDEX(136), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0404, ZAP_ATTRIBUTE_INDEX(137), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Flow Measurement (client) */ \ } diff --git a/zzz_generated/thermostat/zap-generated/attribute-size.cpp b/zzz_generated/thermostat/zap-generated/attribute-size.cpp index f2c0ce77efe114..ec8a24e710c1ec 100644 --- a/zzz_generated/thermostat/zap-generated/attribute-size.cpp +++ b/zzz_generated/thermostat/zap-generated/attribute-size.cpp @@ -346,6 +346,44 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo } break; } + case 0x0034: // Software Diagnostics Cluster + { + uint16_t entryOffset = kSizeLengthInBytes; + switch (am->attributeId) + { + case 0x0000: // ThreadMetrics + { + entryLength = 30; + if (((index - 1) * entryLength) > (am->size - entryLength)) + { + ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); + return 0; + } + entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); + // Struct _ThreadMetrics + _ThreadMetrics * entry = reinterpret_cast<_ThreadMetrics *>(write ? src : dest); + copyListMember(write ? dest : (uint8_t *) &entry->Id, write ? (uint8_t *) &entry->Id : src, write, &entryOffset, + sizeof(entry->Id)); // INT64U + ByteSpan NameSpanStorage(Uint8::from_const_char(entry->Name.data()), entry->Name.size()); // CHAR_STRING + ByteSpan * NameSpan = &NameSpanStorage; + if (CHIP_NO_ERROR != + (write ? WriteByteSpan(dest + entryOffset, 10, NameSpan) : ReadByteSpan(src + entryOffset, 10, NameSpan))) + { + ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); + return 0; + } + entryOffset = static_cast(entryOffset + 10); + copyListMember(write ? dest : (uint8_t *) &entry->StackFreeCurrent, write ? (uint8_t *) &entry->StackFreeCurrent : src, + write, &entryOffset, sizeof(entry->StackFreeCurrent)); // INT32U + copyListMember(write ? dest : (uint8_t *) &entry->StackFreeMinimum, write ? (uint8_t *) &entry->StackFreeMinimum : src, + write, &entryOffset, sizeof(entry->StackFreeMinimum)); // INT32U + copyListMember(write ? dest : (uint8_t *) &entry->StackSize, write ? (uint8_t *) &entry->StackSize : src, write, + &entryOffset, sizeof(entry->StackSize)); // INT32U + break; + } + } + break; + } case 0x0035: // Thread Network Diagnostics Cluster { uint16_t entryOffset = kSizeLengthInBytes; @@ -585,6 +623,15 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut break; } break; + case 0x0034: // Software Diagnostics Cluster + switch (attributeId) + { + case 0x0000: // ThreadMetrics + // Struct _ThreadMetrics + entryLength = 30; + break; + } + break; case 0x0035: // Thread Network Diagnostics Cluster switch (attributeId) { diff --git a/zzz_generated/thermostat/zap-generated/endpoint_config.h b/zzz_generated/thermostat/zap-generated/endpoint_config.h index e4c34443529e71..5a16acdce12140 100644 --- a/zzz_generated/thermostat/zap-generated/endpoint_config.h +++ b/zzz_generated/thermostat/zap-generated/endpoint_config.h @@ -80,24 +80,24 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 543 - ProductLabel, */ \ + /* 544 - ProductLabel, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 608 - SerialNumber, */ \ + /* 609 - SerialNumber, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Commissioning (server), big-endian */ \ \ - /* 641 - Breadcrumb, */ \ + /* 642 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 649 - BasicCommissioningInfoList, */ \ + /* 650 - BasicCommissioningInfoList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -115,38 +115,38 @@ \ /* Endpoint: 0, Cluster: General Diagnostics (server), big-endian */ \ \ - /* 903 - UpTime, */ \ + /* 904 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 911 - TotalOperationalHours, */ \ + /* 912 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), big-endian */ \ \ - /* 915 - CurrentHeapFree, */ \ + /* 916 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 923 - CurrentHeapUsed, */ \ + /* 924 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 931 - CurrentHeapHighWatermark, */ \ + /* 932 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), big-endian */ \ \ - /* 939 - NetworkName, */ \ + /* 940 - NetworkName, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 956 - ExtendedPanId, */ \ + /* 957 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 964 - MeshLocalPrefix, */ \ + /* 965 - MeshLocalPrefix, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 982 - OverrunCount, */ \ + /* 983 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 990 - NeighborTableList, */ \ + /* 991 - NeighborTableList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -162,7 +162,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1244 - RouteTableList, */ \ + /* 1245 - RouteTableList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -178,184 +178,184 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1498 - PartitionId, */ \ + /* 1499 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1502 - TxTotalCount, */ \ + /* 1503 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1506 - TxUnicastCount, */ \ + /* 1507 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1510 - TxBroadcastCount, */ \ + /* 1511 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1514 - TxAckRequestedCount, */ \ + /* 1515 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1518 - TxAckedCount, */ \ + /* 1519 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1522 - TxNoAckRequestedCount, */ \ + /* 1523 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1526 - TxDataCount, */ \ + /* 1527 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1530 - TxDataPollCount, */ \ + /* 1531 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1534 - TxBeaconCount, */ \ + /* 1535 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1538 - TxBeaconRequestCount, */ \ + /* 1539 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1542 - TxOtherCount, */ \ + /* 1543 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1546 - TxRetryCount, */ \ + /* 1547 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1550 - TxDirectMaxRetryExpiryCount, */ \ + /* 1551 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1554 - TxIndirectMaxRetryExpiryCount, */ \ + /* 1555 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1558 - TxErrCcaCount, */ \ + /* 1559 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1562 - TxErrAbortCount, */ \ + /* 1563 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1566 - TxErrBusyChannelCount, */ \ + /* 1567 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1570 - RxTotalCount, */ \ + /* 1571 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1574 - RxUnicastCount, */ \ + /* 1575 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1578 - RxBroadcastCount, */ \ + /* 1579 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1582 - RxDataCount, */ \ + /* 1583 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1586 - RxDataPollCount, */ \ + /* 1587 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1590 - RxBeaconCount, */ \ + /* 1591 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1594 - RxBeaconRequestCount, */ \ + /* 1595 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1598 - RxOtherCount, */ \ + /* 1599 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1602 - RxAddressFilteredCount, */ \ + /* 1603 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1606 - RxDestAddrFilteredCount, */ \ + /* 1607 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1610 - RxDuplicatedCount, */ \ + /* 1611 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1614 - RxErrNoFrameCount, */ \ + /* 1615 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1618 - RxErrUnknownNeighborCount, */ \ + /* 1619 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1622 - RxErrInvalidSrcAddrCount, */ \ + /* 1623 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1626 - RxErrSecCount, */ \ + /* 1627 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1630 - RxErrFcsCount, */ \ + /* 1631 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1634 - RxErrOtherCount, */ \ + /* 1635 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1638 - ActiveTimestamp, */ \ + /* 1639 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1646 - PendingTimestamp, */ \ + /* 1647 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1654 - delay, */ \ + /* 1655 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1658 - SecurityPolicy, */ \ + /* 1659 - SecurityPolicy, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1664 - ChannelMask, */ \ + /* 1665 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1669 - OperationalDatasetComponents, */ \ + /* 1670 - OperationalDatasetComponents, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1683 - ActiveNetworkFaultsList, */ \ + /* 1684 - ActiveNetworkFaultsList, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), big-endian */ \ \ - /* 1687 - bssid, */ \ + /* 1688 - bssid, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1694 - BeaconLostCount, */ \ + /* 1695 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1698 - BeaconRxCount, */ \ + /* 1699 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1702 - PacketMulticastRxCount, */ \ + /* 1703 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1706 - PacketMulticastTxCount, */ \ + /* 1707 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1710 - PacketUnicastRxCount, */ \ + /* 1711 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1714 - PacketUnicastTxCount, */ \ + /* 1715 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1718 - CurrentMaxRate, */ \ + /* 1719 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1726 - OverrunCount, */ \ + /* 1727 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), big-endian */ \ \ - /* 1734 - PacketRxCount, */ \ + /* 1735 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1742 - PacketTxCount, */ \ + /* 1743 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1750 - TxErrCount, */ \ + /* 1751 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1758 - CollisionCount, */ \ + /* 1759 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1766 - OverrunCount, */ \ + /* 1767 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1774 - TimeSinceReset, */ \ + /* 1775 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Group Key Management (server), big-endian */ \ \ - /* 1782 - groups, */ \ + /* 1783 - groups, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -371,7 +371,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2036 - group keys, */ \ + /* 2037 - group keys, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -389,31 +389,31 @@ \ /* Endpoint: 1, Cluster: Basic (server), big-endian */ \ \ - /* 2290 - VendorName, */ \ + /* 2291 - VendorName, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2323 - ProductName, */ \ + /* 2324 - ProductName, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2356 - UserLabel, */ \ + /* 2357 - UserLabel, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2389 - Location, */ \ + /* 2390 - Location, */ \ 0x00, 0x00, 0x00, \ \ - /* 2392 - HardwareVersionString, */ \ + /* 2393 - HardwareVersionString, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2457 - SoftwareVersion, */ \ + /* 2458 - SoftwareVersion, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2461 - SoftwareVersionString, */ \ + /* 2462 - SoftwareVersionString, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -421,7 +421,7 @@ \ /* Endpoint: 1, Cluster: Thermostat (server), big-endian */ \ \ - /* 2526 - FeatureMap, */ \ + /* 2527 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x0B, \ } @@ -482,24 +482,24 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 543 - ProductLabel, */ \ + /* 544 - ProductLabel, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 608 - SerialNumber, */ \ + /* 609 - SerialNumber, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Commissioning (server), little-endian */ \ \ - /* 641 - Breadcrumb, */ \ + /* 642 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 649 - BasicCommissioningInfoList, */ \ + /* 650 - BasicCommissioningInfoList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -517,38 +517,38 @@ \ /* Endpoint: 0, Cluster: General Diagnostics (server), little-endian */ \ \ - /* 903 - UpTime, */ \ + /* 904 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 911 - TotalOperationalHours, */ \ + /* 912 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), little-endian */ \ \ - /* 915 - CurrentHeapFree, */ \ + /* 916 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 923 - CurrentHeapUsed, */ \ + /* 924 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 931 - CurrentHeapHighWatermark, */ \ + /* 932 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), little-endian */ \ \ - /* 939 - NetworkName, */ \ + /* 940 - NetworkName, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 956 - ExtendedPanId, */ \ + /* 957 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 964 - MeshLocalPrefix, */ \ + /* 965 - MeshLocalPrefix, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 982 - OverrunCount, */ \ + /* 983 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 990 - NeighborTableList, */ \ + /* 991 - NeighborTableList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -564,7 +564,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1244 - RouteTableList, */ \ + /* 1245 - RouteTableList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -580,184 +580,184 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1498 - PartitionId, */ \ + /* 1499 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1502 - TxTotalCount, */ \ + /* 1503 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1506 - TxUnicastCount, */ \ + /* 1507 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1510 - TxBroadcastCount, */ \ + /* 1511 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1514 - TxAckRequestedCount, */ \ + /* 1515 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1518 - TxAckedCount, */ \ + /* 1519 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1522 - TxNoAckRequestedCount, */ \ + /* 1523 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1526 - TxDataCount, */ \ + /* 1527 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1530 - TxDataPollCount, */ \ + /* 1531 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1534 - TxBeaconCount, */ \ + /* 1535 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1538 - TxBeaconRequestCount, */ \ + /* 1539 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1542 - TxOtherCount, */ \ + /* 1543 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1546 - TxRetryCount, */ \ + /* 1547 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1550 - TxDirectMaxRetryExpiryCount, */ \ + /* 1551 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1554 - TxIndirectMaxRetryExpiryCount, */ \ + /* 1555 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1558 - TxErrCcaCount, */ \ + /* 1559 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1562 - TxErrAbortCount, */ \ + /* 1563 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1566 - TxErrBusyChannelCount, */ \ + /* 1567 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1570 - RxTotalCount, */ \ + /* 1571 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1574 - RxUnicastCount, */ \ + /* 1575 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1578 - RxBroadcastCount, */ \ + /* 1579 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1582 - RxDataCount, */ \ + /* 1583 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1586 - RxDataPollCount, */ \ + /* 1587 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1590 - RxBeaconCount, */ \ + /* 1591 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1594 - RxBeaconRequestCount, */ \ + /* 1595 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1598 - RxOtherCount, */ \ + /* 1599 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1602 - RxAddressFilteredCount, */ \ + /* 1603 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1606 - RxDestAddrFilteredCount, */ \ + /* 1607 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1610 - RxDuplicatedCount, */ \ + /* 1611 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1614 - RxErrNoFrameCount, */ \ + /* 1615 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1618 - RxErrUnknownNeighborCount, */ \ + /* 1619 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1622 - RxErrInvalidSrcAddrCount, */ \ + /* 1623 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1626 - RxErrSecCount, */ \ + /* 1627 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1630 - RxErrFcsCount, */ \ + /* 1631 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1634 - RxErrOtherCount, */ \ + /* 1635 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1638 - ActiveTimestamp, */ \ + /* 1639 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1646 - PendingTimestamp, */ \ + /* 1647 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1654 - delay, */ \ + /* 1655 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1658 - SecurityPolicy, */ \ + /* 1659 - SecurityPolicy, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1664 - ChannelMask, */ \ + /* 1665 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1669 - OperationalDatasetComponents, */ \ + /* 1670 - OperationalDatasetComponents, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1683 - ActiveNetworkFaultsList, */ \ + /* 1684 - ActiveNetworkFaultsList, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), little-endian */ \ \ - /* 1687 - bssid, */ \ + /* 1688 - bssid, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1694 - BeaconLostCount, */ \ + /* 1695 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1698 - BeaconRxCount, */ \ + /* 1699 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1702 - PacketMulticastRxCount, */ \ + /* 1703 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1706 - PacketMulticastTxCount, */ \ + /* 1707 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1710 - PacketUnicastRxCount, */ \ + /* 1711 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1714 - PacketUnicastTxCount, */ \ + /* 1715 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1718 - CurrentMaxRate, */ \ + /* 1719 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1726 - OverrunCount, */ \ + /* 1727 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), little-endian */ \ \ - /* 1734 - PacketRxCount, */ \ + /* 1735 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1742 - PacketTxCount, */ \ + /* 1743 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1750 - TxErrCount, */ \ + /* 1751 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1758 - CollisionCount, */ \ + /* 1759 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1766 - OverrunCount, */ \ + /* 1767 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1774 - TimeSinceReset, */ \ + /* 1775 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Group Key Management (server), little-endian */ \ \ - /* 1782 - groups, */ \ + /* 1783 - groups, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -773,7 +773,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2036 - group keys, */ \ + /* 2037 - group keys, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -791,31 +791,31 @@ \ /* Endpoint: 1, Cluster: Basic (server), little-endian */ \ \ - /* 2290 - VendorName, */ \ + /* 2291 - VendorName, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2323 - ProductName, */ \ + /* 2324 - ProductName, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2356 - UserLabel, */ \ + /* 2357 - UserLabel, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2389 - Location, */ \ + /* 2390 - Location, */ \ 0x00, 0x00, 0x00, \ \ - /* 2392 - HardwareVersionString, */ \ + /* 2393 - HardwareVersionString, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2457 - SoftwareVersion, */ \ + /* 2458 - SoftwareVersion, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2461 - SoftwareVersionString, */ \ + /* 2462 - SoftwareVersionString, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -823,7 +823,7 @@ \ /* Endpoint: 1, Cluster: Thermostat (server), little-endian */ \ \ - /* 2526 - FeatureMap, */ \ + /* 2527 - FeatureMap, */ \ 0x0B, 0x00, 0x00, 0x00, \ } @@ -857,7 +857,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 183 +#define GENERATED_ATTRIBUTE_COUNT 184 #define GENERATED_ATTRIBUTES \ { \ \ @@ -891,10 +891,11 @@ ZAP_LONG_DEFAULTS_INDEX(171) }, /* SoftwareVersionString */ \ { 0x000B, ZAP_TYPE(CHAR_STRING), 17, ZAP_ATTRIBUTE_MASK(SINGLETON), \ ZAP_LONG_DEFAULTS_INDEX(236) }, /* ManufacturingDate */ \ - { 0x000C, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(253) }, /* PartNumber */ \ - { 0x000D, ZAP_TYPE(CHAR_STRING), 257, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(286) }, /* ProductURL */ \ - { 0x000E, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(543) }, /* ProductLabel */ \ - { 0x000F, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(608) }, /* SerialNumber */ \ + { 0x000C, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(253) }, /* PartNumber */ \ + { 0x000D, ZAP_TYPE(LONG_CHAR_STRING), 258, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_LONG_DEFAULTS_INDEX(286) }, /* ProductURL */ \ + { 0x000E, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(544) }, /* ProductLabel */ \ + { 0x000F, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(609) }, /* SerialNumber */ \ { 0x0010, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* LocalConfigDisabled */ \ { 0x0011, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(1) }, /* Reachable */ \ @@ -904,8 +905,8 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x0000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(641) }, /* Breadcrumb */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(649) }, /* BasicCommissioningInfoList */ \ + { 0x0000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(642) }, /* Breadcrumb */ \ + { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(650) }, /* BasicCommissioningInfoList */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ @@ -914,28 +915,29 @@ /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NetworkInterfaces */ \ { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* RebootCount */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(903) }, /* UpTime */ \ - { 0x0003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(911) }, /* TotalOperationalHours */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(904) }, /* UpTime */ \ + { 0x0003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(912) }, /* TotalOperationalHours */ \ { 0x0004, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BootReasons */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(915) }, /* CurrentHeapFree */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(923) }, /* CurrentHeapUsed */ \ - { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(931) }, /* CurrentHeapHighWatermark */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ThreadMetrics */ \ + { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(916) }, /* CurrentHeapFree */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(924) }, /* CurrentHeapUsed */ \ + { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(932) }, /* CurrentHeapHighWatermark */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ - { 0x0002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(939) }, /* NetworkName */ \ + { 0x0002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(940) }, /* NetworkName */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ - { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(956) }, /* ExtendedPanId */ \ - { 0x0005, ZAP_TYPE(OCTET_STRING), 18, 0, ZAP_LONG_DEFAULTS_INDEX(964) }, /* MeshLocalPrefix */ \ - { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(982) }, /* OverrunCount */ \ - { 0x0007, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(990) }, /* NeighborTableList */ \ - { 0x0008, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1244) }, /* RouteTableList */ \ - { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1498) }, /* PartitionId */ \ + { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(957) }, /* ExtendedPanId */ \ + { 0x0005, ZAP_TYPE(OCTET_STRING), 18, 0, ZAP_LONG_DEFAULTS_INDEX(965) }, /* MeshLocalPrefix */ \ + { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(983) }, /* OverrunCount */ \ + { 0x0007, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(991) }, /* NeighborTableList */ \ + { 0x0008, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1245) }, /* RouteTableList */ \ + { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1499) }, /* PartitionId */ \ { 0x000A, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* weighting */ \ { 0x000B, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* DataVersion */ \ { 0x000C, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* StableDataVersion */ \ @@ -948,75 +950,75 @@ { 0x0013, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PartitionIdChangeCount */ \ { 0x0014, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* BetterPartitionAttachAttemptCount */ \ { 0x0015, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ParentChangeCount */ \ - { 0x0016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1502) }, /* TxTotalCount */ \ - { 0x0017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1506) }, /* TxUnicastCount */ \ - { 0x0018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1510) }, /* TxBroadcastCount */ \ - { 0x0019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1514) }, /* TxAckRequestedCount */ \ - { 0x001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1518) }, /* TxAckedCount */ \ - { 0x001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1522) }, /* TxNoAckRequestedCount */ \ - { 0x001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1526) }, /* TxDataCount */ \ - { 0x001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1530) }, /* TxDataPollCount */ \ - { 0x001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1534) }, /* TxBeaconCount */ \ - { 0x001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1538) }, /* TxBeaconRequestCount */ \ - { 0x0020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1542) }, /* TxOtherCount */ \ - { 0x0021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1546) }, /* TxRetryCount */ \ - { 0x0022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1550) }, /* TxDirectMaxRetryExpiryCount */ \ - { 0x0023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1554) }, /* TxIndirectMaxRetryExpiryCount */ \ - { 0x0024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1558) }, /* TxErrCcaCount */ \ - { 0x0025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1562) }, /* TxErrAbortCount */ \ - { 0x0026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1566) }, /* TxErrBusyChannelCount */ \ - { 0x0027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1570) }, /* RxTotalCount */ \ - { 0x0028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1574) }, /* RxUnicastCount */ \ - { 0x0029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1578) }, /* RxBroadcastCount */ \ - { 0x002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1582) }, /* RxDataCount */ \ - { 0x002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1586) }, /* RxDataPollCount */ \ - { 0x002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1590) }, /* RxBeaconCount */ \ - { 0x002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1594) }, /* RxBeaconRequestCount */ \ - { 0x002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1598) }, /* RxOtherCount */ \ - { 0x002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1602) }, /* RxAddressFilteredCount */ \ - { 0x0030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1606) }, /* RxDestAddrFilteredCount */ \ - { 0x0031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1610) }, /* RxDuplicatedCount */ \ - { 0x0032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1614) }, /* RxErrNoFrameCount */ \ - { 0x0033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1618) }, /* RxErrUnknownNeighborCount */ \ - { 0x0034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1622) }, /* RxErrInvalidSrcAddrCount */ \ - { 0x0035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1626) }, /* RxErrSecCount */ \ - { 0x0036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1630) }, /* RxErrFcsCount */ \ - { 0x0037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1634) }, /* RxErrOtherCount */ \ - { 0x0038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1638) }, /* ActiveTimestamp */ \ - { 0x0039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1646) }, /* PendingTimestamp */ \ - { 0x003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1654) }, /* delay */ \ - { 0x003B, ZAP_TYPE(ARRAY), 6, 0, ZAP_LONG_DEFAULTS_INDEX(1658) }, /* SecurityPolicy */ \ - { 0x003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(1664) }, /* ChannelMask */ \ - { 0x003D, ZAP_TYPE(ARRAY), 14, 0, ZAP_LONG_DEFAULTS_INDEX(1669) }, /* OperationalDatasetComponents */ \ - { 0x003E, ZAP_TYPE(ARRAY), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1683) }, /* ActiveNetworkFaultsList */ \ + { 0x0016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1503) }, /* TxTotalCount */ \ + { 0x0017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1507) }, /* TxUnicastCount */ \ + { 0x0018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1511) }, /* TxBroadcastCount */ \ + { 0x0019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1515) }, /* TxAckRequestedCount */ \ + { 0x001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1519) }, /* TxAckedCount */ \ + { 0x001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1523) }, /* TxNoAckRequestedCount */ \ + { 0x001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1527) }, /* TxDataCount */ \ + { 0x001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1531) }, /* TxDataPollCount */ \ + { 0x001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1535) }, /* TxBeaconCount */ \ + { 0x001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1539) }, /* TxBeaconRequestCount */ \ + { 0x0020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1543) }, /* TxOtherCount */ \ + { 0x0021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1547) }, /* TxRetryCount */ \ + { 0x0022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1551) }, /* TxDirectMaxRetryExpiryCount */ \ + { 0x0023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1555) }, /* TxIndirectMaxRetryExpiryCount */ \ + { 0x0024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1559) }, /* TxErrCcaCount */ \ + { 0x0025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1563) }, /* TxErrAbortCount */ \ + { 0x0026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1567) }, /* TxErrBusyChannelCount */ \ + { 0x0027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1571) }, /* RxTotalCount */ \ + { 0x0028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1575) }, /* RxUnicastCount */ \ + { 0x0029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1579) }, /* RxBroadcastCount */ \ + { 0x002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1583) }, /* RxDataCount */ \ + { 0x002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1587) }, /* RxDataPollCount */ \ + { 0x002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1591) }, /* RxBeaconCount */ \ + { 0x002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1595) }, /* RxBeaconRequestCount */ \ + { 0x002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1599) }, /* RxOtherCount */ \ + { 0x002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1603) }, /* RxAddressFilteredCount */ \ + { 0x0030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1607) }, /* RxDestAddrFilteredCount */ \ + { 0x0031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1611) }, /* RxDuplicatedCount */ \ + { 0x0032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1615) }, /* RxErrNoFrameCount */ \ + { 0x0033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1619) }, /* RxErrUnknownNeighborCount */ \ + { 0x0034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1623) }, /* RxErrInvalidSrcAddrCount */ \ + { 0x0035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1627) }, /* RxErrSecCount */ \ + { 0x0036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1631) }, /* RxErrFcsCount */ \ + { 0x0037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1635) }, /* RxErrOtherCount */ \ + { 0x0038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1639) }, /* ActiveTimestamp */ \ + { 0x0039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1647) }, /* PendingTimestamp */ \ + { 0x003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1655) }, /* delay */ \ + { 0x003B, ZAP_TYPE(ARRAY), 6, 0, ZAP_LONG_DEFAULTS_INDEX(1659) }, /* SecurityPolicy */ \ + { 0x003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(1665) }, /* ChannelMask */ \ + { 0x003D, ZAP_TYPE(ARRAY), 14, 0, ZAP_LONG_DEFAULTS_INDEX(1670) }, /* OperationalDatasetComponents */ \ + { 0x003E, ZAP_TYPE(ARRAY), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1684) }, /* ActiveNetworkFaultsList */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ - { 0x0000, ZAP_TYPE(OCTET_STRING), 7, 0, ZAP_LONG_DEFAULTS_INDEX(1687) }, /* bssid */ \ + { 0x0000, ZAP_TYPE(OCTET_STRING), 7, 0, ZAP_LONG_DEFAULTS_INDEX(1688) }, /* bssid */ \ { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SecurityType */ \ { 0x0002, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* WiFiVersion */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ChannelNumber */ \ { 0x0004, ZAP_TYPE(INT8S), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Rssi */ \ - { 0x0005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1694) }, /* BeaconLostCount */ \ - { 0x0006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1698) }, /* BeaconRxCount */ \ - { 0x0007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1702) }, /* PacketMulticastRxCount */ \ - { 0x0008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1706) }, /* PacketMulticastTxCount */ \ - { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1710) }, /* PacketUnicastRxCount */ \ - { 0x000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1714) }, /* PacketUnicastTxCount */ \ - { 0x000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1718) }, /* CurrentMaxRate */ \ - { 0x000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1726) }, /* OverrunCount */ \ + { 0x0005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1695) }, /* BeaconLostCount */ \ + { 0x0006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1699) }, /* BeaconRxCount */ \ + { 0x0007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1703) }, /* PacketMulticastRxCount */ \ + { 0x0008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1707) }, /* PacketMulticastTxCount */ \ + { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1711) }, /* PacketUnicastRxCount */ \ + { 0x000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1715) }, /* PacketUnicastTxCount */ \ + { 0x000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1719) }, /* CurrentMaxRate */ \ + { 0x000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1727) }, /* OverrunCount */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* PHYRate */ \ { 0x0001, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* FullDuplex */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1734) }, /* PacketRxCount */ \ - { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1742) }, /* PacketTxCount */ \ - { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1750) }, /* TxErrCount */ \ - { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1758) }, /* CollisionCount */ \ - { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1766) }, /* OverrunCount */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1735) }, /* PacketRxCount */ \ + { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1743) }, /* PacketTxCount */ \ + { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1751) }, /* TxErrCount */ \ + { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1759) }, /* CollisionCount */ \ + { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1767) }, /* OverrunCount */ \ { 0x0007, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* CarrierDetect */ \ - { 0x0008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1774) }, /* TimeSinceReset */ \ + { 0x0008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1775) }, /* TimeSinceReset */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ @@ -1036,8 +1038,8 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Group Key Management (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1782) }, /* groups */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2036) }, /* group keys */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1783) }, /* groups */ \ + { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2037) }, /* group keys */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Identify (client) */ \ @@ -1062,20 +1064,20 @@ \ /* Endpoint: 1, Cluster: Basic (server) */ \ { 0x0000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* InteractionModelVersion */ \ - { 0x0001, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(2290) }, /* VendorName */ \ + { 0x0001, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(2291) }, /* VendorName */ \ { 0x0002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* VendorID */ \ - { 0x0003, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(2323) }, /* ProductName */ \ + { 0x0003, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(2324) }, /* ProductName */ \ { 0x0004, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* ProductID */ \ { 0x0005, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(2356) }, /* UserLabel */ \ + ZAP_LONG_DEFAULTS_INDEX(2357) }, /* UserLabel */ \ { 0x0006, ZAP_TYPE(CHAR_STRING), 3, ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(2389) }, /* Location */ \ + ZAP_LONG_DEFAULTS_INDEX(2390) }, /* Location */ \ { 0x0007, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(0x00) }, /* HardwareVersion */ \ { 0x0008, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), \ - ZAP_LONG_DEFAULTS_INDEX(2392) }, /* HardwareVersionString */ \ - { 0x0009, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(2457) }, /* SoftwareVersion */ \ + ZAP_LONG_DEFAULTS_INDEX(2393) }, /* HardwareVersionString */ \ + { 0x0009, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(2458) }, /* SoftwareVersion */ \ { 0x000A, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), \ - ZAP_LONG_DEFAULTS_INDEX(2461) }, /* SoftwareVersionString */ \ + ZAP_LONG_DEFAULTS_INDEX(2462) }, /* SoftwareVersionString */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Thermostat (server) */ \ @@ -1099,7 +1101,7 @@ { 0x0020, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* start of week */ \ { 0x0021, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(7) }, /* number of weekly transitions */ \ { 0x0022, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(4) }, /* number of daily transitions */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(2526) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(2527) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ } @@ -1138,7 +1140,7 @@ { 0x0028, \ ZAP_ATTRIBUTE_INDEX(7), \ 19, \ - 653, \ + 654, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayBasicServer }, /* Endpoint: 0, Cluster: Basic (server) */ \ { \ @@ -1157,58 +1159,58 @@ 0x0033, ZAP_ATTRIBUTE_INDEX(31), 6, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { \ - 0x0034, ZAP_ATTRIBUTE_INDEX(37), 4, 26, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0034, ZAP_ATTRIBUTE_INDEX(37), 5, 26, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(41), 64, 774, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0035, ZAP_ATTRIBUTE_INDEX(42), 64, 774, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { \ - 0x0036, ZAP_ATTRIBUTE_INDEX(105), 14, 54, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0036, ZAP_ATTRIBUTE_INDEX(106), 14, 54, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ { \ - 0x0037, ZAP_ATTRIBUTE_INDEX(119), 10, 53, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0037, ZAP_ATTRIBUTE_INDEX(120), 10, 53, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { \ - 0x003C, ZAP_ATTRIBUTE_INDEX(129), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003C, ZAP_ATTRIBUTE_INDEX(130), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { \ - 0x003E, ZAP_ATTRIBUTE_INDEX(130), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003E, ZAP_ATTRIBUTE_INDEX(131), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0xF000, ZAP_ATTRIBUTE_INDEX(136), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0xF000, ZAP_ATTRIBUTE_INDEX(137), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Binding (server) */ \ { \ - 0xF004, ZAP_ATTRIBUTE_INDEX(137), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0xF004, ZAP_ATTRIBUTE_INDEX(138), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Group Key Management (server) */ \ { \ - 0x0003, ZAP_ATTRIBUTE_INDEX(140), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0003, ZAP_ATTRIBUTE_INDEX(141), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Identify (client) */ \ { 0x0003, \ - ZAP_ATTRIBUTE_INDEX(141), \ + ZAP_ATTRIBUTE_INDEX(142), \ 3, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayIdentifyServer }, /* Endpoint: 1, Cluster: Identify (server) */ \ { 0x0004, \ - ZAP_ATTRIBUTE_INDEX(144), \ + ZAP_ATTRIBUTE_INDEX(145), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayGroupsServer }, /* Endpoint: 1, Cluster: Groups (server) */ \ { 0x0005, \ - ZAP_ATTRIBUTE_INDEX(146), \ + ZAP_ATTRIBUTE_INDEX(147), \ 6, \ 8, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayScenesServer }, /* Endpoint: 1, Cluster: Scenes (server) */ \ { 0x0028, \ - ZAP_ATTRIBUTE_INDEX(152), \ + ZAP_ATTRIBUTE_INDEX(153), \ 12, \ 246, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayBasicServer }, /* Endpoint: 1, Cluster: Basic (server) */ \ { \ - 0x0201, ZAP_ATTRIBUTE_INDEX(164), 19, 34, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0201, ZAP_ATTRIBUTE_INDEX(165), 19, 34, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Thermostat (server) */ \ } @@ -1217,17 +1219,17 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 16, 2367 }, { ZAP_CLUSTER_INDEX(16), 6, 298 }, \ + { ZAP_CLUSTER_INDEX(0), 16, 2368 }, { ZAP_CLUSTER_INDEX(16), 6, 298 }, \ } // Largest attribute size is needed for various buffers #define ATTRIBUTE_LARGEST (401) // Total size of singleton attributes -#define ATTRIBUTE_SINGLETONS_SIZE (899) +#define ATTRIBUTE_SINGLETONS_SIZE (900) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (2665) +#define ATTRIBUTE_MAX_SIZE (2666) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (2) diff --git a/zzz_generated/tv-app/zap-generated/attribute-size.cpp b/zzz_generated/tv-app/zap-generated/attribute-size.cpp index 8e034db9cc9d33..277108162767c5 100644 --- a/zzz_generated/tv-app/zap-generated/attribute-size.cpp +++ b/zzz_generated/tv-app/zap-generated/attribute-size.cpp @@ -492,6 +492,44 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo } break; } + case 0x0034: // Software Diagnostics Cluster + { + uint16_t entryOffset = kSizeLengthInBytes; + switch (am->attributeId) + { + case 0x0000: // ThreadMetrics + { + entryLength = 30; + if (((index - 1) * entryLength) > (am->size - entryLength)) + { + ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); + return 0; + } + entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); + // Struct _ThreadMetrics + _ThreadMetrics * entry = reinterpret_cast<_ThreadMetrics *>(write ? src : dest); + copyListMember(write ? dest : (uint8_t *) &entry->Id, write ? (uint8_t *) &entry->Id : src, write, &entryOffset, + sizeof(entry->Id)); // INT64U + ByteSpan NameSpanStorage(Uint8::from_const_char(entry->Name.data()), entry->Name.size()); // CHAR_STRING + ByteSpan * NameSpan = &NameSpanStorage; + if (CHIP_NO_ERROR != + (write ? WriteByteSpan(dest + entryOffset, 10, NameSpan) : ReadByteSpan(src + entryOffset, 10, NameSpan))) + { + ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); + return 0; + } + entryOffset = static_cast(entryOffset + 10); + copyListMember(write ? dest : (uint8_t *) &entry->StackFreeCurrent, write ? (uint8_t *) &entry->StackFreeCurrent : src, + write, &entryOffset, sizeof(entry->StackFreeCurrent)); // INT32U + copyListMember(write ? dest : (uint8_t *) &entry->StackFreeMinimum, write ? (uint8_t *) &entry->StackFreeMinimum : src, + write, &entryOffset, sizeof(entry->StackFreeMinimum)); // INT32U + copyListMember(write ? dest : (uint8_t *) &entry->StackSize, write ? (uint8_t *) &entry->StackSize : src, write, + &entryOffset, sizeof(entry->StackSize)); // INT32U + break; + } + } + break; + } case 0x0504: // TV Channel Cluster { uint16_t entryOffset = kSizeLengthInBytes; @@ -857,6 +895,15 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut break; } break; + case 0x0034: // Software Diagnostics Cluster + switch (attributeId) + { + case 0x0000: // ThreadMetrics + // Struct _ThreadMetrics + entryLength = 30; + break; + } + break; case 0x0504: // TV Channel Cluster switch (attributeId) { diff --git a/zzz_generated/tv-app/zap-generated/endpoint_config.h b/zzz_generated/tv-app/zap-generated/endpoint_config.h index 660417520396e9..8572808912c748 100644 --- a/zzz_generated/tv-app/zap-generated/endpoint_config.h +++ b/zzz_generated/tv-app/zap-generated/endpoint_config.h @@ -80,24 +80,24 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 543 - ProductLabel, */ \ + /* 544 - ProductLabel, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 608 - SerialNumber, */ \ + /* 609 - SerialNumber, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Commissioning (server), big-endian */ \ \ - /* 641 - Breadcrumb, */ \ + /* 642 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 649 - BasicCommissioningInfoList, */ \ + /* 650 - BasicCommissioningInfoList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -115,38 +115,38 @@ \ /* Endpoint: 0, Cluster: General Diagnostics (server), big-endian */ \ \ - /* 903 - UpTime, */ \ + /* 904 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 911 - TotalOperationalHours, */ \ + /* 912 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), big-endian */ \ \ - /* 915 - CurrentHeapFree, */ \ + /* 916 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 923 - CurrentHeapUsed, */ \ + /* 924 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 931 - CurrentHeapHighWatermark, */ \ + /* 932 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), big-endian */ \ \ - /* 939 - NetworkName, */ \ + /* 940 - NetworkName, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 956 - ExtendedPanId, */ \ + /* 957 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 964 - MeshLocalPrefix, */ \ + /* 965 - MeshLocalPrefix, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 982 - OverrunCount, */ \ + /* 983 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 990 - NeighborTableList, */ \ + /* 991 - NeighborTableList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -162,7 +162,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1244 - RouteTableList, */ \ + /* 1245 - RouteTableList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -178,184 +178,184 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1498 - PartitionId, */ \ + /* 1499 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1502 - TxTotalCount, */ \ + /* 1503 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1506 - TxUnicastCount, */ \ + /* 1507 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1510 - TxBroadcastCount, */ \ + /* 1511 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1514 - TxAckRequestedCount, */ \ + /* 1515 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1518 - TxAckedCount, */ \ + /* 1519 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1522 - TxNoAckRequestedCount, */ \ + /* 1523 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1526 - TxDataCount, */ \ + /* 1527 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1530 - TxDataPollCount, */ \ + /* 1531 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1534 - TxBeaconCount, */ \ + /* 1535 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1538 - TxBeaconRequestCount, */ \ + /* 1539 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1542 - TxOtherCount, */ \ + /* 1543 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1546 - TxRetryCount, */ \ + /* 1547 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1550 - TxDirectMaxRetryExpiryCount, */ \ + /* 1551 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1554 - TxIndirectMaxRetryExpiryCount, */ \ + /* 1555 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1558 - TxErrCcaCount, */ \ + /* 1559 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1562 - TxErrAbortCount, */ \ + /* 1563 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1566 - TxErrBusyChannelCount, */ \ + /* 1567 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1570 - RxTotalCount, */ \ + /* 1571 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1574 - RxUnicastCount, */ \ + /* 1575 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1578 - RxBroadcastCount, */ \ + /* 1579 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1582 - RxDataCount, */ \ + /* 1583 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1586 - RxDataPollCount, */ \ + /* 1587 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1590 - RxBeaconCount, */ \ + /* 1591 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1594 - RxBeaconRequestCount, */ \ + /* 1595 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1598 - RxOtherCount, */ \ + /* 1599 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1602 - RxAddressFilteredCount, */ \ + /* 1603 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1606 - RxDestAddrFilteredCount, */ \ + /* 1607 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1610 - RxDuplicatedCount, */ \ + /* 1611 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1614 - RxErrNoFrameCount, */ \ + /* 1615 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1618 - RxErrUnknownNeighborCount, */ \ + /* 1619 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1622 - RxErrInvalidSrcAddrCount, */ \ + /* 1623 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1626 - RxErrSecCount, */ \ + /* 1627 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1630 - RxErrFcsCount, */ \ + /* 1631 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1634 - RxErrOtherCount, */ \ + /* 1635 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1638 - ActiveTimestamp, */ \ + /* 1639 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1646 - PendingTimestamp, */ \ + /* 1647 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1654 - delay, */ \ + /* 1655 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1658 - SecurityPolicy, */ \ + /* 1659 - SecurityPolicy, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1664 - ChannelMask, */ \ + /* 1665 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1669 - OperationalDatasetComponents, */ \ + /* 1670 - OperationalDatasetComponents, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1683 - ActiveNetworkFaultsList, */ \ + /* 1684 - ActiveNetworkFaultsList, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), big-endian */ \ \ - /* 1687 - bssid, */ \ + /* 1688 - bssid, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1694 - BeaconLostCount, */ \ + /* 1695 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1698 - BeaconRxCount, */ \ + /* 1699 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1702 - PacketMulticastRxCount, */ \ + /* 1703 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1706 - PacketMulticastTxCount, */ \ + /* 1707 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1710 - PacketUnicastRxCount, */ \ + /* 1711 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1714 - PacketUnicastTxCount, */ \ + /* 1715 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1718 - CurrentMaxRate, */ \ + /* 1719 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1726 - OverrunCount, */ \ + /* 1727 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), big-endian */ \ \ - /* 1734 - PacketRxCount, */ \ + /* 1735 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1742 - PacketTxCount, */ \ + /* 1743 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1750 - TxErrCount, */ \ + /* 1751 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1758 - CollisionCount, */ \ + /* 1759 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1766 - OverrunCount, */ \ + /* 1767 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1774 - TimeSinceReset, */ \ + /* 1775 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Group Key Management (server), big-endian */ \ \ - /* 1782 - groups, */ \ + /* 1783 - groups, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -371,7 +371,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2036 - group keys, */ \ + /* 2037 - group keys, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -389,13 +389,13 @@ \ /* Endpoint: 1, Cluster: Wake on LAN (server), big-endian */ \ \ - /* 2290 - wake on lan mac address, */ \ + /* 2291 - wake on lan mac address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: TV Channel (server), big-endian */ \ \ - /* 2323 - tv channel list, */ \ + /* 2324 - tv channel list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -411,17 +411,17 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2577 - tv channel lineup, */ \ + /* 2578 - tv channel lineup, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2610 - current tv channel, */ \ + /* 2611 - current tv channel, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Target Navigator (server), big-endian */ \ \ - /* 2643 - target navigator list, */ \ + /* 2644 - target navigator list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -439,7 +439,7 @@ \ /* Endpoint: 1, Cluster: Media Input (server), big-endian */ \ \ - /* 2897 - media input list, */ \ + /* 2898 - media input list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -457,7 +457,7 @@ \ /* Endpoint: 1, Cluster: Content Launcher (server), big-endian */ \ \ - /* 3151 - accepts header list, */ \ + /* 3152 - accepts header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -473,7 +473,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3405 - supported streaming types, */ \ + /* 3406 - supported streaming types, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -491,7 +491,7 @@ \ /* Endpoint: 1, Cluster: Application Launcher (server), big-endian */ \ \ - /* 3659 - application launcher list, */ \ + /* 3660 - application launcher list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -509,7 +509,7 @@ \ /* Endpoint: 2, Cluster: Audio Output (server), big-endian */ \ \ - /* 3913 - audio output list, */ \ + /* 3914 - audio output list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -527,30 +527,30 @@ \ /* Endpoint: 3, Cluster: Media Playback (server), big-endian */ \ \ - /* 4167 - start time, */ \ + /* 4168 - start time, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, \ \ - /* 4175 - duration, */ \ + /* 4176 - duration, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4183 - position updated at, */ \ + /* 4184 - position updated at, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4191 - position, */ \ + /* 4192 - position, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4199 - playback speed, */ \ + /* 4200 - playback speed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4207 - seek range end, */ \ + /* 4208 - seek range end, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4215 - seek range start, */ \ + /* 4216 - seek range start, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 3, Cluster: Content Launcher (server), big-endian */ \ \ - /* 4223 - accepts header list, */ \ + /* 4224 - accepts header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -566,7 +566,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4477 - supported streaming types, */ \ + /* 4478 - supported streaming types, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -584,21 +584,21 @@ \ /* Endpoint: 3, Cluster: Application Basic (server), big-endian */ \ \ - /* 4731 - vendor name, */ \ + /* 4732 - vendor name, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4764 - application name, */ \ + /* 4765 - application name, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4797 - application id, */ \ + /* 4798 - application id, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 4, Cluster: Content Launcher (server), big-endian */ \ \ - /* 4830 - accepts header list, */ \ + /* 4831 - accepts header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -614,7 +614,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5084 - supported streaming types, */ \ + /* 5085 - supported streaming types, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -632,29 +632,29 @@ \ /* Endpoint: 4, Cluster: Application Basic (server), big-endian */ \ \ - /* 5338 - vendor name, */ \ + /* 5339 - vendor name, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5371 - application name, */ \ + /* 5372 - application name, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5404 - application id, */ \ + /* 5405 - application id, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 5, Cluster: Application Basic (server), big-endian */ \ \ - /* 5437 - vendor name, */ \ + /* 5438 - vendor name, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5470 - application name, */ \ + /* 5471 - application name, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5503 - application id, */ \ + /* 5504 - application id, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ } @@ -716,24 +716,24 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 543 - ProductLabel, */ \ + /* 544 - ProductLabel, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 608 - SerialNumber, */ \ + /* 609 - SerialNumber, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Commissioning (server), little-endian */ \ \ - /* 641 - Breadcrumb, */ \ + /* 642 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 649 - BasicCommissioningInfoList, */ \ + /* 650 - BasicCommissioningInfoList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -751,38 +751,38 @@ \ /* Endpoint: 0, Cluster: General Diagnostics (server), little-endian */ \ \ - /* 903 - UpTime, */ \ + /* 904 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 911 - TotalOperationalHours, */ \ + /* 912 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), little-endian */ \ \ - /* 915 - CurrentHeapFree, */ \ + /* 916 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 923 - CurrentHeapUsed, */ \ + /* 924 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 931 - CurrentHeapHighWatermark, */ \ + /* 932 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), little-endian */ \ \ - /* 939 - NetworkName, */ \ + /* 940 - NetworkName, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 956 - ExtendedPanId, */ \ + /* 957 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 964 - MeshLocalPrefix, */ \ + /* 965 - MeshLocalPrefix, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 982 - OverrunCount, */ \ + /* 983 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 990 - NeighborTableList, */ \ + /* 991 - NeighborTableList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -798,7 +798,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1244 - RouteTableList, */ \ + /* 1245 - RouteTableList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -814,184 +814,184 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1498 - PartitionId, */ \ + /* 1499 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1502 - TxTotalCount, */ \ + /* 1503 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1506 - TxUnicastCount, */ \ + /* 1507 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1510 - TxBroadcastCount, */ \ + /* 1511 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1514 - TxAckRequestedCount, */ \ + /* 1515 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1518 - TxAckedCount, */ \ + /* 1519 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1522 - TxNoAckRequestedCount, */ \ + /* 1523 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1526 - TxDataCount, */ \ + /* 1527 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1530 - TxDataPollCount, */ \ + /* 1531 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1534 - TxBeaconCount, */ \ + /* 1535 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1538 - TxBeaconRequestCount, */ \ + /* 1539 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1542 - TxOtherCount, */ \ + /* 1543 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1546 - TxRetryCount, */ \ + /* 1547 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1550 - TxDirectMaxRetryExpiryCount, */ \ + /* 1551 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1554 - TxIndirectMaxRetryExpiryCount, */ \ + /* 1555 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1558 - TxErrCcaCount, */ \ + /* 1559 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1562 - TxErrAbortCount, */ \ + /* 1563 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1566 - TxErrBusyChannelCount, */ \ + /* 1567 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1570 - RxTotalCount, */ \ + /* 1571 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1574 - RxUnicastCount, */ \ + /* 1575 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1578 - RxBroadcastCount, */ \ + /* 1579 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1582 - RxDataCount, */ \ + /* 1583 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1586 - RxDataPollCount, */ \ + /* 1587 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1590 - RxBeaconCount, */ \ + /* 1591 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1594 - RxBeaconRequestCount, */ \ + /* 1595 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1598 - RxOtherCount, */ \ + /* 1599 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1602 - RxAddressFilteredCount, */ \ + /* 1603 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1606 - RxDestAddrFilteredCount, */ \ + /* 1607 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1610 - RxDuplicatedCount, */ \ + /* 1611 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1614 - RxErrNoFrameCount, */ \ + /* 1615 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1618 - RxErrUnknownNeighborCount, */ \ + /* 1619 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1622 - RxErrInvalidSrcAddrCount, */ \ + /* 1623 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1626 - RxErrSecCount, */ \ + /* 1627 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1630 - RxErrFcsCount, */ \ + /* 1631 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1634 - RxErrOtherCount, */ \ + /* 1635 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1638 - ActiveTimestamp, */ \ + /* 1639 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1646 - PendingTimestamp, */ \ + /* 1647 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1654 - delay, */ \ + /* 1655 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1658 - SecurityPolicy, */ \ + /* 1659 - SecurityPolicy, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1664 - ChannelMask, */ \ + /* 1665 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1669 - OperationalDatasetComponents, */ \ + /* 1670 - OperationalDatasetComponents, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1683 - ActiveNetworkFaultsList, */ \ + /* 1684 - ActiveNetworkFaultsList, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), little-endian */ \ \ - /* 1687 - bssid, */ \ + /* 1688 - bssid, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1694 - BeaconLostCount, */ \ + /* 1695 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1698 - BeaconRxCount, */ \ + /* 1699 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1702 - PacketMulticastRxCount, */ \ + /* 1703 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1706 - PacketMulticastTxCount, */ \ + /* 1707 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1710 - PacketUnicastRxCount, */ \ + /* 1711 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1714 - PacketUnicastTxCount, */ \ + /* 1715 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1718 - CurrentMaxRate, */ \ + /* 1719 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1726 - OverrunCount, */ \ + /* 1727 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), little-endian */ \ \ - /* 1734 - PacketRxCount, */ \ + /* 1735 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1742 - PacketTxCount, */ \ + /* 1743 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1750 - TxErrCount, */ \ + /* 1751 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1758 - CollisionCount, */ \ + /* 1759 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1766 - OverrunCount, */ \ + /* 1767 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1774 - TimeSinceReset, */ \ + /* 1775 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Group Key Management (server), little-endian */ \ \ - /* 1782 - groups, */ \ + /* 1783 - groups, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1007,7 +1007,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2036 - group keys, */ \ + /* 2037 - group keys, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1025,13 +1025,13 @@ \ /* Endpoint: 1, Cluster: Wake on LAN (server), little-endian */ \ \ - /* 2290 - wake on lan mac address, */ \ + /* 2291 - wake on lan mac address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: TV Channel (server), little-endian */ \ \ - /* 2323 - tv channel list, */ \ + /* 2324 - tv channel list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1047,17 +1047,17 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2577 - tv channel lineup, */ \ + /* 2578 - tv channel lineup, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2610 - current tv channel, */ \ + /* 2611 - current tv channel, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Target Navigator (server), little-endian */ \ \ - /* 2643 - target navigator list, */ \ + /* 2644 - target navigator list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1075,7 +1075,7 @@ \ /* Endpoint: 1, Cluster: Media Input (server), little-endian */ \ \ - /* 2897 - media input list, */ \ + /* 2898 - media input list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1093,7 +1093,7 @@ \ /* Endpoint: 1, Cluster: Content Launcher (server), little-endian */ \ \ - /* 3151 - accepts header list, */ \ + /* 3152 - accepts header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1109,7 +1109,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3405 - supported streaming types, */ \ + /* 3406 - supported streaming types, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1127,7 +1127,7 @@ \ /* Endpoint: 1, Cluster: Application Launcher (server), little-endian */ \ \ - /* 3659 - application launcher list, */ \ + /* 3660 - application launcher list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1145,7 +1145,7 @@ \ /* Endpoint: 2, Cluster: Audio Output (server), little-endian */ \ \ - /* 3913 - audio output list, */ \ + /* 3914 - audio output list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1163,30 +1163,30 @@ \ /* Endpoint: 3, Cluster: Media Playback (server), little-endian */ \ \ - /* 4167 - start time, */ \ + /* 4168 - start time, */ \ 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4175 - duration, */ \ + /* 4176 - duration, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4183 - position updated at, */ \ + /* 4184 - position updated at, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4191 - position, */ \ + /* 4192 - position, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4199 - playback speed, */ \ + /* 4200 - playback speed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4207 - seek range end, */ \ + /* 4208 - seek range end, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4215 - seek range start, */ \ + /* 4216 - seek range start, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 3, Cluster: Content Launcher (server), little-endian */ \ \ - /* 4223 - accepts header list, */ \ + /* 4224 - accepts header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1202,7 +1202,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4477 - supported streaming types, */ \ + /* 4478 - supported streaming types, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1220,21 +1220,21 @@ \ /* Endpoint: 3, Cluster: Application Basic (server), little-endian */ \ \ - /* 4731 - vendor name, */ \ + /* 4732 - vendor name, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4764 - application name, */ \ + /* 4765 - application name, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4797 - application id, */ \ + /* 4798 - application id, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 4, Cluster: Content Launcher (server), little-endian */ \ \ - /* 4830 - accepts header list, */ \ + /* 4831 - accepts header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1250,7 +1250,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5084 - supported streaming types, */ \ + /* 5085 - supported streaming types, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1268,29 +1268,29 @@ \ /* Endpoint: 4, Cluster: Application Basic (server), little-endian */ \ \ - /* 5338 - vendor name, */ \ + /* 5339 - vendor name, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5371 - application name, */ \ + /* 5372 - application name, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5404 - application id, */ \ + /* 5405 - application id, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 5, Cluster: Application Basic (server), little-endian */ \ \ - /* 5437 - vendor name, */ \ + /* 5438 - vendor name, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5470 - application name, */ \ + /* 5471 - application name, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5503 - application id, */ \ + /* 5504 - application id, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ } @@ -1325,7 +1325,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 251 +#define GENERATED_ATTRIBUTE_COUNT 252 #define GENERATED_ATTRIBUTES \ { \ \ @@ -1355,10 +1355,11 @@ ZAP_LONG_DEFAULTS_INDEX(171) }, /* SoftwareVersionString */ \ { 0x000B, ZAP_TYPE(CHAR_STRING), 17, ZAP_ATTRIBUTE_MASK(SINGLETON), \ ZAP_LONG_DEFAULTS_INDEX(236) }, /* ManufacturingDate */ \ - { 0x000C, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(253) }, /* PartNumber */ \ - { 0x000D, ZAP_TYPE(CHAR_STRING), 257, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(286) }, /* ProductURL */ \ - { 0x000E, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(543) }, /* ProductLabel */ \ - { 0x000F, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(608) }, /* SerialNumber */ \ + { 0x000C, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(253) }, /* PartNumber */ \ + { 0x000D, ZAP_TYPE(LONG_CHAR_STRING), 258, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_LONG_DEFAULTS_INDEX(286) }, /* ProductURL */ \ + { 0x000E, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(544) }, /* ProductLabel */ \ + { 0x000F, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(609) }, /* SerialNumber */ \ { 0x0010, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_SIMPLE_DEFAULT(0x00) }, /* LocalConfigDisabled */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ @@ -1370,8 +1371,8 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x0000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(641) }, /* Breadcrumb */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(649) }, /* BasicCommissioningInfoList */ \ + { 0x0000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(642) }, /* Breadcrumb */ \ + { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(650) }, /* BasicCommissioningInfoList */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Network Commissioning (client) */ \ @@ -1383,28 +1384,29 @@ /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NetworkInterfaces */ \ { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* RebootCount */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(903) }, /* UpTime */ \ - { 0x0003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(911) }, /* TotalOperationalHours */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(904) }, /* UpTime */ \ + { 0x0003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(912) }, /* TotalOperationalHours */ \ { 0x0004, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BootReasons */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(915) }, /* CurrentHeapFree */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(923) }, /* CurrentHeapUsed */ \ - { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(931) }, /* CurrentHeapHighWatermark */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ThreadMetrics */ \ + { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(916) }, /* CurrentHeapFree */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(924) }, /* CurrentHeapUsed */ \ + { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(932) }, /* CurrentHeapHighWatermark */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ - { 0x0002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(939) }, /* NetworkName */ \ + { 0x0002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(940) }, /* NetworkName */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ - { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(956) }, /* ExtendedPanId */ \ - { 0x0005, ZAP_TYPE(OCTET_STRING), 18, 0, ZAP_LONG_DEFAULTS_INDEX(964) }, /* MeshLocalPrefix */ \ - { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(982) }, /* OverrunCount */ \ - { 0x0007, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(990) }, /* NeighborTableList */ \ - { 0x0008, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1244) }, /* RouteTableList */ \ - { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1498) }, /* PartitionId */ \ + { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(957) }, /* ExtendedPanId */ \ + { 0x0005, ZAP_TYPE(OCTET_STRING), 18, 0, ZAP_LONG_DEFAULTS_INDEX(965) }, /* MeshLocalPrefix */ \ + { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(983) }, /* OverrunCount */ \ + { 0x0007, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(991) }, /* NeighborTableList */ \ + { 0x0008, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1245) }, /* RouteTableList */ \ + { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1499) }, /* PartitionId */ \ { 0x000A, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* weighting */ \ { 0x000B, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* DataVersion */ \ { 0x000C, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* StableDataVersion */ \ @@ -1417,75 +1419,75 @@ { 0x0013, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PartitionIdChangeCount */ \ { 0x0014, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* BetterPartitionAttachAttemptCount */ \ { 0x0015, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ParentChangeCount */ \ - { 0x0016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1502) }, /* TxTotalCount */ \ - { 0x0017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1506) }, /* TxUnicastCount */ \ - { 0x0018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1510) }, /* TxBroadcastCount */ \ - { 0x0019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1514) }, /* TxAckRequestedCount */ \ - { 0x001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1518) }, /* TxAckedCount */ \ - { 0x001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1522) }, /* TxNoAckRequestedCount */ \ - { 0x001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1526) }, /* TxDataCount */ \ - { 0x001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1530) }, /* TxDataPollCount */ \ - { 0x001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1534) }, /* TxBeaconCount */ \ - { 0x001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1538) }, /* TxBeaconRequestCount */ \ - { 0x0020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1542) }, /* TxOtherCount */ \ - { 0x0021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1546) }, /* TxRetryCount */ \ - { 0x0022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1550) }, /* TxDirectMaxRetryExpiryCount */ \ - { 0x0023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1554) }, /* TxIndirectMaxRetryExpiryCount */ \ - { 0x0024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1558) }, /* TxErrCcaCount */ \ - { 0x0025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1562) }, /* TxErrAbortCount */ \ - { 0x0026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1566) }, /* TxErrBusyChannelCount */ \ - { 0x0027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1570) }, /* RxTotalCount */ \ - { 0x0028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1574) }, /* RxUnicastCount */ \ - { 0x0029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1578) }, /* RxBroadcastCount */ \ - { 0x002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1582) }, /* RxDataCount */ \ - { 0x002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1586) }, /* RxDataPollCount */ \ - { 0x002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1590) }, /* RxBeaconCount */ \ - { 0x002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1594) }, /* RxBeaconRequestCount */ \ - { 0x002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1598) }, /* RxOtherCount */ \ - { 0x002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1602) }, /* RxAddressFilteredCount */ \ - { 0x0030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1606) }, /* RxDestAddrFilteredCount */ \ - { 0x0031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1610) }, /* RxDuplicatedCount */ \ - { 0x0032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1614) }, /* RxErrNoFrameCount */ \ - { 0x0033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1618) }, /* RxErrUnknownNeighborCount */ \ - { 0x0034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1622) }, /* RxErrInvalidSrcAddrCount */ \ - { 0x0035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1626) }, /* RxErrSecCount */ \ - { 0x0036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1630) }, /* RxErrFcsCount */ \ - { 0x0037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1634) }, /* RxErrOtherCount */ \ - { 0x0038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1638) }, /* ActiveTimestamp */ \ - { 0x0039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1646) }, /* PendingTimestamp */ \ - { 0x003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1654) }, /* delay */ \ - { 0x003B, ZAP_TYPE(ARRAY), 6, 0, ZAP_LONG_DEFAULTS_INDEX(1658) }, /* SecurityPolicy */ \ - { 0x003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(1664) }, /* ChannelMask */ \ - { 0x003D, ZAP_TYPE(ARRAY), 14, 0, ZAP_LONG_DEFAULTS_INDEX(1669) }, /* OperationalDatasetComponents */ \ - { 0x003E, ZAP_TYPE(ARRAY), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1683) }, /* ActiveNetworkFaultsList */ \ + { 0x0016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1503) }, /* TxTotalCount */ \ + { 0x0017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1507) }, /* TxUnicastCount */ \ + { 0x0018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1511) }, /* TxBroadcastCount */ \ + { 0x0019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1515) }, /* TxAckRequestedCount */ \ + { 0x001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1519) }, /* TxAckedCount */ \ + { 0x001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1523) }, /* TxNoAckRequestedCount */ \ + { 0x001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1527) }, /* TxDataCount */ \ + { 0x001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1531) }, /* TxDataPollCount */ \ + { 0x001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1535) }, /* TxBeaconCount */ \ + { 0x001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1539) }, /* TxBeaconRequestCount */ \ + { 0x0020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1543) }, /* TxOtherCount */ \ + { 0x0021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1547) }, /* TxRetryCount */ \ + { 0x0022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1551) }, /* TxDirectMaxRetryExpiryCount */ \ + { 0x0023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1555) }, /* TxIndirectMaxRetryExpiryCount */ \ + { 0x0024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1559) }, /* TxErrCcaCount */ \ + { 0x0025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1563) }, /* TxErrAbortCount */ \ + { 0x0026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1567) }, /* TxErrBusyChannelCount */ \ + { 0x0027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1571) }, /* RxTotalCount */ \ + { 0x0028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1575) }, /* RxUnicastCount */ \ + { 0x0029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1579) }, /* RxBroadcastCount */ \ + { 0x002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1583) }, /* RxDataCount */ \ + { 0x002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1587) }, /* RxDataPollCount */ \ + { 0x002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1591) }, /* RxBeaconCount */ \ + { 0x002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1595) }, /* RxBeaconRequestCount */ \ + { 0x002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1599) }, /* RxOtherCount */ \ + { 0x002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1603) }, /* RxAddressFilteredCount */ \ + { 0x0030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1607) }, /* RxDestAddrFilteredCount */ \ + { 0x0031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1611) }, /* RxDuplicatedCount */ \ + { 0x0032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1615) }, /* RxErrNoFrameCount */ \ + { 0x0033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1619) }, /* RxErrUnknownNeighborCount */ \ + { 0x0034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1623) }, /* RxErrInvalidSrcAddrCount */ \ + { 0x0035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1627) }, /* RxErrSecCount */ \ + { 0x0036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1631) }, /* RxErrFcsCount */ \ + { 0x0037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1635) }, /* RxErrOtherCount */ \ + { 0x0038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1639) }, /* ActiveTimestamp */ \ + { 0x0039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1647) }, /* PendingTimestamp */ \ + { 0x003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1655) }, /* delay */ \ + { 0x003B, ZAP_TYPE(ARRAY), 6, 0, ZAP_LONG_DEFAULTS_INDEX(1659) }, /* SecurityPolicy */ \ + { 0x003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(1665) }, /* ChannelMask */ \ + { 0x003D, ZAP_TYPE(ARRAY), 14, 0, ZAP_LONG_DEFAULTS_INDEX(1670) }, /* OperationalDatasetComponents */ \ + { 0x003E, ZAP_TYPE(ARRAY), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1684) }, /* ActiveNetworkFaultsList */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ - { 0x0000, ZAP_TYPE(OCTET_STRING), 7, 0, ZAP_LONG_DEFAULTS_INDEX(1687) }, /* bssid */ \ + { 0x0000, ZAP_TYPE(OCTET_STRING), 7, 0, ZAP_LONG_DEFAULTS_INDEX(1688) }, /* bssid */ \ { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SecurityType */ \ { 0x0002, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* WiFiVersion */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ChannelNumber */ \ { 0x0004, ZAP_TYPE(INT8S), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Rssi */ \ - { 0x0005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1694) }, /* BeaconLostCount */ \ - { 0x0006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1698) }, /* BeaconRxCount */ \ - { 0x0007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1702) }, /* PacketMulticastRxCount */ \ - { 0x0008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1706) }, /* PacketMulticastTxCount */ \ - { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1710) }, /* PacketUnicastRxCount */ \ - { 0x000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1714) }, /* PacketUnicastTxCount */ \ - { 0x000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1718) }, /* CurrentMaxRate */ \ - { 0x000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1726) }, /* OverrunCount */ \ + { 0x0005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1695) }, /* BeaconLostCount */ \ + { 0x0006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1699) }, /* BeaconRxCount */ \ + { 0x0007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1703) }, /* PacketMulticastRxCount */ \ + { 0x0008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1707) }, /* PacketMulticastTxCount */ \ + { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1711) }, /* PacketUnicastRxCount */ \ + { 0x000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1715) }, /* PacketUnicastTxCount */ \ + { 0x000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1719) }, /* CurrentMaxRate */ \ + { 0x000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1727) }, /* OverrunCount */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* PHYRate */ \ { 0x0001, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* FullDuplex */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1734) }, /* PacketRxCount */ \ - { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1742) }, /* PacketTxCount */ \ - { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1750) }, /* TxErrCount */ \ - { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1758) }, /* CollisionCount */ \ - { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1766) }, /* OverrunCount */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1735) }, /* PacketRxCount */ \ + { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1743) }, /* PacketTxCount */ \ + { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1751) }, /* TxErrCount */ \ + { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1759) }, /* CollisionCount */ \ + { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1767) }, /* OverrunCount */ \ { 0x0007, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* CarrierDetect */ \ - { 0x0008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1774) }, /* TimeSinceReset */ \ + { 0x0008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1775) }, /* TimeSinceReset */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ @@ -1514,8 +1516,8 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Group Key Management (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1782) }, /* groups */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2036) }, /* group keys */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1783) }, /* groups */ \ + { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2037) }, /* group keys */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: On/Off (server) */ \ @@ -1530,21 +1532,21 @@ { 0xFFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ - { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(2290) }, /* wake on lan mac address */ \ + { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(2291) }, /* wake on lan mac address */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: TV Channel (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2323) }, /* tv channel list */ \ - { 0x0001, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(2577) }, /* tv channel lineup */ \ - { 0x0002, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(2610) }, /* current tv channel */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2324) }, /* tv channel list */ \ + { 0x0001, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(2578) }, /* tv channel lineup */ \ + { 0x0002, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(2611) }, /* current tv channel */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Target Navigator (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2643) }, /* target navigator list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2644) }, /* target navigator list */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Media Input (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2897) }, /* media input list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2898) }, /* media input list */ \ { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current media input */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ @@ -1555,12 +1557,12 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Content Launcher (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(3151) }, /* accepts header list */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(3405) }, /* supported streaming types */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(3152) }, /* accepts header list */ \ + { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(3406) }, /* supported streaming types */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Application Launcher (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(3659) }, /* application launcher list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(3660) }, /* application launcher list */ \ { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* catalog vendor id */ \ { 0x0002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* application id */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ @@ -1595,7 +1597,7 @@ { 0xFFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 2, Cluster: Audio Output (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(3913) }, /* audio output list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(3914) }, /* audio output list */ \ { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current audio output */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ @@ -1608,26 +1610,26 @@ \ /* Endpoint: 3, Cluster: Media Playback (server) */ \ { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* playback state */ \ - { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(4167) }, /* start time */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(4175) }, /* duration */ \ - { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(4183) }, /* position updated at */ \ - { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(4191) }, /* position */ \ - { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(4199) }, /* playback speed */ \ - { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(4207) }, /* seek range end */ \ - { 0x0007, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(4215) }, /* seek range start */ \ + { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(4168) }, /* start time */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(4176) }, /* duration */ \ + { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(4184) }, /* position updated at */ \ + { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(4192) }, /* position */ \ + { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(4200) }, /* playback speed */ \ + { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(4208) }, /* seek range end */ \ + { 0x0007, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(4216) }, /* seek range start */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 3, Cluster: Content Launcher (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(4223) }, /* accepts header list */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(4477) }, /* supported streaming types */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(4224) }, /* accepts header list */ \ + { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(4478) }, /* supported streaming types */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 3, Cluster: Application Basic (server) */ \ - { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(4731) }, /* vendor name */ \ + { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(4732) }, /* vendor name */ \ { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* vendor id */ \ - { 0x0002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(4764) }, /* application name */ \ + { 0x0002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(4765) }, /* application name */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* product id */ \ - { 0x0005, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(4797) }, /* application id */ \ + { 0x0005, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(4798) }, /* application id */ \ { 0x0006, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* catalog vendor id */ \ { 0x0007, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* application status */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ @@ -1643,16 +1645,16 @@ { 0xFFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 4, Cluster: Content Launcher (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(4830) }, /* accepts header list */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(5084) }, /* supported streaming types */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(4831) }, /* accepts header list */ \ + { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(5085) }, /* supported streaming types */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 4, Cluster: Application Basic (server) */ \ - { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(5338) }, /* vendor name */ \ + { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(5339) }, /* vendor name */ \ { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* vendor id */ \ - { 0x0002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(5371) }, /* application name */ \ + { 0x0002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(5372) }, /* application name */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* product id */ \ - { 0x0005, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(5404) }, /* application id */ \ + { 0x0005, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(5405) }, /* application id */ \ { 0x0006, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* catalog vendor id */ \ { 0x0007, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* application status */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ @@ -1665,11 +1667,11 @@ { 0xFFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 5, Cluster: Application Basic (server) */ \ - { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(5437) }, /* vendor name */ \ + { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(5438) }, /* vendor name */ \ { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* vendor id */ \ - { 0x0002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(5470) }, /* application name */ \ + { 0x0002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(5471) }, /* application name */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* product id */ \ - { 0x0005, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(5503) }, /* application id */ \ + { 0x0005, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(5504) }, /* application id */ \ { 0x0006, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* catalog vendor id */ \ { 0x0007, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* application status */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ @@ -1698,7 +1700,7 @@ { 0x0028, \ ZAP_ATTRIBUTE_INDEX(5), \ 18, \ - 652, \ + 653, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayBasicServer }, /* Endpoint: 0, Cluster: Basic (server) */ \ { \ @@ -1723,115 +1725,115 @@ 0x0033, ZAP_ATTRIBUTE_INDEX(30), 6, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { \ - 0x0034, ZAP_ATTRIBUTE_INDEX(36), 4, 26, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0034, ZAP_ATTRIBUTE_INDEX(36), 5, 26, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(40), 64, 774, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0035, ZAP_ATTRIBUTE_INDEX(41), 64, 774, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { \ - 0x0036, ZAP_ATTRIBUTE_INDEX(104), 14, 54, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0036, ZAP_ATTRIBUTE_INDEX(105), 14, 54, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ { \ - 0x0037, ZAP_ATTRIBUTE_INDEX(118), 10, 53, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0037, ZAP_ATTRIBUTE_INDEX(119), 10, 53, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { \ - 0x003C, ZAP_ATTRIBUTE_INDEX(128), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003C, ZAP_ATTRIBUTE_INDEX(129), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { \ - 0x003E, ZAP_ATTRIBUTE_INDEX(129), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x003E, ZAP_ATTRIBUTE_INDEX(130), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (client) */ \ { \ - 0x003E, ZAP_ATTRIBUTE_INDEX(130), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003E, ZAP_ATTRIBUTE_INDEX(131), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x0405, ZAP_ATTRIBUTE_INDEX(136), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0405, ZAP_ATTRIBUTE_INDEX(137), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ { \ - 0xF000, ZAP_ATTRIBUTE_INDEX(140), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0xF000, ZAP_ATTRIBUTE_INDEX(141), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Binding (server) */ \ { \ - 0xF004, ZAP_ATTRIBUTE_INDEX(141), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0xF004, ZAP_ATTRIBUTE_INDEX(142), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Group Key Management (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(144), \ + ZAP_ATTRIBUTE_INDEX(145), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(146), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(147), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ { \ - 0x0503, ZAP_ATTRIBUTE_INDEX(151), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0503, ZAP_ATTRIBUTE_INDEX(152), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ { \ - 0x0504, ZAP_ATTRIBUTE_INDEX(153), 4, 322, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0504, ZAP_ATTRIBUTE_INDEX(154), 4, 322, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: TV Channel (server) */ \ { \ - 0x0505, ZAP_ATTRIBUTE_INDEX(157), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0505, ZAP_ATTRIBUTE_INDEX(158), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Target Navigator (server) */ \ { \ - 0x0507, ZAP_ATTRIBUTE_INDEX(159), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0507, ZAP_ATTRIBUTE_INDEX(160), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Media Input (server) */ \ { \ - 0x0508, ZAP_ATTRIBUTE_INDEX(162), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0508, ZAP_ATTRIBUTE_INDEX(163), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Low Power (server) */ \ { \ - 0x0509, ZAP_ATTRIBUTE_INDEX(163), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0509, ZAP_ATTRIBUTE_INDEX(164), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Keypad Input (server) */ \ { \ - 0x050A, ZAP_ATTRIBUTE_INDEX(164), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050A, ZAP_ATTRIBUTE_INDEX(165), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Content Launcher (server) */ \ { \ - 0x050C, ZAP_ATTRIBUTE_INDEX(167), 4, 258, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050C, ZAP_ATTRIBUTE_INDEX(168), 4, 258, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Launcher (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(171), \ + ZAP_ATTRIBUTE_INDEX(172), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 2, Cluster: On/Off (server) */ \ { 0x0008, \ - ZAP_ATTRIBUTE_INDEX(173), \ + ZAP_ATTRIBUTE_INDEX(174), \ 15, \ 23, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayLevelControlServer }, /* Endpoint: 2, Cluster: Level Control (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(188), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(189), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 2, Cluster: Descriptor (server) */ \ { \ - 0x050B, ZAP_ATTRIBUTE_INDEX(193), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050B, ZAP_ATTRIBUTE_INDEX(194), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 2, Cluster: Audio Output (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(196), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(197), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 3, Cluster: Descriptor (server) */ \ { \ - 0x0506, ZAP_ATTRIBUTE_INDEX(201), 9, 59, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0506, ZAP_ATTRIBUTE_INDEX(202), 9, 59, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 3, Cluster: Media Playback (server) */ \ { \ - 0x050A, ZAP_ATTRIBUTE_INDEX(210), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050A, ZAP_ATTRIBUTE_INDEX(211), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 3, Cluster: Content Launcher (server) */ \ { \ - 0x050D, ZAP_ATTRIBUTE_INDEX(213), 8, 108, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050D, ZAP_ATTRIBUTE_INDEX(214), 8, 108, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 3, Cluster: Application Basic (server) */ \ { \ - 0x050E, ZAP_ATTRIBUTE_INDEX(221), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050E, ZAP_ATTRIBUTE_INDEX(222), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 3, Cluster: Account Login (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(222), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(223), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 4, Cluster: Descriptor (server) */ \ { \ - 0x050A, ZAP_ATTRIBUTE_INDEX(227), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050A, ZAP_ATTRIBUTE_INDEX(228), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 4, Cluster: Content Launcher (server) */ \ { \ - 0x050D, ZAP_ATTRIBUTE_INDEX(230), 8, 108, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050D, ZAP_ATTRIBUTE_INDEX(231), 8, 108, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 4, Cluster: Application Basic (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(238), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(239), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 5, Cluster: Descriptor (server) */ \ { \ - 0x050D, ZAP_ATTRIBUTE_INDEX(243), 8, 108, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050D, ZAP_ATTRIBUTE_INDEX(244), 8, 108, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 5, Cluster: Application Basic (server) */ \ } @@ -1840,7 +1842,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 19, 2376 }, { ZAP_CLUSTER_INDEX(19), 10, 1645 }, { ZAP_CLUSTER_INDEX(29), 4, 283 }, \ + { ZAP_CLUSTER_INDEX(0), 19, 2377 }, { ZAP_CLUSTER_INDEX(19), 10, 1645 }, { ZAP_CLUSTER_INDEX(29), 4, 283 }, \ { ZAP_CLUSTER_INDEX(33), 5, 679 }, { ZAP_CLUSTER_INDEX(38), 3, 618 }, { ZAP_CLUSTER_INDEX(41), 2, 108 }, \ } @@ -1848,10 +1850,10 @@ #define ATTRIBUTE_LARGEST (401) // Total size of singleton attributes -#define ATTRIBUTE_SINGLETONS_SIZE (652) +#define ATTRIBUTE_SINGLETONS_SIZE (653) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (5709) +#define ATTRIBUTE_MAX_SIZE (5710) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (6) diff --git a/zzz_generated/tv-casting-app/zap-generated/attribute-size.cpp b/zzz_generated/tv-casting-app/zap-generated/attribute-size.cpp index 49f67d49b1a79f..ef0fa8ea7d36f0 100644 --- a/zzz_generated/tv-casting-app/zap-generated/attribute-size.cpp +++ b/zzz_generated/tv-casting-app/zap-generated/attribute-size.cpp @@ -531,6 +531,44 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo } break; } + case 0x0034: // Software Diagnostics Cluster + { + uint16_t entryOffset = kSizeLengthInBytes; + switch (am->attributeId) + { + case 0x0000: // ThreadMetrics + { + entryLength = 30; + if (((index - 1) * entryLength) > (am->size - entryLength)) + { + ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); + return 0; + } + entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); + // Struct _ThreadMetrics + _ThreadMetrics * entry = reinterpret_cast<_ThreadMetrics *>(write ? src : dest); + copyListMember(write ? dest : (uint8_t *) &entry->Id, write ? (uint8_t *) &entry->Id : src, write, &entryOffset, + sizeof(entry->Id)); // INT64U + ByteSpan NameSpanStorage(Uint8::from_const_char(entry->Name.data()), entry->Name.size()); // CHAR_STRING + ByteSpan * NameSpan = &NameSpanStorage; + if (CHIP_NO_ERROR != + (write ? WriteByteSpan(dest + entryOffset, 10, NameSpan) : ReadByteSpan(src + entryOffset, 10, NameSpan))) + { + ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); + return 0; + } + entryOffset = static_cast(entryOffset + 10); + copyListMember(write ? dest : (uint8_t *) &entry->StackFreeCurrent, write ? (uint8_t *) &entry->StackFreeCurrent : src, + write, &entryOffset, sizeof(entry->StackFreeCurrent)); // INT32U + copyListMember(write ? dest : (uint8_t *) &entry->StackFreeMinimum, write ? (uint8_t *) &entry->StackFreeMinimum : src, + write, &entryOffset, sizeof(entry->StackFreeMinimum)); // INT32U + copyListMember(write ? dest : (uint8_t *) &entry->StackSize, write ? (uint8_t *) &entry->StackSize : src, write, + &entryOffset, sizeof(entry->StackSize)); // INT32U + break; + } + } + break; + } case 0x0504: // TV Channel Cluster { uint16_t entryOffset = kSizeLengthInBytes; @@ -976,6 +1014,15 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut break; } break; + case 0x0034: // Software Diagnostics Cluster + switch (attributeId) + { + case 0x0000: // ThreadMetrics + // Struct _ThreadMetrics + entryLength = 30; + break; + } + break; case 0x0504: // TV Channel Cluster switch (attributeId) { diff --git a/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h b/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h index 53be74d0454a54..67edb498d9ad27 100644 --- a/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h +++ b/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h @@ -80,24 +80,24 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 543 - ProductLabel, */ \ + /* 544 - ProductLabel, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 608 - SerialNumber, */ \ + /* 609 - SerialNumber, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Commissioning (server), big-endian */ \ \ - /* 641 - Breadcrumb, */ \ + /* 642 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 649 - BasicCommissioningInfoList, */ \ + /* 650 - BasicCommissioningInfoList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -115,38 +115,38 @@ \ /* Endpoint: 0, Cluster: General Diagnostics (server), big-endian */ \ \ - /* 903 - UpTime, */ \ + /* 904 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 911 - TotalOperationalHours, */ \ + /* 912 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), big-endian */ \ \ - /* 915 - CurrentHeapFree, */ \ + /* 916 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 923 - CurrentHeapUsed, */ \ + /* 924 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 931 - CurrentHeapHighWatermark, */ \ + /* 932 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), big-endian */ \ \ - /* 939 - NetworkName, */ \ + /* 940 - NetworkName, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 956 - ExtendedPanId, */ \ + /* 957 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 964 - MeshLocalPrefix, */ \ + /* 965 - MeshLocalPrefix, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 982 - OverrunCount, */ \ + /* 983 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 990 - NeighborTableList, */ \ + /* 991 - NeighborTableList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -162,7 +162,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1244 - RouteTableList, */ \ + /* 1245 - RouteTableList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -178,184 +178,184 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1498 - PartitionId, */ \ + /* 1499 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1502 - TxTotalCount, */ \ + /* 1503 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1506 - TxUnicastCount, */ \ + /* 1507 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1510 - TxBroadcastCount, */ \ + /* 1511 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1514 - TxAckRequestedCount, */ \ + /* 1515 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1518 - TxAckedCount, */ \ + /* 1519 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1522 - TxNoAckRequestedCount, */ \ + /* 1523 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1526 - TxDataCount, */ \ + /* 1527 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1530 - TxDataPollCount, */ \ + /* 1531 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1534 - TxBeaconCount, */ \ + /* 1535 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1538 - TxBeaconRequestCount, */ \ + /* 1539 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1542 - TxOtherCount, */ \ + /* 1543 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1546 - TxRetryCount, */ \ + /* 1547 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1550 - TxDirectMaxRetryExpiryCount, */ \ + /* 1551 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1554 - TxIndirectMaxRetryExpiryCount, */ \ + /* 1555 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1558 - TxErrCcaCount, */ \ + /* 1559 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1562 - TxErrAbortCount, */ \ + /* 1563 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1566 - TxErrBusyChannelCount, */ \ + /* 1567 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1570 - RxTotalCount, */ \ + /* 1571 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1574 - RxUnicastCount, */ \ + /* 1575 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1578 - RxBroadcastCount, */ \ + /* 1579 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1582 - RxDataCount, */ \ + /* 1583 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1586 - RxDataPollCount, */ \ + /* 1587 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1590 - RxBeaconCount, */ \ + /* 1591 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1594 - RxBeaconRequestCount, */ \ + /* 1595 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1598 - RxOtherCount, */ \ + /* 1599 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1602 - RxAddressFilteredCount, */ \ + /* 1603 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1606 - RxDestAddrFilteredCount, */ \ + /* 1607 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1610 - RxDuplicatedCount, */ \ + /* 1611 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1614 - RxErrNoFrameCount, */ \ + /* 1615 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1618 - RxErrUnknownNeighborCount, */ \ + /* 1619 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1622 - RxErrInvalidSrcAddrCount, */ \ + /* 1623 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1626 - RxErrSecCount, */ \ + /* 1627 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1630 - RxErrFcsCount, */ \ + /* 1631 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1634 - RxErrOtherCount, */ \ + /* 1635 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1638 - ActiveTimestamp, */ \ + /* 1639 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1646 - PendingTimestamp, */ \ + /* 1647 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1654 - delay, */ \ + /* 1655 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1658 - SecurityPolicy, */ \ + /* 1659 - SecurityPolicy, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1664 - ChannelMask, */ \ + /* 1665 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1669 - OperationalDatasetComponents, */ \ + /* 1670 - OperationalDatasetComponents, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1683 - ActiveNetworkFaultsList, */ \ + /* 1684 - ActiveNetworkFaultsList, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), big-endian */ \ \ - /* 1687 - bssid, */ \ + /* 1688 - bssid, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1694 - BeaconLostCount, */ \ + /* 1695 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1698 - BeaconRxCount, */ \ + /* 1699 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1702 - PacketMulticastRxCount, */ \ + /* 1703 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1706 - PacketMulticastTxCount, */ \ + /* 1707 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1710 - PacketUnicastRxCount, */ \ + /* 1711 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1714 - PacketUnicastTxCount, */ \ + /* 1715 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1718 - CurrentMaxRate, */ \ + /* 1719 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1726 - OverrunCount, */ \ + /* 1727 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), big-endian */ \ \ - /* 1734 - PacketRxCount, */ \ + /* 1735 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1742 - PacketTxCount, */ \ + /* 1743 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1750 - TxErrCount, */ \ + /* 1751 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1758 - CollisionCount, */ \ + /* 1759 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1766 - OverrunCount, */ \ + /* 1767 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1774 - TimeSinceReset, */ \ + /* 1775 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Group Key Management (server), big-endian */ \ \ - /* 1782 - groups, */ \ + /* 1783 - groups, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -371,7 +371,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2036 - group keys, */ \ + /* 2037 - group keys, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -389,42 +389,42 @@ \ /* Endpoint: 1, Cluster: On/Off (server), big-endian */ \ \ - /* 2290 - FeatureMap, */ \ + /* 2291 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Bridged Device Basic (server), big-endian */ \ \ - /* 2294 - VendorName, */ \ + /* 2295 - VendorName, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2327 - ProductName, */ \ + /* 2328 - ProductName, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2360 - UserLabel, */ \ + /* 2361 - UserLabel, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2393 - HardwareVersionString, */ \ + /* 2394 - HardwareVersionString, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2458 - SoftwareVersion, */ \ + /* 2459 - SoftwareVersion, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2462 - SoftwareVersionString, */ \ + /* 2463 - SoftwareVersionString, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2527 - ManufacturingDate, */ \ + /* 2528 - ManufacturingDate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2544 - PartNumber, */ \ + /* 2545 - PartNumber, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -440,7 +440,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2799 - ProductURL, */ \ + /* 2800 - ProductURL, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -456,19 +456,19 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3054 - ProductLabel, */ \ + /* 3055 - ProductLabel, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3119 - SerialNumber, */ \ + /* 3120 - SerialNumber, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Fixed Label (server), big-endian */ \ \ - /* 3152 - label list, */ \ + /* 3153 - label list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -486,12 +486,12 @@ \ /* Endpoint: 1, Cluster: Thermostat (server), big-endian */ \ \ - /* 3406 - FeatureMap, */ \ + /* 3407 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x0B, \ \ /* Endpoint: 1, Cluster: Color Control (server), big-endian */ \ \ - /* 3410 - compensation text, */ \ + /* 3411 - compensation text, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -509,18 +509,18 @@ \ /* Endpoint: 1, Cluster: IAS Zone (server), big-endian */ \ \ - /* 3665 - IAS CIE address, */ \ + /* 3666 - IAS CIE address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Wake on LAN (server), big-endian */ \ \ - /* 3673 - wake on lan mac address, */ \ + /* 3674 - wake on lan mac address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: TV Channel (server), big-endian */ \ \ - /* 3706 - tv channel list, */ \ + /* 3707 - tv channel list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -536,17 +536,17 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3960 - tv channel lineup, */ \ + /* 3961 - tv channel lineup, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3993 - current tv channel, */ \ + /* 3994 - current tv channel, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Target Navigator (server), big-endian */ \ \ - /* 4026 - target navigator list, */ \ + /* 4027 - target navigator list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -564,7 +564,7 @@ \ /* Endpoint: 1, Cluster: Media Input (server), big-endian */ \ \ - /* 4280 - media input list, */ \ + /* 4281 - media input list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -582,7 +582,7 @@ \ /* Endpoint: 1, Cluster: Content Launcher (server), big-endian */ \ \ - /* 4534 - accepts header list, */ \ + /* 4535 - accepts header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -598,7 +598,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4788 - supported streaming types, */ \ + /* 4789 - supported streaming types, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -616,7 +616,7 @@ \ /* Endpoint: 1, Cluster: Audio Output (server), big-endian */ \ \ - /* 5042 - audio output list, */ \ + /* 5043 - audio output list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -634,7 +634,7 @@ \ /* Endpoint: 1, Cluster: Application Launcher (server), big-endian */ \ \ - /* 5296 - application launcher list, */ \ + /* 5297 - application launcher list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -652,45 +652,45 @@ \ /* Endpoint: 1, Cluster: Application Basic (server), big-endian */ \ \ - /* 5550 - vendor name, */ \ + /* 5551 - vendor name, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5583 - application name, */ \ + /* 5584 - application name, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5616 - application id, */ \ + /* 5617 - application id, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Test Cluster (server), big-endian */ \ \ - /* 5649 - bitmap32, */ \ + /* 5650 - bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 5653 - bitmap64, */ \ + /* 5654 - bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5661 - int32u, */ \ + /* 5662 - int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 5665 - int64u, */ \ + /* 5666 - int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5673 - int32s, */ \ + /* 5674 - int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 5677 - int64s, */ \ + /* 5678 - int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5685 - octet_string, */ \ + /* 5686 - octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5696 - list_int8u, */ \ + /* 5697 - list_int8u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5706 - list_octet_string, */ \ + /* 5707 - list_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -706,7 +706,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5960 - list_struct_octet_string, */ \ + /* 5961 - list_struct_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -722,7 +722,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 6214 - long_octet_string, */ \ + /* 6215 - long_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -835,24 +835,24 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 543 - ProductLabel, */ \ + /* 544 - ProductLabel, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 608 - SerialNumber, */ \ + /* 609 - SerialNumber, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Commissioning (server), little-endian */ \ \ - /* 641 - Breadcrumb, */ \ + /* 642 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 649 - BasicCommissioningInfoList, */ \ + /* 650 - BasicCommissioningInfoList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -870,38 +870,38 @@ \ /* Endpoint: 0, Cluster: General Diagnostics (server), little-endian */ \ \ - /* 903 - UpTime, */ \ + /* 904 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 911 - TotalOperationalHours, */ \ + /* 912 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), little-endian */ \ \ - /* 915 - CurrentHeapFree, */ \ + /* 916 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 923 - CurrentHeapUsed, */ \ + /* 924 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 931 - CurrentHeapHighWatermark, */ \ + /* 932 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), little-endian */ \ \ - /* 939 - NetworkName, */ \ + /* 940 - NetworkName, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 956 - ExtendedPanId, */ \ + /* 957 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 964 - MeshLocalPrefix, */ \ + /* 965 - MeshLocalPrefix, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 982 - OverrunCount, */ \ + /* 983 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 990 - NeighborTableList, */ \ + /* 991 - NeighborTableList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -917,7 +917,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1244 - RouteTableList, */ \ + /* 1245 - RouteTableList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -933,184 +933,184 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1498 - PartitionId, */ \ + /* 1499 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1502 - TxTotalCount, */ \ + /* 1503 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1506 - TxUnicastCount, */ \ + /* 1507 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1510 - TxBroadcastCount, */ \ + /* 1511 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1514 - TxAckRequestedCount, */ \ + /* 1515 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1518 - TxAckedCount, */ \ + /* 1519 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1522 - TxNoAckRequestedCount, */ \ + /* 1523 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1526 - TxDataCount, */ \ + /* 1527 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1530 - TxDataPollCount, */ \ + /* 1531 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1534 - TxBeaconCount, */ \ + /* 1535 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1538 - TxBeaconRequestCount, */ \ + /* 1539 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1542 - TxOtherCount, */ \ + /* 1543 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1546 - TxRetryCount, */ \ + /* 1547 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1550 - TxDirectMaxRetryExpiryCount, */ \ + /* 1551 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1554 - TxIndirectMaxRetryExpiryCount, */ \ + /* 1555 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1558 - TxErrCcaCount, */ \ + /* 1559 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1562 - TxErrAbortCount, */ \ + /* 1563 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1566 - TxErrBusyChannelCount, */ \ + /* 1567 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1570 - RxTotalCount, */ \ + /* 1571 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1574 - RxUnicastCount, */ \ + /* 1575 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1578 - RxBroadcastCount, */ \ + /* 1579 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1582 - RxDataCount, */ \ + /* 1583 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1586 - RxDataPollCount, */ \ + /* 1587 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1590 - RxBeaconCount, */ \ + /* 1591 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1594 - RxBeaconRequestCount, */ \ + /* 1595 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1598 - RxOtherCount, */ \ + /* 1599 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1602 - RxAddressFilteredCount, */ \ + /* 1603 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1606 - RxDestAddrFilteredCount, */ \ + /* 1607 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1610 - RxDuplicatedCount, */ \ + /* 1611 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1614 - RxErrNoFrameCount, */ \ + /* 1615 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1618 - RxErrUnknownNeighborCount, */ \ + /* 1619 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1622 - RxErrInvalidSrcAddrCount, */ \ + /* 1623 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1626 - RxErrSecCount, */ \ + /* 1627 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1630 - RxErrFcsCount, */ \ + /* 1631 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1634 - RxErrOtherCount, */ \ + /* 1635 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1638 - ActiveTimestamp, */ \ + /* 1639 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1646 - PendingTimestamp, */ \ + /* 1647 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1654 - delay, */ \ + /* 1655 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1658 - SecurityPolicy, */ \ + /* 1659 - SecurityPolicy, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1664 - ChannelMask, */ \ + /* 1665 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1669 - OperationalDatasetComponents, */ \ + /* 1670 - OperationalDatasetComponents, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1683 - ActiveNetworkFaultsList, */ \ + /* 1684 - ActiveNetworkFaultsList, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), little-endian */ \ \ - /* 1687 - bssid, */ \ + /* 1688 - bssid, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1694 - BeaconLostCount, */ \ + /* 1695 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1698 - BeaconRxCount, */ \ + /* 1699 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1702 - PacketMulticastRxCount, */ \ + /* 1703 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1706 - PacketMulticastTxCount, */ \ + /* 1707 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1710 - PacketUnicastRxCount, */ \ + /* 1711 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1714 - PacketUnicastTxCount, */ \ + /* 1715 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1718 - CurrentMaxRate, */ \ + /* 1719 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1726 - OverrunCount, */ \ + /* 1727 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), little-endian */ \ \ - /* 1734 - PacketRxCount, */ \ + /* 1735 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1742 - PacketTxCount, */ \ + /* 1743 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1750 - TxErrCount, */ \ + /* 1751 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1758 - CollisionCount, */ \ + /* 1759 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1766 - OverrunCount, */ \ + /* 1767 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1774 - TimeSinceReset, */ \ + /* 1775 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Group Key Management (server), little-endian */ \ \ - /* 1782 - groups, */ \ + /* 1783 - groups, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1126,7 +1126,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2036 - group keys, */ \ + /* 2037 - group keys, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1144,42 +1144,42 @@ \ /* Endpoint: 1, Cluster: On/Off (server), little-endian */ \ \ - /* 2290 - FeatureMap, */ \ + /* 2291 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Bridged Device Basic (server), little-endian */ \ \ - /* 2294 - VendorName, */ \ + /* 2295 - VendorName, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2327 - ProductName, */ \ + /* 2328 - ProductName, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2360 - UserLabel, */ \ + /* 2361 - UserLabel, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2393 - HardwareVersionString, */ \ + /* 2394 - HardwareVersionString, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2458 - SoftwareVersion, */ \ + /* 2459 - SoftwareVersion, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2462 - SoftwareVersionString, */ \ + /* 2463 - SoftwareVersionString, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2527 - ManufacturingDate, */ \ + /* 2528 - ManufacturingDate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2544 - PartNumber, */ \ + /* 2545 - PartNumber, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1195,7 +1195,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2799 - ProductURL, */ \ + /* 2800 - ProductURL, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1211,19 +1211,19 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3054 - ProductLabel, */ \ + /* 3055 - ProductLabel, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3119 - SerialNumber, */ \ + /* 3120 - SerialNumber, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Fixed Label (server), little-endian */ \ \ - /* 3152 - label list, */ \ + /* 3153 - label list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1241,12 +1241,12 @@ \ /* Endpoint: 1, Cluster: Thermostat (server), little-endian */ \ \ - /* 3406 - FeatureMap, */ \ + /* 3407 - FeatureMap, */ \ 0x0B, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Color Control (server), little-endian */ \ \ - /* 3410 - compensation text, */ \ + /* 3411 - compensation text, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1264,18 +1264,18 @@ \ /* Endpoint: 1, Cluster: IAS Zone (server), little-endian */ \ \ - /* 3665 - IAS CIE address, */ \ + /* 3666 - IAS CIE address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Wake on LAN (server), little-endian */ \ \ - /* 3673 - wake on lan mac address, */ \ + /* 3674 - wake on lan mac address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: TV Channel (server), little-endian */ \ \ - /* 3706 - tv channel list, */ \ + /* 3707 - tv channel list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1291,17 +1291,17 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3960 - tv channel lineup, */ \ + /* 3961 - tv channel lineup, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3993 - current tv channel, */ \ + /* 3994 - current tv channel, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Target Navigator (server), little-endian */ \ \ - /* 4026 - target navigator list, */ \ + /* 4027 - target navigator list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1319,7 +1319,7 @@ \ /* Endpoint: 1, Cluster: Media Input (server), little-endian */ \ \ - /* 4280 - media input list, */ \ + /* 4281 - media input list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1337,7 +1337,7 @@ \ /* Endpoint: 1, Cluster: Content Launcher (server), little-endian */ \ \ - /* 4534 - accepts header list, */ \ + /* 4535 - accepts header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1353,7 +1353,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4788 - supported streaming types, */ \ + /* 4789 - supported streaming types, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1371,7 +1371,7 @@ \ /* Endpoint: 1, Cluster: Audio Output (server), little-endian */ \ \ - /* 5042 - audio output list, */ \ + /* 5043 - audio output list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1389,7 +1389,7 @@ \ /* Endpoint: 1, Cluster: Application Launcher (server), little-endian */ \ \ - /* 5296 - application launcher list, */ \ + /* 5297 - application launcher list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1407,45 +1407,45 @@ \ /* Endpoint: 1, Cluster: Application Basic (server), little-endian */ \ \ - /* 5550 - vendor name, */ \ + /* 5551 - vendor name, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5583 - application name, */ \ + /* 5584 - application name, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5616 - application id, */ \ + /* 5617 - application id, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Test Cluster (server), little-endian */ \ \ - /* 5649 - bitmap32, */ \ + /* 5650 - bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 5653 - bitmap64, */ \ + /* 5654 - bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5661 - int32u, */ \ + /* 5662 - int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 5665 - int64u, */ \ + /* 5666 - int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5673 - int32s, */ \ + /* 5674 - int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 5677 - int64s, */ \ + /* 5678 - int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5685 - octet_string, */ \ + /* 5686 - octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5696 - list_int8u, */ \ + /* 5697 - list_int8u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5706 - list_octet_string, */ \ + /* 5707 - list_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1461,7 +1461,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5960 - list_struct_octet_string, */ \ + /* 5961 - list_struct_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1477,7 +1477,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 6214 - long_octet_string, */ \ + /* 6215 - long_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1563,7 +1563,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 375 +#define GENERATED_ATTRIBUTE_COUNT 376 #define GENERATED_ATTRIBUTES \ { \ \ @@ -1593,10 +1593,11 @@ ZAP_LONG_DEFAULTS_INDEX(171) }, /* SoftwareVersionString */ \ { 0x000B, ZAP_TYPE(CHAR_STRING), 17, ZAP_ATTRIBUTE_MASK(SINGLETON), \ ZAP_LONG_DEFAULTS_INDEX(236) }, /* ManufacturingDate */ \ - { 0x000C, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(253) }, /* PartNumber */ \ - { 0x000D, ZAP_TYPE(CHAR_STRING), 257, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(286) }, /* ProductURL */ \ - { 0x000E, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(543) }, /* ProductLabel */ \ - { 0x000F, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(608) }, /* SerialNumber */ \ + { 0x000C, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(253) }, /* PartNumber */ \ + { 0x000D, ZAP_TYPE(LONG_CHAR_STRING), 258, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_LONG_DEFAULTS_INDEX(286) }, /* ProductURL */ \ + { 0x000E, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(544) }, /* ProductLabel */ \ + { 0x000F, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(609) }, /* SerialNumber */ \ { 0x0010, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* LocalConfigDisabled */ \ { 0x0011, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(1) }, /* Reachable */ \ @@ -1606,8 +1607,8 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x0000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(641) }, /* Breadcrumb */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(649) }, /* BasicCommissioningInfoList */ \ + { 0x0000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(642) }, /* Breadcrumb */ \ + { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(650) }, /* BasicCommissioningInfoList */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ @@ -1616,28 +1617,29 @@ /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NetworkInterfaces */ \ { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* RebootCount */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(903) }, /* UpTime */ \ - { 0x0003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(911) }, /* TotalOperationalHours */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(904) }, /* UpTime */ \ + { 0x0003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(912) }, /* TotalOperationalHours */ \ { 0x0004, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BootReasons */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(915) }, /* CurrentHeapFree */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(923) }, /* CurrentHeapUsed */ \ - { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(931) }, /* CurrentHeapHighWatermark */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ThreadMetrics */ \ + { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(916) }, /* CurrentHeapFree */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(924) }, /* CurrentHeapUsed */ \ + { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(932) }, /* CurrentHeapHighWatermark */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ - { 0x0002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(939) }, /* NetworkName */ \ + { 0x0002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(940) }, /* NetworkName */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ - { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(956) }, /* ExtendedPanId */ \ - { 0x0005, ZAP_TYPE(OCTET_STRING), 18, 0, ZAP_LONG_DEFAULTS_INDEX(964) }, /* MeshLocalPrefix */ \ - { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(982) }, /* OverrunCount */ \ - { 0x0007, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(990) }, /* NeighborTableList */ \ - { 0x0008, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1244) }, /* RouteTableList */ \ - { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1498) }, /* PartitionId */ \ + { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(957) }, /* ExtendedPanId */ \ + { 0x0005, ZAP_TYPE(OCTET_STRING), 18, 0, ZAP_LONG_DEFAULTS_INDEX(965) }, /* MeshLocalPrefix */ \ + { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(983) }, /* OverrunCount */ \ + { 0x0007, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(991) }, /* NeighborTableList */ \ + { 0x0008, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1245) }, /* RouteTableList */ \ + { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1499) }, /* PartitionId */ \ { 0x000A, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* weighting */ \ { 0x000B, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* DataVersion */ \ { 0x000C, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* StableDataVersion */ \ @@ -1650,75 +1652,75 @@ { 0x0013, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PartitionIdChangeCount */ \ { 0x0014, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* BetterPartitionAttachAttemptCount */ \ { 0x0015, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ParentChangeCount */ \ - { 0x0016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1502) }, /* TxTotalCount */ \ - { 0x0017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1506) }, /* TxUnicastCount */ \ - { 0x0018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1510) }, /* TxBroadcastCount */ \ - { 0x0019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1514) }, /* TxAckRequestedCount */ \ - { 0x001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1518) }, /* TxAckedCount */ \ - { 0x001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1522) }, /* TxNoAckRequestedCount */ \ - { 0x001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1526) }, /* TxDataCount */ \ - { 0x001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1530) }, /* TxDataPollCount */ \ - { 0x001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1534) }, /* TxBeaconCount */ \ - { 0x001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1538) }, /* TxBeaconRequestCount */ \ - { 0x0020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1542) }, /* TxOtherCount */ \ - { 0x0021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1546) }, /* TxRetryCount */ \ - { 0x0022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1550) }, /* TxDirectMaxRetryExpiryCount */ \ - { 0x0023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1554) }, /* TxIndirectMaxRetryExpiryCount */ \ - { 0x0024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1558) }, /* TxErrCcaCount */ \ - { 0x0025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1562) }, /* TxErrAbortCount */ \ - { 0x0026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1566) }, /* TxErrBusyChannelCount */ \ - { 0x0027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1570) }, /* RxTotalCount */ \ - { 0x0028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1574) }, /* RxUnicastCount */ \ - { 0x0029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1578) }, /* RxBroadcastCount */ \ - { 0x002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1582) }, /* RxDataCount */ \ - { 0x002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1586) }, /* RxDataPollCount */ \ - { 0x002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1590) }, /* RxBeaconCount */ \ - { 0x002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1594) }, /* RxBeaconRequestCount */ \ - { 0x002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1598) }, /* RxOtherCount */ \ - { 0x002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1602) }, /* RxAddressFilteredCount */ \ - { 0x0030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1606) }, /* RxDestAddrFilteredCount */ \ - { 0x0031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1610) }, /* RxDuplicatedCount */ \ - { 0x0032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1614) }, /* RxErrNoFrameCount */ \ - { 0x0033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1618) }, /* RxErrUnknownNeighborCount */ \ - { 0x0034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1622) }, /* RxErrInvalidSrcAddrCount */ \ - { 0x0035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1626) }, /* RxErrSecCount */ \ - { 0x0036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1630) }, /* RxErrFcsCount */ \ - { 0x0037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1634) }, /* RxErrOtherCount */ \ - { 0x0038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1638) }, /* ActiveTimestamp */ \ - { 0x0039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1646) }, /* PendingTimestamp */ \ - { 0x003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1654) }, /* delay */ \ - { 0x003B, ZAP_TYPE(ARRAY), 6, 0, ZAP_LONG_DEFAULTS_INDEX(1658) }, /* SecurityPolicy */ \ - { 0x003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(1664) }, /* ChannelMask */ \ - { 0x003D, ZAP_TYPE(ARRAY), 14, 0, ZAP_LONG_DEFAULTS_INDEX(1669) }, /* OperationalDatasetComponents */ \ - { 0x003E, ZAP_TYPE(ARRAY), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1683) }, /* ActiveNetworkFaultsList */ \ + { 0x0016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1503) }, /* TxTotalCount */ \ + { 0x0017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1507) }, /* TxUnicastCount */ \ + { 0x0018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1511) }, /* TxBroadcastCount */ \ + { 0x0019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1515) }, /* TxAckRequestedCount */ \ + { 0x001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1519) }, /* TxAckedCount */ \ + { 0x001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1523) }, /* TxNoAckRequestedCount */ \ + { 0x001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1527) }, /* TxDataCount */ \ + { 0x001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1531) }, /* TxDataPollCount */ \ + { 0x001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1535) }, /* TxBeaconCount */ \ + { 0x001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1539) }, /* TxBeaconRequestCount */ \ + { 0x0020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1543) }, /* TxOtherCount */ \ + { 0x0021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1547) }, /* TxRetryCount */ \ + { 0x0022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1551) }, /* TxDirectMaxRetryExpiryCount */ \ + { 0x0023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1555) }, /* TxIndirectMaxRetryExpiryCount */ \ + { 0x0024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1559) }, /* TxErrCcaCount */ \ + { 0x0025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1563) }, /* TxErrAbortCount */ \ + { 0x0026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1567) }, /* TxErrBusyChannelCount */ \ + { 0x0027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1571) }, /* RxTotalCount */ \ + { 0x0028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1575) }, /* RxUnicastCount */ \ + { 0x0029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1579) }, /* RxBroadcastCount */ \ + { 0x002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1583) }, /* RxDataCount */ \ + { 0x002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1587) }, /* RxDataPollCount */ \ + { 0x002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1591) }, /* RxBeaconCount */ \ + { 0x002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1595) }, /* RxBeaconRequestCount */ \ + { 0x002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1599) }, /* RxOtherCount */ \ + { 0x002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1603) }, /* RxAddressFilteredCount */ \ + { 0x0030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1607) }, /* RxDestAddrFilteredCount */ \ + { 0x0031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1611) }, /* RxDuplicatedCount */ \ + { 0x0032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1615) }, /* RxErrNoFrameCount */ \ + { 0x0033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1619) }, /* RxErrUnknownNeighborCount */ \ + { 0x0034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1623) }, /* RxErrInvalidSrcAddrCount */ \ + { 0x0035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1627) }, /* RxErrSecCount */ \ + { 0x0036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1631) }, /* RxErrFcsCount */ \ + { 0x0037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1635) }, /* RxErrOtherCount */ \ + { 0x0038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1639) }, /* ActiveTimestamp */ \ + { 0x0039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1647) }, /* PendingTimestamp */ \ + { 0x003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1655) }, /* delay */ \ + { 0x003B, ZAP_TYPE(ARRAY), 6, 0, ZAP_LONG_DEFAULTS_INDEX(1659) }, /* SecurityPolicy */ \ + { 0x003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(1665) }, /* ChannelMask */ \ + { 0x003D, ZAP_TYPE(ARRAY), 14, 0, ZAP_LONG_DEFAULTS_INDEX(1670) }, /* OperationalDatasetComponents */ \ + { 0x003E, ZAP_TYPE(ARRAY), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1684) }, /* ActiveNetworkFaultsList */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ - { 0x0000, ZAP_TYPE(OCTET_STRING), 7, 0, ZAP_LONG_DEFAULTS_INDEX(1687) }, /* bssid */ \ + { 0x0000, ZAP_TYPE(OCTET_STRING), 7, 0, ZAP_LONG_DEFAULTS_INDEX(1688) }, /* bssid */ \ { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SecurityType */ \ { 0x0002, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* WiFiVersion */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ChannelNumber */ \ { 0x0004, ZAP_TYPE(INT8S), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Rssi */ \ - { 0x0005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1694) }, /* BeaconLostCount */ \ - { 0x0006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1698) }, /* BeaconRxCount */ \ - { 0x0007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1702) }, /* PacketMulticastRxCount */ \ - { 0x0008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1706) }, /* PacketMulticastTxCount */ \ - { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1710) }, /* PacketUnicastRxCount */ \ - { 0x000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1714) }, /* PacketUnicastTxCount */ \ - { 0x000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1718) }, /* CurrentMaxRate */ \ - { 0x000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1726) }, /* OverrunCount */ \ + { 0x0005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1695) }, /* BeaconLostCount */ \ + { 0x0006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1699) }, /* BeaconRxCount */ \ + { 0x0007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1703) }, /* PacketMulticastRxCount */ \ + { 0x0008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1707) }, /* PacketMulticastTxCount */ \ + { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1711) }, /* PacketUnicastRxCount */ \ + { 0x000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1715) }, /* PacketUnicastTxCount */ \ + { 0x000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1719) }, /* CurrentMaxRate */ \ + { 0x000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1727) }, /* OverrunCount */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* PHYRate */ \ { 0x0001, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* FullDuplex */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1734) }, /* PacketRxCount */ \ - { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1742) }, /* PacketTxCount */ \ - { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1750) }, /* TxErrCount */ \ - { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1758) }, /* CollisionCount */ \ - { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1766) }, /* OverrunCount */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1735) }, /* PacketRxCount */ \ + { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1743) }, /* PacketTxCount */ \ + { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1751) }, /* TxErrCount */ \ + { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1759) }, /* CollisionCount */ \ + { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1767) }, /* OverrunCount */ \ { 0x0007, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* CarrierDetect */ \ - { 0x0008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1774) }, /* TimeSinceReset */ \ + { 0x0008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1775) }, /* TimeSinceReset */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ @@ -1744,8 +1746,8 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Group Key Management (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1782) }, /* groups */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2036) }, /* group keys */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1783) }, /* groups */ \ + { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2037) }, /* group keys */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Identify (server) */ \ @@ -1770,7 +1772,7 @@ { 0x4001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OnTime */ \ { 0x4002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OffWaitTime */ \ { 0x4003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* StartUpOnOff */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(2290) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(2291) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Level Control (server) */ \ @@ -1806,25 +1808,25 @@ ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Bridged Device Basic (server) */ \ - { 0x0001, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(2294) }, /* VendorName */ \ + { 0x0001, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(2295) }, /* VendorName */ \ { 0x0002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* VendorID */ \ - { 0x0003, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(2327) }, /* ProductName */ \ + { 0x0003, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(2328) }, /* ProductName */ \ { 0x0005, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(2360) }, /* UserLabel */ \ + ZAP_LONG_DEFAULTS_INDEX(2361) }, /* UserLabel */ \ { 0x0007, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(0x00) }, /* HardwareVersion */ \ { 0x0008, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), \ - ZAP_LONG_DEFAULTS_INDEX(2393) }, /* HardwareVersionString */ \ - { 0x0009, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(2458) }, /* SoftwareVersion */ \ + ZAP_LONG_DEFAULTS_INDEX(2394) }, /* HardwareVersionString */ \ + { 0x0009, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(2459) }, /* SoftwareVersion */ \ { 0x000A, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), \ - ZAP_LONG_DEFAULTS_INDEX(2462) }, /* SoftwareVersionString */ \ + ZAP_LONG_DEFAULTS_INDEX(2463) }, /* SoftwareVersionString */ \ { 0x000B, ZAP_TYPE(CHAR_STRING), 17, ZAP_ATTRIBUTE_MASK(SINGLETON), \ - ZAP_LONG_DEFAULTS_INDEX(2527) }, /* ManufacturingDate */ \ - { 0x000C, ZAP_TYPE(CHAR_STRING), 255, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(2544) }, /* PartNumber */ \ - { 0x000D, ZAP_TYPE(CHAR_STRING), 255, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(2799) }, /* ProductURL */ \ + ZAP_LONG_DEFAULTS_INDEX(2528) }, /* ManufacturingDate */ \ + { 0x000C, ZAP_TYPE(CHAR_STRING), 255, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(2545) }, /* PartNumber */ \ + { 0x000D, ZAP_TYPE(CHAR_STRING), 255, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(2800) }, /* ProductURL */ \ { 0x000E, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), \ - ZAP_LONG_DEFAULTS_INDEX(3054) }, /* ProductLabel */ \ + ZAP_LONG_DEFAULTS_INDEX(3055) }, /* ProductLabel */ \ { 0x000F, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), \ - ZAP_LONG_DEFAULTS_INDEX(3119) }, /* SerialNumber */ \ + ZAP_LONG_DEFAULTS_INDEX(3120) }, /* SerialNumber */ \ { 0x0011, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(0x00) }, /* Reachable */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ @@ -1834,7 +1836,7 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Fixed Label (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(3152) }, /* label list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(3153) }, /* label list */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Door Lock (server) */ \ @@ -1883,7 +1885,7 @@ { 0x0020, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* start of week */ \ { 0x0021, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(7) }, /* number of weekly transitions */ \ { 0x0022, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(4) }, /* number of daily transitions */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3406) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3407) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Color Control (server) */ \ @@ -1893,7 +1895,7 @@ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x616B) }, /* current x */ \ { 0x0004, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x607D) }, /* current y */ \ { 0x0005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* drift compensation */ \ - { 0x0006, ZAP_TYPE(CHAR_STRING), 255, 0, ZAP_LONG_DEFAULTS_INDEX(3410) }, /* compensation text */ \ + { 0x0006, ZAP_TYPE(CHAR_STRING), 255, 0, ZAP_LONG_DEFAULTS_INDEX(3411) }, /* compensation text */ \ { 0x0007, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x00FA) }, /* color temperature */ \ { 0x0008, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* color mode */ \ { 0x000F, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* color control options */ \ @@ -1968,53 +1970,53 @@ { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* zone state */ \ { 0x0001, ZAP_TYPE(ENUM16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* zone type */ \ { 0x0002, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* zone status */ \ - { 0x0010, ZAP_TYPE(NODE_ID), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3665) }, /* IAS CIE address */ \ + { 0x0010, ZAP_TYPE(NODE_ID), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3666) }, /* IAS CIE address */ \ { 0x0011, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xff) }, /* Zone ID */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ - { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(3673) }, /* wake on lan mac address */ \ + { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(3674) }, /* wake on lan mac address */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: TV Channel (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(3706) }, /* tv channel list */ \ - { 0x0001, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(3960) }, /* tv channel lineup */ \ - { 0x0002, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(3993) }, /* current tv channel */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(3707) }, /* tv channel list */ \ + { 0x0001, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(3961) }, /* tv channel lineup */ \ + { 0x0002, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(3994) }, /* current tv channel */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Target Navigator (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(4026) }, /* target navigator list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(4027) }, /* target navigator list */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Media Playback (server) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Media Input (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(4280) }, /* media input list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(4281) }, /* media input list */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Keypad Input (server) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Content Launcher (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(4534) }, /* accepts header list */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(4788) }, /* supported streaming types */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(4535) }, /* accepts header list */ \ + { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(4789) }, /* supported streaming types */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Audio Output (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(5042) }, /* audio output list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(5043) }, /* audio output list */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Application Launcher (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(5296) }, /* application launcher list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(5297) }, /* application launcher list */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Application Basic (server) */ \ - { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(5550) }, /* vendor name */ \ + { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(5551) }, /* vendor name */ \ { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* vendor id */ \ - { 0x0002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(5583) }, /* application name */ \ + { 0x0002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(5584) }, /* application name */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* product id */ \ - { 0x0005, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(5616) }, /* application id */ \ + { 0x0005, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(5617) }, /* application id */ \ { 0x0006, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* catalog vendor id */ \ { 0x0007, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* application status */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ @@ -2026,25 +2028,25 @@ { 0x0000, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(false) }, /* boolean */ \ { 0x0001, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap8 */ \ { 0x0002, ZAP_TYPE(BITMAP16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap16 */ \ - { 0x0003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(5649) }, /* bitmap32 */ \ - { 0x0004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(5653) }, /* bitmap64 */ \ + { 0x0003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(5650) }, /* bitmap32 */ \ + { 0x0004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(5654) }, /* bitmap64 */ \ { 0x0005, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8u */ \ { 0x0006, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16u */ \ - { 0x0008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(5661) }, /* int32u */ \ - { 0x000C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(5665) }, /* int64u */ \ + { 0x0008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(5662) }, /* int32u */ \ + { 0x000C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(5666) }, /* int64u */ \ { 0x000D, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8s */ \ { 0x000E, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16s */ \ - { 0x0010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(5673) }, /* int32s */ \ - { 0x0014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(5677) }, /* int64s */ \ + { 0x0010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(5674) }, /* int32s */ \ + { 0x0014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(5678) }, /* int64s */ \ { 0x0015, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum8 */ \ { 0x0016, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum16 */ \ { 0x0019, ZAP_TYPE(OCTET_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(5685) }, /* octet_string */ \ - { 0x001A, ZAP_TYPE(ARRAY), 10, 0, ZAP_LONG_DEFAULTS_INDEX(5696) }, /* list_int8u */ \ - { 0x001B, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(5706) }, /* list_octet_string */ \ - { 0x001C, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(5960) }, /* list_struct_octet_string */ \ + ZAP_LONG_DEFAULTS_INDEX(5686) }, /* octet_string */ \ + { 0x001A, ZAP_TYPE(ARRAY), 10, 0, ZAP_LONG_DEFAULTS_INDEX(5697) }, /* list_int8u */ \ + { 0x001B, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(5707) }, /* list_octet_string */ \ + { 0x001C, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(5961) }, /* list_struct_octet_string */ \ { 0x001D, ZAP_TYPE(LONG_OCTET_STRING), 1002, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(6214) }, /* long_octet_string */ \ + ZAP_LONG_DEFAULTS_INDEX(6215) }, /* long_octet_string */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Binding (server) */ \ @@ -2115,7 +2117,7 @@ { 0x0028, \ ZAP_ATTRIBUTE_INDEX(5), \ 19, \ - 653, \ + 654, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayBasicServer }, /* Endpoint: 0, Cluster: Basic (server) */ \ { \ @@ -2134,167 +2136,167 @@ 0x0033, ZAP_ATTRIBUTE_INDEX(29), 6, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { \ - 0x0034, ZAP_ATTRIBUTE_INDEX(35), 4, 26, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0034, ZAP_ATTRIBUTE_INDEX(35), 5, 26, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(39), 64, 774, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0035, ZAP_ATTRIBUTE_INDEX(40), 64, 774, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { \ - 0x0036, ZAP_ATTRIBUTE_INDEX(103), 14, 54, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0036, ZAP_ATTRIBUTE_INDEX(104), 14, 54, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ { \ - 0x0037, ZAP_ATTRIBUTE_INDEX(117), 10, 53, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0037, ZAP_ATTRIBUTE_INDEX(118), 10, 53, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { \ - 0x003C, ZAP_ATTRIBUTE_INDEX(127), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003C, ZAP_ATTRIBUTE_INDEX(128), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { \ - 0x003E, ZAP_ATTRIBUTE_INDEX(128), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003E, ZAP_ATTRIBUTE_INDEX(129), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x0405, ZAP_ATTRIBUTE_INDEX(134), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0405, ZAP_ATTRIBUTE_INDEX(135), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ { \ - 0xF000, ZAP_ATTRIBUTE_INDEX(138), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0xF000, ZAP_ATTRIBUTE_INDEX(139), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Binding (server) */ \ { \ - 0xF004, ZAP_ATTRIBUTE_INDEX(139), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0xF004, ZAP_ATTRIBUTE_INDEX(140), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Group Key Management (server) */ \ { 0x0003, \ - ZAP_ATTRIBUTE_INDEX(142), \ + ZAP_ATTRIBUTE_INDEX(143), \ 2, \ 4, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayIdentifyServer }, /* Endpoint: 1, Cluster: Identify (server) */ \ { 0x0004, \ - ZAP_ATTRIBUTE_INDEX(144), \ + ZAP_ATTRIBUTE_INDEX(145), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayGroupsServer }, /* Endpoint: 1, Cluster: Groups (server) */ \ { 0x0005, \ - ZAP_ATTRIBUTE_INDEX(146), \ + ZAP_ATTRIBUTE_INDEX(147), \ 6, \ 8, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayScenesServer }, /* Endpoint: 1, Cluster: Scenes (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(152), \ + ZAP_ATTRIBUTE_INDEX(153), \ 7, \ 13, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ { 0x0008, \ - ZAP_ATTRIBUTE_INDEX(159), \ + ZAP_ATTRIBUTE_INDEX(160), \ 15, \ 23, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \ { \ - 0x000F, ZAP_ATTRIBUTE_INDEX(174), 4, 5, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x000F, ZAP_ATTRIBUTE_INDEX(175), 4, 5, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Binary Input (Basic) (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(178), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(179), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ { \ - 0x0039, ZAP_ATTRIBUTE_INDEX(183), 15, 865, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0039, ZAP_ATTRIBUTE_INDEX(184), 15, 865, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Bridged Device Basic (server) */ \ { \ - 0x003B, ZAP_ATTRIBUTE_INDEX(198), 3, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003B, ZAP_ATTRIBUTE_INDEX(199), 3, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Switch (server) */ \ { \ - 0x0040, ZAP_ATTRIBUTE_INDEX(201), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0040, ZAP_ATTRIBUTE_INDEX(202), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Fixed Label (server) */ \ { 0x0101, \ - ZAP_ATTRIBUTE_INDEX(203), \ + ZAP_ATTRIBUTE_INDEX(204), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayDoorLockServer }, /* Endpoint: 1, Cluster: Door Lock (server) */ \ { \ - 0x0102, ZAP_ATTRIBUTE_INDEX(207), 19, 31, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0102, ZAP_ATTRIBUTE_INDEX(208), 19, 31, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Window Covering (server) */ \ { \ - 0x0103, ZAP_ATTRIBUTE_INDEX(226), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0103, ZAP_ATTRIBUTE_INDEX(227), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Barrier Control (server) */ \ { \ - 0x0201, ZAP_ATTRIBUTE_INDEX(231), 10, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0201, ZAP_ATTRIBUTE_INDEX(232), 10, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Thermostat (server) */ \ { 0x0300, \ - ZAP_ATTRIBUTE_INDEX(241), \ + ZAP_ATTRIBUTE_INDEX(242), \ 51, \ 337, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayColorControlServer }, /* Endpoint: 1, Cluster: Color Control (server) */ \ { \ - 0x0402, ZAP_ATTRIBUTE_INDEX(292), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0402, ZAP_ATTRIBUTE_INDEX(293), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ { \ - 0x0403, ZAP_ATTRIBUTE_INDEX(296), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0403, ZAP_ATTRIBUTE_INDEX(297), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ { \ - 0x0404, ZAP_ATTRIBUTE_INDEX(300), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0404, ZAP_ATTRIBUTE_INDEX(301), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ { \ - 0x0405, ZAP_ATTRIBUTE_INDEX(304), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0405, ZAP_ATTRIBUTE_INDEX(305), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ { 0x0500, \ - ZAP_ATTRIBUTE_INDEX(308), \ + ZAP_ATTRIBUTE_INDEX(309), \ 6, \ 16, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | \ ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ chipFuncArrayIasZoneServer }, /* Endpoint: 1, Cluster: IAS Zone (server) */ \ { \ - 0x0503, ZAP_ATTRIBUTE_INDEX(314), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0503, ZAP_ATTRIBUTE_INDEX(315), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ { \ - 0x0504, ZAP_ATTRIBUTE_INDEX(316), 4, 322, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0504, ZAP_ATTRIBUTE_INDEX(317), 4, 322, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: TV Channel (server) */ \ { \ - 0x0505, ZAP_ATTRIBUTE_INDEX(320), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0505, ZAP_ATTRIBUTE_INDEX(321), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Target Navigator (server) */ \ { \ - 0x0506, ZAP_ATTRIBUTE_INDEX(322), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0506, ZAP_ATTRIBUTE_INDEX(323), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Media Playback (server) */ \ { \ - 0x0507, ZAP_ATTRIBUTE_INDEX(323), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0507, ZAP_ATTRIBUTE_INDEX(324), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Media Input (server) */ \ { \ - 0x0509, ZAP_ATTRIBUTE_INDEX(325), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0509, ZAP_ATTRIBUTE_INDEX(326), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Keypad Input (server) */ \ { \ - 0x050A, ZAP_ATTRIBUTE_INDEX(326), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050A, ZAP_ATTRIBUTE_INDEX(327), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Content Launcher (server) */ \ { \ - 0x050B, ZAP_ATTRIBUTE_INDEX(329), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050B, ZAP_ATTRIBUTE_INDEX(330), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Audio Output (server) */ \ { \ - 0x050C, ZAP_ATTRIBUTE_INDEX(331), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050C, ZAP_ATTRIBUTE_INDEX(332), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Launcher (server) */ \ { \ - 0x050D, ZAP_ATTRIBUTE_INDEX(333), 8, 108, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050D, ZAP_ATTRIBUTE_INDEX(334), 8, 108, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Basic (server) */ \ { \ - 0x050E, ZAP_ATTRIBUTE_INDEX(341), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050E, ZAP_ATTRIBUTE_INDEX(342), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Account Login (server) */ \ { \ - 0x050F, ZAP_ATTRIBUTE_INDEX(342), 21, 1582, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050F, ZAP_ATTRIBUTE_INDEX(343), 21, 1582, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Test Cluster (server) */ \ { \ - 0xF000, ZAP_ATTRIBUTE_INDEX(363), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0xF000, ZAP_ATTRIBUTE_INDEX(364), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Binding (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(364), \ + ZAP_ATTRIBUTE_INDEX(365), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 2, Cluster: On/Off (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(366), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(367), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 2, Cluster: Descriptor (server) */ \ { 0x0406, \ - ZAP_ATTRIBUTE_INDEX(371), \ + ZAP_ATTRIBUTE_INDEX(372), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2306,17 +2308,17 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 16, 2371 }, { ZAP_CLUSTER_INDEX(16), 33, 5215 }, { ZAP_CLUSTER_INDEX(49), 3, 8 }, \ + { ZAP_CLUSTER_INDEX(0), 16, 2372 }, { ZAP_CLUSTER_INDEX(16), 33, 5215 }, { ZAP_CLUSTER_INDEX(49), 3, 8 }, \ } // Largest attribute size is needed for various buffers #define ATTRIBUTE_LARGEST (1003) // Total size of singleton attributes -#define ATTRIBUTE_SINGLETONS_SIZE (1518) +#define ATTRIBUTE_SINGLETONS_SIZE (1519) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (7594) +#define ATTRIBUTE_MAX_SIZE (7595) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (3) diff --git a/zzz_generated/window-app/zap-generated/attribute-size.cpp b/zzz_generated/window-app/zap-generated/attribute-size.cpp index ff942e42785082..9a1d2219a9e984 100644 --- a/zzz_generated/window-app/zap-generated/attribute-size.cpp +++ b/zzz_generated/window-app/zap-generated/attribute-size.cpp @@ -287,6 +287,44 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo } break; } + case 0x0034: // Software Diagnostics Cluster + { + uint16_t entryOffset = kSizeLengthInBytes; + switch (am->attributeId) + { + case 0x0000: // ThreadMetrics + { + entryLength = 30; + if (((index - 1) * entryLength) > (am->size - entryLength)) + { + ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); + return 0; + } + entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); + // Struct _ThreadMetrics + _ThreadMetrics * entry = reinterpret_cast<_ThreadMetrics *>(write ? src : dest); + copyListMember(write ? dest : (uint8_t *) &entry->Id, write ? (uint8_t *) &entry->Id : src, write, &entryOffset, + sizeof(entry->Id)); // INT64U + ByteSpan NameSpanStorage(Uint8::from_const_char(entry->Name.data()), entry->Name.size()); // CHAR_STRING + ByteSpan * NameSpan = &NameSpanStorage; + if (CHIP_NO_ERROR != + (write ? WriteByteSpan(dest + entryOffset, 10, NameSpan) : ReadByteSpan(src + entryOffset, 10, NameSpan))) + { + ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); + return 0; + } + entryOffset = static_cast(entryOffset + 10); + copyListMember(write ? dest : (uint8_t *) &entry->StackFreeCurrent, write ? (uint8_t *) &entry->StackFreeCurrent : src, + write, &entryOffset, sizeof(entry->StackFreeCurrent)); // INT32U + copyListMember(write ? dest : (uint8_t *) &entry->StackFreeMinimum, write ? (uint8_t *) &entry->StackFreeMinimum : src, + write, &entryOffset, sizeof(entry->StackFreeMinimum)); // INT32U + copyListMember(write ? dest : (uint8_t *) &entry->StackSize, write ? (uint8_t *) &entry->StackSize : src, write, + &entryOffset, sizeof(entry->StackSize)); // INT32U + break; + } + } + break; + } case 0x0035: // Thread Network Diagnostics Cluster { uint16_t entryOffset = kSizeLengthInBytes; @@ -513,6 +551,15 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut break; } break; + case 0x0034: // Software Diagnostics Cluster + switch (attributeId) + { + case 0x0000: // ThreadMetrics + // Struct _ThreadMetrics + entryLength = 30; + break; + } + break; case 0x0035: // Thread Network Diagnostics Cluster switch (attributeId) { diff --git a/zzz_generated/window-app/zap-generated/endpoint_config.h b/zzz_generated/window-app/zap-generated/endpoint_config.h index f1c01393f0180e..921a67f941bf6f 100644 --- a/zzz_generated/window-app/zap-generated/endpoint_config.h +++ b/zzz_generated/window-app/zap-generated/endpoint_config.h @@ -669,7 +669,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 176 +#define GENERATED_ATTRIBUTE_COUNT 177 #define GENERATED_ATTRIBUTES \ { \ \ @@ -715,8 +715,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(510) }, /* CurrentHeapFree */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(518) }, /* CurrentHeapUsed */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ThreadMetrics */ \ + { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(510) }, /* CurrentHeapFree */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(518) }, /* CurrentHeapUsed */ \ { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(526) }, /* CurrentHeapHighWatermark */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ @@ -916,34 +917,34 @@ 0x0033, ZAP_ATTRIBUTE_INDEX(21), 6, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { \ - 0x0034, ZAP_ATTRIBUTE_INDEX(27), 4, 26, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0034, ZAP_ATTRIBUTE_INDEX(27), 5, 26, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(31), 64, 774, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0035, ZAP_ATTRIBUTE_INDEX(32), 64, 774, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { \ - 0x0036, ZAP_ATTRIBUTE_INDEX(95), 14, 54, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0036, ZAP_ATTRIBUTE_INDEX(96), 14, 54, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ { \ - 0x0037, ZAP_ATTRIBUTE_INDEX(109), 10, 53, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0037, ZAP_ATTRIBUTE_INDEX(110), 10, 53, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { \ - 0x003C, ZAP_ATTRIBUTE_INDEX(119), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003C, ZAP_ATTRIBUTE_INDEX(120), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { \ - 0x003E, ZAP_ATTRIBUTE_INDEX(120), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003E, ZAP_ATTRIBUTE_INDEX(121), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(126), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(127), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ { \ - 0x0102, ZAP_ATTRIBUTE_INDEX(131), 20, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0102, ZAP_ATTRIBUTE_INDEX(132), 20, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Window Covering (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(151), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(152), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 2, Cluster: Descriptor (server) */ \ { \ - 0x0102, ZAP_ATTRIBUTE_INDEX(156), 20, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0102, ZAP_ATTRIBUTE_INDEX(157), 20, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 2, Cluster: Window Covering (server) */ \ }