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>
Tue, 15 Nov 2016 08:11:45 +0000 (08:11 +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>
resource/csdk/security/src/pstatresource.c

index 360eb65b431d87bbc8ee894b20cd2a89ed928eb7..30f939467ea4bd2301e953e4ced1f6c5bcd65808 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