Re: mesh: bt_mesh_model_publish called with BT_MESH_ADDR_UNASSIGNED

Johan Hedberg

Hi Steve,

On Tue, Nov 28, 2017, Steve Brown wrote:
Mesh spec suggests that setting the publish address to the
unassigned address can be used to disable publishing.
Yes, and this is how it's implemented if you look at the _mod_pub_set()
function in cfg_srv.c.

However, the current implementation returns -EADDRNOTAVAIL.

Why doesn't bt_mesh_model_publish silently exit?
Do you mean why doesn't bt_mesh_model_publish() return 0 in this case? I
can imagine arguments for both ways. Wouldn't it be good for the app to
know that its attempts to send out data are not going anywhere? That
said, I'm not sure that -EADDRNOTAVAIL is the best choice here,
considering it's also used for when the publication app key is not
available. Perhaps -EAGAIN might make more sense since it conveys a more
temporary situation.


Join to automatically receive all group messages.