Merge "Enable GATT server indication for Tizen Speaker" into tizen
[platform/upstream/iotivity.git] / resource / include / InProcClientWrapper.h
old mode 100644 (file)
new mode 100755 (executable)
index bbf6a38..95143d6
@@ -30,6 +30,9 @@
 #include <IClientWrapper.h>
 #include <InitializeException.h>
 #include <ResourceInitException.h>
+#ifdef WITH_PROCESS_EVENT
+#include "ocevent.h"
+#endif
 
 namespace OC
 {
@@ -56,22 +59,33 @@ namespace OC
                 : callback(cb), clientWrapper(cw){}
         };
 
-        struct ListenContext2
+        struct ListenErrorContext
+        {
+            FindCallback callback;
+            FindErrorCallback errorCallback;
+            std::weak_ptr<IClientWrapper> clientWrapper;
+
+            ListenErrorContext(FindCallback cb1, FindErrorCallback cb2,
+                               std::weak_ptr<IClientWrapper> cw)
+                : callback(cb1), errorCallback(cb2), clientWrapper(cw){}
+        };
+
+        struct ListenResListContext
         {
             FindResListCallback callback;
             std::weak_ptr<IClientWrapper> clientWrapper;
 
-            ListenContext2(FindResListCallback cb, std::weak_ptr<IClientWrapper> cw)
+            ListenResListContext(FindResListCallback cb, std::weak_ptr<IClientWrapper> cw)
                 : callback(cb), clientWrapper(cw){}
         };
 
-        struct ListenErrorContext
+        struct ListenResListWithErrorContext
         {
-            FindCallback callback;
+            FindResListCallback callback;
             FindErrorCallback errorCallback;
             std::weak_ptr<IClientWrapper> clientWrapper;
 
-            ListenErrorContext(FindCallback cb1, FindErrorCallback cb2,
+            ListenResListWithErrorContext(FindResListCallback cb1, FindErrorCallback cb2,
                                std::weak_ptr<IClientWrapper> cw)
                 : callback(cb1), errorCallback(cb2), clientWrapper(cw){}
         };
@@ -108,6 +122,13 @@ namespace OC
             DirectPairingContext(DirectPairingCallback cb) : callback(cb){}
 
         };
+#ifdef TCP_ADAPTER
+        struct KeepAliveContext
+        {
+            KeepAliveCallback callback;
+            KeepAliveContext(KeepAliveCallback cb) : callback(cb){}
+        };
+#endif
 
 #ifdef WITH_MQ
         struct MQTopicContext
@@ -133,10 +154,15 @@ namespace OC
             const std::string& resourceType, OCConnectivityType transportFlags,
             FindCallback& callback, QualityOfService QoS);
 
-        virtual OCStackResult ListenForResource2(const std::string& serviceUrl,
+        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);
@@ -227,13 +253,22 @@ namespace OC
             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:
         void listeningFunc();
         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;
@@ -241,6 +276,9 @@ namespace OC
 
     private:
         PlatformConfig  m_cfg;
+#ifdef WITH_PROCESS_EVENT
+        oc_event m_processEvent;
+#endif
     };
 }