Check Device Operational State 60/194560/1 accepted/tizen/5.0/unified/20181206.055549 submit/tizen_5.0/20181206.000945
authorVitalii Irkha <v.irkha@samsung.com>
Wed, 5 Dec 2018 12:17:46 +0000 (14:17 +0200)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 6 Dec 2018 00:07:16 +0000 (09:07 +0900)
Add API - OCGetDeviceOperationalState() to get isop value of pstat.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/353
(cherry picked from commit 2c2d19d2012093aee3fe1fb7e83e24f19871dbe7)

Change-Id: Icc64e0d8767dbb98620860955c84004418505531
Signed-off-by: Vitalii Irkha <v.irkha@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
resource/csdk/stack/include/ocstack.h
resource/csdk/stack/src/ocstack.c

index 81cbab5..96bae43 100644 (file)
@@ -900,6 +900,14 @@ OCStackResult OCGetKey(unsigned char* key);
  */
 OCStackResult OCSetOtmEventHandler(void *ctx, OCOtmEventHandler cb);
 
+ /**
+ * Gets the bool state of "isOp" property on the pstat resource
+ * @param isOp a pointer to be assigned to isop property
+ * @return Returns ::OC_STACK_OK.
+ */
+
+OCStackResult OCGetDeviceOperationalState(bool* isOp);
+
 #ifdef __cplusplus
 }
 #endif // __cplusplus
index adba4c5..8f77cf7 100644 (file)
@@ -5570,6 +5570,17 @@ OCStackResult OCGetDeviceOwnedState(bool *isOwned)
     return ret;
 }
 
+OCStackResult OCGetDeviceOperationalState(bool* isOp)
+{
+    if(NULL != isOp)
+    {
+        *isOp = GetPstatIsop();
+        return OC_STACK_OK;
+    }
+
+    return OC_STACK_ERROR;
+}
+
 void OCClearCallBackList()
 {
     DeleteClientCBList();