net: lwm2m: API for multiple resource writing
Used the registry lock in the functions lwm2m_registry_lock() and lwm2m_registry_unlock() to make the registry lockable through a public API. If writing to multiple resources that are composite-observed, locking will halt the main thread until every resource is written to, ensuring that only one notify message will be sent. Updated the documentation in lwm2m to include this addition. Signed-off-by: Ola Tangen Kulseng <ola.kulseng@nordicsemi.no>
This commit is contained in:
parent
0956647aaf
commit
1df3de4e98
5 changed files with 51 additions and 2 deletions
|
@ -2254,8 +2254,10 @@ void lwm2m_udp_receive(struct lwm2m_ctx *client_ctx, uint8_t *buf, uint16_t buf_
|
|||
|
||||
client_ctx->processed_req = msg;
|
||||
|
||||
lwm2m_registry_lock();
|
||||
/* process the response to this request */
|
||||
r = udp_request_handler(&response, msg);
|
||||
lwm2m_registry_unlock();
|
||||
if (r < 0) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue