Merge tizen_5.0 codes into tizen_4.0
[platform/upstream/iotivity.git] / resource / csdk / stack / include / ocstack.h
index 2a9f595..96bae43 100644 (file)
@@ -144,7 +144,7 @@ OCStackResult OCProcess();
  *                          favor of destination.)
  * @param destination       Complete description of destination.
  * @param payload           Encoded request payload,
                           OCDoResource will free given payload when return OC_STATUS_OK.
*                          OCDoResource will free given payload.
  * @param connectivityType  Modifier flags when destination is not given.
  * @param qos               Quality of service. Note that if this API is called on a uri with the
  *                          well-known multicast IP address, the qos will be forced to ::OC_LOW_QOS
@@ -189,7 +189,7 @@ OCStackResult OCDoResource(OCDoHandle *handle,
  *                          favor of destination.)
  * @param destination       Complete description of destination.
  * @param payload           Encoded request payload.
                           OCDoRequest does not free given payload.
*                          OCDoRequest does not free given payload.
  * @param connectivityType  Modifier flags when destination is not given.
  * @param qos               Quality of service. Note that if this API is called on a uri with the
  *                          well-known multicast IP address, the qos will be forced to ::OC_LOW_QOS
@@ -245,7 +245,6 @@ OCStackResult OCCancel(OCDoHandle handle,
  */
 OCStackResult OCRegisterPersistentStorageHandler(OCPersistentStorage* persistentStorageHandler);
 
-#ifdef WITH_PRESENCE
 /**
  * When operating in  OCServer or  OCClientServer mode,
  * this API will start sending out presence notifications to clients via multicast.
@@ -277,8 +276,6 @@ OCStackResult OCStartPresence(const uint32_t ttl);
  */
 
 OCStackResult OCStopPresence();
-#endif // WITH_PRESENCE
-
 
 /**
  * This function sets default device entity handler.
@@ -379,6 +376,19 @@ OCStackResult OCUnBindResource(OCResourceHandle collectionHandle, OCResourceHand
  */
 OCStackResult OCBindResourceTypeToResource(OCResourceHandle handle,
                                            const char *resourceTypeName);
+
+/**
+ * This function clears all bound resource types and bind newly passing
+ * resource type to resource.
+ *
+ * @param handle            Handle to the resource.
+ * @param newResourceType   Name of resource type.  Example: "core.led".
+ *
+ * @return ::OC_STACK_OK on success, some other value upon failure.
+ */
+OCStackResult OCResetResourceTypes(OCResourceHandle handle,
+                                   const char *newResourceType);
+
 /**
  * This function binds a resource interface to a resource.
  *
@@ -391,6 +401,18 @@ OCStackResult OCBindResourceInterfaceToResource(OCResourceHandle handle,
                                                 const char *resourceInterfaceName);
 
 /**
+ * This function clears all bound interfaces and bind newly passing
+ * interface to resource.
+ *
+ * @param handle                  Handle to the resource.
+ * @param newResourceInterface    Name of resource interface.  Example: "core.rw".
+ *
+ * @return ::OC_STACK_OK on success, some other value upon failure.
+ */
+OCStackResult OCResetResourceInterfaces(OCResourceHandle handle,
+                                        const char *newResourceInterface);
+
+/**
  * This function binds an entity handler to the resource.
  *
  * @param handle            Handle to the resource that the contained resource is to be bound.
@@ -693,7 +715,7 @@ OCStackResult
 OCSetHeaderOption(OCHeaderOption* ocHdrOpt,
                   size_t* numOptions,
                   uint16_t optionID,
-                  void* optionData,
+                  const void* optionData,
                   size_t optionDataLength);
 
 /**
@@ -878,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