Re: State Change and Periodic Publishing


Johan Hedberg
 

Hi Steve,

On Sun, Nov 26, 2017, Steve Brown wrote:
I need help clarifying my understanding of section 3.7.6.1 (Publish) of
the mesh spec.

As I read it, my onoff server would be responsible for publishing
status after a state change. I suspect it would always call
bt_mesh_model_publish for if publish wasn't enabled, nothing would be
output.

If periodic publishing is also enabled, the mesh stack would republish
the state change status message without any intervention by the onoff
server.

Is this the correct interpretation?
Yes, or at least that's how I interpret the spec myself as well. Well,
"without any intervention" isn't quite right, since to support periodic
publishing the model needs to provide an "update" callback which the
stack will call periodically. The intention of this callback is to let
the app update the content of pub->msg, however if there's nothing to be
updated (the buffer already has the right content) then the function
would do nothing, i.e. just return success (0).

Johan

Join devel@lists.zephyrproject.org to automatically receive all group messages.