net: lwm2m: Add data validation callback
Add a data validation callback to the resource structure, which can be registered by an application. It allows to verify the data before actually modifying the resource data. If the callback is registered for a resource, the data is decoded into a temporary buffer first, and only copied into the actual resource buffer if the validation is successfull. If no validation is required (and thus no callback registered) the resource value is decoded directly into the resource buffer, as it used to be. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
parent
6f5a1529d4
commit
31e5ec79b8
16 changed files with 192 additions and 59 deletions
|
@ -216,7 +216,7 @@ static struct lwm2m_engine_obj_inst *buzzer_create(uint16_t obj_inst_id)
|
|||
res_inst[avail], j, 1, false, true,
|
||||
&buzzer_data[avail].onoff,
|
||||
sizeof(buzzer_data[avail].onoff),
|
||||
NULL, NULL, onoff_post_write_cb, NULL);
|
||||
NULL, NULL, NULL, onoff_post_write_cb, NULL);
|
||||
INIT_OBJ_RES_DATA(BUZZER_LEVEL_ID, res[avail], i, res_inst[avail], j,
|
||||
&buzzer_data[avail].level,
|
||||
sizeof(buzzer_data[avail].level));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue