Add OCGetDeviceOwnedState API
authorjs126.lee <js126.lee@samsung.com>
Thu, 8 Dec 2016 04:00:43 +0000 (13:00 +0900)
committerRandeep Singh <randeep.s@samsung.com>
Thu, 8 Dec 2016 07:52:49 +0000 (07:52 +0000)
Change-Id: Ia9996e794f9cc0eb4b62a4b00b8f6fa79e773fc1
Signed-off-by: js126.lee <js126.lee@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/15247
Reviewed-by: dongik Lee <dongik.lee@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
(cherry picked from commit 9a3b00071047071d218fee88a9d4824bdfd185c7)
Reviewed-on: https://gerrit.iotivity.org/gerrit/15255

resource/csdk/octbstack_product.def
resource/csdk/stack/include/ocstack.h
resource/csdk/stack/src/ocstack.c

index bec1594..a402a87 100644 (file)
@@ -49,6 +49,7 @@ OCEndpointPayloadGetEndpoint
 OCEndpointPayloadGetEndpointCount
 OCFreeOCStringLL
 OCGetDeviceId
+OCGetDeviceOwnedState
 OCGetDirectPairedDevices
 OCGetHeaderOption
 OCGetNumberOfResources
index 61aecda..159684f 100644 (file)
@@ -708,6 +708,14 @@ OCStackResult OCGetDeviceId(OCUUIdentity *deviceId);
  */
 OCStackResult OCSetDeviceId(const OCUUIdentity *deviceId);
 
+ /**
+ * Gets the bool state of "isOwned" property on the doxm resource.
+ *
+ * @param isOwned a pointer to be assigned to isOwned property
+ * @return Returns ::OC_STACK_OK if success.
+ */
+OCStackResult OCGetDeviceOwnedState(bool *isOwned);
+
 /**
  * Encode an address string to match RFC 6874.
  *
index de6c911..4bfd27d 100644 (file)
@@ -5219,3 +5219,21 @@ OCStackResult OCSetDeviceId(const OCUUIdentity *deviceId)
     ret = SetDoxmDeviceID(&oicUuid);
     return ret;
 }
+
+OCStackResult OCGetDeviceOwnedState(bool *isOwned)
+{
+    bool isDeviceOwned = true;
+    OCStackResult ret = OC_STACK_ERROR;
+
+    ret = GetDoxmIsOwned(&isDeviceOwned);
+    if (OC_STACK_OK == ret)
+    {
+        *isOwned = isDeviceOwned;
+    }
+    else
+    {
+        OIC_LOG(ERROR, TAG, "Device Owned State Get error");
+    }
+    return ret;
+}
+