Skip to content
Permalink
Browse files

net: lwm2m: add LwM2M path to engine_set errors

When presenting errors in lwm2m_engine_set() let's include the related
LwM2M path for easier debugging.

Signed-off-by: Michael Scott <mike@foundries.io>
  • Loading branch information...
mike-scott authored and jukkar committed Jul 29, 2019
1 parent efa1679 commit 6af8fa692be6320ff43c6c310d1ca55ec1453e28
Showing with 6 additions and 2 deletions.
  1. +6 −2 subsys/net/lib/lwm2m/lwm2m_engine.c
@@ -1413,7 +1413,9 @@ static int lwm2m_engine_set(char *pathstr, void *value, u16_t len)
}

if (LWM2M_HAS_RES_FLAG(res_inst, LWM2M_RES_DATA_FLAG_RO)) {
LOG_ERR("res instance data pointer is read-only");
LOG_ERR("res instance data pointer is read-only "
"[%u/%u/%u/%u:%u]", path.obj_id, path.obj_inst_id,
path.res_id, path.res_inst_id, path.level);
return -EACCES;
}

@@ -1429,7 +1431,9 @@ static int lwm2m_engine_set(char *pathstr, void *value, u16_t len)
}

if (!data_ptr) {
LOG_ERR("res instance data pointer is NULL");
LOG_ERR("res instance data pointer is NULL [%u/%u/%u/%u:%u]",
path.obj_id, path.obj_inst_id, path.res_id,
path.res_inst_id, path.level);
return -EINVAL;
}

0 comments on commit 6af8fa6

Please sign in to comment.
You can’t perform that action at this time.