Added preprocessor WITH_CLOUD for Subscribe device presence.
authorJaehong Jo <jaehong.jo@samsung.com>
Fri, 22 Jul 2016 02:41:39 +0000 (11:41 +0900)
committerAshok Babu Channa <ashok.channa@samsung.com>
Tue, 26 Jul 2016 03:32:58 +0000 (03:32 +0000)
It is only used with RD in cloud.

Change-Id: Iabebe4b8b6cf33443e6114281d1ab8ceb3a1b646
Signed-off-by: Jaehong Jo <jaehong.jo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/9585
Reviewed-by: Eunok Shin <eunok.shin@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: jihwan seo <jihwan.seo@samsung.com>
Reviewed-by: Hyuna Jo <hyuna0213.jo@samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
resource/csdk/stack/include/octypes.h
resource/include/IClientWrapper.h
resource/include/InProcClientWrapper.h
resource/include/OCPlatform.h
resource/include/OCPlatform_impl.h
resource/include/OutOfProcClientWrapper.h
resource/src/InProcClientWrapper.cpp
resource/src/OCPlatform.cpp
resource/src/OCPlatform_impl.cpp
resource/unittests/OCPlatformTest.cpp

index b132d6e..c45d3c6 100644 (file)
@@ -79,8 +79,10 @@ extern "C" {
 /** Presence URI through which the OIC devices advertise their presence.*/
 #define OC_RSRVD_PRESENCE_URI                 "/oic/ad"
 
+#ifdef WITH_CLOUD
 /** Presence URI through which the OCF devices advertise their device presence.*/
 #define OCF_RSRVD_DEVICE_PRESENCE_URI         "/.well-known/ocf/prs"
+#endif
 
 /** Sets the default time to live (TTL) for presence.*/
 #define OC_DEFAULT_PRESENCE_TTL_SECONDS (60)
index 43e52c1..e560219 100644 (file)
@@ -109,11 +109,13 @@ namespace OC
 
         virtual OCStackResult UnsubscribePresence(OCDoHandle handle) =0;
 
+#ifdef WITH_CLOUD
         virtual OCStackResult SubscribeDevicePresence(OCDoHandle* handle,
                                                       const std::string& host,
                                                       const QueryParamsList& queryParams,
                                                       OCConnectivityType connectivityType,
                                                       ObserveCallback& callback) = 0;
+#endif
 
         virtual OCStackResult GetDefaultQos(QualityOfService& qos) = 0;
 
index e97c990..0cd2df4 100644 (file)
@@ -179,11 +179,13 @@ namespace OC
 
         virtual OCStackResult UnsubscribePresence(OCDoHandle handle);
 
+#ifdef WITH_CLOUD
         virtual OCStackResult SubscribeDevicePresence(OCDoHandle* handle,
                                                       const std::string& host,
                                                       const QueryParamsList& queryParams,
                                                       OCConnectivityType connectivityType,
                                                       ObserveCallback& callback);
+#endif
 
         OCStackResult GetDefaultQos(QualityOfService& QoS);
 
index c3d540f..f5e9692 100644 (file)
@@ -534,6 +534,7 @@ namespace OC
          */
         OCStackResult unsubscribePresence(OCPresenceHandle presenceHandle);
 
+#ifdef WITH_CLOUD
         /**
          * Subscribes to a server's device presence change events.
          *
@@ -555,6 +556,7 @@ namespace OC
                                               const QueryParamsList& queryParams,
                                               OCConnectivityType connectivityType,
                                               ObserveCallback callback);
+#endif
 
         /**
          * Creates a resource proxy object so that get/put/observe functionality
index 2beb4a3..7897c46 100644 (file)
@@ -225,11 +225,13 @@ namespace OC
                         SubscribeCallback presenceHandler);
         OCStackResult unsubscribePresence(OCPresenceHandle presenceHandle);
 
+#ifdef WITH_CLOUD
         OCStackResult subscribeDevicePresence(OCPresenceHandle& presenceHandle,
                                               const std::string& host,
                                               const QueryParamsList& queryParams,
                                               OCConnectivityType connectivityType,
                                               ObserveCallback callback);
+#endif
 
         OCResource::Ptr constructResourceObject(const std::string& host, const std::string& uri,
                         OCConnectivityType connectivityType, bool isObservable,
index 513156d..982fbb3 100644 (file)
@@ -121,7 +121,7 @@ namespace OC
 
         virtual OCStackResult UnsubscribePresence(OCDoHandle /*handle*/)
             {return OC_STACK_NOTIMPL;}
-
+#ifdef WITH_CLOUD
         virtual OCStackResult SubscribeDevicePresence(
             OCDoHandle* /*handle*/,
             const std::string& /*host*/,
@@ -129,6 +129,7 @@ namespace OC
             OCConnectivityType /*connectivityType*/,
             ObserveCallback& /*callback*/)
             {return OC_STACK_NOTIMPL;}
+#endif
 
         virtual OCStackResult GetDefaultQos(QualityOfService& /*QoS*/)
             {return OC_STACK_NOTIMPL;}
index 8a892c6..76cce93 100644 (file)
@@ -1197,6 +1197,7 @@ namespace OC
         return result;
     }
 
+#ifdef WITH_CLOUD
     OCStackResult InProcClientWrapper::SubscribeDevicePresence(OCDoHandle* handle,
                                                                const std::string& host,
                                                                const QueryParamsList& queryParams,
@@ -1240,6 +1241,7 @@ namespace OC
 
         return result;
     }
+#endif
 
     OCStackResult InProcClientWrapper::GetDefaultQos(QualityOfService& qos)
     {
index dd161e4..913f658 100644 (file)
@@ -266,6 +266,7 @@ namespace OC
             return OCPlatform_impl::Instance().unsubscribePresence(presenceHandle);
         }
 
+#ifdef WITH_CLOUD
         OCStackResult subscribeDevicePresence(OCPresenceHandle& presenceHandle,
                                               const std::string& host,
                                               const QueryParamsList& queryParams,
@@ -278,6 +279,7 @@ namespace OC
                                                                        connectivityType,
                                                                        callback);
         }
+#endif
 
         OCStackResult sendResponse(const std::shared_ptr<OCResourceResponse> pResponse)
         {
index f40c14c..f5817c6 100644 (file)
@@ -382,6 +382,7 @@ namespace OC
                              std::ref(presenceHandle));
     }
 
+#ifdef WITH_CLOUD
     OCStackResult OCPlatform_impl::subscribeDevicePresence(OCPresenceHandle& presenceHandle,
                                                            const std::string& host,
                                                            const QueryParamsList& queryParams,
@@ -391,6 +392,7 @@ namespace OC
         return checked_guard(m_client, &IClientWrapper::SubscribeDevicePresence,
                              &presenceHandle, host, queryParams, connectivityType, callback);
     }
+#endif
 
     OCStackResult OCPlatform_impl::sendResponse(const std::shared_ptr<OCResourceResponse> pResponse)
     {
index 2a18ad7..d7e2cf2 100644 (file)
@@ -62,9 +62,11 @@ namespace OCPlatformTest
     {
     }
 
+#ifdef WITH_CLOUD
     void onObserve(const HeaderOptions, const OCRepresentation&, const int&, const int&)
     {
     }
+#endif
 
     void directPairHandler(std::shared_ptr<OCDirectPairing> /*dev*/, OCStackResult /*res*/)
     {
@@ -837,6 +839,7 @@ namespace OCPlatformTest
         EXPECT_EQ(OC_STACK_OK, OCPlatform::unsubscribePresence(presenceHandle));
     }
 
+#ifdef WITH_CLOUD
     //SubscribeDevicePresence Test
     TEST(SubscribeDevicePresenceTest, DISABLED_SubscribeDevicePresenceWithValidParameters)
     {
@@ -877,6 +880,7 @@ namespace OCPlatformTest
                 hostAddress, queryParams, CT_DEFAULT, &onObserve));
         EXPECT_EQ(OC_STACK_OK, OCPlatform::unsubscribePresence(presenceHandle));
     }
+#endif
 
     TEST(FindDirectPairingTest, FindDirectPairingNullCallback)
     {