X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fcsdk%2Fconnectivity%2Finc%2Fcainterfacecontroller.h;h=fedc1a77284f6e0a64725c8cbc490dbe99046733;hb=3c093548382bb2542c87a67e6e5fa32552c29cb3;hp=a0cd2f0dff42712b1030c8bf302879ef59ffde40;hpb=66ea6de691f2f58652110c9c9cfc9f46e435f669;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/csdk/connectivity/inc/cainterfacecontroller.h b/resource/csdk/connectivity/inc/cainterfacecontroller.h index a0cd2f0..fedc1a7 100644 --- a/resource/csdk/connectivity/inc/cainterfacecontroller.h +++ b/resource/csdk/connectivity/inc/cainterfacecontroller.h @@ -29,6 +29,7 @@ #include "caadapterinterface.h" #include "cainterface.h" +#include "cautilinterface.h" #ifndef SINGLE_THREAD #include "cathreadpool.h" /* for thread pool */ @@ -49,8 +50,9 @@ void CAInitializeAdapters(); * Initializes different adapters based on the compilation flags. * @param[in] handle thread pool handle created by message handler * for different adapters. + * @param[in] transportType transport type to initialize. */ -void CAInitializeAdapters(ca_thread_pool_t handle); +void CAInitializeAdapters(ca_thread_pool_t handle, CATransportAdapter_t transportType); #endif /** @@ -67,11 +69,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 +122,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 +147,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). */ @@ -149,6 +171,41 @@ void CATerminateAdapters(); CAResult_t CAReadData(); #endif +#ifdef IP_ADAPTER +/** + * Set multicast time to live value to control the scope of the multicasts. + * @param[in] ttl To be set to any value from 0 to 255. + * + * @return ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h). + */ +CAResult_t CASetMulticastTTL(size_t ttl); + +/** + * Get multicast time to live value. + * @param[out] ttl TTL pointer to get the stored multicast time to live. + * + * @return ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h). + */ +CAResult_t CAGetMulticastTTL(size_t *ttl); +#endif + +#ifdef TCP_ADAPTER +/** + * Disconnect TCP session. + * When there is no transmission for a long time. + * Some carrier vendor is blocking data. + * Thur, TCP Session is cleaned through this function. + * @param[in] endpoint endpoint information to disconnect. + */ +CAResult_t CADisconnectSession(const CAEndpoint_t *endpoint); +#endif + +#ifdef LE_ADAPTER +void CAStartGattServer(); + +void CAStopGattServer(); +#endif + #ifdef __cplusplus } /* extern "C" */ #endif