+/**
+ * Push the data from CA layer to the Sender processor queue.
+ *
+ * @param[in] remoteEndpoint Remote endpoint information of the
+ * server.
+ * @param[in] data Data to be transmitted from LE.
+ * @param[in] dataLen Length of the Data being transmitted.
+ *
+ * @return ::CA_STATUS_OK or Appropriate error code.
+ * @retval ::CA_STATUS_OK Successful.
+ * @retval ::CA_STATUS_INVALID_PARAM Invalid input arguments.
+ * @retval ::CA_STATUS_FAILED Operation failed.
+ */
+static CAResult_t CALEAdapterServerSendData(const CAEndpoint_t *remoteEndpoint,
+ const uint8_t *data,
+ uint32_t dataLen);
+
+/**
+ * Push the data from CA layer to the Sender processor queue.
+ *
+ * @param[in] remoteEndpoint Remote endpoint information of the
+ * server.
+ * @param[in] data Data to be transmitted from LE.
+ * @param[in] dataLen Length of the Data being transmitted.
+ *
+ * @return ::CA_STATUS_OK or Appropriate error code.
+ * @retval ::CA_STATUS_OK Successful.
+ * @retval ::CA_STATUS_INVALID_PARAM Invalid input arguments.
+ * @retval ::CA_STATUS_FAILED Operation failed.
+ */
+static CAResult_t CALEAdapterClientSendData(const CAEndpoint_t *remoteEndpoint,
+ const uint8_t *data,
+ uint32_t dataLen);
+
+/**
+ * This function will receive the data from the GattServer and add the
+ * data to the Server receiver queue.
+ *
+ * @param[in] remoteAddress Remote address of the device from where
+ * data is received.
+ * @param[in] data Actual data recevied from the remote
+ * device.
+ * @param[in] dataLength Length of the data received from the
+ * remote device.
+ * @param[in] sentLength Length of the data sent from the remote
+ * device.
+ *
+ * @return ::CA_STATUS_OK or Appropriate error code.
+ * @retval ::CA_STATUS_OK Successful.
+ * @retval ::CA_STATUS_INVALID_PARAM Invalid input arguments.
+ * @retval ::CA_STATUS_FAILED Operation failed.
+ *
+ */
+static CAResult_t CALEAdapterServerReceivedData(const char *remoteAddress,
+ const uint8_t *data,
+ uint32_t dataLength,
+ uint32_t *sentLength);
+
+/**
+ * This function will receive the data from the GattClient and add the
+ * data into the Client receiver queue.
+ *
+ * @param[in] remoteAddress Remote address of the device from where
+ * data is received.
+ * @param[in] data Actual data recevied from the remote
+ * device.
+ * @param[in] dataLength Length of the data received from the
+ * remote device.
+ * @param[in] sentLength Length of the data sent from the remote
+ * device.
+ *
+ * @return ::CA_STATUS_OK or Appropriate error code.
+ * @retval ::CA_STATUS_OK Successful.
+ * @retval ::CA_STATUS_INVALID_PARAM Invalid input arguments.
+ * @retval ::CA_STATUS_FAILED Operation failed.
+ */
+static CAResult_t CALEAdapterClientReceivedData(const char *remoteAddress,
+ const uint8_t *data,
+ uint32_t dataLength,
+ uint32_t *sentLength);
+
+/**
+ * This function will be associated with the sender queue for
+ * GattServer.
+ *
+ * This function will fragment the data to the MTU of the transport
+ * and send the data in fragments to the adapters. The function will
+ * be blocked until all data is sent out from the adapter.
+ *
+ * @param[in] threadData Data pushed to the queue which contains the
+ * info about RemoteEndpoint and Data.
+ */
+static void CALEServerSendDataThread(void *threadData);
+
+/**
+ * This function will be associated with the sender queue for
+ * GattClient.
+ *
+ * This function will fragment the data to the MTU of the transport
+ * and send the data in fragments to the adapters. The function will
+ * be blocked until all data is sent out from the adapter.
+ *
+ * @param[in] threadData Data pushed to the queue which contains the
+ * info about RemoteEndpoint and Data.
+ */
+static void CALEClientSendDataThread(void *threadData);
+
+/**
+ * This function will be associated with the receiver queue.
+ *
+ * This function will defragment the received data from each sender
+ * respectively and will send it up to CA layer. Respective sender's
+ * header will provide the length of the data sent.
+ *
+ * @param[in] threadData Data pushed to the queue which contains the
+ * info about RemoteEndpoint and Data.
+ */
+static void CALEDataReceiverHandler(void *threadData);
+
+/**
+ * This function will stop all queues created for GattServer and
+ * GattClient. All four queues will be be stopped with this function
+ * invocations.
+ */
+static void CAStopLEQueues();
+
+/**
+ * This function will terminate all queues created for GattServer and
+ * GattClient. All four queues will be be terminated with this
+ * function invocations.
+ */
+static void CATerminateLEQueues();
+
+/**
+ * This function will initalize the Receiver and Sender queues for
+ * GattServer. This function will in turn call the functions
+ * CAInitBleServerReceiverQueue() and CAInitBleServerSenderQueue() to
+ * initialize the queues.
+ *
+ * @return ::CA_STATUS_OK or Appropriate error code.
+ * @retval ::CA_STATUS_OK Successful.
+ * @retval ::CA_STATUS_INVALID_PARAM Invalid input arguments.
+ * @retval ::CA_STATUS_FAILED Operation failed.
+ */
+static CAResult_t CAInitLEServerQueues();
+
+/**
+ * This function will initalize the Receiver and Sender queues for
+ * GattClient. This function will inturn call the functions
+ * CAInitBleClientReceiverQueue() and CAInitBleClientSenderQueue() to
+ * initialize the queues.
+ *
+ * @return ::CA_STATUS_OK or Appropriate error code.
+ * @retval ::CA_STATUS_OK Successful.
+ * @retval ::CA_STATUS_INVALID_PARAM Invalid input arguments.
+ * @retval ::CA_STATUS_FAILED Operation failed.
+ *
+ */
+static CAResult_t CAInitLEClientQueues();
+
+/**
+ * This function will initalize the Receiver queue for
+ * GattServer. This will initialize the queue to process the function
+ * CABLEServerSendDataThread() when ever the task is added to this
+ * queue.
+ *
+ * @return ::CA_STATUS_OK or Appropriate error code.
+ * @retval ::CA_STATUS_OK Successful.
+ * @retval ::CA_STATUS_INVALID_PARAM Invalid input arguments.
+ * @retval ::CA_STATUS_FAILED Operation failed.
+ */
+static CAResult_t CAInitLEServerSenderQueue();
+
+/**
+ * This function will initalize the Receiver queue for
+ * GattClient. This will initialize the queue to process the function
+ * CABLEClientSendDataThread() when ever the task is added to this
+ * queue.
+ *
+ * @return ::CA_STATUS_OK or Appropriate error code.
+ * @retval ::CA_STATUS_OK Successful.
+ * @retval ::CA_STATUS_INVALID_PARAM Invalid input arguments.
+ * @retval ::CA_STATUS_FAILED Operation failed.
+ */
+static CAResult_t CAInitLEClientSenderQueue();
+
+/**
+ * This function will initialize the Receiver queue for
+ * LEAdapter. This will initialize the queue to process the function
+ * CABLEDataReceiverHandler() when ever the task is added to this
+ * queue.
+ *
+ * @return ::CA_STATUS_OK or Appropriate error code
+ * @retval ::CA_STATUS_OK Successful
+ * @retval ::CA_STATUS_INVALID_PARAM Invalid input arguments
+ * @retval ::CA_STATUS_FAILED Operation failed
+ *
+ */
+static CAResult_t CAInitLEReceiverQueue();
+
+/**
+ * This function will create the Data required to send it in the
+ * queue.
+ *
+ * @param[in] remoteEndpoint Remote endpoint information of the
+ * server.
+ * @param[in] data Data to be transmitted from LE.
+ * @param[in] dataLength Length of the Data being transmitted.
+ *
+ * @return ::CA_STATUS_OK or Appropriate error code.
+ * @retval ::CA_STATUS_OK Successful.
+ * @retval ::CA_STATUS_INVALID_PARAM Invalid input arguments.
+ * @retval ::CA_STATUS_FAILED Operation failed.
+ */
+static CALEData_t *CACreateLEData(const CAEndpoint_t *remoteEndpoint,
+ const uint8_t *data,
+ uint32_t dataLength);
+
+/**
+ * Used to free the BLE information stored in the sender/receiver
+ * queues.
+ *
+ * @param[in] bleData Information for a particular data segment.
+ */
+static void CAFreeLEData(CALEData_t *bleData);
+
+/**
+ * Free data.
+ */
+static void CALEDataDestroyer(void *data, uint32_t size);
+
+static CAResult_t CAInitLEServerQueues()