Lines Matching refs:obj_inst
168 static void engine_register_obj_inst(struct lwm2m_engine_obj_inst *obj_inst) in engine_register_obj_inst() argument
175 access_control_add(obj_inst->obj->obj_id, obj_inst->obj_inst_id, server_obj_inst_id); in engine_register_obj_inst()
178 sys_slist_append(&engine_obj_inst_list, &obj_inst->node); in engine_register_obj_inst()
181 static void engine_unregister_obj_inst(struct lwm2m_engine_obj_inst *obj_inst) in engine_unregister_obj_inst() argument
184 access_control_remove(obj_inst->obj->obj_id, obj_inst->obj_inst_id); in engine_unregister_obj_inst()
186 engine_remove_observer_by_id(obj_inst->obj->obj_id, obj_inst->obj_inst_id); in engine_unregister_obj_inst()
187 sys_slist_find_and_remove(&engine_obj_inst_list, &obj_inst->node); in engine_unregister_obj_inst()
192 struct lwm2m_engine_obj_inst *obj_inst; in get_engine_obj_inst() local
194 SYS_SLIST_FOR_EACH_CONTAINER(&engine_obj_inst_list, obj_inst, node) { in get_engine_obj_inst()
195 if (obj_inst->obj->obj_id == obj_id && obj_inst->obj_inst_id == obj_inst_id) { in get_engine_obj_inst()
196 return obj_inst; in get_engine_obj_inst()
205 struct lwm2m_engine_obj_inst *obj_inst, *next = NULL; in next_engine_obj_inst() local
207 SYS_SLIST_FOR_EACH_CONTAINER(&engine_obj_inst_list, obj_inst, node) { in next_engine_obj_inst()
208 if (obj_inst->obj->obj_id == obj_id && obj_inst->obj_inst_id > obj_inst_id && in next_engine_obj_inst()
209 (!next || next->obj_inst_id > obj_inst->obj_inst_id)) { in next_engine_obj_inst()
210 next = obj_inst; in next_engine_obj_inst()
218 struct lwm2m_engine_obj_inst **obj_inst) in lwm2m_create_obj_inst() argument
224 *obj_inst = NULL; in lwm2m_create_obj_inst()
244 *obj_inst = obj->create_cb(obj_inst_id); in lwm2m_create_obj_inst()
245 if (!*obj_inst) { in lwm2m_create_obj_inst()
256 (*obj_inst)->obj = obj; in lwm2m_create_obj_inst()
257 (*obj_inst)->obj_inst_id = obj_inst_id; in lwm2m_create_obj_inst()
258 engine_register_obj_inst(*obj_inst); in lwm2m_create_obj_inst()
278 struct lwm2m_engine_obj_inst *obj_inst; in lwm2m_delete_obj_inst() local
286 obj_inst = get_engine_obj_inst(obj_id, obj_inst_id); in lwm2m_delete_obj_inst()
287 if (!obj_inst) { in lwm2m_delete_obj_inst()
300 engine_unregister_obj_inst(obj_inst); in lwm2m_delete_obj_inst()
308 for (i = 0; i < obj_inst->resource_count; i++) { in lwm2m_delete_obj_inst()
309 clear_attrs(&obj_inst->resources[i]); in lwm2m_delete_obj_inst()
310 (void)memset(obj_inst->resources + i, 0, sizeof(struct lwm2m_engine_res)); in lwm2m_delete_obj_inst()
313 clear_attrs(obj_inst); in lwm2m_delete_obj_inst()
314 (void)memset(obj_inst, 0, sizeof(struct lwm2m_engine_obj_inst)); in lwm2m_delete_obj_inst()
321 struct lwm2m_engine_obj_inst *obj_inst; in lwm2m_create_object_inst() local
329 ret = lwm2m_create_obj_inst(path->obj_id, path->obj_inst_id, &obj_inst); in lwm2m_create_object_inst()
367 int path_to_objs(const struct lwm2m_obj_path *path, struct lwm2m_engine_obj_inst **obj_inst, in path_to_objs() argument
424 if (obj_inst) { in path_to_objs()
425 *obj_inst = oi; in path_to_objs()
539 struct lwm2m_engine_obj_inst *obj_inst; in lwm2m_engine_set() local
558 ret = path_to_objs(path, &obj_inst, &obj_field, &res, &res_inst); in lwm2m_engine_set()
584 data_ptr = res->pre_write_cb(obj_inst->obj_inst_id, res->res_id, in lwm2m_engine_set()
609 ret = res->validate_cb(obj_inst->obj_inst_id, res->res_id, res_inst->res_inst_id, in lwm2m_engine_set()
716 ret = res->post_write_cb(obj_inst->obj_inst_id, res->res_id, res_inst->res_inst_id, in lwm2m_engine_set()
863 struct lwm2m_engine_obj_inst *obj_inst; in lwm2m_engine_get() local
879 ret = path_to_objs(path, &obj_inst, &obj_field, &res, &res_inst); in lwm2m_engine_get()
897 data_ptr = res->read_cb(obj_inst->obj_inst_id, res->res_id, res_inst->res_inst_id, in lwm2m_engine_get()
1376 struct lwm2m_engine_obj_inst **obj_inst, uint8_t *created) in lwm2m_get_or_create_engine_obj() argument
1384 *obj_inst = get_engine_obj_inst(msg->path.obj_id, msg->path.obj_inst_id); in lwm2m_get_or_create_engine_obj()
1385 if (!*obj_inst) { in lwm2m_get_or_create_engine_obj()
1386 ret = lwm2m_create_obj_inst(msg->path.obj_id, msg->path.obj_inst_id, obj_inst); in lwm2m_get_or_create_engine_obj()
1591 struct lwm2m_engine_obj_inst *obj_inst; in lwm2m_enable_cache() local
1599 ret = path_to_objs(path, &obj_inst, &obj_field, NULL, &res_inst); in lwm2m_enable_cache()