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

◆ bt_mesh_onoff_cli_set()

int bt_mesh_onoff_cli_set ( struct bt_mesh_onoff_cli * cli,
struct bt_mesh_msg_ctx * ctx,
const struct bt_mesh_onoff_set * set,
struct bt_mesh_onoff_status * rsp )

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

Set the OnOff state in the srv.

This call is blocking if the rsp buffer is non-NULL. Otherwise, this function will return, and the response will be passed to the bt_mesh_onoff_cli::status_handler callback.

Parameters
[in]cliClient model to send on.
[in]ctxMessage context, or NULL to use the configured publish parameters.
[in]setNew OnOff parameters to set. set::transition can either point to a transition structure, or be left to NULL to use the default transition parameters on the server.
[out]rspStatus response buffer, or NULL to keep from blocking.
Return values
0Successfully sent the message and populated the rsp buffer.
-EALREADYA blocking request is already in progress.
-EADDRNOTAVAILA message context was not provided and publishing is not configured.
-EAGAINThe device has not been provisioned.
-ETIMEDOUTThe request timed out without a response.