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>
/** 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)
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;
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);
*/
OCStackResult unsubscribePresence(OCPresenceHandle presenceHandle);
+#ifdef WITH_CLOUD
/**
* Subscribes to a server's device presence change events.
*
const QueryParamsList& queryParams,
OCConnectivityType connectivityType,
ObserveCallback callback);
+#endif
/**
* Creates a resource proxy object so that get/put/observe functionality
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,
virtual OCStackResult UnsubscribePresence(OCDoHandle /*handle*/)
{return OC_STACK_NOTIMPL;}
-
+#ifdef WITH_CLOUD
virtual OCStackResult SubscribeDevicePresence(
OCDoHandle* /*handle*/,
const std::string& /*host*/,
OCConnectivityType /*connectivityType*/,
ObserveCallback& /*callback*/)
{return OC_STACK_NOTIMPL;}
+#endif
virtual OCStackResult GetDefaultQos(QualityOfService& /*QoS*/)
{return OC_STACK_NOTIMPL;}
return result;
}
+#ifdef WITH_CLOUD
OCStackResult InProcClientWrapper::SubscribeDevicePresence(OCDoHandle* handle,
const std::string& host,
const QueryParamsList& queryParams,
return result;
}
+#endif
OCStackResult InProcClientWrapper::GetDefaultQos(QualityOfService& qos)
{
return OCPlatform_impl::Instance().unsubscribePresence(presenceHandle);
}
+#ifdef WITH_CLOUD
OCStackResult subscribeDevicePresence(OCPresenceHandle& presenceHandle,
const std::string& host,
const QueryParamsList& queryParams,
connectivityType,
callback);
}
+#endif
OCStackResult sendResponse(const std::shared_ptr<OCResourceResponse> pResponse)
{
std::ref(presenceHandle));
}
+#ifdef WITH_CLOUD
OCStackResult OCPlatform_impl::subscribeDevicePresence(OCPresenceHandle& presenceHandle,
const std::string& host,
const QueryParamsList& queryParams,
return checked_guard(m_client, &IClientWrapper::SubscribeDevicePresence,
&presenceHandle, host, queryParams, connectivityType, callback);
}
+#endif
OCStackResult OCPlatform_impl::sendResponse(const std::shared_ptr<OCResourceResponse> pResponse)
{
{
}
+#ifdef WITH_CLOUD
void onObserve(const HeaderOptions, const OCRepresentation&, const int&, const int&)
{
}
+#endif
void directPairHandler(std::shared_ptr<OCDirectPairing> /*dev*/, OCStackResult /*res*/)
{
EXPECT_EQ(OC_STACK_OK, OCPlatform::unsubscribePresence(presenceHandle));
}
+#ifdef WITH_CLOUD
//SubscribeDevicePresence Test
TEST(SubscribeDevicePresenceTest, DISABLED_SubscribeDevicePresenceWithValidParameters)
{
hostAddress, queryParams, CT_DEFAULT, &onObserve));
EXPECT_EQ(OC_STACK_OK, OCPlatform::unsubscribePresence(presenceHandle));
}
+#endif
TEST(FindDirectPairingTest, FindDirectPairingNullCallback)
{