espressif / esp-zigbee-sdk

Espressif Zigbee SDK
Apache License 2.0
178 stars 31 forks source link

Custom attribute of type ESP_ZB_ZCL_ATTR_TYPE_LONG_CHAR_STRING results in "Failed to get attribute size" on startup (TZ-1125) #424

Closed ghost closed 2 months ago

ghost commented 2 months ago

Answers checklist.

IDF version.

v5.2.2

esp-zigbee-lib version.

1.0.9

esp-zboss-lib version.

1.0.9

Espressif SoC revision.

ESP32-C6

What is the expected behavior?

To set the value of a custom attribute of type ESP_ZB_ZCL_ATTR_TYPE_LONG_CHAR_STRING to "\x0c\x00""hello world" and not receive E (474) ESP_ZIGBEE_ATTRIBUTE: esp_zb_custom_cluster_add_custom_attr(3325): Failed to get attribute size.

__

What is the actual behavior?

VS shows error "E (474) ESP_ZIGBEE_ATTRIBUTE: esp_zb_custom_cluster_add_custom_attr(3325): Failed to get attribute size" on the ESP-IDF monitor.

Steps to reproduce.

Hello,

I want to create a simple custom cluster following this guideline link. For long string attribute i modified the given string attribute to fit the format of zigbee long string types. I tried out several ESP_ZB_ZCL_ATTR_TYPE_LONG_CHAR_STRING attribute values:


uint8_t custom_attr1_value[] = "\x0b\x00""hello world"; //this one..
uint8_t custom_attr2_value[] = "\x0b\x00hello world"; //..or this one is expected to work
uint8_t custom_attr3_value[] = "\x00\x0b""hello world";
uint8_t custom_attr4_value[] = "\x0b\x0b""hello world";
uint8_t custom_attr5_value[] = "\x00\x00""hello world";
uint8_t custom_attr6_value[] = "  hello world";

None of these works, as I receive all the times the "failed to get attribute size" error in the IDF monitor.

Thanks for helping and best regards

More Information.

No response

xieqinan commented 2 months ago

Hi,

Could you please use the ZB_ZCL_ATTR_TYPE_LONG_OCTET_STRING instead ?

chshu commented 2 months ago

Please reopen if any follow up quetions.