SID IS supposed to be 16 bytes.  It is a pointer there because it allows for 
stealing the pointer from the parser later on.

We DO have a UUID_SIZE defined, but I think it might be inside of one of our 
internal include files.  It seems that pulling this up to the octypes.h would 
be a good fix.

-----Original Message-----
From: iotivity-dev-bounces at lists.iotivity.org 
[mailto:[email protected]] On Behalf Of Schulhof, Gabriel
Sent: Friday, August 07, 2015 2:24 AM
To: iotivity-dev at lists.iotivity.org
Subject: [dev] sid length

Hi!

The sid is documented under OCResourcePayload as simply uint8_t *sid.
What is its length?

ocpayload.h defines UUID_SIZE as (16), but it does so only if TB_LOG
is defined, which I take to mean that it's only defined for the
purposes of logging the payload.

So, either sid should be redefined inside the structure as

uint8_t sid[16]

which would be in keeping with the generally fixed-length nature of
most structures (although a lot of linked lists and null-terminated
strings have appeared since 0.9.1), or UUID_SIZE (or a similarly named
constant) should be defined in ocstackconfig.h.

I'm inclined to favour fixed-lengh data structures, because you can
avoid malloc()ing left and right.

For now, I think I'll define UUID_SIZE in my own project, because
TB_LOG is turned off during compilation.

HTH,



Gabriel
_______________________________________________
iotivity-dev mailing list
iotivity-dev at lists.iotivity.org
https://lists.iotivity.org/mailman/listinfo/iotivity-dev

Reply via email to