Bluetooth: Mesh: Improve documentation for model publication

Make it clear that the model publication msg member must not be a
stack variable.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2017-11-26 16:23:00 +02:00 committed by Johan Hedberg
commit aa930f3f94

View file

@ -281,7 +281,14 @@ struct bt_mesh_model_pub {
* contain a valid publication message before calling the
* bt_mesh_model_publish() API or after the publication's
* @ref bt_mesh_model_pub.update callback has been called
* and returned success.
* and returned success. The buffer must be created outside
* of function context, i.e. it must not be on the stack.
* This is most conveniently acheived by creating it inline
* when declaring the publication context:
*
* static struct bt_mesh_model_pub my_pub = {
* .msg = NET_BUF_SIMPLE(size),
* };
*/
struct net_buf_simple *msg;