At the moment, it is unlikely that IoTivity would be able to support that. The problem is 2 fold:
1- The spec requires that Representation objects be represented in a certain way, requiring that all sub-data be in a "rep" tag. 2- There is no 'map' type specified, which is the only way to get the sourceName/sourceNumber/sourceType/status as the root of an 'object'. I believe this is a case where the IoTivity Resource Model spec and the Smart Home TG spec are incompatible. I believe that I/Jon are not the right ones to refer this bug to, the correct people to get this to is the OIC specification board, since they'll have to correct ONE of the specifications to make this work. If I were them, I'd change the "sources" array to just contain OCRepresentation objects as specified in the IoTivity resource specification. -Erich On Mon, 2015-11-16 at 07:44 +0000, ??? wrote: > Dear Erich, > > > > I think I can explain about this issue. > > It's not a problem between IoTivity and IoTivity devices. > > It's a standard spec compliance issue and you assume IoTivity and > non-IoTivity device communication. > > > > If we see the "OIC Resource Type Specification" from Smart Home TG, > > (https://workspace.openinterconnect.org/apps/org/workgroup/smarthome_tg/download.php/3829/OIC_Resource_Type_Specification_Project_B_v0.9.9.docx) > > Page 128 and 129, They defined Media source list resource. > > There is a " sources" property and it's using array type. You can find > next example in the spec. > > { > "rt": "oic.r.mediaSourceList", > "id": "unique_example_id", > "sources": [ > { > "sourceName": "HDMI-CEC", > "sourceNumber": "1", > "sourceType": "audioPlusVideo", > "status": true > }, > { > "sourceName": "dualRCA", > "sourceNumber": "1", > "sourceType": "audioOnly", > "status": false > } > ] > } > > > > > > > > I am not sure IoTivity can make this palyload using array now. > > Could you help us regarding this issue? > (IOT-835, https://jira.iotivity.org/browse/IOT-835) > > > > Thanks & BR, > > Sungkyu Ko. > > > > ------- Original Message ------- > > Sender : Keane, Erich<erich.keane at intel.com> > > Date : 2015-11-14 01:37 (GMT+09:00) > > Title : Re: [dev] Fwd: Array data type problem in IoTivity. > > > > My understanding is that the {"rep":{...}} part of each message is a > part of the specification for what makes an OCRepresentation, and is > thus necessary. > > The "href":"" could potentially be ommitted, but I don't see why that > would be too big of a problem to ignore. > > Finally, I note that you're showing JSON, the IoTivity stack uses CBOR > primarily now, so I was wondering if there is a translation happening > here, or if this is an older version of the code? > > -Erich > > On Fri, 2015-11-13 at 06:43 +0000, ??? wrote: > > Hi, > > > > We found a problem when we tested using a 'oic.r.mediaInput' > resource. > > > > The OIC Core Spec. addressed this resource should exchange array > > contains multiple source list. > > > > We guess, IoTivity makes incompatible payload with specification. > > > > You can see the details in Jira ( IOT-835, > > https://jira.iotivity.org/browse/IOT-835 ) > > > > And we think the patchset to resolve this problem should be applied > > before plugfest #5. > > > > To release it very very quickly, developer who has ownership of this > > source code part would better create patchset. > > > > Unfortunately, we don't know who is the right person.. > > > > Please help us... > > > > > > > > [ IOT-835 ] > > > > When exchanging data which data type is array between client and > > server, > > it always add "href" and "rep" in every array's element in OC stack > > layer. > > For example, when Client requests "GET" to Server, > > (assume data payload which Server makes in application layer is like > > below. > > "ABC":[ > > {"name":"name1","value":"value1"} > > , > > {"name":"name2","value":"value2"} > > , > > ] > > -> ABC is vector, and its elements are > > {"name":"name1","value":"value1"} > > and > > {"name":"name1","value":"value2"} > > ) > > Client gets payload by server like this > > "ABC":[ > > {"href" : "", "rep" :{"name":"name1","value":"value1"}}, > > {"href" : "", "rep" :{"name":"name2","value":"value2"}} > > ] > > Problem is that "href" and "rep" is made automatically when making > > payload. > > Also, if client is not made of iotivity, and requests "POST" with > > array payload to iotivty Server, server can not parse payload that > > client sends. > > > > > > > > > > > > Thanks. > > > > Best Regards, > > > > --- > > > > MyeongGi Jeong > > > > Senior Engineer, Software Architect > > > > Software R&D Center, Samsung Electronics Co., Ltd. > > > > +82-10-3328-1130 > > > > > > > > > > > > > > > > _______________________________________________ > > iotivity-dev mailing list > > iotivity-dev at lists.iotivity.org > > https://lists.iotivity.org/mailman/listinfo/iotivity-dev > > _______________________________________________ > iotivity-dev mailing list > iotivity-dev at lists.iotivity.org > https://lists.iotivity.org/mailman/listinfo/iotivity-dev > > > > > > > > > > > >
