#include <IClientWrapper.h>
#include <InitializeException.h>
#include <ResourceInitException.h>
+#ifdef WITH_PROCESS_EVENT
+#include "ocevent.h"
+#endif
namespace OC
{
: callback(cb1), errorCallback(cb2), clientWrapper(cw){}
};
+ struct ListenResListContext
+ {
+ FindResListCallback callback;
+ std::weak_ptr<IClientWrapper> clientWrapper;
+
+ ListenResListContext(FindResListCallback cb, std::weak_ptr<IClientWrapper> cw)
+ : callback(cb), clientWrapper(cw){}
+ };
+
+ struct ListenResListWithErrorContext
+ {
+ FindResListCallback callback;
+ FindErrorCallback errorCallback;
+ std::weak_ptr<IClientWrapper> clientWrapper;
+
+ ListenResListWithErrorContext(FindResListCallback cb1, FindErrorCallback cb2,
+ std::weak_ptr<IClientWrapper> cw)
+ : callback(cb1), errorCallback(cb2), clientWrapper(cw){}
+ };
+
struct DeviceListenContext
{
FindDeviceCallback callback;
DirectPairingContext(DirectPairingCallback cb) : callback(cb){}
};
+#ifdef TCP_ADAPTER
+ struct KeepAliveContext
+ {
+ KeepAliveCallback callback;
+ KeepAliveContext(KeepAliveCallback cb) : callback(cb){}
+ };
+#endif
#ifdef WITH_MQ
- struct CreateMQTopicContext
+ struct MQTopicContext
{
- MQCreateTopicCallback callback;
+ MQTopicCallback callback;
std::weak_ptr<IClientWrapper> clientWrapper;
- CreateMQTopicContext(MQCreateTopicCallback cb, std::weak_ptr<IClientWrapper> cw)
+ MQTopicContext(MQTopicCallback cb, std::weak_ptr<IClientWrapper> cw)
: callback(cb), clientWrapper(cw){}
};
#endif
const std::string& resourceType, OCConnectivityType transportFlags,
FindCallback& callback, QualityOfService QoS);
+ virtual OCStackResult ListenForResourceList(const std::string& serviceUrl,
+ const std::string& resourceType, OCConnectivityType transportFlags,
+ FindResListCallback& callback, QualityOfService QoS);
+
+ virtual OCStackResult ListenForResourceListWithError(const std::string& serviceUrl,
+ const std::string& resourceType, OCConnectivityType connectivityType,
+ FindResListCallback& callback, FindErrorCallback& errorCallback,
+ QualityOfService QoS);
+
virtual OCStackResult ListenErrorForResource(const std::string& serviceUrl,
const std::string& resourceType, OCConnectivityType transportFlags,
FindCallback& callback, FindErrorCallback& errorCallback, QualityOfService QoS);
const OCDevAddr& devAddr,
const std::string& uri,
const QueryParamsMap& queryParams, const HeaderOptions& headerOptions,
+ OCConnectivityType connectivityType,
GetCallback& callback, QualityOfService QoS);
virtual OCStackResult PutResourceRepresentation(
const OCDevAddr& devAddr,
const std::string& uri,
const HeaderOptions& headerOptions,
+ OCConnectivityType connectivityType,
DeleteCallback& callback, QualityOfService QoS);
virtual OCStackResult ObserveResource(
#ifdef WITH_CLOUD
virtual OCStackResult SubscribeDevicePresence(OCDoHandle* handle,
const std::string& host,
- const QueryParamsList& queryParams,
+ const std::vector<std::string>& di,
OCConnectivityType connectivityType,
ObserveCallback& callback);
#endif
const OCDevAddr& devAddr,
const std::string& resourceUri,
const QueryParamsMap& queryParams, const HeaderOptions& headerOptions,
- FindCallback& callback, QualityOfService QoS);
+ MQTopicCallback& callback, QualityOfService QoS);
virtual OCStackResult PutMQTopicRepresentation(
const OCDevAddr& devAddr,
const std::string& uri,
const OCRepresentation& rep,
const QueryParamsMap& queryParams, const HeaderOptions& headerOptions,
- MQCreateTopicCallback& callback, QualityOfService QoS);
+ MQTopicCallback& callback, QualityOfService QoS);
+#endif
+
+ virtual OCStackResult stop();
+ virtual OCStackResult start();
+
+#ifdef TCP_ADAPTER
+ virtual OCStackResult findKeepAliveResource(std::string host,
+ KeepAliveCallback resultCallback);
+ virtual OCStackResult sendKeepAliveRequest(std::string host, const OCRepresentation& rep,
+ KeepAliveCallback resultCallback);
#endif
private:
std::string assembleSetResourceUri(std::string uri, const QueryParamsMap& queryParams);
std::string assembleSetResourceUri(std::string uri, const QueryParamsList& queryParams);
OCPayload* assembleSetResourcePayload(const OCRepresentation& attributes);
- OCHeaderOption* assembleHeaderOptions(OCHeaderOption options[],
- const HeaderOptions& headerOptions);
+ OCHeaderOption* assembleHeaderOptions(const HeaderOptions& headerOptions);
void convert(const OCDPDev_t *list, PairedDevices& dpList);
std::thread m_listeningThread;
bool m_threadRun;
private:
PlatformConfig m_cfg;
+#ifdef WITH_PROCESS_EVENT
+ oc_event m_processEvent;
+#endif
};
}