• Parkhi's avatar
    Update a payload format to be compatible to OIC spec in easysetup · cb323a1b
    Parkhi authored
    1. In a response for get/post request with batch interface,
       "rep" keyword should be included for containing child resource's properties
       for each child resource.
    2. Provisioning resource is a collection resource so it should have
       a "oic.wk.col" resource type.
    3. "links" property for baseline and linklist interfaces should include a
       "p"(i.e. policy) property.
    
    e.g. response for baseline:
    {
      "rt":[
        "oic.wk.prov",
        "oic.wk.col"
      ],
      "if":[
        "oic.if.baseline",
        "oic.if.ll",
        "oic.if.b"
      ],
      "ps":0,
      "lec":0,
      "links":[
        {
          "href":"/WiFiProvisioningResURI",
          "rt":[
            "oic.wk.wifi"
          ],
          "if":[
            "oic.if.baseline"
          ],
          "p":{
            "bm":3
          }
        },
        {
          "href":"/DevConfProvisioningResURI",
          "rt":[
            "oic.wk.devconf"
          ],
          "if":[
            "oic.if.baseline"
          ],
          "p":{
            "bm":3
          }
        },
        {
          "href":"/CloudServerProvisioningResURI",
          "rt":[
            "oic.wk.cloudserver"
          ],
          "if":[
            "oic.if.baseline"
          ],
          "p":{
            "bm":3
          }
        }
      ]
    }
    
    e.g. response for linklist:
    {
      "links":[
        {
          "href":"/WiFiProvisioningResURI",
          "rt":[
            "oic.wk.wifi"
          ],
          "if":[
            "oic.if.baseline"
          ],
          "p":{
            "bm":3
          }
        },
        {
          "href":"/DevConfProvisioningResURI",
          "rt":[
            "oic.wk.devconf"
          ],
          "if":[
            "oic.if.baseline"
          ],
          "p":{
            "bm":3
          }
        },
        {
          "href":"/CloudServerProvisioningResURI",
          "rt":[
            "oic.wk.cloudserver"
          ],
          "if":[
            "oic.if.baseline"
          ],
          "p":{
            "bm":3
          }
        }
      ]
    }
    
    e.g. response for batch:
    [
      {
        "href":"/ProvisioningResURI",
        "rep":{
          "if":[
            "oic.if.baseline",
            "oic.if.ll",
            "oic.if.b"
          ],
          "rt":[
            "oic.wk.prov",
            "oic.wk.col"
          ],
          "ps":0,
          "lec":0
        }
      },
      {
        "href":"/WiFiProvisioningResURI",
        "rep":{
          "if":[
            "oic.if.baseline"
          ],
          "rt":[
            "oic.wk.wifi"
          ],
          "swmt":[
            2,
            3,
            4
          ],
          "swf":1,
          "tnn":"",
          "cd":"",
          "wat":0,
          "wet":0
        }
      },
      {
        "href":"/CloudServerProvisioningResURI",
        "rep":{
          "if":[
            "oic.if.baseline"
          ],
          "rt":[
            "oic.wk.cloudserver"
          ],
          "ac":"",
          "apn":"",
          "cis":""
        }
      },
      {
        "href":"/DevConfProvisioningResURI",
        "rep":{
          "if":[
            "oic.if.baseline"
          ],
          "rt":[
            "oic.wk.devconf"
          ],
          "dn":"Test Device",
          "mnmo":"Test Model Number",
          "loc":"",
          "lang":"",
          "ctry":""
        }
      }
    
    ]
    
    Change-Id: I13ccda6fedb7c628dc77cc13e84c1c10c0e1b487
    Signed-off-by: default avatarJihun Ha <jihun.ha@samsung.com>
    Signed-off-by: default avatarParkhi <h_w.park@samsung.com>
    Reviewed-on: https://gerrit.iotivity.org/gerrit/14855Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
    Reviewed-by: default avatarUze Choi <uzchoi@samsung.com>
    (cherry picked from commit e1409c4b)
    Reviewed-on: https://gerrit.iotivity.org/gerrit/15139
    cb323a1b
resourcehandler.c 51.8 KB