-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom cluster with multiple string attributes #31
Comments
String attributes are not really implemented and I never tested those. Can you try to deactivate reporting and just use the coordinator to read them? Just to eliminate one potential source of error. |
Setting a long string as the default value results in the same behavior as the default value of 0. Setting it to "1" and "2" (values must be different) actually works, although the actual value is garbage at first until the attributes are set for the first time. I feel like it's more or less just luck 😅 Slightly off topic: The method I used to send a report right after setting an attribute actually sends the old value of the attribute (probably because the loop of the attribute hasn't written the value yet). Do you have a clever way to fix this? |
yes that's what I thought. Basically we need to add string support to
Ha, yes that could happen. Just don't use the manual reporting :D |
I might look into that if I find a little time this week.
Yeah, even thought about moving the reporting logic to the attributes themselves, so we can report attributes individually. |
Hey, I'm currently working on a ZigBee-based BLE proxy (mainly for use with the Bermuda integration).
So I have created a configuration with a custom cluster containing two string attributes:
The scanresult attribute is set by a callback (
bt_zigbee_tracker_cb
) from the ble_tracker, while the macaddress attribute is set using theset_local_bt_address
function.C++ Implementation
It works fine as long as you do not use both attributes. When I try to use both, the debug logs still show the correct data in the char arrays, but the transmitted values (double-checked with a sniffer) are a mix of both. It looks like the memory region is being reused somehow.
Am I using the
set_attr()
API incorrectly?I've also tried implementing a
set_attr_array' function that uses the
delete[]operator instead of
delete', but that doesn't help.The text was updated successfully, but these errors were encountered: