net: lwm2m: Send operation registry lock update
Secured Message allocation, init and rebuild process for secure timeseries ring buffer. Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
This commit is contained in:
parent
05a92f9258
commit
efa75b5a76
1 changed files with 4 additions and 3 deletions
|
@ -3041,12 +3041,14 @@ int lwm2m_engine_send(struct lwm2m_ctx *ctx, char const *path_list[], uint8_t pa
|
||||||
}
|
}
|
||||||
/* Clear path which are part are part of recursive path /1 will include /1/0/1 */
|
/* Clear path which are part are part of recursive path /1 will include /1/0/1 */
|
||||||
lwm2m_engine_clear_duplicate_path(&lwm2m_path_list, &lwm2m_path_free_list);
|
lwm2m_engine_clear_duplicate_path(&lwm2m_path_list, &lwm2m_path_free_list);
|
||||||
|
lwm2m_registry_lock();
|
||||||
#if defined(CONFIG_LWM2M_RESOURCE_DATA_CACHE_SUPPORT)
|
#if defined(CONFIG_LWM2M_RESOURCE_DATA_CACHE_SUPPORT)
|
||||||
msg_alloc:
|
msg_alloc:
|
||||||
#endif
|
#endif
|
||||||
/* Allocate Message buffer */
|
/* Allocate Message buffer */
|
||||||
msg = lwm2m_get_message(ctx);
|
msg = lwm2m_get_message(ctx);
|
||||||
if (!msg) {
|
if (!msg) {
|
||||||
|
lwm2m_registry_unlock();
|
||||||
LOG_ERR("Unable to get a lwm2m message!");
|
LOG_ERR("Unable to get a lwm2m message!");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
@ -3087,9 +3089,7 @@ msg_init:
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write requested path data */
|
/* Write requested path data */
|
||||||
lwm2m_registry_lock();
|
|
||||||
ret = do_send_op(msg, content_format, &lwm2m_path_list);
|
ret = do_send_op(msg, content_format, &lwm2m_path_list);
|
||||||
lwm2m_registry_unlock();
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
if (lwm2m_timeseries_data_rebuild(msg, ret)) {
|
if (lwm2m_timeseries_data_rebuild(msg, ret)) {
|
||||||
/* Message Build fail by ENOMEM and data include timeseries data.
|
/* Message Build fail by ENOMEM and data include timeseries data.
|
||||||
|
@ -3120,9 +3120,10 @@ msg_init:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
lwm2m_registry_unlock();
|
||||||
return 0;
|
return 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
|
lwm2m_registry_unlock();
|
||||||
lwm2m_reset_message(msg, true);
|
lwm2m_reset_message(msg, true);
|
||||||
return ret;
|
return ret;
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue