From 5fc57ad4c4773dc37a77008f3abc8dc0a1ae34ac Mon Sep 17 00:00:00 2001 From: Chirag Atal Date: Mon, 11 Jul 2022 10:16:16 -0400 Subject: [PATCH] esp_matter_rainmaker: Fixing compilation esp_matter_attribute: Minor additions --- components/esp_matter/esp_matter_attribute_utils.cpp | 7 +++++++ components/esp_matter_rainmaker/esp_matter_rainmaker.cpp | 2 ++ 2 files changed, 9 insertions(+) diff --git a/components/esp_matter/esp_matter_attribute_utils.cpp b/components/esp_matter/esp_matter_attribute_utils.cpp index 3f365951e..69d691f5d 100644 --- a/components/esp_matter/esp_matter_attribute_utils.cpp +++ b/components/esp_matter/esp_matter_attribute_utils.cpp @@ -294,6 +294,9 @@ static esp_err_t console_handler(int argc, char **argv) } else if (type == ESP_MATTER_VAL_TYPE_BITMAP32) { uint32_t value = atoi(argv[4]); val = esp_matter_bitmap32(value); + } else if (type == ESP_MATTER_VAL_TYPE_ENUM8) { + uint8_t value = atoi(argv[4]); + val = esp_matter_enum8(value); } else { ESP_LOGE(TAG, "Type not handled: %d", type); return ESP_ERR_INVALID_ARG; @@ -365,6 +368,10 @@ static esp_err_t console_handler(int argc, char **argv) uint32_t value = 0; get_val_raw(endpoint_id, cluster_id, attribute_id, (uint8_t *)&value, sizeof(value)); val = esp_matter_bitmap32(value); + } else if (type == ESP_MATTER_VAL_TYPE_ENUM8) { + uint8_t value = 0; + get_val_raw(endpoint_id, cluster_id, attribute_id, (uint8_t *)&value, sizeof(value)); + val = esp_matter_enum8(value); } else { ESP_LOGE(TAG, "Type not handled: %d", type); return ESP_ERR_INVALID_ARG; diff --git a/components/esp_matter_rainmaker/esp_matter_rainmaker.cpp b/components/esp_matter_rainmaker/esp_matter_rainmaker.cpp index 06d2c0e5b..e7272d75a 100644 --- a/components/esp_matter_rainmaker/esp_matter_rainmaker.cpp +++ b/components/esp_matter_rainmaker/esp_matter_rainmaker.cpp @@ -24,6 +24,8 @@ #define ESP_MATTER_RAINMAKER_COMMAND_LIMIT 5 /* This command can be called 5 times per reboot */ #define ESP_MATTER_RAINMAKER_MAX_DATA_LEN 40 +using namespace chip::app::Clusters; + static const char *TAG = "esp_matter_rainmaker"; namespace esp_matter {