nRF Connect SDK API 0.1.0
|
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
.
[in] | srv | Property Server instance whose property to set. |
[in] | ctx | Message context for the message that triggered the change, or NULL if the change is not coming from a message. |
[in,out] | val | Property value to set. Any changes to the value will be reflected in the response message. |