-/******************************************************************
+/* ****************************************************************
*
* Copyright 2014 Samsung Electronics All Rights Reserved.
*
*
******************************************************************/
-/**
- * @file caleadapter.h
- * @brief This file contains the APIs for LE adapters to be implemented
- */
-#ifndef _CA_LEADAPTER_H_
-#define _CA_LEADAPTER_H_
+
+#ifndef CA_LEADAPTER_H_
+#define CA_LEADAPTER_H_
#include "cacommon.h"
#include "caadapterinterface.h"
-#include "uthreadpool.h"
+#include "cathreadpool.h"
-/**
- * BLE Interface APIs.
- */
#ifdef __cplusplus
extern "C"
{
#endif
+
/**
- * @brief Initialize LE connectivity interface.
- * @param registerCallback [IN] To register LE interfaces to Connectivity Abstraction Layer
- * @param reqRespCallback [IN] sending responses and discovery messages from unicast , \
- * multicast servers
- * @param netCallback [IN] Intimate the network additions to Connectivity Abstraction Layer.
- * @return CA_STATUS_OK or ERROR CODES ( CAResult_t error codes in cacommon.h)
+ * Initialize LE connectivity interface.
+ *
+ * @param[in] registerCallback Callback to register LE interfaces to
+ * Connectivity Abstraction Layer.
+ * @param[in] reqRespCallback Callback to notify request and response
+ * messages from server(s) started at
+ * Connectivity Abstraction Layer.
+ * @param[in] netCallback Callback to notify the adapter changes
+ * to Connectivity Abstraction Layer.
+ * @param[in] connCallback Callback to notify the connection changes
+ * to Connectivity Abstraction Layer.
+ * @param[in] errorCallback errorCallback to notify error to
+ * connectivity common logic layer from adapter.
+ * @param[in] handle Threadpool Handle.
+ *
+ * @return ::CA_STATUS_OK or Appropriate error code.
*/
-
CAResult_t CAInitializeLE(CARegisterConnectivityCallback registerCallback,
CANetworkPacketReceivedCallback reqRespCallback,
- CANetworkChangeCallback netCallback,
- u_thread_pool_t handle);
-/**
- * @brief Starting LE connectivity adapters . \
- * As its peer to peer it doesnot require to start any servers
- * @return CA_STATUS_OK or ERROR CODES ( CAResult_t error codes in cacommon.h)
- */
-CAResult_t CAStartLE();
-
-/**
- * @brief Starting listening server for receiving multicast search requests
- * Transport Specific Behavior:
- * LE Starts GATT Server with prefixed UUID and Characteristics as per OIC Specification.
- * @return CA_STATUS_OK or ERROR CODES ( CAResult_t error codes in cacommon.h)
- */
-CAResult_t CAStartLEListeningServer();
-
-/**
- * @brief for starting discovery servers for receiving multicast advertisements
- * Transport Specific Behavior:
- * LE Starts GATT Server with prefixed UUID and Characteristics as per OIC Specification.
- * @return CA_STATUS_OK or ERROR CODES ( CAResult_t error codes in cacommon.h)
- */
-CAResult_t CAStartLEDiscoveryServer();
-
-/**
- * @brief Sends data to the endpoint using the adapter connectivity.
- * Note: length must be > 0.
- * @param endpoint [IN] Remote Endpoint information (like ipaddress , port, reference uri \
- * and connectivity type) to which the unicast data has to be sent.
- * @param data [IN] Data which required to be sent.
- * @param dataLen [IN] Size of data to be sent.
- * @return - The number of bytes sent on the network. Return value equal to zero indicates error.
- */
-uint32_t CASendLEUnicastData(const CARemoteEndpoint_t *endpoint, void *data, uint32_t dataLen);
+ CAAdapterChangeCallback netCallback,
+ CAConnectionChangeCallback connCallback,
+ CAErrorHandleCallback errorCallback,
+ ca_thread_pool_t handle);
-/**
- * @brief Sends Multicast data to the endpoint using the LE connectivity.
- * Note: length must be > 0.
- * @param data [IN] Data which required to be sent.
- * @param dataLen [IN] Size of data to be sent.
- * @return - The number of bytes sent on the network. Return value equal to zero indicates error.
- */
-uint32_t CASendLEMulticastData(void *data, uint32_t dataLen);
-
-/**
- * @brief Starts notification server on EDR adapters.
- * @return CA_STATUS_OK or ERROR CODES ( CAResult_t error codes in cacommon.h)
- */
-CAResult_t CAStartLENotifyServer();
-
-/**
- * @brief Send notification information.
- * Note: length must be > 0.
- * @param endpoint [IN] Remote Endpoint information (like ipaddress , port, reference uri \
- * and connectivity type) to which the unicast data has to be sent.
- * @param data [IN] Data which required to be sent.
- * @param dataLen [IN] Size of data to be sent.
- * @return - The number of bytes sent on the network. Return value equal to zero indicates error.
- */
-uint32_t CASendLENotification(const CARemoteEndpoint_t *endpoint, void *data, uint32_t dataLen);
-
-/**
- * @brief Get LE Connectivity network information
- * @param info [OUT] Local connectivity information structures
- * @param size [OUT] Number of local connectivity structures.
- * @return CA_STATUS_OK or ERROR CODES ( CAResult_t error codes in cacommon.h)
- */
-CAResult_t CAGetLEInterfaceInformation(CALocalConnectivity_t **info, uint32_t *size);
-
-/**
- * @brief Read Synchronous API callback.
- * @return CA_STATUS_OK or ERROR CODES ( CAResult_t error codes in cacommon.h)
- */
-CAResult_t CAReadLEData();
-
-/**
- * @brief Stopping the adapters and close socket connections
- * LE Stops all GATT servers and close sockets.
- * @return CA_STATUS_OK or ERROR CODES ( CAResult_t error codes in cacommon.h)
- */
-CAResult_t CAStopLE();
-
-/**
- * @brief Terminate the LE connectivity adapter.
- * Configuration information will be deleted from further use
- */
-void CATerminateLE();
+void CALEStartGattServer();
+void CALEStopGattServer();
#ifdef __cplusplus
} /* extern "C" */
#endif
-#endif //#ifndef _CA_LEADAPTER_H_
+#endif /* CA_LEADAPTER_H_ */