mirror of
https://github.com/espressif/esp-matter.git
synced 2026-04-27 19:13:13 +00:00
Fix active locale attributes
This commit is contained in:
@@ -1869,9 +1869,13 @@ namespace attribute {
|
|||||||
|
|
||||||
attribute_t *create_active_locale(cluster_t *cluster, char *value, uint16_t length)
|
attribute_t *create_active_locale(cluster_t *cluster, char *value, uint16_t length)
|
||||||
{
|
{
|
||||||
|
if (length > k_max_active_locale_length) {
|
||||||
|
ESP_LOGE(TAG, "Could not create attribute, string length out of bound");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
return esp_matter::attribute::create(cluster, LocalizationConfiguration::Attributes::ActiveLocale::Id,
|
return esp_matter::attribute::create(cluster, LocalizationConfiguration::Attributes::ActiveLocale::Id,
|
||||||
ATTRIBUTE_FLAG_WRITABLE | ATTRIBUTE_FLAG_NONVOLATILE,
|
ATTRIBUTE_FLAG_WRITABLE | ATTRIBUTE_FLAG_NONVOLATILE,
|
||||||
esp_matter_char_str(value, length));
|
esp_matter_char_str(value, length), k_max_active_locale_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
attribute_t *create_supported_locales(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count)
|
attribute_t *create_supported_locales(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count)
|
||||||
|
|||||||
Reference in New Issue
Block a user