core: Update DMV and ICV value as per the Spec
authorPhilippe Coval <philippe.coval@osg.samsung.com>
Tue, 7 Mar 2017 14:14:23 +0000 (15:14 +0100)
committerZiran Sun <ziran.sun@samsung.com>
Fri, 10 Mar 2017 15:44:49 +0000 (15:44 +0000)
Bug: https://jira.iotivity.org/browse/IOT-1797
Change-Id: Ic818d571ddade00fc9d5d6b31f78bdefb81247cf
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17737
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Habib Virji <habib.virji@samsung.com>
Reviewed-by: Ziran Sun <ziran.sun@samsung.com>
13 files changed:
resource/csdk/include/octypes.h
resource/csdk/stack/samples/linux/SimpleClientServer/ocserver.cpp
resource/csdk/stack/samples/tizen/SimpleClientServer/ocserver.cpp
resource/examples/devicediscoveryserver.cpp
resource/examples/fridgeserver.cpp
resource/examples/garageserver.cpp
resource/examples/lightserver.cpp
resource/examples/mediaserver.cpp
resource/examples/presenceserver.cpp
resource/examples/roomserver.cpp
resource/examples/simpleserver.cpp
resource/examples/simpleserverHQ.cpp
resource/unittests/OCRepresentationEncodingTest.cpp

index 52b17b6..57a4c5a 100755 (executable)
@@ -324,13 +324,13 @@ extern "C" {
 #define OC_RSRVD_DATA_MODEL_VERSION     "dmv"
 
 /** Device specification version.*/
-#define OC_SPEC_VERSION                 "core.1.1.0"
+#define OC_SPEC_VERSION                 "ocf.1.1.0"
 
 /** Integer value of spec version.*/
 #define OC_SPEC_VERSION_VALUE           0
 
 /** Device Data Model version.*/
-#define OC_DATA_MODEL_VERSION           "res.1.1.0,sh.1.1.0"
+#define OC_DATA_MODEL_VERSION           "ocf.res.1.1.0,ocf.sh.1.1.0"
 
 /** Protocol-Independent ID.*/
 #define OC_RSRVD_PROTOCOL_INDEPENDENT_ID "piid"
index 2d857b7..98ed64e 100644 (file)
@@ -98,8 +98,8 @@ const char *platformVersion = "myPlatformVersion";
 const char *supportLink = "https://www.iotivity.org";
 const char *version = "myVersion";
 const char *systemTime = "2015-05-15T11.04";
-const char *specVersion = "core.1.1.0";
-const char *dataModelVersions = "res.1.1.0,sh.1.1.0";
+const char *specVersion = "ocf.1.1.0";
+const char *dataModelVersions = "ocf.res.1.1.0,ocf.sh.1.1.0";
 const char *deviceType = "oic.d.tv";
 
 OCPlatformInfo platformInfo;
index 387e27a..fbb8fd6 100644 (file)
@@ -87,8 +87,8 @@ const char *platformVersion = "myPlatformVersion";
 const char *supportLink = "https://www.iotivity.org";
 const char *version = "myVersion";
 const char *systemTime = "2015-05-15T11.04";
-const char *specVersion = "core.1.1.0";
-const char *dataModelVersions = "res.1.1.0,sh.1.1.0";
+const char *specVersion = "ocf.1.1.0";
+const char *dataModelVersions = "ocf.res.1.1.0,ocf.sh.1.1.0";
 const char *deviceType = "oic.d.tv";
 
 // Entity handler should check for resourceTypeName and ResourceInterface in order to GET
index e709c71..3b6aa3a 100644 (file)
@@ -48,8 +48,8 @@ std::string  systemTime = "2016-01-15T11.01";
 
 // Set of strings for each of device info fields
 std::string  deviceName = "Bill's Battlestar";
-std::string  specVersion = "core.1.1.0";
-std::vector<std::string> dataModelVersions = {"res.1.1.0", "sh.1.1.0"};
+std::string  specVersion = "ocf.1.1.0";
+std::vector<std::string> dataModelVersions = {"ocf.res.1.1.0", "ocf.sh.1.1.0"};
 std::string  protocolIndependentID = "4cae60c1-48cb-47dc-882e-dedec114f45c";
 
 // Device type
index 2ce63ba..964f9b6 100644 (file)
@@ -61,8 +61,8 @@ std::string  systemTime = "2016-01-15T11.01";
 
 // Set of strings for each of device info fields
 std::string  deviceName = "IoTivity Fridge Server";
-std::string  specVersion = "core.1.1.0";
-std::vector<std::string> dataModelVersions = {"res.1.1.0"};
+std::string  specVersion = "ocf.1.1.0";
+std::vector<std::string> dataModelVersions = {"ocf.res.1.1.0"};
 std::string  protocolIndependentID = "054718eb-b1e7-4e9e-9892-30e718a6a8f3";
 
 // OCPlatformInfo Contains all the platform info to be stored
index e8238ef..88a30f4 100644 (file)
@@ -50,8 +50,8 @@ std::string  systemTime = "2016-01-15T11.01";
 
 // Set of strings for each of device info fields
 std::string  deviceName = "IoTivity Garage Server";
-std::string  specVersion = "core.1.1.0";
-std::vector<std::string> dataModelVersions = {"res.1.1.0"};
+std::string  specVersion = "ocf.1.1.0";
+std::vector<std::string> dataModelVersions = {"ocf.res.1.1.0"};
 std::string  protocolIndependentID = "1cbab786-ca5f-4eb9-89b2-e90eb4820145";
 
 // OCPlatformInfo Contains all the platform info to be stored
index a9b605b..0c58e99 100644 (file)
@@ -61,8 +61,8 @@ std::string  systemTime = "2016-01-15T11.01";
 
 // Set of strings for each of device info fields
 std::string  deviceName = "IoTivity Light Server";
-std::string  specVersion = "core.1.1.0";
-std::vector<std::string> dataModelVersions = {"res.1.1.0"};
+std::string  specVersion = "ocf.1.1.0";
+std::vector<std::string> dataModelVersions = {"ocf.res.1.1.0"};
 std::string  protocolIndependentID = "b0ed9259-ec95-4ac6-8f62-241d0da02683";
 
 // OCPlatformInfo Contains all the platform info to be stored
index d9017e7..d0ca927 100644 (file)
@@ -414,7 +414,7 @@ OCStackResult SetDeviceInfo()
         return result;
     }
 
-    result = OCPlatform::setPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_SPEC_VERSION, "core.1.1.0");
+    result = OCPlatform::setPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_SPEC_VERSION, "ocf.1.1.0");
     if (result != OC_STACK_OK)
     {
         cout << "Failed to set spec version" << endl;
index a6b7311..e515b8b 100644 (file)
@@ -61,8 +61,8 @@ std::string  systemTime = "2016-01-15T11.01";
 
 // Set of strings for each of device info fields
 std::string  deviceName = "IoTivity Presence Server";
-std::string  specVersion = "core.1.1.0";
-std::vector<std::string> dataModelVersions = {"res.1.1.0"};
+std::string  specVersion = "ocf.1.1.0";
+std::vector<std::string> dataModelVersions = {"ocf.res.1.1.0"};
 std::string  protocolIndependentID = "41a75d38-83c3-4b83-a794-f2174990b30b";
 
 // OCPlatformInfo Contains all the platform info to be stored
index 65eefa8..36a2ae8 100644 (file)
@@ -58,8 +58,8 @@ std::string  systemTime = "2016-01-15T11.01";
 
 // Set of strings for each of device info fields
 std::string  deviceName = "IoTivity Room Server";
-std::string  specVersion = "core.1.1.0";
-std::vector<std::string> dataModelVersions = {"res.1.1.0"};
+std::string  specVersion = "ocf.1.1.0";
+std::vector<std::string> dataModelVersions = {"ocf.res.1.1.0"};
 std::string  protocolIndependentID = "ac1b42a7-0518-448f-9b11-bfe328837bbf";
 
 // OCPlatformInfo Contains all the platform info to be stored
index 006216f..49583c6 100644 (file)
@@ -67,8 +67,8 @@ std::string  systemTime = "2016-01-15T11.01";
 // Set of strings for each of device info fields
 std::string  deviceName = "IoTivity Simple Server";
 std::string  deviceType = "oic.wk.tv";
-std::string  specVersion = "core.1.1.0";
-std::vector<std::string> dataModelVersions = {"res.1.1.0", "sh.1.1.0"};
+std::string  specVersion = "ocf.1.1.0";
+std::vector<std::string> dataModelVersions = {"ocf.res.1.1.0", "ocf.sh.1.1.0"};
 std::string  protocolIndependentID = "fa008167-3bbf-4c9d-8604-c9bcb96cb712";
 
 // OCPlatformInfo Contains all the platform info to be stored
index 013dbd9..89e68b4 100644 (file)
@@ -63,8 +63,8 @@ std::string  systemTime = "2016-01-15T11.01";
 
 // Set of strings for each of device info fields
 std::string  deviceName = "IoTivity Simple Server HQ";
-std::string  specVersion = "core.1.1.0";
-std::vector<std::string> dataModelVersions = {"res.1.1.0"};
+std::string  specVersion = "ocf.1.1.0";
+std::vector<std::string> dataModelVersions = {"ocf.res.1.1.0"};
 std::string  protocolIndependentID = "88b3584f-d7bc-4e56-9210-0e8b305202c3";
 
 // OCPlatformInfo Contains all the platform info to be stored
index 6ddbed5..f48f9af 100644 (file)
@@ -143,8 +143,8 @@ namespace OCRepresentationEncodingTest
         size_t dim1[MAX_REP_ARRAY_DEPTH] = {2, 0, 0};
         char **dt1 = (char **)OICMalloc(sizeof(char *) * 2);
         EXPECT_TRUE(dt1);
-        dt1[0] = OICStrdup("res.1.1.0");
-        dt1[1] = OICStrdup("sh.1.1.0");
+        dt1[0] = OICStrdup("ocf.res.1.1.0");
+        dt1[1] = OICStrdup("ocf.sh.1.1.0");
         OCRepPayloadSetStringArray(device, OC_RSRVD_DATA_MODEL_VERSION, (const char**)dt1, dim1);
         EXPECT_EQ(OC_STACK_OK, OCConvertPayload((OCPayload *)device, &cborData, &cborSize));
         EXPECT_EQ(OC_STACK_OK, OCParsePayload(&parsedDevice, PAYLOAD_TYPE_REPRESENTATION, cborData, cborSize));
@@ -155,8 +155,8 @@ namespace OCRepresentationEncodingTest
         char **dmv1 = NULL;
         parsedRep = (OCRepPayload *)parsedDevice;
         EXPECT_TRUE(OCRepPayloadGetStringArray(parsedRep, OC_RSRVD_DATA_MODEL_VERSION, &dmv1, dim));
-        EXPECT_STREQ("res.1.1.0", dmv1[0]);
-        EXPECT_STREQ("sh.1.1.0", dmv1[1]);
+        EXPECT_STREQ("ocf.res.1.1.0", dmv1[0]);
+        EXPECT_STREQ("ocf.sh.1.1.0", dmv1[1]);
         OICFree(dmv1[0]);
         OICFree(dmv1[1]);
         OICFree(dmv1);
@@ -166,8 +166,8 @@ namespace OCRepresentationEncodingTest
         EXPECT_EQ(1u, mc2.representations().size());
         const OC::OCRepresentation r2 = mc2.representations()[0];
         std::vector<std::string> dmv3 = r2.getValue<std::vector<std::string>>(OC_RSRVD_DATA_MODEL_VERSION);
-        EXPECT_STREQ("res.1.1.0", dmv3[0].c_str());
-        EXPECT_STREQ("sh.1.1.0", dmv3[1].c_str());
+        EXPECT_STREQ("ocf.res.1.1.0", dmv3[0].c_str());
+        EXPECT_STREQ("ocf.sh.1.1.0", dmv3[1].c_str());
         OCPayloadDestroy(parsedDevice);
     }