Dividing Cloud related services under separate Flag
authorabitha.s <abitha.s@samsung.com>
Wed, 3 Aug 2016 13:49:28 +0000 (19:19 +0530)
committerMadan Lanka <lanka.madan@samsung.com>
Thu, 4 Aug 2016 03:17:57 +0000 (03:17 +0000)
1)Moved cloud services in NS Wrapper code inside WITH_CLOUD option built in scons.
2)Refractered the code to move the includes into cpp files.

patch 1 : initial commit
patch 2 : updated with review comments

Change-Id: Icce8f9dbbbec17cea944a8db0aa3ec284b3bf5d4
Signed-off-by: abitha.s <abitha.s@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/9981
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
21 files changed:
service/notification/SConscript
service/notification/cpp-wrapper/common/NSErrorCode.h [new file with mode: 0755]
service/notification/cpp-wrapper/common/NSMediaContents.cpp
service/notification/cpp-wrapper/common/NSMediaContents.h
service/notification/cpp-wrapper/common/NSMessage.cpp
service/notification/cpp-wrapper/common/NSMessage.h
service/notification/cpp-wrapper/common/NSSyncInfo.cpp
service/notification/cpp-wrapper/common/NSSyncInfo.h
service/notification/cpp-wrapper/consumer/SConscript
service/notification/cpp-wrapper/consumer/inc/NSConsumerService.h
service/notification/cpp-wrapper/consumer/inc/NSProvider.h
service/notification/cpp-wrapper/consumer/src/NSConsumerService.cpp
service/notification/cpp-wrapper/consumer/src/NSProvider.cpp
service/notification/cpp-wrapper/examples/linux/SConscript
service/notification/cpp-wrapper/examples/linux/notificationserviceconsumer.cpp
service/notification/cpp-wrapper/examples/linux/notificationserviceprovider.cpp
service/notification/cpp-wrapper/provider/SConscript
service/notification/cpp-wrapper/provider/inc/NSConsumer.h
service/notification/cpp-wrapper/provider/inc/NSProviderService.h
service/notification/cpp-wrapper/provider/src/NSConsumer.cpp
service/notification/cpp-wrapper/provider/src/NSProviderService.cpp

index 012a9b2..ae1b111 100644 (file)
@@ -141,4 +141,4 @@ if target_os == 'android':
     SConscript('android/SConscript')
 
  # Go to build c++ wrapper
-#SConscript('cpp-wrapper/SConscript')
\ No newline at end of file
+SConscript('cpp-wrapper/SConscript')
\ No newline at end of file
diff --git a/service/notification/cpp-wrapper/common/NSErrorCode.h b/service/notification/cpp-wrapper/common/NSErrorCode.h
new file mode 100755 (executable)
index 0000000..c337b10
--- /dev/null
@@ -0,0 +1,47 @@
+//******************************************************************\r
+//\r
+// Copyright 2016 Samsung Electronics All Rights Reserved.\r
+//\r
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
+//\r
+// Licensed under the Apache License, Version 2.0 (the "License");\r
+// you may not use this file except in compliance with the License.\r
+// You may obtain a copy of the License at\r
+//\r
+//      http://www.apache.org/licenses/LICENSE-2.0\r
+//\r
+// Unless required by applicable law or agreed to in writing, software\r
+// distributed under the License is distributed on an "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+// See the License for the specific language governing permissions and\r
+// limitations under the License.\r
+//\r
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
+\r
+/**\r
+ * @file\r
+ *\r
+ * This file contains Notification service Error Codes.\r
+ */\r
+\r
+#ifndef _NS_ERROR_CODE_H_\r
+#define _NS_ERROR_CODE_H_\r
+\r
+\r
+namespace OIC\r
+{\r
+    namespace Service\r
+    {\r
+        /** Result - enumeration for NS service Result*/\r
+        enum class Result\r
+        {\r
+            OK = 100,\r
+            ERROR = 200,\r
+            SUCCESS = 300,\r
+            FAIL = 400,\r
+            ALLOW = 500,\r
+            DENY = 600,\r
+        };\r
+    }\r
+}\r
+#endif /* _NS_ERROR_CODE_H_ */\r
index dc8399c..1920766 100755 (executable)
@@ -19,6 +19,7 @@
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
 \r
 #include "NSMediaContents.h"\r
+#include "string.h"\r
 \r
 namespace OIC\r
 {\r
index da06bc7..6e72484 100755 (executable)
@@ -30,8 +30,6 @@
 \r
 #include <string>\r
 #include "NSCommon.h"\r
-#include "oic_string.h"\r
-#include "string.h"\r
 \r
 namespace OIC\r
 {\r
index 763cf80..899b22c 100755 (executable)
@@ -19,6 +19,8 @@
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
 \r
 #include "NSMessage.h"\r
+#include "string.h"\r
+#include <cstdint>\r
 \r
 namespace OIC\r
 {\r
@@ -102,6 +104,16 @@ namespace OIC
             return m_mediaContents;\r
         }\r
 \r
+        void NSMessage::setMessageId(const uint64_t &messageId)\r
+        {\r
+            m_messageId = messageId;\r
+        }\r
+\r
+        void NSMessage::setProviderId(const std::string &providerId)\r
+        {\r
+            m_providerId = providerId;\r
+        }\r
+\r
         void NSMessage::setType(const NSMessageType &type)\r
         {\r
             m_type = type;\r
index f691e23..6cd7755 100755 (executable)
 #ifndef _NS_MESSAGE_H_\r
 #define _NS_MESSAGE_H_\r
 \r
+#include <string>\r
 #include "NSMediaContents.h"\r
-#include "oic_string.h"\r
-#include <cstdint>\r
-#include "string.h"\r
 \r
 namespace OIC\r
 {\r
@@ -77,6 +75,13 @@ namespace OIC
                 uint64_t getMessageId() const;\r
 \r
                 /**\r
+                     * This method is for setting Message Id from the Notification service Message.\r
+                     *\r
+                     * @param messageId as uint64_t.\r
+                     */\r
+                void setMessageId(const uint64_t &messageId);\r
+\r
+                /**\r
                      * This method is for getting Provider Id from the Notification service Message.\r
                      *\r
                      * @return Id as string.\r
@@ -84,6 +89,13 @@ namespace OIC
                 std::string getProviderId() const;\r
 \r
                 /**\r
+                     * This method is for setting Provider Id from the Notification service Message.\r
+                     *\r
+                     * @param providerId as string.\r
+                     */\r
+                void setProviderId(const std::string &providerId);\r
+\r
+                /**\r
                      * This method is for getting type from the Notification service Message.\r
                      *\r
                      * @return type as NSMessageType.\r
index 4f41dbf..0962c11 100755 (executable)
@@ -19,6 +19,7 @@
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
 \r
 #include "NSSyncInfo.h"\r
+#include "string.h"\r
 \r
 namespace OIC\r
 {\r
index f4b4ef5..e3e5b65 100755 (executable)
@@ -29,8 +29,6 @@
 \r
 #include <string>\r
 #include "NSCommon.h"\r
-#include "oic_string.h"\r
-#include "string.h"\r
 \r
 namespace OIC\r
 {\r
index beef822..642831e 100755 (executable)
@@ -51,13 +51,16 @@ notification_env.AppendUnique(CPPPATH = ['../../src/common'])
 
 notification_env.PrependUnique(LIBS = [
        'oc_logger',
-       'libnotification_consumer'
+       'notification_consumer'
        ])
 notification_env.AppendUnique(CXXFLAGS = ['-O2', '-Wall', '-fmessage-length=0', '-std=c++0x','-frtti'])
 if target_os == 'android':
     notification_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
     notification_env.PrependUnique(LIBS = ['gnustl_shared', 'log'])
 
+if env.get('WITH_CLOUD') == True:      
+       notification_env.AppendUnique(CPPDEFINES = ['WITH_CLOUD'])
+
 ######################################################################
 # Source files and Targets
 ######################################################################
@@ -68,3 +71,7 @@ notification_consumer_src = [
 consumersdk = notification_env.SharedLibrary('notification_consumer_wrapper', notification_consumer_src)
 notification_env.InstallTarget(consumersdk, 'libnotification_consumer_wrapper')
 notification_env.UserInstallTargetLib(consumersdk, 'libnotification_consumer_wrapper')
+
+consumersdk = notification_env.StaticLibrary('notification_consumer_wrapper', notification_consumer_src)
+notification_env.InstallTarget(consumersdk, 'libnotification_consumer_wrapper')
+notification_env.UserInstallTargetLib(consumersdk, 'libnotification_consumer_wrapper')
index 3be2595..e34fd69 100755 (executable)
 #ifndef _NS_CONSUMER_SERVICE_H_\r
 #define _NS_CONSUMER_SERVICE_H_\r
 \r
-#include "NSCommon.h"\r
-#include "NSConsumerInterface.h"\r
 #include <list>\r
 #include <algorithm>\r
-#include "NSConstants.h"\r
+#include "NSProvider.h"\r
+#include "NSErrorCode.h"\r
 \r
 \r
 namespace OIC\r
 {\r
     namespace Service\r
     {\r
-        class NSProvider;\r
         /**\r
          * @class   NSConsumerService\r
          * @brief   This class provides a set of C++APIs for Notification Consumer.\r
@@ -95,9 +93,9 @@ namespace OIC
                 /**\r
                      * Request to discover to remote address as parameter.\r
                      * @param[in]  server address combined with IP address and port number using delimiter :\r
-                     * @return  result code of NSResult\r
+                     * @return  result code of Consumer Service\r
                      */\r
-                NSResult EnableRemoteService(const std::string &serverAddress);\r
+                Result EnableRemoteService(const std::string &serverAddress);\r
 \r
                 /**\r
                       * Request discovery manually\r
index 6f23bc4..5ace980 100755 (executable)
 \r
 \r
 #include <string>\r
-#include <cstring>\r
-#include "oic_string.h"\r
 #include "NSSyncInfo.h"\r
-#include "NSConstants.h"\r
+#include "NSMessage.h"\r
 \r
 namespace OIC\r
 {\r
     namespace Service\r
     {\r
-        class NSMessage;\r
-        class NSSyncInfo;\r
         /**\r
          * @class   NSProvider\r
          * @brief   This class provides a set of Notification service Provider representation APIs.\r
index 602037c..341fb92 100755 (executable)
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
 \r
 #include "NSConsumerService.h"\r
-#include "NSProvider.h"\r
+#include <cstring>\r
+#include "NSConsumerInterface.h"\r
 #include "NSMessage.h"\r
+#include "NSCommon.h"\r
+#include "NSConstants.h"\r
+#include "oic_string.h"\r
 \r
 namespace OIC\r
 {\r
@@ -130,10 +134,15 @@ namespace OIC
             return;\r
         }\r
 \r
-        NSResult NSConsumerService::EnableRemoteService(const std::string &serverAddress)\r
+        Result NSConsumerService::EnableRemoteService(const std::string &serverAddress)\r
         {\r
             NS_LOG(DEBUG, "EnableRemoteService - IN");\r
-            NSResult result = NSConsumerEnableRemoteService(OICStrdup(serverAddress.c_str()));\r
+            Result result = Result::ERROR;\r
+#ifdef WITH_CLOUD\r
+            result = (Result) NSConsumerEnableRemoteService(OICStrdup(serverAddress.c_str()));\r
+#else\r
+            NS_LOG(ERROR, "Remote Services feature is not enabled in the Build");\r
+#endif\r
             NS_LOG(DEBUG, "EnableRemoteService - OUT");\r
             return result;\r
         }\r
index 31d7e52..fe4c228 100755 (executable)
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
 \r
 #include "NSProvider.h"\r
+#include <cstring>\r
 #include "NSConsumerInterface.h"\r
+#include "NSConstants.h"\r
+#include "NSCommon.h"\r
+#include "oic_string.h"\r
 \r
 namespace OIC\r
 {\r
index 96d8f35..1470f3d 100755 (executable)
@@ -1,3 +1,23 @@
+#******************************************************************
+#
+# Copyright 2016 Samsung Electronics All Rights Reserved.
+#
+#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
 ##
 # Notification build script
 ##
@@ -42,6 +62,10 @@ if target_os == 'android':
 
        if not env.get('RELEASE'):
                notification_sample_env.AppendUnique(LIBS = ['log'])
+
+if env.get('WITH_CLOUD') == True:      
+       notification_sample_env.AppendUnique(CPPDEFINES = ['WITH_CLOUD'])
+
 ####################################################################
 # Source files and Targets
 ######################################################################
index b804a59..c2f8fea 100755 (executable)
@@ -102,7 +102,9 @@ int main(void)
 \r
         std::cout << "1. Start Consumer" << std::endl;\r
         std::cout << "2. Stop Consumer" << std::endl;\r
+#ifdef WITH_CLOUD\r
         std::cout << "3. Enable  NS Consumer RemoteService" << std::endl;\r
+#endif\r
         std::cout << "5. Exit" << std::endl;\r
 \r
         std::cout << "Input: " << std::endl;\r
@@ -117,6 +119,7 @@ int main(void)
                 std::cout << "2. Stop the Notification Consumer" << std::endl;\r
                 NSConsumerService::getInstance()->Stop();\r
                 break;\r
+#ifdef WITH_CLOUD\r
             case 3:\r
                 {\r
                     std::cout << "3. Enable NS Consumer RemoteService" << std::endl;\r
@@ -125,6 +128,7 @@ int main(void)
                     NSConsumerService::getInstance()->EnableRemoteService(REMOTE_SERVER_ADDRESS);\r
                     break;\r
                 }\r
+#endif\r
             case 5:\r
                 std::cout << "5. Exit" << std::endl;\r
                 isExit = true;\r
index 9f55712..3e93025 100755 (executable)
@@ -92,8 +92,10 @@ int main()
         std::cout << "2. Start the Notification Provider(Accepter: Consumer)" << std::endl;\r
         std::cout << "3. SendMessage " << std::endl;\r
         std::cout << "4. SendSyncInfo" << std::endl;\r
+#ifdef WITH_CLOUD\r
         std::cout << "5. Enable NS Provider RemoteService" << std::endl;\r
         std::cout << "6. Disable NS Provider RemoteService" << std::endl;\r
+#endif\r
         std::cout << "9. Stop the Notification Provider" << std::endl;\r
         std::cout << "0. Exit()" << std::endl;\r
 \r
@@ -158,6 +160,7 @@ int main()
                             OIC::Service::NSSyncInfo::NSSyncType::NS_SYNC_READ);\r
                     break;\r
                 }\r
+#ifdef WITH_CLOUD\r
             case 5:\r
                 {\r
                     std::cout << "3. Enable NS Provider RemoteService" << std::endl;\r
@@ -173,6 +176,7 @@ int main()
                     NSProviderService::getInstance()->DisableRemoteService(REMOTE_SERVER_ADDRESS);\r
                     break;\r
                 }\r
+#endif\r
             case 9:\r
                 NSProviderService::getInstance()->Stop();\r
                 break;\r
index 92b58b9..1ce64de 100755 (executable)
@@ -51,13 +51,16 @@ notification_env.AppendUnique(CPPPATH = ['../../src/common'])
 
 notification_env.PrependUnique(LIBS = [
        'oc_logger',
-       'libnotification_provider'
+       'notification_provider'
        ])
 notification_env.AppendUnique(CXXFLAGS = ['-O2', '-Wall', '-fmessage-length=0', '-std=c++0x','-frtti'])
 if target_os == 'android':
     notification_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
     notification_env.PrependUnique(LIBS = ['gnustl_shared', 'log'])
 
+if env.get('WITH_CLOUD') == True:      
+       notification_env.AppendUnique(CPPDEFINES = ['WITH_CLOUD'])
+
 ######################################################################
 # Source files and Targets
 ######################################################################
@@ -68,3 +71,7 @@ notification_provider_src = [
 providersdk = notification_env.SharedLibrary('notification_provider_wrapper', notification_provider_src)
 notification_env.InstallTarget(providersdk, 'libnotification_provider_wrapper')
 notification_env.UserInstallTargetLib(providersdk, 'libnotification_provider_wrapper')
+
+providersdk = notification_env.StaticLibrary('notification_provider_wrapper', notification_provider_src)
+notification_env.InstallTarget(providersdk, 'libnotification_provider_wrapper')
+notification_env.UserInstallTargetLib(providersdk, 'libnotification_provider_wrapper')
index cae98c0..ed2bc56 100755 (executable)
 \r
 \r
 #include <string>\r
-#include <cstring>\r
 #include "NSCommon.h"\r
-#include "oic_string.h"\r
-#include "NSConstants.h"\r
 \r
 namespace OIC\r
 {\r
index d98d31e..b71ae29 100755 (executable)
 #ifndef _NS_PROVIDER_SERVICE_H_\r
 #define _NS_PROVIDER_SERVICE_H_\r
 \r
-#include "NSCommon.h"\r
-#include "NSProviderInterface.h"\r
-#include "NSMessage.h"\r
-#include "oic_string.h"\r
+#include <string>\r
 #include "NSConsumer.h"\r
 #include "NSSyncInfo.h"\r
-#include "NSConstants.h"\r
-#include <cstring>\r
+#include "NSMessage.h"\r
+#include "NSErrorCode.h"\r
 \r
 namespace OIC\r
 {\r
@@ -96,43 +93,42 @@ namespace OIC
                       * @param[in]  policy   Accepter\r
                       * @param[in]  config   ProviderConfig Callback function pointers to onConsumerSubscribed,\r
                       * and onMessageSynchronized function listeners\r
-                      * @return :: result code of NSResult\r
+                      * @return :: result code of Provider Service\r
                       */\r
-                NSResult Start(NSAccessPolicy policy, ProviderConfig config);\r
+                Result Start(NSAccessPolicy policy, ProviderConfig config);\r
 \r
                 /**\r
                       * Terminate notification service for provider\r
-                      * @return :: result code of NSResult\r
+                      * @return :: result code of Provider Service\r
                       */\r
-                NSResult Stop();\r
+                Result Stop();\r
 \r
                 /**\r
                       * Request to publish resource to cloud server\r
                       * @param[in]  server address combined with IP address and port number using delimiter :\r
-                      * @return  result code of NSResult\r
+                      * @return  result code of Provider Service\r
                       */\r
-                NSResult EnableRemoteService(const std::string &serverAddress);\r
+                Result EnableRemoteService(const std::string &serverAddress);\r
 \r
                 /**\r
                       * Request to cancel remote service using cloud server\r
                       * @param[in]  server address combined with IP address and port number using delimiter :\r
-                      * @return  result code of NSResult\r
+                      * @return  result code of Provider Service\r
                       */\r
-                NSResult DisableRemoteService(const std::string &serverAddress);\r
+                Result DisableRemoteService(const std::string &serverAddress);\r
 \r
                 /**\r
                       * Send notification message to all subscribers\r
                       * @param[in]  msg  Notification message including id, title, contentText\r
-                      * @return :: result code of NSResult\r
+                      * @return :: result code of Provider Service\r
                       */\r
-                NSResult SendMessage(NSMessage *msg);\r
+                Result SendMessage(NSMessage *msg);\r
 \r
 \r
                 /**\r
                       * Send read-check to provider in order to synchronize notification status with other consumers\r
                       * @param[in]  messageId  Notification message to synchronize the status\r
                       * @param[in]  type  NotificationSyncType of the SyncInfo message\r
-                      * @return :: result code of NSResult\r
                       */\r
                 void SendSyncInfo(uint64_t messageId, NSSyncInfo::NSSyncType type);\r
 \r
index d264191..b10d6b9 100755 (executable)
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
 \r
 #include "NSConsumer.h"\r
+#include <cstring>\r
 #include "NSProviderInterface.h"\r
+#include "NSConstants.h"\r
+#include "oic_string.h"\r
 \r
 namespace OIC\r
 {\r
index 6514d85..fa9a902 100755 (executable)
 \r
 \r
 #include "NSProviderService.h"\r
+#include <cstring>\r
+#include "NSCommon.h"\r
+#include "NSProviderInterface.h"\r
+#include "oic_string.h"\r
+#include "NSConsumer.h"\r
+#include "NSSyncInfo.h"\r
+#include "NSConstants.h"\r
 \r
 namespace OIC\r
 {\r
@@ -71,48 +78,58 @@ namespace OIC
             return &s_instance;\r
         }\r
 \r
-        NSResult NSProviderService::Start(NSProviderService::NSAccessPolicy policy,\r
-                                          NSProviderService::ProviderConfig config)\r
+        Result NSProviderService::Start(NSProviderService::NSAccessPolicy policy,\r
+                                        NSProviderService::ProviderConfig config)\r
         {\r
             NS_LOG(DEBUG, "Start - IN");\r
 \r
             m_config = config;\r
-            NSResult result = NSStartProvider((::NSAccessPolicy)policy, onConsumerSubscribedCallback,\r
-                                              onMessageSynchronizedCallback);\r
+            Result result = (Result) NSStartProvider((::NSAccessPolicy)policy,\r
+                            onConsumerSubscribedCallback, onMessageSynchronizedCallback);\r
             NS_LOG(DEBUG, "Start - OUT");\r
             return result;\r
         }\r
 \r
-        NSResult NSProviderService::Stop()\r
+        Result NSProviderService::Stop()\r
         {\r
             NS_LOG(DEBUG, "Stop - IN");\r
-            NSResult result = NSStopProvider();\r
+            Result result = (Result) NSStopProvider();\r
             NS_LOG(DEBUG, "Stop - OUT");\r
             return result;\r
         }\r
 \r
-        NSResult NSProviderService::EnableRemoteService(const std::string &serverAddress)\r
+        Result NSProviderService::EnableRemoteService(const std::string &serverAddress)\r
         {\r
             NS_LOG(DEBUG, "EnableRemoteService - IN");\r
-            NSResult result = NSProviderEnableRemoteService(OICStrdup(serverAddress.c_str()));\r
+            Result result = Result::ERROR;\r
+#ifdef WITH_CLOUD\r
+            result = (Result) NSProviderEnableRemoteService(OICStrdup(serverAddress.c_str()));\r
+#else\r
+            NS_LOG(ERROR, "Remote Services feature is not enabled in the Build");\r
+#endif\r
             NS_LOG(DEBUG, "EnableRemoteService - OUT");\r
             return result;\r
         }\r
 \r
-        NSResult NSProviderService::DisableRemoteService(const std::string &serverAddress)\r
+        Result NSProviderService::DisableRemoteService(const std::string &serverAddress)\r
         {\r
             NS_LOG(DEBUG, "DisableRemoteService - IN");\r
-            NSResult result = NSProviderDisableRemoteService(OICStrdup(serverAddress.c_str()));\r
+            Result result = Result::ERROR;\r
+#ifdef WITH_CLOUD\r
+            result = (Result) NSProviderDisableRemoteService(OICStrdup(serverAddress.c_str()));\r
+#else\r
+            NS_LOG(ERROR, "Remote Services feature is not enabled in the Build");\r
+#endif\r
             NS_LOG(DEBUG, "DisableRemoteService - OUT");\r
             return result;\r
         }\r
 \r
-        NSResult NSProviderService::SendMessage(NSMessage *msg)\r
+        Result NSProviderService::SendMessage(NSMessage *msg)\r
         {\r
             NS_LOG(DEBUG, "SendMessage - IN");\r
-            NSResult result = NS_ERROR;\r
+            Result result = Result::ERROR;\r
             if (msg != nullptr)\r
-                result = NSSendMessage(getNSMessage(msg));\r
+                result = (Result) NSSendMessage(getNSMessage(msg));\r
             else\r
                 NS_LOG(DEBUG, "Empty Message");\r
             NS_LOG(DEBUG, "SendMessage - OUT");\r