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:
parent
8a13066a4e
commit
aa930f3f94
1 changed files with 8 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue