Properly defined URI & Resource Type values for Presence Advertisement.
authorJoseph Morrow <joseph.l.morrow@intel.com>
Wed, 13 May 2015 19:46:27 +0000 (15:46 -0400)
committerErich Keane <erich.keane@intel.com>
Thu, 14 May 2015 16:57:11 +0000 (16:57 +0000)
This changeset ensures that presence advertisments comply with section
11.3.2.4 of OIC Core Specification 0.9. This will ensure that any
implementation of the OIC Core Spec Compliant Project A will be able to
send/receive advertisements with IoTivity.

Change-Id: Ie00347099cab67c03af6557157e64290c625d828
Signed-off-by: Joseph Morrow <joseph.l.morrow@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/981
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Sakthivel Samidurai <sakthivel.samidurai@intel.com>
Reviewed-by: Mandeep Shetty <mandeep.shetty@intel.com>
Reviewed-by: Erich Keane <erich.keane@intel.com>
resource/csdk/stack/include/octypes.h
resource/csdk/stack/src/ocresource.c
resource/src/InProcClientWrapper.cpp
service/notification-manager/NotificationManager/src/hosting.c

index 53357a4..7868428 100644 (file)
@@ -51,7 +51,7 @@ extern "C" {
 /// NOTE: Changing the setting to a longer duration may lead to unsupported and untested
 /// operation.
 #define OC_MAX_PRESENCE_TTL_SECONDS     (60 * 60 * 24) // 60 sec/min * 60 min/hr * 24 hr/day
-#define OC_PRESENCE_URI                      "/oc/presence"
+#define OC_PRESENCE_URI                      "/oic/ad"
 
 /**
  * Attributes used to form a proper OIC conforming JSON message.
@@ -63,7 +63,7 @@ extern "C" {
 #define OC_RSRVD_REPRESENTATION         "rep"
 #define OC_RSRVD_CONTENT_TYPE           "ct"
 #define OC_RSRVD_RESOURCE_TYPE          "rt"
-#define OC_RSRVD_RESOURCE_TYPE_PRESENCE "core.presence"
+#define OC_RSRVD_RESOURCE_TYPE_PRESENCE "oic.wk.ad"
 #define OC_RSRVD_INTERFACE              "if"
 #define OC_RSRVD_DEVICE_ID              "di"
 #define OC_RSRVD_DEVICE_NAME            "dn"
@@ -108,7 +108,7 @@ typedef enum
     OC_DEVICE_URI,              ///< "/oc/core/d"
     OC_RESOURCE_TYPES_URI,      ///< "/oc/core/d/type"
     #ifdef WITH_PRESENCE
-    OC_PRESENCE,                ///< "/oc/presence"
+    OC_PRESENCE,                ///< "/oic/ad"
     #endif
     OC_MAX_VIRTUAL_RESOURCES    ///<s Max items in the list
 } OCVirtualResources;
index 190d2fa..1417f6a 100644 (file)
@@ -55,7 +55,7 @@ static const char * VIRTUAL_RSRCS[] =
        "/oc/core/d",
        "/oc/core/types/d",
        #ifdef WITH_PRESENCE
-       "/oc/presence"
+       "/oic/ad"
        #endif
 };
 
index d8f4f0e..84a8f93 100644 (file)
@@ -773,7 +773,7 @@ namespace OC
         auto cLock = m_csdkLock.lock();
 
         std::ostringstream os;
-        os << host << "/oc/presence";
+        os << host << OC_PRESENCE_URI;
 
         if(!resourceType.empty())
         {
index 5931bfd..3878d6a 100755 (executable)
@@ -38,7 +38,6 @@ static RequestHandleList *s_requestHandleList = NULL;
 #define OC_DEFAULT_ADDRESS               "224.0.1.187"
 #define OC_WELL_KNOWN_COORDINATING_QUERY "coap://224.0.1.187:5683/oc/core?rt=Resource.Hosting"
 #define OC_COORDINATING_QUERY            "/oc/core?rt=Resource.Hosting"
-#define OC_PRESENCE_URI                  "/oc/presence"
 #define DEFAULT_CONTEXT_VALUE 0x99
 
 /*