From 2f157eaae1c9ef3d585915440931359aa857459a Mon Sep 17 00:00:00 2001 From: cc Date: Mon, 23 Jan 2017 10:43:30 +0900 Subject: [PATCH] Change notification-service resource type It is required to change notification-service resource type to pass CTT as below. x.org. naming scheme is accepted as vendor specific resource name during OCF F2F meeting in Vegas. oic.wk.xxx -> x.org.iotivity.xxx Change-Id: I7e9d50c315ad7cd4beda6b4454e525dc03d3bfb5 Signed-off-by: cc Reviewed-on: https://gerrit.iotivity.org/gerrit/16687 Reviewed-by: Uze Choi Tested-by: Uze Choi --- .../cpp-wrapper/unittest/NSConsumerServiceSimulator.h | 4 ++-- .../cpp-wrapper/unittest/NSProviderServiceSimulator.h | 8 ++++---- service/notification/src/common/NSConstants.h | 8 ++++---- service/notification/src/consumer/NSConsumerCommon.h | 4 ++-- service/notification/src/consumer/NSConsumerDiscovery.c | 4 ++-- .../notification/src/consumer/NSConsumerNetworkEventListener.c | 2 +- service/notification/unittest/NSConsumerSimulator.h | 8 ++++---- service/notification/unittest/NSProviderSimulator.h | 8 ++++---- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/service/notification/cpp-wrapper/unittest/NSConsumerServiceSimulator.h b/service/notification/cpp-wrapper/unittest/NSConsumerServiceSimulator.h index 054f76c..c34af54 100755 --- a/service/notification/cpp-wrapper/unittest/NSConsumerServiceSimulator.h +++ b/service/notification/cpp-wrapper/unittest/NSConsumerServiceSimulator.h @@ -53,7 +53,7 @@ class NSConsumerSimulator void findProvider() { - OC::OCPlatform::findResource("", std::string("/oic/res?rt=oic.wk.notification"), + OC::OCPlatform::findResource("", std::string("/oic/res?rt=x.org.iotivity.notification"), OCConnectivityType::CT_DEFAULT, std::bind(&NSConsumerSimulator::findResultCallback, this, std::placeholders::_1), OC::QualityOfService::LowQos); @@ -121,7 +121,7 @@ class NSConsumerSimulator try { - std::vector rts{"oic.wk.notification"}; + std::vector rts{"x.org.iotivity.notification"}; m_msgResource = OC::OCPlatform::constructResourceObject( diff --git a/service/notification/cpp-wrapper/unittest/NSProviderServiceSimulator.h b/service/notification/cpp-wrapper/unittest/NSProviderServiceSimulator.h index 4a7488c..229e24b 100755 --- a/service/notification/cpp-wrapper/unittest/NSProviderServiceSimulator.h +++ b/service/notification/cpp-wrapper/unittest/NSProviderServiceSimulator.h @@ -398,7 +398,7 @@ class NSProviderSimulator OC::OCPlatform::startPresence(30); std::string notificationUri = m_notificationUri; - std::string resourceTypeName = "oic.wk.notification.topic"; + std::string resourceTypeName = "x.org.iotivity.notification.topic"; std::string resourceInterface = OC::DEFAULT_INTERFACE; uint8_t resourceProperty = OC_OBSERVABLE; @@ -418,7 +418,7 @@ class NSProviderSimulator } //resourceProperty |= OC_OBSERVABLE; - resourceTypeName = "oic.wk.notification.message"; + resourceTypeName = "x.org.iotivity.notification.message"; childUri = uri + m_messageUri; try { @@ -434,7 +434,7 @@ class NSProviderSimulator std::cout << e.what() << std::endl; } - resourceTypeName = "oic.wk.notification.sync"; + resourceTypeName = "x.org.iotivity.notification.sync"; childUri = uri + m_syncUri; try { @@ -451,7 +451,7 @@ class NSProviderSimulator } resourceProperty |= OC_DISCOVERABLE; - resourceTypeName = "oic.wk.notification"; + resourceTypeName = "x.org.iotivity.notification"; try { OC::OCPlatform::registerResource( diff --git a/service/notification/src/common/NSConstants.h b/service/notification/src/common/NSConstants.h index 2eda9c6..df3dde1 100644 --- a/service/notification/src/common/NSConstants.h +++ b/service/notification/src/common/NSConstants.h @@ -89,10 +89,10 @@ #define RESOURCE_TAG "NS_PROVIDER_RESOURCE" #define TOPIC_TAG "NS_PROVIDER_TOPIC" -#define NS_ROOT_TYPE "oic.wk.notification" -#define NS_COLLECTION_MESSAGE_TYPE "oic.wk.notification.message" -#define NS_COLLECTION_SYNC_TYPE "oic.wk.notification.sync" -#define NS_COLLECTION_TOPIC_TYPE "oic.wk.notification.topic" +#define NS_ROOT_TYPE "x.org.iotivity.notification" +#define NS_COLLECTION_MESSAGE_TYPE "x.org.iotivity.notification.message" +#define NS_COLLECTION_SYNC_TYPE "x.org.iotivity.notification.sync" +#define NS_COLLECTION_TOPIC_TYPE "x.org.iotivity.notification.topic" #define NS_INTERFACE_READ "oic.if.r" #define NS_INTERFACE_READWRITE "oic.if.rw" diff --git a/service/notification/src/consumer/NSConsumerCommon.h b/service/notification/src/consumer/NSConsumerCommon.h index 9320625..2100b22 100644 --- a/service/notification/src/consumer/NSConsumerCommon.h +++ b/service/notification/src/consumer/NSConsumerCommon.h @@ -33,12 +33,12 @@ extern "C" { #include "ocstack.h" #define NS_QOS OC_HIGH_QOS -#define NS_RESOURCE_TYPE "oic.wk.notification" +#define NS_RESOURCE_TYPE "x.org.iotivity.notification" #define NS_RESOURCE_URI "/notification" #define NS_INTERFACE_BASELINE "oic.if.baseline" #define NS_RESOURCE_QUERY "/oic/res" -#define NS_DISCOVER_QUERY "/oic/res?rt=oic.wk.notification" +#define NS_DISCOVER_QUERY "/oic/res?rt=x.org.iotivity.notification" #define NS_DEVICE_ID_LENGTH 37 typedef enum diff --git a/service/notification/src/consumer/NSConsumerDiscovery.c b/service/notification/src/consumer/NSConsumerDiscovery.c index 5b6a070..4d4f072 100644 --- a/service/notification/src/consumer/NSConsumerDiscovery.c +++ b/service/notification/src/consumer/NSConsumerDiscovery.c @@ -29,8 +29,8 @@ #include "oic_malloc.h" #include "oic_string.h" -#define NS_DISCOVER_QUERY "/oic/res?rt=oic.wk.notification" -#define NS_PRESENCE_SUBSCRIBE_QUERY_TCP "/oic/ad?rt=oic.wk.notification" +#define NS_DISCOVER_QUERY "/oic/res?rt=x.org.iotivity.notification" +#define NS_PRESENCE_SUBSCRIBE_QUERY_TCP "/oic/ad?rt=x.org.iotivity.notification" OCStackApplicationResult NSConsumerPresenceListener( void * ctx, OCDoHandle handle, OCClientResponse * clientResponse) diff --git a/service/notification/src/consumer/NSConsumerNetworkEventListener.c b/service/notification/src/consumer/NSConsumerNetworkEventListener.c index 8e9e1e5..4e22d7b 100644 --- a/service/notification/src/consumer/NSConsumerNetworkEventListener.c +++ b/service/notification/src/consumer/NSConsumerNetworkEventListener.c @@ -30,7 +30,7 @@ #include "NSConsumerDiscovery.h" #include "NSConsumerNetworkEventListener.h" -#define NS_PRESENCE_SUBSCRIBE_QUERY "/oic/ad?rt=oic.wk.notification" +#define NS_PRESENCE_SUBSCRIBE_QUERY "/oic/ad?rt=x.org.iotivity.notification" void NSConnectionStateListener(const CAEndpoint_t * info, bool isConnected); diff --git a/service/notification/unittest/NSConsumerSimulator.h b/service/notification/unittest/NSConsumerSimulator.h index 1a7a8ff..2bca595 100644 --- a/service/notification/unittest/NSConsumerSimulator.h +++ b/service/notification/unittest/NSConsumerSimulator.h @@ -53,7 +53,7 @@ public: void findProvider() { - OC::OCPlatform::findResource("", std::string("/oic/res?rt=oic.wk.notification"), + OC::OCPlatform::findResource("", std::string("/oic/res?rt=x.org.iotivity.notification"), OCConnectivityType::CT_DEFAULT, std::bind(&NSConsumerSimulator::findResultCallback, this, std::placeholders::_1), OC::QualityOfService::LowQos); @@ -99,7 +99,7 @@ private: { if(resource->uri() == "/notification") { - resource->get(std::string("oic.wk.notification"), std::string("oic.if.baseline"), + resource->get(std::string("x.org.iotivity.notification"), std::string("oic.if.baseline"), OC::QueryParamsMap(), std::bind(&NSConsumerSimulator::onGet, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, resource), OC::QualityOfService::LowQos); @@ -115,7 +115,7 @@ private: try { - std::vector rts{"oic.wk.notification"}; + std::vector rts{"x.org.iotivity.notification"}; m_msgResource = OC::OCPlatform::constructResourceObject( @@ -165,7 +165,7 @@ private: if(rep.getValue("messageid") == 3) { - m_topicResource->get(std::string("oic.wk.notification"), + m_topicResource->get(std::string("x.org.iotivity.notification"), std::string("oic.if.baseline"), OC::QueryParamsMap(), std::bind(&NSConsumerSimulator::onTopicGet, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, m_topicResource), diff --git a/service/notification/unittest/NSProviderSimulator.h b/service/notification/unittest/NSProviderSimulator.h index 8874733..2798e5d 100644 --- a/service/notification/unittest/NSProviderSimulator.h +++ b/service/notification/unittest/NSProviderSimulator.h @@ -398,7 +398,7 @@ public: OC::OCPlatform::startPresence(30); std::string notificationUri = m_notificationUri; - std::string resourceTypeName = "oic.wk.notification.topic"; + std::string resourceTypeName = "x.org.iotivity.notification.topic"; std::string resourceInterface = OC::DEFAULT_INTERFACE; uint8_t resourceProperty = OC_OBSERVABLE; @@ -418,7 +418,7 @@ public: } //resourceProperty |= OC_OBSERVABLE; - resourceTypeName = "oic.wk.notification.message"; + resourceTypeName = "x.org.iotivity.notification.message"; childUri = uri + m_messageUri; try { @@ -434,7 +434,7 @@ public: std::cout << e.what() << std::endl; } - resourceTypeName = "oic.wk.notification.sync"; + resourceTypeName = "x.org.iotivity.notification.sync"; childUri = uri + m_syncUri; try { @@ -451,7 +451,7 @@ public: } resourceProperty |= OC_DISCOVERABLE; - resourceTypeName = "oic.wk.notification"; + resourceTypeName = "x.org.iotivity.notification"; try { OC::OCPlatform::registerResource( -- 2.7.4