Rework callback mechanism#1
Conversation
2660436 to
cafa37c
Compare
|
|
||
| /** Function to be called before/after read/write operations to groups. */ | ||
| typedef void (*thingset_group_callback_t)(enum thingset_callback_reason cb_reason); | ||
| typedef int (*thingset_group_callback_t)(enum thingset_callback_reason cb_reason); |
There was a problem hiding this comment.
I think it would be useful to add the thingset_data_object as a parameter. You can then call this inside the first deserialize_child loop (where some validation is done already).
There was a problem hiding this comment.
I think we should probably have more of a think about value validation tbh. The more important part right now is state checking (which this MR should now allow), and I guess the idea in my head was to permit specific ranges for specific values (I'm thinking imposing the limits from the BQ reference manual on the corresponding values etc) but that functionality likely wouldn't be elegant when calling a group callback.
There was a problem hiding this comment.
Ultimately, that can probably be added separately regardless IMO as it's nice to have, but not absolutely required right now
Add return value to callbacks and do not write the value if the pre write callback fails