Imported Upstream version 1.0.1
[platform/upstream/iotivity.git] / resource / csdk / stack / include / octypes.h
index 9e67e78..4125f4d 100644 (file)
@@ -137,6 +137,12 @@ extern "C" {
 /** To represent resource type with presence.*/
 #define OC_RSRVD_RESOURCE_TYPE_PRESENCE "oic.wk.ad"
 
+/** To represent resource type with device.*/
+#define OC_RSRVD_RESOURCE_TYPE_DEVICE   "oic.wk.d"
+
+/** To represent resource type with platform.*/
+#define OC_RSRVD_RESOURCE_TYPE_PLATFORM "oic.wk.p"
+
 /** To represent interface.*/
 #define OC_RSRVD_INTERFACE              "if"
 
@@ -155,6 +161,9 @@ extern "C" {
 /** To represent default interface.*/
 #define OC_RSRVD_INTERFACE_DEFAULT      "oic.if.baseline"
 
+/** To represent read-only interface.*/
+#define OC_RSRVD_INTERFACE_READ         "oic.if.r"
+
 /** To represent ll interface.*/
 #define OC_RSRVD_INTERFACE_LL           "oic.if.ll"
 
@@ -245,10 +254,10 @@ extern "C" {
 #define OC_RSRVD_DATA_MODEL_VERSION     "dmv"
 
 /** Device specification version.*/
-#define OC_SPEC_VERSION                "0.9.0"
+#define OC_SPEC_VERSION                "core.1.0.0"
 
 /** Device Data Model version.*/
-#define OC_DATA_MODEL_VERSION          "sec.0.95"
+#define OC_DATA_MODEL_VERSION          "res.1.0.0"
 
 /**
  *  These provide backward compatibility - their use is deprecated.
@@ -336,11 +345,8 @@ typedef enum
     /**Remote Access over XMPP.*/
     OC_ADAPTER_REMOTE_ACCESS = (1 << 3),
 #endif
-
-#ifdef TCP_ADAPTER
     /** CoAP over TCP.*/
     OC_ADAPTER_TCP           = (1 << 4)
-#endif
 
 } OCTransportAdapter;
 
@@ -462,11 +468,8 @@ typedef enum
     /** Remote Access over XMPP.*/
     CT_ADAPTER_REMOTE_ACCESS = (1 << 19),
 #endif
-
-#ifdef TCP_ADAPTER
     /** CoAP over TCP.*/
     CT_ADAPTER_TCP          = (1 << 20),
-#endif
 
     /** Insecure transport is the default (subject to change).*/
 
@@ -937,10 +940,21 @@ typedef enum
     OCREP_PROP_DOUBLE,
     OCREP_PROP_BOOL,
     OCREP_PROP_STRING,
+    OCREP_PROP_BYTE_STRING,
     OCREP_PROP_OBJECT,
     OCREP_PROP_ARRAY
 }OCRepPayloadPropType;
 
+/** This structure will be used to represent a binary string for CBOR payloads.*/
+typedef struct
+{
+    /** pointer to data bytes.*/
+    uint8_t* bytes;
+
+    /** number of data bytes.*/
+    size_t   len;
+} OCByteString;
+
 #define MAX_REP_ARRAY_DEPTH 3
 typedef struct
 {
@@ -953,6 +967,10 @@ typedef struct
         double* dArray;
         bool* bArray;
         char** strArray;
+
+        /** pointer to ByteString array.*/
+        OCByteString* ocByteStrArray;
+
         struct OCRepPayload** objArray;
     };
 } OCRepPayloadValueArray;
@@ -967,6 +985,10 @@ typedef struct OCRepPayloadValue
         double d;
         bool b;
         char* str;
+
+        /** ByteString object.*/
+        OCByteString ocByteStr;
+
         struct OCRepPayload* obj;
         OCRepPayloadValueArray arr;
     };
@@ -995,7 +1017,6 @@ typedef struct OCRepPayload
 typedef struct OCResourcePayload
 {
     char* uri;
-    uint8_t* sid;
     OCStringLL* types;
     OCStringLL* interfaces;
     uint8_t bitmap;
@@ -1089,6 +1110,9 @@ typedef struct OCResourceCollectionPayload
 typedef struct
 {
     OCPayload base;
+
+    uint8_t* sid;
+
     /** This structure holds the old /oic/res response. */
     OCResourcePayload *resources;
     /** This structure holds the collection response for the /oic/res. */
@@ -1123,7 +1147,6 @@ typedef struct
 typedef struct
 {
     OCPayload base;
-    char* uri;
     uint8_t* sid;
     char* deviceName;
     char* specVersion;