Closed MJDSys closed 1 year ago
Thanks @MJDSys, nice catch.
I would suggest we keep these attributes in the zb_device_ctx struct to be consistent with the other values. We already have a prst_batt_attrs_t
there, so we can just extend it with these two values. I think it's okay that they are consts, I would still move them there.
Tks!
@rbaron I moved them into the zb_device_ctx struct as requested. I didn't bother to leave them as consts, as that would require some more dramatic changes to the code.
I originally made them const to have them be in flash, but that's not possible if they are in the struct so cost of restructuring the code is probably not there.
Awesome. Thank you @MJDSys.
The API for reporting information requires a pointer to the data value, and cannot deal with a constant directly. The current quantity/size returned by the device are random values from memory.
Instead create a couple constants in the flash memory and return those. The values can be read successfully from Z2M. Attempting to write to the values results in an error to Z2M but does not crash the device.