NRF Connect SDK: Bluetooth mesh config server model callback

Dear all,

When the provisioner add appkey or bind appkey for the node's model, I want to be informed and run a callback function.

Can I set callback for config server model?

Parents Reply Children
  • Hi,

    Since there are no callbacks for configuration changes on the device, the way to do this would be to use the configuration client. Along with providing the AppKey, the configuration device should do the rest of the configuration. If you need special functionality (where the device does a lot of self-configuration), you could trigger this through a custom model (which would require the configuration device to trigger this through use of that custom model.)

    If you want a user attention then you could use the attention timer through the health server, although there is no way to differentiate a reason for the attention.

    In case you want to try to poll the configuration state through directly accessing the internal structures: The key index is stored in the bt_mesh_model struct here: https://github.com/zephyrproject-rtos/zephyr/blob/84f3a0a8c6a930f0252d9ceca6adf8c3b1284af0/include/zephyr/bluetooth/mesh/access.h#L536. When no keys are bound, they are BT_MESH_KEY_UNUSED. I highly recommend only using the public API instead, though, as internal structures may change without further notice.

    Regards,
    Terje

Related