[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[wakaama-dev] object instances management
|
Hi,
I have some remarks about the object instances management.
Wakaama need to know the list of instances Id of an object, this
information is stored in lwm2m_object_t as a linked list.
This is a problem for my Lua binding because objects and instances are
stored in a lua table. So each time I add or remove an instance, I need
to modify the C linked list. This mean Lua table should know C lua_object.c.
Maybe we could replace the field :
lwm2m_list_t * instanceList;
by :
lwm2m_instanceList_callback_t instanceListFunc;
typedef lwm2m_list_t * (*lwm2m_instanceList_callback_t) (lwm2m_object_t
* objectP);
and optionally :
lwm2m_instanceListSize_callback_t instanceListSizeFunc;
typedef int (*lwm2m_instanceListSize_callback_t) (lwm2m_object_t *
objectP);
lwm2m_isInstanceExist_callback_t isInstanceExistFunc;
typedef bool (*lwm2m_isInstanceExist_callback_t) (lwm2m_object_t *
objectP, uint16_t instanceId);
In this case, my code could be more dynamic because each time wakaama
need to know something about instances I can read it directly in lua
table instead of maintaining the C linked list.
Simon