How I can clear Pending Publish Messages after disabling and Re-enabling NRF Mesh

For power optimization I did to disable Mesh Using this piece of Code 

ret_code_t retval = proxy_stop(); 
  while (retval == NRF_SUCCESS)
  {
    retval = nrf_mesh_disable();
  }

and Re- Enable using this code

ret_code_t retval = proxy_enable();
  if (retval == NRF_SUCCESS)
  {
    retval = proxy_start();
  }
  if (retval == NRF_SUCCESS)
  {
    retval = nrf_mesh_enable();
  }

So the Real Question is that , After disabling Mesh for some time and then re-enable Mesh I should see Publish Messages after Re-enabling Mesh , but actually I see old publish messages (messages before disabling Mesh) and then new publish messages.. Why I am seeing these pending publish messages, Thanks 
By the I am using Sensor example.

Also I want know how I can stop Publish Interval Timer , and then start again from the code, ( After many hours of searching I found one case regarding this problem but haven't yet answered, they it is in the "config_server.c" file in the sensor example but i don;t know how to do it )
Thanks

Parents
  • Hi,

    nrf_mesh_disable() will stop the mesh communication (sending and receiving messages over the air.) It will not, for instance, remove any messages that were already pending. Therefore you will see after nrf_mesh_enable() that it continues wehere it left off, as if nothing had happened.

    There is a function mesh_stack_power_down() which can be used to completely shut down the mesh stack (including storing to flash the state needed for starting up operations at a later point in time.) It is intended for a full power down (reset) situation. It is thoroughly documented on Infocenter: Power-down feature.

    For low-power applications, you could consider the Low Power node feature. It does require some nodes in the network with Friend node capabilities, and the Friend feature enabled.

    Regarding the other case that you mention, which case is that? Do you have a link?

    Regards,
    Terje

Reply
  • Hi,

    nrf_mesh_disable() will stop the mesh communication (sending and receiving messages over the air.) It will not, for instance, remove any messages that were already pending. Therefore you will see after nrf_mesh_enable() that it continues wehere it left off, as if nothing had happened.

    There is a function mesh_stack_power_down() which can be used to completely shut down the mesh stack (including storing to flash the state needed for starting up operations at a later point in time.) It is intended for a full power down (reset) situation. It is thoroughly documented on Infocenter: Power-down feature.

    For low-power applications, you could consider the Low Power node feature. It does require some nodes in the network with Friend node capabilities, and the Friend feature enabled.

    Regarding the other case that you mention, which case is that? Do you have a link?

    Regards,
    Terje

Children
Related