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

◆ set

void(*const bt_mesh_prop_srv::set) (struct bt_mesh_prop_srv *srv, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_prop_val *val)

Set a property value.

The handler may reject the value change with two levels of severity:

To indicate data format errors and permanently illegal values, change the val::meta::id field to BT_MESH_PROP_ID_PROHIBITED before returning. This will cancel the response message sending, indicating a protocol violation.

To indicate that the new value is temporarily unable to change, but not in violation of the protocol, replace the contents of buf and size with the current property value and size. Note that buf can only fit a value of size CONFIG_GEN_PROP_MAXSIZE.

Note
This handler is mandatory if the server is acting as an Admin Property Server, and ignored if the server is acting as a Manufacturer Property Server.
Parameters
[in]srvProperty Server instance whose property to set.
[in]ctxMessage context for the message that triggered the change, or NULL if the change is not coming from a message.
[in,out]valProperty value to set. Any changes to the value will be reflected in the response message.