Other Parts Discussed in Thread: SYSCONFIG
Hello experts,
what is the correct way to process state changes of the generic model?
I use Simple Mesh Node example project as a base. There is a good documentation how to configure vendor model and set custom handler for a message.
But it's not clear what to do with all gen models.
For example I want to turn LED on/off using gen onOff server.
The handlers are defined in the ti_device_composition.c:
/* Mapping of message handlers for Generic OnOff Server (0x1000) */ const struct bt_mesh_model_op gen_onoff_srv_op[] = { {BT_MESH_MODEL_OP_2(0x82, 0x01) , 0, gen_OnOff_get }, {BT_MESH_MODEL_OP_2(0x82, 0x02) , 0, gen_OnOff_set }, {BT_MESH_MODEL_OP_2(0x82, 0x03) , 0, gen_OnOff_set_unack }, BT_MESH_MODEL_OP_END, };
But I did not find how I can modify those values in SysConfig, I can modify the function directly in the generic_models.c and it actually worked. But the file belongs to SDK, so it looks like not a good idea.
Also the functions from SDK are doing other useful things such as transition and delay, so it would be good to use them. I suppose there should be some event that I can process in the application, something like MODEL_STATE_CHANGE, but I could not find anything like that. Also I did not find that any event is enqueued in the handler. The handlers just change the model state value and that's it.
Did I miss something?