Revert "Generate iotivity_config.h at build time"
[platform/upstream/iotivity.git] / resource / csdk / stack / include / octypes.h
index 39b8aa6..2ae83e4 100644 (file)
@@ -64,15 +64,15 @@ extern "C" {
 
 /** Resource Type.*/
 #define OC_RSRVD_RESOURCE_TYPES_URI           "/oic/res/types/d"
-#if defined (ROUTING_GATEWAY) || defined (ROUTING_EP)
+
 /** Gateway URI.*/
 #define OC_RSRVD_GATEWAY_URI                  "/oic/gateway"
-#endif
 
 /** MQ Broker URI.*/
 #define OC_RSRVD_WELL_KNOWN_MQ_URI            "/oic/ps"
 
-#ifdef WITH_PRESENCE
+
+/** Presence */
 
 /** Presence URI through which the OIC devices advertise their presence.*/
 #define OC_RSRVD_PRESENCE_URI                 "/oic/ad"
@@ -81,13 +81,13 @@ extern "C" {
 #define OC_RSRVD_DEVICE_PRESENCE_URI         "/oic/prs"
 
 /** Sets the default time to live (TTL) for presence.*/
-#define OC_DEFAULT_PRESENCE_TTL_SECONDS (60)
+#define OC_DEFAULT_PRESENCE_TTL_SECONDS       (60)
 
 /** For multicast Discovery mechanism.*/
-#define OC_MULTICAST_DISCOVERY_URI           "/oic/res"
+#define OC_MULTICAST_DISCOVERY_URI            "/oic/res"
 
 /** Separator for multiple query string.*/
-#define OC_QUERY_SEPARATOR                "&;"
+#define OC_QUERY_SEPARATOR                    "&;"
 
 /**
  *  OC_DEFAULT_PRESENCE_TTL_SECONDS sets the default time to live (TTL) for presence.
@@ -101,7 +101,7 @@ extern "C" {
  *  60 sec/min * 60 min/hr * 24 hr/day
  */
 #define OC_MAX_PRESENCE_TTL_SECONDS     (60 * 60 * 24)
-#endif
+
 
 /**
  *  Presence "Announcement Triggers".
@@ -122,6 +122,7 @@ extern "C" {
 
 #define OC_RSRVD_OC                     "oic"
 
+
 /** For payload. */
 
 #define OC_RSRVD_PAYLOAD                "payload"
@@ -151,15 +152,14 @@ extern "C" {
 #define OC_RSRVD_RESOURCE_TYPE_PLATFORM "oic.wk.p"
 
 /** To represent resource type with RES.*/
-#define OC_RSRVD_RESOURCE_TYPE_RES    "oic.wk.res"
+#define OC_RSRVD_RESOURCE_TYPE_RES      "oic.wk.res"
 
-#ifdef WITH_MQ
 /** To represent content type with MQ Broker.*/
-#define OC_RSRVD_RESOURCE_TYPE_MQ_BROKER     "oic.wk.ps"
+#define OC_RSRVD_RESOURCE_TYPE_MQ_BROKER "oic.wk.ps"
 
 /** To represent content type with MQ Topic.*/
-#define OC_RSRVD_RESOURCE_TYPE_MQ_TOPIC      "oic.wk.ps.topic"
-#endif
+#define OC_RSRVD_RESOURCE_TYPE_MQ_TOPIC  "oic.wk.ps.topic"
+
 
 /** To represent interface.*/
 #define OC_RSRVD_INTERFACE              "if"
@@ -256,7 +256,7 @@ extern "C" {
 #define OC_RSRVD_SUPPORT_URL            "mnsl"
 
 /** System time for the platform. */
-#define OC_RSRVD_SYSTEM_TIME             "st"
+#define OC_RSRVD_SYSTEM_TIME            "st"
 
 /**
  *  Device.
@@ -275,10 +275,10 @@ extern "C" {
 #define OC_RSRVD_DATA_MODEL_VERSION     "dmv"
 
 /** Device specification version.*/
-#define OC_SPEC_VERSION                "core.1.0.0"
+#define OC_SPEC_VERSION                 "core.1.0.0"
 
 /** Device Data Model version.*/
-#define OC_DATA_MODEL_VERSION          "res.1.0.0"
+#define OC_DATA_MODEL_VERSION           "res.1.0.0"
 
 /**
  *  These provide backward compatibility - their use is deprecated.
@@ -286,13 +286,13 @@ extern "C" {
 #ifndef GOING_AWAY
 
 /** Multicast Prefix.*/
-#define OC_MULTICAST_PREFIX                  "224.0.1.187:5683"
+#define OC_MULTICAST_PREFIX             "224.0.1.187:5683"
 
 /** Multicast IP address.*/
-#define OC_MULTICAST_IP                      "224.0.1.187"
+#define OC_MULTICAST_IP                 "224.0.1.187"
 
 /** Multicast Port.*/
-#define OC_MULTICAST_PORT                    5683
+#define OC_MULTICAST_PORT               (5683)
 #endif // GOING_AWAY
 
 /** Max Device address size. */
@@ -368,10 +368,10 @@ extern "C" {
 #define OC_RSRVD_ACCOUNT_TOKEN_REFRESH_URI "/oic/account/tokenrefresh"
 
 /** ACL group URI.*/
-#define OC_RSRVD_ACL_GROUP_URI             "/ocf/acl/group"
+#define OC_RSRVD_ACL_GROUP_URI             "/oic/acl/group"
 
 /** ACL invite URI.*/
-#define OC_RSRVD_ACL_INVITE_URI            "/ocf/acl/invite"
+#define OC_RSRVD_ACL_INVITE_URI            "/oic/acl/invite"
 
 /** Defines auth provider. */
 #define OC_RSRVD_AUTHPROVIDER              "authprovider"
@@ -1539,15 +1539,6 @@ typedef struct OCDPDev
 } OCDPDev_t;
 //#endif // DIRECT_PAIRING
 
-/**
- * Type of Group for ACL.
- */
-typedef enum
-{
-    GT_PUBLIC = 0,
-    GT_PRIVATE,
-} OCAclGroupType;
-
 /*
  * -------------------------------------------------------------------------------------------
  * Callback function definitions
@@ -1590,12 +1581,60 @@ typedef struct OCCallbackData
 /**
  * Application server implementations must implement this callback to consume requests OTA.
  * Entity handler callback needs to fill the resPayload of the entityHandlerRequest.
+ *
+ * When you set specific return value like OC_EH_CHANGED, OC_EH_CONTENT,
+ * OC_EH_SLOW and etc in entity handler callback,
+ * ocstack will be not send response automatically to client
+ * except for error return value like OC_EH_ERROR.
+ *
+ * If you want to send response to client with specific result,
+ * OCDoResponse API should be called with the result value.
+ *
+ * e.g)
+ *
+ * OCEntityHandlerResponse response;
+ *
+ * ..
+ *
+ * response.ehResult = OC_EH_CHANGED;
+ *
+ * ..
+ *
+ * OCDoResponse(&response)
+ *
+ * ..
+ *
+ * return OC_EH_OK;
  */
 typedef OCEntityHandlerResult (*OCEntityHandler)
 (OCEntityHandlerFlag flag, OCEntityHandlerRequest * entityHandlerRequest, void* callbackParam);
 
 /**
  * Device Entity handler need to use this call back instead of OCEntityHandler.
+ *
+ * When you set specific return value like OC_EH_CHANGED, OC_EH_CONTENT,
+ * OC_EH_SLOW and etc in entity handler callback,
+ * ocstack will be not send response automatically to client
+ * except for error return value like OC_EH_ERROR.
+ *
+ * If you want to send response to client with specific result,
+ * OCDoResponse API should be called with the result value.
+ *
+ * e.g)
+ *
+ * OCEntityHandlerResponse response;
+ *
+ * ..
+ *
+ * response.ehResult = OC_EH_CHANGED;
+ *
+ * ..
+ *
+ * OCDoResponse(&response)
+ *
+ * ..
+ *
+ * return OC_EH_OK;
  */
 typedef OCEntityHandlerResult (*OCDeviceEntityHandler)
 (OCEntityHandlerFlag flag, OCEntityHandlerRequest * entityHandlerRequest, char* uri, void* callbackParam);