Change pstat.deviceuuid from R-only to RW
authorJongmin Choi <jminl.choi@samsung.com>
Mon, 7 Nov 2016 09:57:14 +0000 (18:57 +0900)
committerRandeep Singh <randeep.s@samsung.com>
Wed, 16 Nov 2016 04:16:23 +0000 (04:16 +0000)
As SWG decided that pstat.deviceuuid is RW,
pstat handler has been fixed accordingly.

Patch #1: Initial upload

Change-Id: Ibc0b1d86ddfb06306268dddaf07f38152d8800f2
Signed-off-by: Jongmin Choi <jminl.choi@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/14069
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Kevin Kane <kkane@microsoft.com>
Reviewed-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
(cherry picked from commit 4f64da7a5e385b66948daee3d61b9b2bf6a408e8)
Reviewed-on: https://gerrit.iotivity.org/gerrit/14347

resource/csdk/security/src/pstatresource.c

index 360eb65..30f9394 100644 (file)
@@ -301,10 +301,6 @@ static OCStackResult CBORPayloadToPstatBin(const uint8_t *cborPayload, const siz
         OICFree(strUuid );
         strUuid  = NULL;
 
-        if (roParsed)
-        {
-            *roParsed = true;
-        }
     }
     else
     {
@@ -603,6 +599,7 @@ static OCEntityHandlerResult HandlePstatPostRequest(const OCEntityHandlerRequest
             gPstat->om = pstat->om;
             gPstat->tm = pstat->tm;
             gPstat->cm = pstat->cm;
+            memcpy(&(gPstat->deviceID), &(pstat->deviceID), sizeof(OicUuid_t));
             memcpy(&(gPstat->rownerID), &(pstat->rownerID), sizeof(OicUuid_t));
 
             // Convert pstat data into CBOR for update to persistent storage