Parsing about a payload including resource information of multiple devices
authorJaehong Jo <jaehong.jo@samsung.com>
Fri, 8 Jul 2016 06:53:52 +0000 (15:53 +0900)
committerJon A. Cruz <jon@joncruz.org>
Thu, 14 Jul 2016 20:50:20 +0000 (20:50 +0000)
commit8862542143991a1580da151879f56210a4380ccf
treed88bbdf7b8efc20f5d523c59351da32f03e82796
parentdb4616c56dec0763d800fd9c120172977c454ef9
Parsing about a payload including resource information of multiple devices

Assuming the siatuation that many servers published their resource information into resource directory(RD),
then the RD will send response including multiple device information for the discovery request by resouce type.
That means a response payload will be comprised of multiple device list including resource information.
But now, the resource client can parse only the first device's resource information..

There is the payload I tested as follow

[
    {    di=717111ce-31c1-47a0-81a1-3e39eca,
         links=[
                        {href=/q/resource_foo1, rt=core.foo, if=oic.if.baseline, p={bm=1}},
                        {href=/q/resource_foo2, rt=core.foo, if=oic.if.baseline, p={bm=1}}
                 ]
    },
    {    di=a7b77e75-e6d5-4158-af16-3a4dd95,
        links=[
                        {href=/q/resource_foo1, rt=core.foo, if=oic.if.baseline, p={bm=1}},
                        {href=/q/resource_foo2, rt=core.foo, if=oic.if.baseline, p={bm=1}}
                ]
    }
]

Change-Id: Ic1f58c473ab91a497508b2425a4ad07692120054
Signed-off-by: Jaehong Jo <jaehong.jo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/9245
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jon A. Cruz <jon@joncruz.org>
resource/csdk/stack/include/octypes.h
resource/csdk/stack/include/payload_logging.h
resource/csdk/stack/src/ocpayload.c
resource/csdk/stack/src/ocpayloadconvert.c
resource/csdk/stack/src/ocpayloadparse.c
resource/include/OCSerialization.h