[IOT-1413,IOT-1415] Fixed request handling bugs for /oic/ping resource
[platform/upstream/iotivity.git] / resource / csdk / stack / include / internal / oickeepalive.h
index 24fe755..38203c6 100644 (file)
@@ -54,15 +54,17 @@ extern "C"
 
 /**
  * Initialize the KeepAlive.
+ * @param[in]   mode        Host mode of operation.
  * @return  ::OC_STACK_OK or Appropriate error code.
  */
-OCStackResult InitializeKeepAlive();
+OCStackResult InitializeKeepAlive(OCMode mode);
 
 /**
  * Terminates the KeepAlive.
+ * @param[in]   mode        Host mode of operation.
  * @return  ::OC_STACK_OK or Appropriate error code.
  */
-OCStackResult TerminateKeepAlive();
+OCStackResult TerminateKeepAlive(OCMode mode);
 
 /**
  * Process the KeepAlive timer to send ping message to OIC Server.
@@ -72,24 +74,18 @@ void ProcessKeepAlive();
 /**
  * This API will be called from RI layer whenever there is a request for KeepAlive.
  * Virtual Resource.
- * @param[in]   endPoint        RemoteEndpoint which sent the packet.
- * @param[in]   requestInfo     Received coap packet.
+ * @param[in]   request     Received request information.
+ * @param[in]   resource    Resource handle used for sending the response.
  * @return  ::OC_STACK_OK or Appropriate error code.
  */
-OCStackResult HandleKeepAliveRequest(const CAEndpoint_t* endPoint,
-                                     const CARequestInfo_t* requestInfo);
+OCStackResult HandleKeepAliveRequest(OCServerRequest *request,
+                                     const OCResource *resource);
 
 /**
  * API to handle the connected device for KeepAlive.
  * @return  Current Time.
  */
-void HandleKeepAliveConnCB(const CAEndpoint_t *endpoint);
-
-/**
- * API to handle the disconnected device for KeepAlive.
- * @return  Current Time.
- */
-void HandleKeepAliveDisconnCB(const CAEndpoint_t *endpoint);
+void HandleKeepAliveConnCB(const CAEndpoint_t *endpoint, bool isConnected);
 
 #ifdef __cplusplus
 } // extern "C"