nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches

◆ bt_mesh_onoff_srv_pub()

int bt_mesh_onoff_srv_pub ( struct bt_mesh_onoff_srv srv,
struct bt_mesh_msg_ctx *  ctx,
const struct bt_mesh_onoff_status status 
)

#include <include/bluetooth/mesh/gen_onoff_srv.h>

Publish the Generic OnOff Server model status.

Asynchronously publishes a Generic OnOff status message with the configured publish parameters.

Note
This API is only used for publishing unprompted status messages. Response messages for get and set messages are handled internally.
Parameters
[in]srvServer instance to publish on.
[in]ctxMessage context to send with, or NULL to send with the default publish parameters.
[in]statusCurrent status.
Return values
0Successfully published a Generic OnOff Status message.
-EADDRNOTAVAILA message context was not provided and publishing is not configured.
-EAGAINThe device has not been provisioned.