[IOT-1671] Fixed base layer terminate logic
[platform/upstream/iotivity.git] / resource / csdk / connectivity / inc / cainterfacecontroller.h
index a0cd2f0..4f48452 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "caadapterinterface.h"
 #include "cainterface.h"
+#include "cautilinterface.h"
 
 #ifndef SINGLE_THREAD
 #include "cathreadpool.h" /* for thread pool */
@@ -67,11 +68,21 @@ void CASetPacketReceivedCallback(CANetworkPacketReceivedCallback callback);
 void CASetErrorHandleCallback(CAErrorHandleCallback errorCallback);
 
 /**
- * Set the network status changed callback for message handler.
- * @param[in]   callback         message handler network status callback
- *                               to receive network changes.
+ * Set the network status changed callback for CAUtil.
+ * @param[in]   adapterCB       CAUtil callback to receive adapter status changes.
+ * @param[in]   connCB          CAUtil callback to receive connection status changes.
  */
-void CASetNetworkChangeCallback(CANetworkChangeCallback callback);
+void CASetNetworkMonitorCallbacks(CAAdapterStateChangedCB adapterCB,
+                                  CAConnectionStateChangedCB connCB);
+
+/**
+ * Unset the network status changed callback for CAUtil.
+ * @param[in]   adapterCB       CAUtil callback to receive adapter status changes.
+ * @param[in]   connCB          CAUtil callback to receive connection status changes.
+ * @return  ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
+ */
+CAResult_t CAUnsetNetworkMonitorCallbacks(CAAdapterStateChangedCB adapterCB,
+                                          CAConnectionStateChangedCB connCB);
 
 /**
  * Starting different connectivity adapters based on the network selection.
@@ -110,19 +121,23 @@ CAResult_t CAGetNetworkInfo(CAEndpoint_t **info, uint32_t *size);
  * @param[in]   endpoint       endpoint information where the data has to be sent.
  * @param[in]   data           data that needs to be sent.
  * @param[in]   length         length of the data that needs to be sent.
+ * @param[in]   dataType       Data type which is REQUEST or RESPONSE.
  * @return  ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
  */
-CAResult_t CASendUnicastData(const CAEndpoint_t *endpoint, const void *data, uint32_t length);
+CAResult_t CASendUnicastData(const CAEndpoint_t *endpoint, const void *data,
+                             uint32_t length, CADataType_t dataType);
 
 /**
  * Sends multicast data to all endpoints in the network.
  * @param[in]   endpoint       endpoint information where the data has to be sent.
  * @param[in]   data           data that needs to be sent.
  * @param[in]   length         length of the data that needs to be sent.
+ * @param[in]   dataType       Data type which is REQUEST or RESPONSE.
  * @return  ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
  */
 
-CAResult_t CASendMulticastData(const CAEndpoint_t *endpoint, const void *data, uint32_t length);
+CAResult_t CASendMulticastData(const CAEndpoint_t *endpoint, const void *data,
+                               uint32_t length, CADataType_t dataType);
 
 /**
  * Start listening servers to receive search requests from clients.
@@ -131,6 +146,12 @@ CAResult_t CASendMulticastData(const CAEndpoint_t *endpoint, const void *data, u
 CAResult_t CAStartListeningServerAdapters();
 
 /**
+ * Stop listening servers to receive search requests from clients.
+ * @return  ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
+ */
+CAResult_t CAStopListeningServerAdapters();
+
+/**
  * Start discovery servers to receive advertisements from server.
  * @return  ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
  */