Lines Matching refs:obj
104 void lwm2m_register_obj(struct lwm2m_engine_obj *obj) in lwm2m_register_obj() argument
112 access_control_add_obj(obj->obj_id, server_obj_inst_id); in lwm2m_register_obj()
115 sys_slist_append(&engine_obj_list, &obj->node); in lwm2m_register_obj()
119 void lwm2m_unregister_obj(struct lwm2m_engine_obj *obj) in lwm2m_unregister_obj() argument
123 access_control_remove_obj(obj->obj_id); in lwm2m_unregister_obj()
125 engine_remove_observer_by_id(obj->obj_id, -1); in lwm2m_unregister_obj()
126 sys_slist_find_and_remove(&engine_obj_list, &obj->node); in lwm2m_unregister_obj()
132 struct lwm2m_engine_obj *obj; in get_engine_obj() local
134 SYS_SLIST_FOR_EACH_CONTAINER(&engine_obj_list, obj, node) { in get_engine_obj()
135 if (obj->obj_id == obj_id) { in get_engine_obj()
136 return obj; in get_engine_obj()
143 struct lwm2m_engine_obj_field *lwm2m_get_engine_obj_field(struct lwm2m_engine_obj *obj, int res_id) in lwm2m_get_engine_obj_field() argument
147 if (obj && obj->fields && obj->field_count > 0) { in lwm2m_get_engine_obj_field()
148 for (i = 0; i < obj->field_count; i++) { in lwm2m_get_engine_obj_field()
149 if (obj->fields[i].res_id == res_id) { in lwm2m_get_engine_obj_field()
150 return &obj->fields[i]; in lwm2m_get_engine_obj_field()
175 access_control_add(obj_inst->obj->obj_id, obj_inst->obj_inst_id, server_obj_inst_id); in engine_register_obj_inst()
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()
195 if (obj_inst->obj->obj_id == obj_id && obj_inst->obj_inst_id == obj_inst_id) { in get_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()
221 struct lwm2m_engine_obj *obj; in lwm2m_create_obj_inst() local
225 obj = get_engine_obj(obj_id); in lwm2m_create_obj_inst()
226 if (!obj) { in lwm2m_create_obj_inst()
232 if (!obj->create_cb) { in lwm2m_create_obj_inst()
238 if (obj->instance_count + 1 > obj->max_instance_count) { in lwm2m_create_obj_inst()
244 *obj_inst = obj->create_cb(obj_inst_id); in lwm2m_create_obj_inst()
255 obj->instance_count++; in lwm2m_create_obj_inst()
256 (*obj_inst)->obj = obj; in lwm2m_create_obj_inst()
260 if (obj->user_create_cb) { in lwm2m_create_obj_inst()
261 ret = obj->user_create_cb(obj_inst_id); in lwm2m_create_obj_inst()
277 struct lwm2m_engine_obj *obj; in lwm2m_delete_obj_inst() local
280 obj = get_engine_obj(obj_id); in lwm2m_delete_obj_inst()
281 if (!obj) { in lwm2m_delete_obj_inst()
292 if (obj->user_delete_cb) { in lwm2m_delete_obj_inst()
293 ret = obj->user_delete_cb(obj_inst_id); in lwm2m_delete_obj_inst()
301 obj->instance_count--; in lwm2m_delete_obj_inst()
303 if (obj->delete_cb) { in lwm2m_delete_obj_inst()
304 ret = obj->delete_cb(obj_inst_id); in lwm2m_delete_obj_inst()
392 of = lwm2m_get_engine_obj_field(oi->obj, path->res_id); in path_to_objs()
1348 struct lwm2m_engine_obj *obj = NULL; in lwm2m_register_create_callback() local
1350 obj = get_engine_obj(obj_id); in lwm2m_register_create_callback()
1351 if (!obj) { in lwm2m_register_create_callback()
1356 obj->user_create_cb = cb; in lwm2m_register_create_callback()
1362 struct lwm2m_engine_obj *obj = NULL; in lwm2m_register_delete_callback() local
1364 obj = get_engine_obj(obj_id); in lwm2m_register_delete_callback()
1365 if (!obj) { in lwm2m_register_delete_callback()
1370 obj->user_delete_cb = cb; in lwm2m_register_delete_callback()
1438 bool lwm2m_engine_shall_report_obj_version(const struct lwm2m_engine_obj *obj) in lwm2m_engine_shall_report_obj_version() argument
1445 if (!obj->is_core) { in lwm2m_engine_shall_report_obj_version()
1446 return obj->version_major != 1 || obj->version_minor != 0; in lwm2m_engine_shall_report_obj_version()
1451 if (obj->obj_id != default_obj_versions[i].obj_id) { in lwm2m_engine_shall_report_obj_version()
1455 return obj->version_major != default_obj_versions[i].version_major || in lwm2m_engine_shall_report_obj_version()
1456 obj->version_minor != default_obj_versions[i].version_minor; in lwm2m_engine_shall_report_obj_version()