VERIFY_NON_NULL(TAG, acl, ERROR, OC_STACK_INVALID_PARAM);
VERIFY_NON_NULL(TAG, resultCallback, ERROR, OC_STACK_INVALID_CALLBACK);
+ // if rowneruuid is empty, set it to device ID
+ OicUuid_t emptyOwner = {.id = {0} };
+ if (memcmp(&(acl->rownerID.id), &emptyOwner, UUID_IDENTITY_SIZE) == 0)
+ {
+ OIC_LOG(DEBUG, TAG, "Set Rowner to PT's deviceId, because Rowner of ACL is empty");
+ OicUuid_t oicUuid;
+
+ if (OC_STACK_OK == GetDoxmDeviceID(&oicUuid))
+ {
+ memcpy(&(acl->rownerID.id), &oicUuid, UUID_IDENTITY_SIZE);
+ }
+ else
+ {
+ OIC_LOG(DEBUG, TAG, "Failed to set Rowner to PT's deviceID\
+ becuase it failed to retrieve Doxm DeviceID");
+ return OC_STACK_ERROR;
+ }
+ }
+
OCSecurityPayload* secPayload = (OCSecurityPayload*)OICCalloc(1, sizeof(OCSecurityPayload));
if(!secPayload)
{
goto error;
}
OIC_LOG_V(DEBUG, TAG, "Query=%s", query);
-
+
OCCallbackData cbData = { .context = NULL, .cb = NULL, .cd = NULL };
OCMethod method = OC_REST_POST;
OCDoHandle handle = NULL;