Imported Upstream version 0.9.2
[platform/upstream/iotivity.git] / resource / csdk / connectivity / inc / caleadapter.h
index ad6e4bb..284db86 100644 (file)
@@ -46,7 +46,7 @@ extern "C"
  */
 typedef struct
 {
-    CARemoteEndpoint_t
+    CAEndpoint_t
     *remoteEndpoint;   /**< Remote endpoint contains the inforamtion of remote device */
     void *data;        /**< Data to be transmitted over LE tranport */
     uint32_t dataLen;  /**< Length of the data being transmitted */
@@ -60,13 +60,15 @@ typedef struct
  *                               started at Connectivity Abstraction Layer.
  * @param  netCallback      [IN] Callback to notify the network additions to Connectivity
  *                               Abstraction Layer.
+ * @param  errorCallback    [IN] errorCallback to notify error to connectivity common logic
+ *                               layer from adapter
  * @param  handle           [IN] Threadpool Handle
  * @return #CA_STATUS_OK or Appropriate error code
  */
 CAResult_t CAInitializeLE(CARegisterConnectivityCallback registerCallback,
                           CANetworkPacketReceivedCallback reqRespCallback,
                           CANetworkChangeCallback netCallback,
-                          ca_thread_pool_t handle);
+                          CAErrorHandleCallback errorCallback, ca_thread_pool_t handle);
 
 /**
  * @brief Starting LE connectivity adapters.
@@ -100,17 +102,18 @@ CAResult_t CAStartLEDiscoveryServer();
  * @return  The number of bytes sent on the network. Returns -1 on error.
  * @remarks  dataLen must be > 0.
  */
-int32_t CASendLEUnicastData(const CARemoteEndpoint_t *endpoint, const void *data,
+int32_t CASendLEUnicastData(const CAEndpoint_t *endpoint, const void *data,
                              uint32_t dataLen);
 
 /**
  * @brief Sends Multicast data to the endpoint using the LE connectivity.
- * @param   data        [IN]    Data which required to be sent.
- * @param   dataLen     [IN]    Size of data to be sent.
+ * @param   endpoint    [IN]  Remote Endpoint information 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. Returns -1 on error.
  * @remarks  dataLen must be > 0.
  */
-int32_t CASendLEMulticastData(const void *data, uint32_t dataLen);
+int32_t CASendLEMulticastData(const CAEndpoint_t *endpoint, const void *data, uint32_t dataLen);
 
 /**
  * @brief Starts notification server on EDR adapters.
@@ -127,7 +130,7 @@ CAResult_t CAStartLENotifyServer();
  * @return  The number of bytes sent on the network. Returns 0 on error.
  * @remarks dataLen must be > 0.
  */
-uint32_t CASendLENotification(const CARemoteEndpoint_t *endpoint, const void *data,
+uint32_t CASendLENotification(const CAEndpoint_t *endpoint, const void *data,
                               uint32_t dataLen);
 
 /**
@@ -136,7 +139,7 @@ uint32_t CASendLENotification(const CARemoteEndpoint_t *endpoint, const void *da
  * @param  size        [OUT]   Number of local connectivity structures.
  * @return #CA_STATUS_OK or Appropriate error code
  */
-CAResult_t CAGetLEInterfaceInformation(CALocalConnectivity_t **info, uint32_t *size);
+CAResult_t CAGetLEInterfaceInformation(CAEndpoint_t **info, uint32_t *size);
 
 /**
  * @brief Read Synchronous API callback.
@@ -171,8 +174,9 @@ void CATerminateLE();
  * @retval #CA_STATUS_FAILED Operation failed
  *
  */
-CAResult_t CABLEServerReceivedData(const char *remoteAddress, const char *serviceUUID,
-                                   const void *data, uint32_t dataLength, uint32_t *sentLength);
+CAResult_t CALEAdapterServerReceivedData(const char *remoteAddress, const char *serviceUUID,
+                                         const void *data, uint32_t dataLength,
+                                         uint32_t *sentLength);
 
 /**
  * @brief  This function will receive the data from the GattClient and add the data into the
@@ -187,8 +191,9 @@ CAResult_t CABLEServerReceivedData(const char *remoteAddress, const char *servic
  * @retval #CA_STATUS_INVALID_PARAM  Invalid input argumets
  * @retval #CA_STATUS_FAILED Operation failed
  */
-CAResult_t CABLEClientReceivedData(const char *remoteAddress, const char *serviceUUID,
-                                   const void *data, uint32_t dataLength, uint32_t *sentLength);
+CAResult_t CALEAdapterClientReceivedData(const char *remoteAddress, const char *serviceUUID,
+                                         const void *data, uint32_t dataLength,
+                                         uint32_t *sentLength);
 
 /**
  * @brief  This function is used to set the NetworkPacket received callback to CA layer from
@@ -196,7 +201,7 @@ CAResult_t CABLEClientReceivedData(const char *remoteAddress, const char *servic
  * @param  callback [IN] callback handle sent from the upper layer.
  * @return NONE
  */
-void CASetBLEReqRespAdapterCallback(CANetworkPacketReceivedCallback callback);
+void CASetLEReqRespAdapterCallback(CANetworkPacketReceivedCallback callback);
 
 /**
  * @brief  This function will push the data from CA layer to the Sender processor queue.
@@ -210,8 +215,8 @@ void CASetBLEReqRespAdapterCallback(CANetworkPacketReceivedCallback callback);
  * @retval #CA_STATUS_INVALID_PARAM  Invalid input argumets
  * @retval #CA_STATUS_FAILED Operation failed
  */
-CAResult_t CABLEServerSendData(const CARemoteEndpoint_t *remoteEndpoint,
-                               const void *data, uint32_t dataLen);
+CAResult_t CALEAdapterServerSendData(const CAEndpoint_t *remoteEndpoint,
+                                     const void *data, uint32_t dataLen);
 
 /**
  * @brief  This function will push the data from CA layer to the Sender processor queue.
@@ -225,8 +230,8 @@ CAResult_t CABLEServerSendData(const CARemoteEndpoint_t *remoteEndpoint,
  * @retval #CA_STATUS_INVALID_PARAM  Invalid input argumets
  * @retval #CA_STATUS_FAILED Operation failed
  */
-CAResult_t CABLEClientSendData(const CARemoteEndpoint_t *remoteEndpoint,
-                               const void *data,  uint32_t dataLen);
+CAResult_t CALEAdapterClientSendData(const CAEndpoint_t *remoteEndpoint,
+                                     const void *data,  uint32_t dataLen);
 
 /**
  * @brief  This function will be associated with the sender queue for GattServer.This function will
@@ -238,7 +243,7 @@ CAResult_t CABLEClientSendData(const CARemoteEndpoint_t *remoteEndpoint,
  *
  * @return  NONE
  */
-void CABLEServerSendDataThread(void *threadData);
+void CALEServerSendDataThread(void *threadData);
 
 /**
  * @brief  This function will be associated with the sender queue for GattClient.This function will
@@ -250,7 +255,7 @@ void CABLEServerSendDataThread(void *threadData);
  *
  * @return NONE
  */
-void CABLEClientSendDataThread(void *threadData);
+void CALEClientSendDataThread(void *threadData);
 
 /**
  * @brief  This function will be associated with the receiver queue of GattServer. This function
@@ -263,7 +268,7 @@ void CABLEClientSendDataThread(void *threadData);
  *
  * @return  NONE
  */
-void CABLEServerDataReceiverHandler(void *threadData);
+void CALEServerDataReceiverHandler(void *threadData);
 
 /**
  * @brief  This function will be associated with the receiver queue of GattClient. This function
@@ -275,28 +280,28 @@ void CABLEServerDataReceiverHandler(void *threadData);
  *                         and Data.
  * @return NONE
  */
-void CABLEClientDataReceiverHandler(void *threadData);
+void CALEClientDataReceiverHandler(void *threadData);
 
 /**
  * @brief  This function is used to Initalize both GattServer and GattClient queues. All four
  *         queues will be initialized with this function invocations.
  * @return  NONE
  */
-void CAInitBleQueues();
+void CAInitLEQueues();
 
 /**
  * @brief  This function will stop all queues created for GattServer and GattClient. All
  *         four queues will be be stopped with this function invocations.
  * @return  NONE
  */
-void CAStopBleQueues();
+void CAStopLEQueues();
 
 /**
  * @brief  This function will terminate all queues created for GattServer and GattClient. All
  *         four queues will be be terminated with this function invocations.
  * @return  NONE
  */
-void CATerminateBleQueues();
+void CATerminateLEQueues();
 
 /**
  * @brief  This function will initalize the Receiver and Sender queues for GattServer. This
@@ -307,7 +312,7 @@ void CATerminateBleQueues();
  * @retval #CA_STATUS_INVALID_PARAM  Invalid input argumets
  * @retval #CA_STATUS_FAILED Operation failed
  */
-CAResult_t CAInitBleServerQueues();
+CAResult_t CAInitLEServerQueues();
 
 /**
  * @brief  This function will initalize the Receiver and Sender queues for GattClient. This
@@ -320,7 +325,7 @@ CAResult_t CAInitBleServerQueues();
  * @retval #CA_STATUS_FAILED Operation failed
  *
  */
-CAResult_t CAInitBleClientQueues();
+CAResult_t CAInitLEClientQueues();
 
 /**
  * @brief  This function will initalize the Receiver queue for GattServer. This will initialize
@@ -332,7 +337,7 @@ CAResult_t CAInitBleClientQueues();
  * @retval #CA_STATUS_INVALID_PARAM  Invalid input argumets
  * @retval #CA_STATUS_FAILED Operation failed
  */
-CAResult_t CAInitBleServerSenderQueue();
+CAResult_t CAInitLEServerSenderQueue();
 
 /**
  * @brief  This function will initalize the Receiver queue for GattClient. This will initialize
@@ -344,7 +349,7 @@ CAResult_t CAInitBleServerSenderQueue();
  * @retval #CA_STATUS_INVALID_PARAM  Invalid input argumets
  * @retval #CA_STATUS_FAILED Operation failed
  */
-CAResult_t CAInitBleClientSenderQueue();
+CAResult_t CAInitLEClientSenderQueue();
 
 /**
  * @brief  This function will initalize the Receiver queue for GattServer. This will initialize
@@ -357,7 +362,7 @@ CAResult_t CAInitBleClientSenderQueue();
  * @retval #CA_STATUS_FAILED Operation failed
  *
  */
-CAResult_t CAInitBleServerReceiverQueue();
+CAResult_t CAInitLEServerReceiverQueue();
 
 /**
  * @brief  This function will initalize the Receiver queue for GattClient. This will initialize
@@ -369,7 +374,7 @@ CAResult_t CAInitBleServerReceiverQueue();
  * @retval #CA_STATUS_INVALID_PARAM  Invalid input argumets
  * @retval #CA_STATUS_FAILED Operation failed
  */
-CAResult_t CAInitBleClientReceiverQueue();
+CAResult_t CAInitLEClientReceiverQueue();
 
 /**
  * @brief  This function will create the Data required to send it in the queue.
@@ -383,7 +388,7 @@ CAResult_t CAInitBleClientReceiverQueue();
  * @retval #CA_STATUS_INVALID_PARAM  Invalid input argumets
  * @retval #CA_STATUS_FAILED Operation failed
  */
-CALEData_t *CACreateBLEData(const CARemoteEndpoint_t *remoteEndpoint, const void *data,
+CALEData_t *CACreateLEData(const CAEndpoint_t *remoteEndpoint, const void *data,
                            uint32_t dataLength);
 
 /**
@@ -391,7 +396,7 @@ CALEData_t *CACreateBLEData(const CARemoteEndpoint_t *remoteEndpoint, const void
  * @param bleData [IN] Structure contains the information of a particular data segment.
  * @return NONE
  */
-void CAFreeBLEData(CALEData_t *bleData);
+void CAFreeLEData(CALEData_t *bleData);
 
 /**
  * @brief This will be used to notify device status changes to the LE adapter layer