Fix for resource type name of resource hosting.
authorjyong2.kim <jyong2.kim@samsung.com>
Tue, 29 Sep 2015 08:49:01 +0000 (17:49 +0900)
committerMadan Lanka <lanka.madan@samsung.com>
Tue, 29 Sep 2015 11:26:38 +0000 (11:26 +0000)
resource type name is modified to follow naming convention.

Change-Id: I121bc75e627db58332778ff249f7f8fb512a23d2
Signed-off-by: jyong2.kim <jyong2.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/3257
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
service/resource-hosting/SConscript
service/resource-hosting/SampleApp/android/SampleConsumer/src/com/example/sample/consumer/SampleConsumer.java
service/resource-hosting/SampleApp/android/SampleProviderApp/src/com/example/sample/provider/StringConstants.java
service/resource-hosting/SampleApp/linux/sampleConsumer/SampleConsumer.cpp
service/resource-hosting/SampleApp/linux/sampleProvider/SampleProvider.cpp
service/resource-hosting/SampleApp/linux/sampleResourceHosting/main.cpp
service/resource-hosting/SampleApp/tizen/NMSampleApp/src/main.cpp
service/resource-hosting/android/resource_hosting/jni/ResourceHosing_JNI.cpp
service/resource-hosting/include/Hosting.h [moved from service/resource-hosting/include/hosting.h with 100% similarity]
service/resource-hosting/src/Hosting.cpp [moved from service/resource-hosting/src/hosting.cpp with 98% similarity]
service/resource-hosting/src/ResourceHosting.cpp

index 6c356c3..68ddd51 100644 (file)
@@ -77,7 +77,7 @@ if target_os == 'android':
 ######################################################################
 HOSTING_SRC_DIR = 'src/'
 resourcehosting_src = [
-        HOSTING_SRC_DIR + 'hosting.cpp',
+        HOSTING_SRC_DIR + 'Hosting.cpp',
         HOSTING_SRC_DIR + 'ResourceHosting.cpp',
         HOSTING_SRC_DIR + 'HostingObject.cpp',
         HOSTING_SRC_DIR + 'RequestObject.cpp'
@@ -90,8 +90,8 @@ else :
 
 resourcehosting_env.InstallTarget(resourcehostingsdk, 'libresource_hosting')
 resourcehosting_env.UserInstallTargetLib(resourcehostingsdk, 'libresource_hosting')
-resourcehosting_env.UserInstallTargetHeader('include/hosting.h',\
-       'service/resource-hosting', 'hosting.h')
+resourcehosting_env.UserInstallTargetHeader('include/Hosting.h',\
+       'service/resource-hosting', 'Hosting.h')
 
 # Go to build Unit test
 if target_os == 'linux':
index 4cc974f..f88a26b 100644 (file)
@@ -173,7 +173,7 @@ public class SampleConsumer extends Activity implements View.OnClickListener,
     }
 
     public void findResourceCandidate() {
-        nmfindResource("", "/oic/res?rt=resource.hosting");
+        nmfindResource("", "/oic/res?rt=oic.r.resourcehosting");
         current_log_result += "Finding Resource... \n";
         tv_current_log_result.setText(current_log_result);
         Log.i(TAG, current_log_result);
index bd37808..22e2093 100644 (file)
@@ -4,7 +4,7 @@ import org.iotivity.base.OcPlatform;
 
 public class StringConstants {
     public static final String RESOURCE_URI       = "/a/TempHumSensor/hosting";
-    public static final String RESOURCE_TYPENAME  = "resource.hosting";
+    public static final String RESOURCE_TYPENAME  = "oic.r.resourcehosting";
     public static final String RESOURCE_INTERFACE = OcPlatform.DEFAULT_INTERFACE; // resource interface
     public static final String HUMIDITY           = "humidity";
     public static final String TEMPERATURE        = "temperature";
index d3c2d61..f46b880 100644 (file)
@@ -34,7 +34,7 @@ using namespace OC;
 
 const int SUCCESS_RESPONSE = OC_STACK_OK;
 
-#define OC_WELL_KNOWN_COORDINATING_QUERY "/oic/res?rt=resource.hosting"
+#define OC_WELL_KNOWN_COORDINATING_QUERY "/oic/res?rt=oic.r.resourcehosting"
 
 #define OBSERVE 1
 #define GET     2
index d44bcb5..0aaa0cf 100644 (file)
@@ -63,7 +63,7 @@ class TempHumidResource
         void createResource()
         {
             std::string resourceURI = "/a/TempHumSensor/hosting";
-            std::string resourceTypeName = "resource.hosting";
+            std::string resourceTypeName = "oic.r.resourcehosting";
             std::string resourceInterface = DEFAULT_INTERFACE;
 
             m_uri = resourceURI;
@@ -83,7 +83,7 @@ class TempHumidResource
         {
             std::string resourceURI = "/a/NM/TempHumSensor1"; // URI of the resource
             std::string resourceTypeName =
-                "notificationmanager.hosting"; // resource type name. In this case, it is light
+                "oic.r.resourcehosting"; // resource type name.
             std::string resourceInterface = DEFAULT_INTERFACE; // resource interface.
 
             // OCResourceProperty is defined ocstack.h
index 227772b..5712316 100644 (file)
@@ -22,7 +22,7 @@
 #include "nmutil.h"
 #include <algorithm>
 #include <signal.h>
-#include "hosting.h"
+#include "Hosting.h"
 
 using namespace std;
 using namespace OC;
index 2b7106b..faca8ce 100644 (file)
@@ -20,7 +20,7 @@
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
 extern "C" {
-#include "hosting.h"
+#include "Hosting.h"
 }
 #include "ResourceHosing_JNI.h"
 #include "OCAndroid.h"
similarity index 98%
rename from service/resource-hosting/src/hosting.cpp
rename to service/resource-hosting/src/Hosting.cpp
index 3d0ccfa..c7c2005 100644 (file)
@@ -18,7 +18,7 @@
 //
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
-#include "hosting.h"
+#include "Hosting.h"
 
 // Standard API
 #include <stdio.h>
index 765a256..32516e3 100644 (file)
@@ -34,7 +34,7 @@ namespace
     std::string HOSTING_TAG = "/hosting";
     size_t HOSTING_TAG_SIZE = (size_t)HOSTING_TAG.size();
     std::string MULTICAST_PRESENCE_ADDRESS = std::string("coap://") + OC_MULTICAST_PREFIX;
-    std::string HOSTING_RESOURSE_TYPE = "resource.hosting";
+    std::string HOSTING_RESOURSE_TYPE = "oic.r.resourcehosting";
 }
 
 ResourceHosting * ResourceHosting::s_instance(nullptr);
@@ -107,7 +107,6 @@ void ResourceHosting::requestMulticastDiscovery()
 
 void ResourceHosting::discoverHandler(RemoteObjectPtr remoteResource)
 {
-    std::cout << "Discovered Resource uri : " << remoteResource->getUri() << std::endl;
     std::string discoverdUri = remoteResource->getUri();
     if(discoverdUri.compare(
             discoverdUri.size()-HOSTING_TAG_SIZE, HOSTING_TAG_SIZE, HOSTING_TAG) != 0)