triggering model reset handler

Hi, 

I have implemented a set of custom mesh models on nCS. In vendor models we have reset handlers, as in nrf documentation: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/nrf/ug_bt_mesh_vendor_model_dev_overview.html#:~:text=The%20model%20reset%20handler%20is%20called%20when%20the%20mesh%20node%20is%20reset

I have two questions here:

  1. What are the guidelines to write reset handlers, I mean what should they do..?
  2. How do I trigger reset handlers to test..? I do not know how a node is reset, hence kindly suggest how to trigger reset handler.

Thanks,

Parents Reply
  • Hi,

    Apologies for the further delay. I have been out of office for the last week.

    Unfortunately we do not have any existing samples showing how to do this, and in looking into how to use the reset node function I previously sent, I realized I have sent you the wrong reset function. What you want to do is void bt_mesh_reset(void) from the core API to reset the node, followed by int bt_mesh_prov_enable(bt_mesh_prov_bearer_t bearers) if you want to provision the node in a new network. You may disregard the latter if you only want to test the reset of the node.

    The reset handler is a callback that you can choose to implement and register for your model. This will be called when the node is reset and it is specific for your model.

    What you need to do is to implement this model reset callback, on the shape of void (*const reset)(struct bt_mesh_model *model). If its required to do some manual resetting in your model when node resetting, such as if you need to update something stored in flash or in RAM that needs to be updated. As an example, if you have a server-model you will need to reset the stored state of the model. You can bind a button to trigger the bt_mesh_reset() call

    Everything else with regards to the node reset that the stack and our model implementations for standard models from BT SIG is already handled by the stack.

    Thank you for your patience,

    Kind regards,
    Andreas

Children
Related