Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [wakaama-dev] feedback on read object API

if the 16 bits are significant maybe we can use a 32-bit integer ? or we can use a pointer to a 16 bit integer. (if the pointer is NULL we want all data else we want the resource given by "pointed" resourceid)

Le 25/08/2014 16:23, Navarro, David a écrit :
Hi Simon,

I can understand this can be confusing. Thing is I could not come up with better solution without defining more APIs. I'm open to any idea here. But the read callback could be used to read one ressource, all ressources or some ressources.
Using resourceId == -1 can not work as ressourceId is a 16-bit integer and 65535 (-1) is a valid ressource ID. Yes if LWM2M had a reserved value for IDs, it would simplify implementation but I failed to convince other OMA members of this...

Regards,
David Navarro

-----Original Message-----
From: wakaama-dev-bounces@xxxxxxxxxxx [mailto:wakaama-dev-bounces@xxxxxxxxxxx] On Behalf Of Simon Bernard
Sent: Friday, 1 August, 2014 17:57
To: wakaama-dev@xxxxxxxxxxx
Subject: [wakaama-dev] feedback on read object API

I recently updated my code (https://github.com/sbernard31/lualwm2m) to be compliant with the new object API. (with lwm2m_tlv_t struct)

I found the read API a bit confusing because output parameters are also use as input parameters.

static uint8_t prv_read(uint16_t instanceId, int * numDataP,
          lwm2m_tlv_t ** dataArrayP, lwm2m_object_t * objectP)

Currently, numDataP and dataArrayP are output parameters but must be used as input to know how to fill it.

if (*numDataP) == 0  we want all the data else we want just one data with the id (dataArrayP)->id

Maybe this could be clearer to add an input parameter resourceId.

if resourceId == -1 we want all data
else we want the resource with the given resourceId

Simon
_______________________________________________
wakaama-dev mailing list
wakaama-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/wakaama-dev
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
wakaama-dev mailing list
wakaama-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/wakaama-dev



Back to the top