From d8ae5d4d45753ae6fa74fd02a05a8d20838a45a7 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Wed, 22 Jul 2015 17:45:56 -0700 Subject: [PATCH] Corrected files with doxygen comments that were generating warnings. Fixed several files with out of date or incorrect doxygen comments. These included use of explicit tags (@fn, @var, @struct, etc.), incorrect use of "[IN]" and "[OUT]", and other issues. Aside from the problems actually marked in the output as warnings, these issues were causing a large portion of the documentation to be dropped silently. Change-Id: I66027f4f98a6e82b7db826693b5ec1b1f30e58cf Signed-off-by: Jon A. Cruz Reviewed-on: https://gerrit.iotivity.org/gerrit/1836 Reviewed-by: Erich Keane Reviewed-by: Ossama Othman Tested-by: jenkins-iotivity --- resource/csdk/connectivity/common/inc/uqueue.h | 81 ++-- resource/csdk/connectivity/inc/caedrinterface.h | 229 +++++------ resource/csdk/connectivity/inc/caipadapter.h | 95 ++--- resource/csdk/connectivity/inc/caleadapter.h | 439 +++++++++++---------- resource/csdk/connectivity/inc/caraadapter.h | 84 ++-- .../src/bt_edr_adapter/android/caedrserver.c | 48 +-- .../src/bt_edr_adapter/android/caedrserver.h | 90 ++--- .../src/bt_edr_adapter/tizen/caedrclient.c | 57 +-- .../connectivity/src/bt_le_adapter/caleadapter.c | 130 +++--- .../src/bt_le_adapter/tizen/cableclient.c | 63 ++- .../src/bt_le_adapter/tizen/cableclient.h | 340 ++++++++-------- .../csdk/connectivity/src/ip_adapter/caipadapter.c | 21 +- .../csdk/connectivity/src/ra_adapter/caraadapter.c | 16 +- 13 files changed, 787 insertions(+), 906 deletions(-) diff --git a/resource/csdk/connectivity/common/inc/uqueue.h b/resource/csdk/connectivity/common/inc/uqueue.h index cc9a8bb..724c3f2 100644 --- a/resource/csdk/connectivity/common/inc/uqueue.h +++ b/resource/csdk/connectivity/common/inc/uqueue.h @@ -35,109 +35,93 @@ extern "C" #endif /* __cplusplus */ /** - * @struct u_queue_message - * @brief Queue message format + * Queue message format. */ typedef struct u_queue_message_t { - /* Pointer to message*/ + /** Pointer to message. */ void *msg; - /* message size */ + /** message size. */ uint32_t size; } u_queue_message_t; typedef struct u_queue_element_t u_queue_element; /** - * @struct u_queue_element - * @brief Queue element format + * Queue element format. */ struct u_queue_element_t { - /* pointer to queue message */ + /** pointer to queue message. */ u_queue_message_t *message; - /* Pointer to next queue element*/ + /** Pointer to next queue element. */ u_queue_element *next; }; /** - * @struct u_queue_t - * @brief Queue structure + * Queue structure. */ typedef struct u_queue_t { - /* Head of the queue */ + /** Head of the queue. */ u_queue_element *element; - /* Number of messages in Queue*/ + /** Number of messages in Queue. */ uint32_t count; } u_queue_t; /** - * @brief API to creates queue and initializes the elements. - * @return u_queue_t pointer if Success, NULL otherwise + * API to creates queue and initializes the elements. + * @return u_queue_t pointer if Success, NULL otherwise. */ u_queue_t *u_queue_create(); /** - * @fn u_queue_delete - * @brief Resets and deletes the queue - * @param queue- queue pointer - * @return CAResult_t - CA_STATUS_OK, if Success - * @return CA_STATUS_FAILED - otherwise + * Resets and deletes the queue. + * @param queue- queue pointer. + * @return ::CA_STATUS_OK if Success, ::CA_STATUS_FAILED otherwise. */ CAResult_t u_queue_delete(u_queue_t *queue); /** - * @fn u_queue_add_element - * @brief Adds message at the end of the queue - * @param queue - pointer to queue - * @param message - Pointer to message - * @return CAResult_t - CA_STATUS_OK, if Success - * @return CA_STATUS_FAILED - otherwise + * Adds message at the end of the queue. + * @param queue pointer to queue. + * @param message Pointer to message. + * @return ::CA_STATUS_OK if Success, ::CA_STATUS_FAILED otherwise. */ CAResult_t u_queue_add_element(u_queue_t *queue, u_queue_message_t *message); /** - * @fn u_queue_get_element - * @brief Returns the first message in the queue and removes queue element. + * Returns the first message in the queue and removes queue element. * Head is moved to next element. - * @param queue - pointer to queue - * @return pointer to Message, if Success - * @return NULL - otherwise + * @param queue pointer to queue. + * @return pointer to Message if Success, NULL otherwise. */ u_queue_message_t *u_queue_get_element(u_queue_t *queue); /** - * @fn u_queueRemoveElement - * @brief Removes head element of the queue - * @param queue - pointer to queue - * @return CAResult_t - CA_STATUS_OK, if Success - * @return CA_STATUS_FAILED - otherwise + * Removes head element of the queue. + * @param queue pointer to queue. + * @return ::CA_STATUS_OK if Success, ::CA_STATUS_FAILED otherwise. */ CAResult_t u_queue_remove_element(u_queue_t *queue); /** - * @fn u_queue_get_size - * @param queue - pointer to queue - * @return number of elements in queue + * @param queue pointer to queue. + * @return number of elements in queue. */ uint32_t u_queue_get_size(u_queue_t *queue); /** - * @fn u_queue_reset - * @brief Removes all the messages from Queue and reset message count - * @param queue - pointer to queue - * @return CAResult_t - CA_STATUS_OK, if Success - * @return CA_STATUS_FAILED - otherwise + * Removes all the messages from Queue and reset message count. + * @param queue pointer to queue. + * @return ::CA_STATUS_OK if Success, ::CA_STATUS_FAILED otherwise. */ CAResult_t u_queue_reset(u_queue_t *queue); /** - * @fn u_queue_get_head - * @brief Returns the first message in queue, but not remove the element - * @param queue - pointer to queue - * @return pointer to Message, if Success - * @return NULL - otherwise + * Returns the first message in queue, but not remove the element. + * @param queue pointer to queue. + * @return pointer to Message if Success, NULL otherwise. */ u_queue_message_t *u_queue_get_head(u_queue_t *queue); @@ -146,4 +130,3 @@ u_queue_message_t *u_queue_get_head(u_queue_t *queue); #endif /* __cplusplus */ #endif /* U_QUEUE_H_ */ - diff --git a/resource/csdk/connectivity/inc/caedrinterface.h b/resource/csdk/connectivity/inc/caedrinterface.h index cbf26e9..5175216 100644 --- a/resource/csdk/connectivity/inc/caedrinterface.h +++ b/resource/csdk/connectivity/inc/caedrinterface.h @@ -1,4 +1,4 @@ -/****************************************************************** +/* **************************************************************** * * Copyright 2014 Samsung Electronics All Rights Reserved. * @@ -41,8 +41,8 @@ extern "C" typedef enum { - STATE_DISCONNECTED, /**< State is Disconnected */ - STATE_CONNECTED /**< State is Connected */ + STATE_DISCONNECTED, /**< State is Disconnected. */ + STATE_CONNECTED /**< State is Connected. */ } CAConnectedState_t; typedef struct connected_state @@ -52,253 +52,243 @@ typedef struct connected_state } state_t; /** - * @enum CAAdapterServerType_t - * @brief Enum for defining different server types. + * Enum for defining different server types. */ typedef enum { - CA_UNICAST_SERVER = 0, /**< Unicast Server */ - CA_MULTICAST_SERVER, /**< Multicast Server */ - CA_SECURED_UNICAST_SERVER /**< Secured Unicast Server */ + CA_UNICAST_SERVER = 0, /**< Unicast Server. */ + CA_MULTICAST_SERVER, /**< Multicast Server. */ + CA_SECURED_UNICAST_SERVER /**< Secured Unicast Server. */ } CAAdapterServerType_t; /** - * @struct CAEDRData - * @brief Structure to maintain the information of data in message queue. + * Structure to maintain the information of data in message queue. */ typedef struct { - CAEndpoint_t *remoteEndpoint; /**< Remote Endpoint */ - void *data; /**< Data to be sent */ - uint32_t dataLen; /**< Length of the data to be sent */ + CAEndpoint_t *remoteEndpoint; /**< Remote Endpoint. */ + void *data; /**< Data to be sent. */ + uint32_t dataLen; /**< Length of the data to be sent. */ } CAEDRData; /** - * @struct CAEDRNetworkEvent - * @brief Structure to maintain the adapter information and its status. + * Structure to maintain the adapter information and its status. */ typedef struct { - CAEndpoint_t *info; /**< Local Connectivity Information */ - CANetworkStatus_t status; /**< Network Status */ + CAEndpoint_t *info; /**< Local Connectivity Information. */ + CANetworkStatus_t status; /**< Network Status. */ } CAEDRNetworkEvent; /** - * @brief This will be used during the recive of network requests and response. - * @param remoteAddress [IN] EDR address of remote OIC device from which data received. - * @param data [IN] Data received - * @param dataLength [IN] Length of the Data received - * @param sentLength [OUT] Length of the sent data - * @return NONE - * @pre Callback must be registered using CAEDRSetPacketReceivedCallback() + * This will be used during the recive of network requests and response. + * @param[in] remoteAddress EDR address of remote OIC device from which data received. + * @param[in] data Data received. + * @param[in] dataLength Length of the Data received. + * @param[out] sentLength Length of the sent data. + * @pre Callback must be registered using CAEDRSetPacketReceivedCallback(). */ typedef void (*CAEDRDataReceivedCallback)(const char *remoteAddress, const void *data, uint32_t dataLength, uint32_t *sentLength); /** - * @brief This will be used during change in network status. - * @param status [IN] Network Status of the adapter - * @return NONE + * This will be used during change in network status. + * @param[in] status Network Status of the adapter. */ typedef void (*CAEDRNetworkStatusCallback)(CANetworkStatus_t status); /** - * @brief Callback to notify the error in the EDR adapter - * @param remoteAddress [IN] Remote EDR Address - * @param serviceUUID [IN] Service UUID of the device - * @param data [IN] data containing token, uri and coap data - * @param dataLength [IN] length of data - * @param result [IN] error code as defined in CAResult_t - * @return NONE - * @pre Callback must be registered using CAEDRSetPacketReceivedCallback() + * Callback to notify the error in the EDR adapter. + * @param[in] remoteAddress Remote EDR Address. + * @param[in] serviceUUID Service UUID of the device. + * @param[in] data data containing token, uri and coap data. + * @param[in] dataLength length of data. + * @param[in] result error code as defined in ::CAResult_t. + * @pre Callback must be registered using CAEDRSetPacketReceivedCallback(). */ typedef void (*CAEDRErrorHandleCallback)(const char *remoteAddress, const char *serviceUUID, const void *data, uint32_t dataLength, CAResult_t result); /** - * @brief Initialize the network monitor module - * @param threadPool [IN] Threadpool Handle - * @return #CA_STATUS_OK or Appropriate error code - * @retval #CA_STATUS_OK Successful - * @retval #CA_ADAPTER_NOT_ENABLED Initialization is successful, but bluetooth adapter is - * not enabled. - * @retval #CA_STATUS_FAILED Operation failed - * @see CAEDRTerminateNetworkMonitor() + * Initialize the network monitor module + * @param[in] threadPool Threadpool Handle. + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_ADAPTER_NOT_ENABLED Initialization is successful, but + * bluetooth adapter is not enabled. + * @retval ::CA_STATUS_FAILED Operation failed. + * @see CAEDRTerminateNetworkMonitor(). */ CAResult_t CAEDRInitializeNetworkMonitor(const ca_thread_pool_t threadPool); /** - * @brief Deinitialize with bluetooth adapter. - * @return NONE - * @pre CAEDRInitializeNetworkMonitor() should be invoked before using this API. - * @see CAEDRInitializeNetworkMonitor() + * Deinitialize with bluetooth adapter. + * @pre CAEDRInitializeNetworkMonitor() should be invoked before using + * this API. + * @see CAEDRInitializeNetworkMonitor(). */ void CAEDRTerminateNetworkMonitor(); /** - * @brief Start Network Monitoring Process - * @return #CA_STATUS_OK or Appropriate error code + * Start Network Monitoring Process. + * @return ::CA_STATUS_OK or Appropriate error code. */ CAResult_t CAEDRStartNetworkMonitor(); /** - * @brief Stop Network Monitoring Process - * @return #CA_STATUS_OK or Appropriate error code + * Stop Network Monitoring Process. + * @return ::CA_STATUS_OK or Appropriate error code. */ CAResult_t CAEDRStopNetworkMonitor(); /** - * @brief Sets the callback and Starts discovery for nearby OIC bluetooth devices. + * Sets the callback and Starts discovery for nearby OIC bluetooth devices. * - * @return #CA_STATUS_OK or Appropriate error code - * @retval #CA_STATUS_OK Successful - * @retval #CA_STATUS_FAILED Operation failed + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_FAILED Operation failed. */ CAResult_t CAEDRClientSetCallbacks(); /** - * @brief Resetting callbacks with bluetooth framework and stop OIC device discovery. - * @return NONE + * Resetting callbacks with bluetooth framework and stop OIC device discovery. * @pre CAEDRClientSetCallbacks() should be invoked before using this API. - * @see CAEDRClientSetCallbacks() + * @see CAEDRClientSetCallbacks(). */ void CAEDRClientUnsetCallbacks(); /** - * @brief Used to initialize the EDR client module where mutex is initialized - * @return NONE + * Used to initialize the EDR client module where mutex is initialized. */ void CAEDRInitializeClient(ca_thread_pool_t handle); /** - * @brief Destroys the Device list and mutex. - * @return NONE + * Destroys the Device list and mutex. */ void CAEDRClientTerminate(); /** - * @brief Closes all the client connection to peer bluetooth devices. - * @return NONE + * Closes all the client connection to peer bluetooth devices. */ void CAEDRClientDisconnectAll(); /** - * @brief Register callback to send the received packets from remote bluetooth device to BTAdapter. + * Register callback to send the received packets from remote bluetooth + * device to BTAdapter. * - * @param packetReceivedCallback [IN] Callback function to register for sending network - * packets to EDR Adapter. - * @return NONE + * @param[in] packetReceivedCallback Callback function to register for + * sending network packets to EDR Adapter. */ void CAEDRSetPacketReceivedCallback(CAEDRDataReceivedCallback packetReceivedCallback); /** - * @brief Register callback for receiving local bluetooth adapter state. + * Register callback for receiving local bluetooth adapter state. * - * @param networkStateChangeCallback [IN] Callback function to register for receiving local - * bluetooth adapter status. - * @return NONE + * @param[in] networkStateChangeCallback Callback function to register + * for receiving local bluetooth adapter status. */ void CAEDRSetNetworkChangeCallback(CAEDRNetworkStatusCallback networkStateChangeCallback); /** - * @brief set error callback to notify error in EDR adapter + * set error callback to notify error in EDR adapter. * - * @param errorHandleCallback [IN] Callback function to notify the error in the EDR adapter - * @return NONE + * @param[in] errorHandleCallback Callback function to notify the error + * in the EDR adapter. */ void CAEDRSetErrorHandler(CAEDRErrorHandleCallback errorHandleCallback); /** - * @brief Get the local bluetooth adapter information. + * Get the local bluetooth adapter information. * - * @param info [OUT] Local bluetooth adapter information + * @param[out] info Local bluetooth adapter information. * - * @return #CA_STATUS_OK or Appropriate error code - * @retval #CA_STATUS_OK Successful - * @retval #CA_STATUS_INVALID_PARAM Invalid input argumets - * @retval #CA_STATUS_FAILED Operation failed + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_INVALID_PARAM Invalid input argumets. + * @retval ::CA_STATUS_FAILED Operation failed. * - * @see #CALocalConnectivity_t + * @see CALocalConnectivity_t * */ CAResult_t CAEDRGetInterfaceInformation(CAEndpoint_t **info); /** - * @brief Start RFCOMM server for given service UUID + * Start RFCOMM server for given service UUID * - * @param serviceUUID [IN] The UUID of service with which RFCOMM server needs to be started. - * @param serverFD [IN] The RFCOMM server socket file descriptor. - * @param handle [IN] Threadpool Handle + * @param[in] serviceUUID The UUID of service with which RFCOMM server + * needs to be started. + * @param[in] serverFD The RFCOMM server socket file descriptor. + * @param[in] handle Threadpool Handle. * - * @return #CA_STATUS_OK or Appropriate error code - * @retval #CA_STATUS_OK Successful - * @retval #CA_STATUS_INVALID_PARAM Invalid input argumets - * @retval #CA_STATUS_FAILED Operation failed + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_INVALID_PARAM Invalid input argumets. + * @retval ::CA_STATUS_FAILED Operation failed. * */ CAResult_t CAEDRServerStart(const char *serviceUUID, int *serverFD, ca_thread_pool_t handle); /** - * @brief Stop RFCOMM server + * Stop RFCOMM server * - * @param serverFD [IN] The RFCOMM server socket file descriptor which needs to be stopped. + * @param[in] serverFD The RFCOMM server socket file descriptor which + * needs to be stopped. * - * @return #CA_STATUS_OK or Appropriate error code - * @retval #CA_STATUS_OK Successful - * @retval #CA_STATUS_FAILED Operation failed + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_FAILED Operation failed. */ CAResult_t CAEDRServerStop(int serverFD); /** - * @brief Terminate server for EDR - * @return None + * Terminate server for EDR. */ void CAEDRServerTerminate(); /** - * @brief All received data will be notified to upper layer. + * All received data will be notified to upper layer. * - * @return #CA_STATUS_OK or Appropriate error code - * @retval #CA_STATUS_OK Successful - * @retval #CA_STATUS_FAILED Operation failed + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_FAILED Operation failed. * */ CAResult_t CAEDRManagerReadData(); /** - * @brief This function gets bluetooth adapter enable state. - * @param state [OUT] State of the Adapter. - * @return #CA_STATUS_OK or Appropriate error code + * This function gets bluetooth adapter enable state. + * @param[out] state State of the Adapter. + * @return ::CA_STATUS_OK or Appropriate error code. */ CAResult_t CAEDRGetAdapterEnableState(bool *state); /** - * @brief This function sends data to specified remote bluetooth device. - * @param remoteAddress [IN] Remote EDR Address - * @param serviceUUID [IN] Service UUID of the device - * @param data [IN] Data to be sent - * @param dataLength [IN] Length of the data to be sent - * @param sentLength [OUT] Length of the actual sent data - * @return #CA_STATUS_OK or Appropriate error code + * This function sends data to specified remote bluetooth device. + * @param[in] remoteAddress Remote EDR Address. + * @param[in] serviceUUID Service UUID of the device. + * @param[in] data Data to be sent. + * @param[in] dataLength Length of the data to be sent. + * @param[out] sentLength Length of the actual sent data. + * @return ::CA_STATUS_OK or Appropriate error code. */ CAResult_t CAEDRClientSendUnicastData(const char *remoteAddress, const char *serviceUUID, const void *data, uint32_t dataLength, uint32_t *sentLength); /** - * @brief This function sends data to all bluetooth devices running OIC service. - * @param serviceUUID [IN] Service UUID of the device - * @param data [IN] Data to be sent - * @param dataLength [IN] Length of the data to be sent - * @param sentLength [OUT] Length of the actual sent data - * @return #CA_STATUS_OK or Appropriate error code + * This function sends data to all bluetooth devices running OIC service. + * @param[in] serviceUUID Service UUID of the device. + * @param[in] data Data to be sent. + * @param[in] dataLength Length of the data to be sent. + * @param[out] sentLength Length of the actual sent data. + * @return ::CA_STATUS_OK or Appropriate error code. */ CAResult_t CAEDRClientSendMulticastData(const char *serviceUUID, const void *data, uint32_t dataLength, uint32_t *sentLength); /** - * @brief This function gets bonded bluetooth device list - * @return #CA_STATUS_OK or Appropriate error code + * This function gets bonded bluetooth device list + * @return ::CA_STATUS_OK or Appropriate error code. */ CAResult_t CAEDRGetBondedDeviceList(); @@ -307,4 +297,3 @@ CAResult_t CAEDRGetBondedDeviceList(); #endif #endif /* CA_EDR_INTERFACE_H_ */ - diff --git a/resource/csdk/connectivity/inc/caipadapter.h b/resource/csdk/connectivity/inc/caipadapter.h index b6aa76f..505974d 100644 --- a/resource/csdk/connectivity/inc/caipadapter.h +++ b/resource/csdk/connectivity/inc/caipadapter.h @@ -1,4 +1,4 @@ -/****************************************************************** +/* **************************************************************** * * Copyright 2014 Samsung Electronics All Rights Reserved. * @@ -19,8 +19,8 @@ ******************************************************************/ /** - * @file caipadapter.h - * @brief This file contains the APIs for IP Adapter. + * @file + * This file contains the APIs for IP Adapter. */ #ifndef CA_IP_ADAPTER_H_ #define CA_IP_ADAPTER_H_ @@ -35,16 +35,17 @@ extern "C" #endif /** - * @brief API to initialize IP Interface. - * @param registerCallback [IN] Callback to register IP interfaces to Connectivity - * Abstraction Layer - * @param networkPacketCallback [IN] Callback to notify request and response messages from server(s) + * API to initialize IP Interface. + * @param[in] registerCallback Callback to register IP interfaces to + * Connectivity Abstraction Layer. + * @param[in] networkPacketCallback Callback to notify request and + * response messages from server(s) * started at Connectivity Abstraction Layer. - * @param netCallback [IN] Callback to notify the network additions to Connectivity - * Abstraction Layer. - * @param errorCallback [IN] Callback to notify the network errors to Connectivity - * Abstraction Layer - * @param handle [IN] Threadpool Handle + * @param[in] netCallback Callback to notify the network additions + * to Connectivity Abstraction Layer. + * @param[in] errorCallback Callback to notify the network errors to + * Connectivity Abstraction Layer. + * @param[in] handle Threadpool Handle. * @return #CA_STATUS_OK or Appropriate error code */ CAResult_t CAInitializeIP(CARegisterConnectivityCallback registerCallback, @@ -53,76 +54,77 @@ CAResult_t CAInitializeIP(CARegisterConnectivityCallback registerCallback, CAErrorHandleCallback errorCallback, ca_thread_pool_t handle); /** - * @brief Start IP Interface adapter. - * @return #CA_STATUS_OK or Appropriate error code + * Start IP Interface adapter. + * @return #CA_STATUS_OK or Appropriate error code. */ CAResult_t CAStartIP(); /** - * @brief Start listening server for receiving multicast search requests + * Start listening server for receiving multicast search requests. * Transport Specific Behavior: - * IP Starts Multicast Server on a particular interface and prefixed port number and - * as per OIC Specification. - * @return #CA_STATUS_OK or Appropriate error code + * IP Starts Multicast Server on a particular interface and prefixed port + * number and as per OIC Specification. + * @return #CA_STATUS_OK or Appropriate error code. */ CAResult_t CAStartIPListeningServer(); /** - * @brief Start discovery servers for receiving multicast advertisements + * Start discovery servers for receiving multicast advertisements. * Transport Specific Behavior: * IP Starts multicast server on a particular interface and prefixed port - * number as per OIC Specification - * @return #CA_STATUS_OK or Appropriate error code + * number as per OIC Specification. + * @return #CA_STATUS_OK or Appropriate error code. */ CAResult_t CAStartIPDiscoveryServer(); /** - * @brief Sends data to the endpoint using the adapter connectivity. - * @param endpoint [IN] Remote Endpoint information (like ipaddress , port, reference uri - * and transport type) to which the unicast data has to be sent. - * @param data [IN] Data which is 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 -1 indicates error. - * @remark dataLen must be > 0. + * Sends data to the endpoint using the adapter connectivity. + * @param[in] endpoint Remote Endpoint information (like ipaddress, + * port, reference uri and transport type) to + * which the unicast data has to be sent. + * @param[in] data Data which is required to be sent. + * @param[in] dataLen Size of data to be sent. + * @note dataLen must be > 0. + * @return The number of bytes sent on the network, or -1 upon error. */ int32_t CASendIPUnicastData(const CAEndpoint_t *endpoint, const void *data, uint32_t dataLen); /** - * @brief Send Multicast data to the endpoint using the IP connectivity. - * @param endpoint [IN] Remote Endpoint information (like ipaddress , port) - * @param data [IN] Data which is 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 -1 indicates error. - * @remark dataLen must be > 0. + * Send Multicast data to the endpoint using the IP connectivity. + * @param[in] endpoint Remote Endpoint information (like ipaddress, + * port) + * @param[in] data Data which is required to be sent. + * @param[in] dataLen Size of data to be sent. + * @note dataLen must be > 0. + * @return The number of bytes sent on the network, or -1 upon error. */ int32_t CASendIPMulticastData(const CAEndpoint_t *endpoint, const void *data, uint32_t dataLen); /** - * @brief Get IP Connectivity network information - * @param info [OUT] Local connectivity information structures - * @param size [OUT] Number of local connectivity structures. - * @return #CA_STATUS_OK or Appropriate error code - * @remarks info is allocated in this API and should be freed by the caller. + * Get IP Connectivity network information. + * @param[out] info Local connectivity information structures. + * @note info is allocated in this API and should be freed by the caller. + * @param[out] size Number of local connectivity structures. + * @return #CA_STATUS_OK or Appropriate error code. */ CAResult_t CAGetIPInterfaceInformation(CAEndpoint_t **info, uint32_t *size); /** - * @brief Read Synchronous API callback. - * @return #CA_STATUS_OK or Appropriate error code + * Read Synchronous API callback. + * @return #CA_STATUS_OK or Appropriate error code. */ CAResult_t CAReadIPData(); /** - * @brief Stops Unicast, Multicast servers and close the sockets. - * @return #CA_STATUS_OK or Appropriate error code + * Stops Unicast, Multicast servers and close the sockets. + * @return #CA_STATUS_OK or Appropriate error code. */ CAResult_t CAStopIP(); /** - * @brief Terminate the IP connectivity adapter. - * Configuration information will be deleted from further use - * @return NONE + * Terminate the IP connectivity adapter. + * Configuration information will be deleted from further use. */ void CATerminateIP(); @@ -131,4 +133,3 @@ void CATerminateIP(); #endif #endif // #ifndef CA_IP_ADAPTER_H_ - diff --git a/resource/csdk/connectivity/inc/caleadapter.h b/resource/csdk/connectivity/inc/caleadapter.h index 284db86..be13c16 100644 --- a/resource/csdk/connectivity/inc/caleadapter.h +++ b/resource/csdk/connectivity/inc/caleadapter.h @@ -31,39 +31,37 @@ #include "caadapterinterface.h" #include "cathreadpool.h" /* for thread pool */ -/** - * BLE Interface APIs. - */ +// BLE Interface APIs. #ifdef __cplusplus extern "C" { #endif /** - * @struct CALEData_t - * @brief Stores the information of the Data to be sent from the queues. - * This structure will be pushed to the sender/receiver queue for processing. + * Stores the information of the Data to be sent from the queues. + * This structure will be pushed to the sender/receiver queue for processing. */ typedef struct { - 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 */ + CAEndpoint_t *remoteEndpoint; /**< Remote endpoint contains the + information of remote device. */ + void *data; /**< Data to be transmitted over LE tranport. */ + uint32_t dataLen; /**< Length of the data being transmitted. */ } CALEData_t; /** - * @brief Initialize LE connectivity interface. - * @param registerCallback [IN] Callback to register LE interfaces to Connectivity - * Abstraction Layer - * @param reqRespCallback [IN] Callback to notify request and response messages from server(s) - * 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 + * 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 network additions + * 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, @@ -71,107 +69,114 @@ CAResult_t CAInitializeLE(CARegisterConnectivityCallback registerCallback, CAErrorHandleCallback errorCallback, ca_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 Appropriate error code + * Starting LE connectivity adapters. + * As its peer to peer it doesnot require to start any servers. + * @return ::CA_STATUS_OK or Appropriate error code. */ CAResult_t CAStartLE(); /** - * @brief Starting listening server for receiving multicast search requests + * 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 Appropriate error code + * LE Starts GATT Server with prefixed UUID and Characteristics as per + * OIC Specification. + * @return ::CA_STATUS_OK or Appropriate error code. */ CAResult_t CAStartLEListeningServer(); /** - * @brief for starting discovery servers for receiving multicast advertisements + * 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 Appropriate error code + * LE Starts GATT Server with prefixed UUID and Characteristics as per + * OIC Specification. + * @return ::CA_STATUS_OK or Appropriate error code */ CAResult_t CAStartLEDiscoveryServer(); /** - * @brief Sends data to the endpoint using the adapter connectivity. - * @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. Returns -1 on error. - * @remarks dataLen must be > 0. + * Sends data to the endpoint using the adapter connectivity. + * @param[in] endpoint Remote Endpoint information (like ipaddress , + * port, reference uri and connectivity type) to + * which the unicast data has to be sent. + * @param[in] data Data which required to be sent. + * @param[in] dataLen Size of data to be sent. + * @note dataLen must be > 0. + * @return The number of bytes sent on the network, or -1 on error. */ 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 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. + * Sends Multicast data to the endpoint using the LE connectivity. + * @param[in] endpoint Remote Endpoint information to which the + * unicast data has to be sent. + * @param[in] data Data which required to be sent. + * @param[in] dataLen Size of data to be sent. + * @note dataLen must be > 0. + * @return The number of bytes sent on the network, or -1 on error. */ int32_t CASendLEMulticastData(const CAEndpoint_t *endpoint, const void *data, uint32_t dataLen); /** - * @brief Starts notification server on EDR adapters. - * @return #CA_STATUS_OK or Appropriate error code + * Starts notification server on EDR adapters. + * @return ::CA_STATUS_OK or Appropriate error code. */ CAResult_t CAStartLENotifyServer(); /** - * @brief Send notification information. - * @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. Returns 0 on error. - * @remarks dataLen must be > 0. + * Send notification information. + * @param[in] endpoint Remote Endpoint information (like ipaddress , + * port, reference uri and connectivity type) + * to which the unicast data has to be sent. + * @param[in] data Data which required to be sent. + * @param[in] dataLen Size of data to be sent. + * @note dataLen must be > 0. + * @return The number of bytes sent on the network, or 0 on error. */ uint32_t CASendLENotification(const CAEndpoint_t *endpoint, const 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 Appropriate error code + * Get LE Connectivity network information. + * @param[out] info Local connectivity information structures. + * @param[out] size Number of local connectivity structures. + * @return ::CA_STATUS_OK or Appropriate error code. */ CAResult_t CAGetLEInterfaceInformation(CAEndpoint_t **info, uint32_t *size); /** - * @brief Read Synchronous API callback. - * @return #CA_STATUS_OK or Appropriate error code + * Read Synchronous API callback. + * @return ::CA_STATUS_OK or Appropriate error code. */ CAResult_t CAReadLEData(); /** - * @brief Stopping the adapters and close socket connections + * Stopping the adapters and close socket connections. * LE Stops all GATT servers and GATT Clients. - * @return #CA_STATUS_OK or Appropriate error code + * @return ::CA_STATUS_OK or Appropriate error code. */ CAResult_t CAStopLE(); /** - * @brief Terminate the LE connectivity adapter. - * Configuration information will be deleted from further use + * Terminate the LE connectivity adapter. + * Configuration information will be deleted from further use. */ void CATerminateLE(); /** - * @brief This function will receive the data from the GattServer and add the data to + * This function will receive the data from the GattServer and add the data to * the Server receiver queue. - * @param remoteAddress [IN] Remote address of the device from where data is received. - * @param serviceUUID [IN] Uuid of the OIC service running on the remote device - * @param data [IN] Actual data recevied from the remote device. - * @param dataLength [IN] Length of the data received from the remote device. - * @param sentLength [IN] 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 argumets - * @retval #CA_STATUS_FAILED Operation failed + * @param[in] remoteAddress Remote address of the device from where data + * is received. + * @param[in] serviceUUID Uuid of the OIC service running on the remote + * device. + * @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 argumets. + * @retval ::CA_STATUS_FAILED Operation failed. * */ CAResult_t CALEAdapterServerReceivedData(const char *remoteAddress, const char *serviceUUID, @@ -179,259 +184,258 @@ CAResult_t CALEAdapterServerReceivedData(const char *remoteAddress, const char * uint32_t *sentLength); /** - * @brief This function will receive the data from the GattClient and add the data into the - * Client receiver queue. - * @param remoteAddress [IN] Remote address of the device from where data is received. - * @param serviceUUID [IN] Uuid of the OIC service running on the remote device - * @param data [IN] Actual data recevied from the remote device. - * @param dataLength [IN] Length of the data received from the remote device. - * @param sentLength [IN] 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 argumets - * @retval #CA_STATUS_FAILED Operation failed + * 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] serviceUUID Uuid of the OIC service running on the remote + * device. + * @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 argumets. + * @retval ::CA_STATUS_FAILED Operation failed. */ 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 - * adapter layer. - * @param callback [IN] callback handle sent from the upper layer. - * @return NONE + * This function is used to set the NetworkPacket received callback to CA + * layer from adapter layer. + * @param[in] callback callback handle sent from the upper layer. */ void CASetLEReqRespAdapterCallback(CANetworkPacketReceivedCallback callback); /** - * @brief This function will push the data from CA layer to the Sender processor queue. + * This function will push the data from CA layer to the Sender processor queue. * - * @param remoteEndpoint [IN] Remote endpoint information of the server. - * @param data [IN] Data to be transmitted from LE. - * @param dataLen [IN] length of the Data being transmitted. + * @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 argumets - * @retval #CA_STATUS_FAILED Operation failed + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_INVALID_PARAM Invalid input argumets. + * @retval ::CA_STATUS_FAILED Operation failed. */ 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. + * This function will push the data from CA layer to the Sender processor queue. * - * @param remoteEndpoint [IN] Remote endpoint information of the server. - * @param data [IN] Data to be transmitted from LE. - * @param dataLen [IN] length of the Data being transmitted. + * @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 argumets - * @retval #CA_STATUS_FAILED Operation failed + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_INVALID_PARAM Invalid input argumets. + * @retval ::CA_STATUS_FAILED Operation failed. */ 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 - * fragment the data to the MTU of the transport and send the data in fragments to the - * adapters. The function will be blocked untill all data is sent out from the adapter. - * - * @param threadData [IN] Data pushed to the queue which contains the info about RemoteEndpoint - * and Data. + * 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 untill all data is sent out from the adapter. * - * @return NONE + * @param[in] threadData Data pushed to the queue which contains the info + * about RemoteEndpoint and Data. */ void CALEServerSendDataThread(void *threadData); /** - * @brief 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 untill all data is sent out from the adapter. + * 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 untill all data is sent out from the adapter. * - * @param threadData [IN] Data pushed to the queue which contains the info about RemoteEndpoint - * and Data. - * - * @return NONE + * @param[in] threadData Data pushed to the queue which contains the info + * about RemoteEndpoint and Data. */ void CALEClientSendDataThread(void *threadData); /** - * @brief This function will be associated with the receiver queue of GattServer. This function - * will defragment the data received and will send the data UP to the CA layer only after - * it collects all the data from the adapter layer. Adapter Header will provide the - * length of the data sent from the server. - * - * @param threadData [IN] Data pushed to the queue which contains the info about RemoteEndpoint - * and Data. + * This function will be associated with the receiver queue of GattServer. + * This function will defragment the data received and will send the data + * UP to the CA layer only after it collects all the data from the adapter + * layer. Adapter Header will provide the length of the data sent from the + * server. * - * @return NONE + * @param[in] threadData Data pushed to the queue which contains the info + * about RemoteEndpoint and Data. */ void CALEServerDataReceiverHandler(void *threadData); /** - * @brief This function will be associated with the receiver queue of GattClient. This function - * will defragment the data received and will send the data UP to the CA layer only after - * it collects all the data from the adapter layer. Adapter Header will provide the length - * of the data sent from the server. + * This function will be associated with the receiver queue of GattClient. + * This function will defragment the data received and will send the data + * UP to the CA layer only after it collects all the data from the adapter + * layer. Adapter Header will provide the length of the data sent from the + * server. * - * @param threadData [IN] Data pushed to the queue which contains the info about RemoteEndpoint - * and Data. - * @return NONE + * @param[in] threadData Data pushed to the queue which contains the info + * about RemoteEndpoint and Data. */ 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 + * This function is used to Initalize both GattServer and GattClient + * queues. All four queues will be initialized with this function invocations. */ 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 + * This function will stop all queues created for GattServer and GattClient. All + * four queues will be be stopped with this function invocations. */ 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 + * This function will terminate all queues created for GattServer and + * GattClient. All four queues will be be terminated with this function + * invocations. */ void CATerminateLEQueues(); /** - * @brief This function will initalize the Receiver and Sender queues for GattServer. This - * function will inturn 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 argumets - * @retval #CA_STATUS_FAILED Operation failed + * This function will initalize the Receiver and Sender queues for + * GattServer. This function will inturn 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 argumets. + * @retval ::CA_STATUS_FAILED Operation failed. */ CAResult_t CAInitLEServerQueues(); /** - * @brief 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. + * 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 argumets - * @retval #CA_STATUS_FAILED Operation failed + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_INVALID_PARAM Invalid input argumets. + * @retval ::CA_STATUS_FAILED Operation failed. * */ CAResult_t CAInitLEClientQueues(); /** - * @brief 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. + * 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 argumets - * @retval #CA_STATUS_FAILED Operation failed + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_INVALID_PARAM Invalid input argumets. + * @retval ::CA_STATUS_FAILED Operation failed. */ CAResult_t CAInitLEServerSenderQueue(); /** - * @brief 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. + * 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 argumets - * @retval #CA_STATUS_FAILED Operation failed + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_INVALID_PARAM Invalid input argumets. + * @retval ::CA_STATUS_FAILED Operation failed. */ CAResult_t CAInitLEClientSenderQueue(); /** - * @brief This function will initalize the Receiver queue for GattServer. This will initialize - * the queue to process the function CABLEServerDataReceiverHandler() when ever the task - * is added to this queue. + * This function will initalize the Receiver queue for GattServer. This + * will initialize the queue to process the function + * CABLEServerDataReceiverHandler() 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 argumets - * @retval #CA_STATUS_FAILED Operation failed + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_INVALID_PARAM Invalid input argumets. + * @retval ::CA_STATUS_FAILED Operation failed. * */ CAResult_t CAInitLEServerReceiverQueue(); /** - * @brief This function will initalize the Receiver queue for GattClient. This will initialize - * the queue to process the function CABLEClientDataReceiverHandler() when ever the task - * is added to this queue. + * This function will initalize the Receiver queue for GattClient. This + * will initialize the queue to process the function + * CABLEClientDataReceiverHandler() 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 argumets - * @retval #CA_STATUS_FAILED Operation failed + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_INVALID_PARAM Invalid input argumets. + * @retval ::CA_STATUS_FAILED Operation failed. */ CAResult_t CAInitLEClientReceiverQueue(); /** - * @brief This function will create the Data required to send it in the queue. + * This function will create the Data required to send it in the queue. * - * @param remoteEndpoint [IN] Remote endpoint information of the server. - * @param data [IN] Data to be transmitted from LE. - * @param dataLength [IN] length of the Data being transmitted. + * @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 argumets - * @retval #CA_STATUS_FAILED Operation failed + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_INVALID_PARAM Invalid input argumets. + * @retval ::CA_STATUS_FAILED Operation failed. */ CALEData_t *CACreateLEData(const CAEndpoint_t *remoteEndpoint, const void *data, uint32_t dataLength); /** - * @brief Used to free the BLE information stored in the sender/receiver queues. - * @param bleData [IN] Structure contains the information of a particular data segment. - * @return NONE + * Used to free the BLE information stored in the sender/receiver queues. + * @param[in] bleData Structure contains the information of a particular + * data segment. */ void CAFreeLEData(CALEData_t *bleData); /** - * @brief This will be used to notify device status changes to the LE adapter layer - * @param adapter_state [IN] State of the adapter - * @return NONE + * This will be used to notify device status changes to the LE adapter layer. + * @param[in] adapter_state State of the adapter. */ typedef void (*CALEDeviceStateChangedCallback)(CAAdapterState_t adapter_state); /** - * @brief This will be used to notify that network packet recieved from GATTClient to adapter layer. - * @param remoteAddress [IN] Remote endpoint Address - * @param serviceUUID [IN] Service UUID - * @param data [IN] Data received - * @param dataLength [IN] Length of the data received - * @param sentLength [IN] Length of the data sent - * @return #CA_STATUS_OK or Appropriate error code - * @retval #CA_STATUS_OK Successful - * @retval #CA_STATUS_INVALID_PARAM Invalid input argumets - * @retval #CA_STATUS_FAILED Operation failed + * This will be used to notify that network packet recieved from + * GATTClient to adapter layer. + * @param[in] remoteAddress Remote endpoint Address. + * @param[in] serviceUUID Service UUID. + * @param[in] data Data received. + * @param[in] dataLength Length of the data received. + * @param[in] sentLength Length of the data sent. + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_INVALID_PARAM Invalid input argumets. + * @retval ::CA_STATUS_FAILED Operation failed. */ typedef CAResult_t (*CABLEClientDataReceivedCallback)(const char *remoteAddress, const char *serviceUUID, const void *data, uint32_t dataLength, uint32_t *sentLength); /** - * @brief This will be used to notify that network packet recieved from GATTServer to adapter layer. - * @param remoteAddress [IN] Remote endpoint Address - * @param serviceUUID [IN] Service UUID - * @param data [IN] Data received - * @param dataLength [IN] Length of the data received - * @param sentLength [IN] Length of the data sent - * @return #CA_STATUS_OK or Appropriate error code - * @retval #CA_STATUS_OK Successful - * @retval #CA_STATUS_INVALID_PARAM Invalid input argumets - * @retval #CA_STATUS_FAILED Operation failed + * This will be used to notify that network packet recieved from + * GATTServer to adapter layer. + * @param[in] remoteAddress Remote endpoint Address. + * @param[in] serviceUUID Service UUID. + * @param[in] data Data received. + * @param[in] dataLength Length of the data received. + * @param[in] sentLength Length of the data sent. + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_INVALID_PARAM Invalid input argumets. + * @retval ::CA_STATUS_FAILED Operation failed. */ typedef CAResult_t (*CABLEServerDataReceivedCallback)(const char *remoteAddress, const char *serviceUUID, const void *data, @@ -442,4 +446,3 @@ typedef CAResult_t (*CABLEServerDataReceivedCallback)(const char *remoteAddress, #endif #endif /* CA_LEADAPTER_H_ */ - diff --git a/resource/csdk/connectivity/inc/caraadapter.h b/resource/csdk/connectivity/inc/caraadapter.h index 3f08647..32656ba 100644 --- a/resource/csdk/connectivity/inc/caraadapter.h +++ b/resource/csdk/connectivity/inc/caraadapter.h @@ -1,4 +1,4 @@ -/****************************************************************** +//***************************************************************** // // Copyright 2015 Intel Mobile Communications GmbH All Rights Reserved. // @@ -16,11 +16,11 @@ // See the License for the specific language governing permissions and // limitations under the License. // -******************************************************************/ +//**************************************************************** /** * @file caraadapter.h - * @brief This file contains the APIs for IP Adapter. + * This file contains the APIs for IP Adapter. */ #ifndef CA_RA_ADAPTER_H_ #define CA_RA_ADAPTER_H_ @@ -36,15 +36,17 @@ extern "C" /** - * @brief API to initialize RA Interface. - * @param registerCallback [IN] Callback to register RA interfaces to Connectivity - * Abstraction Layer - * @param networkPacketCallback [IN] Callback to notify request and response messages from server(s) + * API to initialize RA Interface. + * @param[in] registerCallback Callback to register RA interfaces to + * Connectivity Abstraction Layer. + * @param[in] networkPacketCallback Callback to notify request and + * response messages from server(s) * started at Connectivity Abstraction Layer. - * @param netCallback [IN] Callback to notify the network additions to Connectivity - * Abstraction Layer. - * @param handle [IN] Threadpool Handle - * @return #CA_STATUS_OK or Appropriate error code + * @param[in] netCallback Callback to notify the network + * additions to Connectivity Abstraction + * Layer. + * @param[in] handle Threadpool Handle. + * @return ::CA_STATUS_OK or Appropriate error code. */ CAResult_t CAInitializeRA(CARegisterConnectivityCallback registerCallback, CANetworkPacketReceivedCallback networkPacketCallback, @@ -53,73 +55,74 @@ CAResult_t CAInitializeRA(CARegisterConnectivityCallback registerCallback, /** - * @brief Start RA Interface adapter. - * @return #CA_STATUS_OK or Appropriate error code + * Start RA Interface adapter. + * @return ::CA_STATUS_OK or Appropriate error code. */ CAResult_t CAStartRA(); /** - * @brief Sends data to the endpoint using the adapter connectivity. - * @param endpoint [IN] Remote Endpoint information (like ipaddress , port, - * reference uri and transport type) to which the unicast data has to be sent. - * @param data [IN] Data which is 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 -1 indicates error. - * @remarks dataLen must be > 0. + * Sends data to the endpoint using the adapter connectivity. + * @param[in] endpoint Remote Endpoint information (like ipaddress, port, + * reference uri and transport type) to which + * the unicast data has to be sent. + * @param[in] data Data which is required to be sent. + * @param[in] dataLen Size of data to be sent. + * @note dataLen must be > 0. + * @return The number of bytes sent on the network, or -1 upon error. */ int32_t CASendRAUnicastData(const CAEndpoint_t *endpoint, const void *data, uint32_t dataLen); /** - * @brief Get RA Connectivity network information - * @param info [OUT] Local connectivity information structures - * @param size [OUT] Number of local connectivity structures. - * @return #CA_STATUS_OK or Appropriate error code - * @remarks info is allocated in this API and should be freed by the caller. + * Get RA Connectivity network information. + * @param[out] info Local connectivity information structures. + * @note info is allocated in this API and should be freed by the caller. + * @param[out] size Number of local connectivity structures. + * @return ::CA_STATUS_OK or Appropriate error code. */ CAResult_t CAGetRAInterfaceInformation(CAEndpoint_t **info, uint32_t *size); /** - * @brief Stops RA server and de-register XMPP callback listeners - * @return #CA_STATUS_OK or Appropriate error code + * Stops RA server and de-register XMPP callback listeners. + * @return ::CA_STATUS_OK or Appropriate error code. */ CAResult_t CAStopRA(); /** - * @brief Terminate the RA connectivity adapter. - * Configuration information will be deleted from further use - * @return NONE + * Terminate the RA connectivity adapter. + * Configuration information will be deleted from further use. */ void CATerminateRA(); /** - * @brief Set Remote Access information for XMPP Client. - * @param caraInfo [IN] remote access info. + * Set Remote Access information for XMPP Client. + * @param[in] caraInfo remote access info. * - * @return CA_STATUS_OK + * @return ::CA_STATUS_OK. */ CAResult_t CASetRAInfo(const CARAInfo_t *caraInfo); /** - * These functions are not applicable to Remote Access adapter + * These functions are not applicable to Remote Access adapter. */ int32_t CASendRAMulticastData(const CAEndpoint_t *endpoint, const void *data, uint32_t dataLen); + /** - * @brief Start listening server for receiving search requests. - * @return #CA_NOT_SUPPORTED + * Start listening server for receiving search requests. + * @return ::CA_NOT_SUPPORTED. */ CAResult_t CAStartRAListeningServer(); /** - * @brief Start discovery servers for receiving advertisements. - * @return #CA_NOT_SUPPORTED + * Start discovery servers for receiving advertisements. + * @return ::CA_NOT_SUPPORTED. */ CAResult_t CAStartRADiscoveryServer(); /** - * @brief Read Synchronous API callback. - * @return #CA_NOT_SUPPORTED + * Read Synchronous API callback. + * @return ::CA_NOT_SUPPORTED. */ CAResult_t CAReadRAData(); @@ -128,4 +131,3 @@ CAResult_t CAReadRAData(); #endif #endif //CA_RA_ADAPTER_H_ - diff --git a/resource/csdk/connectivity/src/bt_edr_adapter/android/caedrserver.c b/resource/csdk/connectivity/src/bt_edr_adapter/android/caedrserver.c index 53ddec6..412cea4 100644 --- a/resource/csdk/connectivity/src/bt_edr_adapter/android/caedrserver.c +++ b/resource/csdk/connectivity/src/bt_edr_adapter/android/caedrserver.c @@ -1,4 +1,4 @@ -/****************************************************************** +/* **************************************************************** * * Copyright 2014 Samsung Electronics All Rights Reserved. * @@ -48,69 +48,61 @@ static ca_thread_pool_t g_threadPoolHandle = NULL; static JavaVM *g_jvm; /** - * @var g_mMutexSocketListManager - * @brief Mutex to synchronize socket list update + * Mutex to synchronize socket list update. */ static ca_mutex g_mutexSocketListManager; -// server socket instance +/** + * server socket instance. + */ static jobject g_serverSocketObject = NULL; /** - * @var g_mutexUnicastServer - * @brief Mutex to synchronize unicast server + * Mutex to synchronize unicast server. */ static ca_mutex g_mutexUnicastServer = NULL; /** - * @var g_stopUnicast - * @brief Flag to control the Receive Unicast Data Thread + * Flag to control the Receive Unicast Data Thread. */ static bool g_stopUnicast = false; /** - * @var g_mutexMulticastServer - * @brief Mutex to synchronize secure multicast server + * Mutex to synchronize secure multicast server. */ static ca_mutex g_mutexMulticastServer = NULL; /** - * @var g_stopMulticast - * @brief Flag to control the Receive Multicast Data Thread + * Flag to control the Receive Multicast Data Thread. */ static bool g_stopMulticast = false; /** - * @var g_mutexAcceptServer - * @brief Mutex to synchronize accept server + * Mutex to synchronize accept server. */ static ca_mutex g_mutexAcceptServer = NULL; /** - * @var g_stopAccept - * @brief Flag to control the Accept Thread + * Flag to control the Accept Thread. */ static bool g_stopAccept = false; static jobject g_inputStream = NULL; /** - * @var g_mutexServerSocket - * @brief Mutex to synchronize server socket + * Mutex to synchronize server socket. */ static ca_mutex g_mutexServerSocket = NULL; static jobject g_serverSocket = NULL; /** - * @var g_mutexStateList - * @brief Mutex to synchronize device state list + * Mutex to synchronize device state list. */ static ca_mutex g_mutexStateList = NULL; /** - * @var g_mutexObjectList - * @brief Mutex to synchronize device object list + * Mutex to synchronize device object list. */ static ca_mutex g_mutexObjectList = NULL; @@ -122,7 +114,7 @@ typedef struct send_data } data_t; /** - @brief Thread context information for unicast, multicast and secured unicast server + * Thread context information for unicast, multicast and secured unicast server. */ typedef struct { @@ -136,8 +128,8 @@ typedef struct } CAAdapterAcceptThreadContext_t; /** - * @var g_edrPacketReceivedCallback - * @brief Maintains the callback to be notified when data received from remote Bluetooth device + * Maintains the callback to be notified when data received from remote + * Bluetooth device. */ static CAEDRDataReceivedCallback g_edrPacketReceivedCallback = NULL; @@ -289,7 +281,7 @@ static void CAAcceptHandler(void *data) } /** - * implement for adapter common method + * implement for adapter common method. */ CAResult_t CAEDRServerStart(const char *serviceUUID, int32_t *serverFD, ca_thread_pool_t handle) { @@ -356,7 +348,7 @@ void CAEDRSetPacketReceivedCallback(CAEDRDataReceivedCallback packetReceivedCall } /** - * Destroy Mutex + * Destroy Mutex. */ static void CAEDRServerDestroyMutex() { @@ -1073,7 +1065,7 @@ void CAEDRNativeAccept(JNIEnv *env, jobject serverSocketObject) } /** - * InputStream & BluetoothServerSocket will be close for Terminating + * InputStream & BluetoothServerSocket will be close for Terminating. */ void CAEDRNatvieCloseServerTask(JNIEnv* env) { diff --git a/resource/csdk/connectivity/src/bt_edr_adapter/android/caedrserver.h b/resource/csdk/connectivity/src/bt_edr_adapter/android/caedrserver.h index faa4a6a..5128b9a 100644 --- a/resource/csdk/connectivity/src/bt_edr_adapter/android/caedrserver.h +++ b/resource/csdk/connectivity/src/bt_edr_adapter/android/caedrserver.h @@ -1,4 +1,4 @@ -/****************************************************************** +/* **************************************************************** * * Copyright 2014 Samsung Electronics All Rights Reserved. * @@ -20,7 +20,7 @@ /** * @file - * @brief This file contains the APIs for BT EDR communications. + * This file contains the APIs for BT EDR communications. */ #ifndef CA_EDR_SERVER_H_ #define CA_EDR_SERVER_H_ @@ -39,98 +39,91 @@ extern "C" typedef void (*CAPacketReceiveCallback)(const char *address, const char *data); /** - * @brief Initialize JNI object - * @return None + * Initialize JNI object. */ void CAEDRServerJniInit(); /** - * @brief Initialize server for EDR - * @param handle [IN] thread pool handle object - * @return None + * Initialize server for EDR. + * @param[in] handle thread pool handle object. */ void CAEDRServerInitialize(ca_thread_pool_t handle); -/* - * @brief Start Accept Thread - * @return None +/** + * Start Accept Thread. */ void CAEDRServerStartAcceptThread(); + /** - * @brief Start unicast server - * @param isSecured [IN] unicast server type - * @return #CA_STATUS_OK or Appropriate error code + * Start unicast server. + * @param[in] isSecured unicast server type. + * @return ::CA_STATUS_OK or Appropriate error code. */ CAResult_t CAEDRStartUnicastServer(bool isSecured); /** - * @brief Start multicast server - * @param isSecured [IN] multicst server type - * @return #CA_STATUS_OK or Appropriate error code + * Start multicast server. + * @param[in] isSecured multicst server type. + * @return ::CA_STATUS_OK or Appropriate error code. */ CAResult_t CAEDRStartMulticastServer(bool isSecured); /** - * @brief Stop unicast server - * @param serverID [IN] unicast server id - * @return #CA_STATUS_OK or Appropriate error code + * Stop unicast server. + * @param[in] serverID unicast server id. + * @return ::CA_STATUS_OK or Appropriate error code. */ CAResult_t CAEDRStopUnicastServer(int32_t serverID); /** - * @brief Stop multicast server - * @param serverID [IN] multicast server id - * @return #CA_STATUS_OK or Appropriate error code + * Stop multicast server. + * @param[in] serverID multicast server id. + * @return ::CA_STATUS_OK or Appropriate error code. */ CAResult_t CAEDRStopMulticastServer(int32_t serverID); -/** - * EDR Method - */ +// EDR Method /** - * @brief This function will read the data from remote device. - * @param env [IN] JNI interface pointer - * @param id [IN] index of remote address - * @param type [IN] EDR server type - * @return #CA_STATUS_OK or Appropriate error code + * This function will read the data from remote device. + * @param[in] env JNI interface pointer. + * @param[in] id index of remote address. + * @param[in] type EDR server type. + * @return ::CA_STATUS_OK or Appropriate error code. */ CAResult_t CAEDRNativeReadData(JNIEnv *env, uint32_t id, CAAdapterServerType_t type); -/* - * @brief Start Listen Task - * @param env [IN] JNI interface pointer - * @return None +/** + * Start Listen Task. + * @param[in] env JNI interface pointer. */ void CANativeStartListenTask(JNIEnv *env); /** - * @brief This function will listen the connection from remote device. - * @param env [IN] JNI interface pointer - * @return server socket object or NULL + * This function will listen the connection from remote device. + * @param[in] env JNI interface pointer. + * @return server socket object or NULL. */ jobject CAEDRNativeListen(JNIEnv *env); /** - * @brief This function will listen the connection from remote device. - * @param env [IN] JNI interface pointer - * @param socket [IN] server socket object - * @return JNI_TRUE or JNI_FALSE + * This function will listen the connection from remote device. + * @param[in] env JNI interface pointer. + * @param[in] socket server socket object. + * @return JNI_TRUE or JNI_FALSE. */ jboolean CAEDRIsConnectedForSocket(JNIEnv *env, jobject socket); /** - * @brief This function will accept the connection from remote device. - * @param env [IN] JNI interface pointer - * @param severSocketObject [IN] server socket object - * @return None + * This function will accept the connection from remote device. + * @param[in] env JNI interface pointer. + * @param[in] severSocketObject server socket object. */ void CAEDRNativeAccept(JNIEnv *env, jobject severSocketObject); /** - * @brief Remove all device objects in the list - * @param env [IN] JNI interface pointer - * @return None + * Remove all device objects in the list. + * @param[in] env JNI interface pointer. */ void CAEDRNatvieCloseServerTask(JNIEnv* env); @@ -139,4 +132,3 @@ void CAEDRNatvieCloseServerTask(JNIEnv* env); #endif #endif /* CA_EDR_SERVER_H_ */ - diff --git a/resource/csdk/connectivity/src/bt_edr_adapter/tizen/caedrclient.c b/resource/csdk/connectivity/src/bt_edr_adapter/tizen/caedrclient.c index 5c7ae30..f0b50da 100644 --- a/resource/csdk/connectivity/src/bt_edr_adapter/tizen/caedrclient.c +++ b/resource/csdk/connectivity/src/bt_edr_adapter/tizen/caedrclient.c @@ -38,74 +38,64 @@ #include "caedrdevicelist.h" /** - * @var g_edrDeviceListMutex - * @brief Mutex to synchronize the access to Bluetooth device information list. + * Mutex to synchronize the access to Bluetooth device information list. */ static ca_mutex g_edrDeviceListMutex = NULL; /** - * @var g_edrDeviceList - * @brief Peer Bluetooth device information list. + * Peer Bluetooth device information list. */ static EDRDeviceList *g_edrDeviceList = NULL; /** - * @var gEDRNetworkChangeCallback - * @brief Maintains the callback to be notified when data received from remote Bluetooth device + * Maintains the callback to be notified when data received from remote + * Bluetooth device. */ static CAEDRDataReceivedCallback g_edrPacketReceivedCallback = NULL; /** - * @var g_edrErrorHandler - * @brief Error callback to update error in EDR + * Error callback to update error in EDR. */ static CAEDRErrorHandleCallback g_edrErrorHandler = NULL; + /** - * @fn CAEDRManagerInitializeMutex - * @brief This function creates mutex. + * This function creates mutex. */ static void CAEDRManagerInitializeMutex(void); /** - * @fn CAEDRManagerTerminateMutex - * @brief This function frees mutex. + * This function frees mutex. */ static void CAEDRManagerTerminateMutex(void); /** - * @fn CAEDRDataRecvCallback - * @brief This callback is registered to recieve data on any open RFCOMM connection. + * This callback is registered to recieve data on any open RFCOMM connection. */ static void CAEDRDataRecvCallback(bt_socket_received_data_s *data, void *userData); /** - * @brief This function starts device discovery. - * @return NONE + * This function starts device discovery. */ static CAResult_t CAEDRStartDeviceDiscovery(void); /** - * @fn CAEDRStopServiceSearch - * @brief This function stops any ongoing service sevice search. + * This function stops any ongoing service sevice search. */ static CAResult_t CAEDRStopServiceSearch(void); /** - * @fn CAEDRStopDeviceDiscovery - * @brief This function stops device discovery. + * This function stops device discovery. */ static CAResult_t CAEDRStopDeviceDiscovery(void); /** - * @fn CAEDRStartServiceSearch - * @brief This function searches for OIC service for remote Bluetooth device. + * This function searches for OIC service for remote Bluetooth device. */ static CAResult_t CAEDRStartServiceSearch(const char *remoteAddress); /** - * @fn CAEDRDeviceDiscoveryCallback - * @brief This callback is registered to recieve all bluetooth nearby devices when device - * scan is initiated. + * This callback is registered to recieve all bluetooth nearby devices + * when device scan is initiated. */ static void CAEDRDeviceDiscoveryCallback(int result, bt_adapter_device_discovery_state_e state, @@ -113,30 +103,27 @@ static void CAEDRDeviceDiscoveryCallback(int result, void *userData); /** - * @fn CAEDRServiceSearchedCallback - * @brief This callback is registered to recieve all the services remote bluetooth device supports - * when service search initiated. + * This callback is registered to recieve all the services remote + * bluetooth device supports when service search initiated. */ static void CAEDRServiceSearchedCallback(int result, bt_device_sdp_info_s *sdpInfo, void *userData); /** - * @fn CAEDRSocketConnectionStateCallback - * @brief This callback is registered to receive bluetooth RFCOMM connection state changes. + * This callback is registered to receive bluetooth RFCOMM connection + * state changes. */ static void CAEDRSocketConnectionStateCallback(int result, bt_socket_connection_state_e state, bt_socket_connection_s *connection, void *userData); /** - * @fn CAEDRClientConnect - * @brief Establishes RFCOMM connection with remote bluetooth device + * Establishes RFCOMM connection with remote bluetooth device. */ static CAResult_t CAEDRClientConnect(const char *remoteAddress, const char *serviceUUID); /** - * @fn CAEDRClientDisconnect - * @brief Disconnect RFCOMM client socket connection + * Disconnect RFCOMM client socket connection. */ static CAResult_t CAEDRClientDisconnect(const int32_t clientID); @@ -873,5 +860,3 @@ void CAEDRDataRecvCallback(bt_socket_received_data_s *data, void *userData) OIC_LOG(DEBUG, EDR_ADAPTER_TAG, "OUT"); } - - diff --git a/resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c b/resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c index 98ed564..ebf1f10 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c @@ -1,4 +1,4 @@ -/****************************************************************** +/* **************************************************************** * * Copyright 2014 Samsung Electronics All Rights Reserved. * @@ -35,113 +35,97 @@ #include "caremotehandler.h" /** - * @var CALEADAPTER_TAG - * @brief Logging tag for module name. + * Logging tag for module name. */ #define CALEADAPTER_TAG "LAD" /** - * @var g_networkCallback - * @brief Callback to provide the status of the network change to CA layer. + * Callback to provide the status of the network change to CA layer. */ static CANetworkChangeCallback g_networkCallback = NULL; /** - * @var g_localBLEAddress - * @brief bleAddress of the local adapter. Value will be initialized to zero, and will + * bleAddress of the local adapter. Value will be initialized to zero, and will * be updated later. */ static char g_localBLEAddress[18] = {0}; /** - * @var g_isServer - * @brief Variable to differentiate btw GattServer and GattClient. + * Variable to differentiate btw GattServer and GattClient. */ static bool g_isServer = false; /** - * @var g_bleIsServerMutex - * @brief Mutex to synchronize the task to be executed on the GattServer function calls. + * Mutex to synchronize the task to be executed on the GattServer function + * calls. */ static ca_mutex g_bleIsServerMutex = NULL; /** - * @var g_bleNetworkCbMutex - * @brief Mutex to synchronize the callback to be called for the network changes. + * Mutex to synchronize the callback to be called for the network changes. */ static ca_mutex g_bleNetworkCbMutex = NULL; /** - * @var g_bleLocalAddressMutex - * @brief Mutex to synchronize the updation of the local LE address of the adapter. + * Mutex to synchronize the updation of the local LE address of the adapter. */ static ca_mutex g_bleLocalAddressMutex = NULL; /** - * @var g_bleAdapterThreadPool - * @brief reference to threadpool + * reference to threadpool. */ static ca_thread_pool_t g_bleAdapterThreadPool = NULL; /** - * @var g_bleAdapterThreadPoolMutex - * @brief Mutex to synchronize the task to be pushed to thread pool. + * Mutex to synchronize the task to be pushed to thread pool. */ static ca_mutex g_bleAdapterThreadPoolMutex = NULL; /** - * @var g_bleClientSendDataMutex - * @brief Mutex to synchronize the queing of the data from SenderQueue. + * Mutex to synchronize the queing of the data from SenderQueue. */ static ca_mutex g_bleClientSendDataMutex = NULL; /** - * @var g_bleClientReceiveDataMutex - * @brief Mutex to synchronize the queing of the data from ReceiverQueue. + * Mutex to synchronize the queing of the data from ReceiverQueue. */ static ca_mutex g_bleClientReceiveDataMutex = NULL; /** - * @var g_bleServerSendDataMutex - * @brief Mutex to synchronize the queing of the data from SenderQueue. + * Mutex to synchronize the queing of the data from SenderQueue. */ static ca_mutex g_bleServerSendDataMutex = NULL; /** - * @var g_bleServerReceiveDataMutex - * @brief Mutex to synchronize the queing of the data from ReceiverQueue. + * Mutex to synchronize the queing of the data from ReceiverQueue. */ static ca_mutex g_bleServerReceiveDataMutex = NULL; /** - * @var g_bleAdapterReqRespCbMutex - * @brief Mutex to synchronize the callback to be called for the adapterReqResponse. + * Mutex to synchronize the callback to be called for the adapterReqResponse. */ static ca_mutex g_bleAdapterReqRespCbMutex = NULL; /** - * @var g_networkPacketReceivedCallback - * @brief Callback to be called when network packet recieved from either GattServer or GattClient. + * Callback to be called when network packet recieved from either + * GattServer or GattClient. */ static CANetworkPacketReceivedCallback g_networkPacketReceivedCallback = NULL; /** - * @var g_errorHandler - * @brief Callback to notify error from the BLE adapter + * Callback to notify error from the BLE adapter. */ static CAErrorHandleCallback g_errorHandler = NULL; /** - * @var g_bleAdapterState - * @brief Storing Adapter state information + * Storing Adapter state information. */ static CAAdapterState_t g_bleAdapterState = CA_ADAPTER_DISABLED; /** - * @ENUM CALeServerStatus - * @brief status of BLE Server Status - * This ENUM provides information of LE Adapter Server status + * status of BLE Server Status. + * This ENUM provides information of LE Adapter Server status. */ typedef enum { @@ -151,114 +135,96 @@ typedef enum } CALeServerStatus; /** - * @var gLeServerStatus - * @brief structure to maintain the status of the server. + * structure to maintain the status of the server. */ static CALeServerStatus gLeServerStatus = CA_SERVER_NOTSTARTED; /** -* @fn CALERegisterNetworkNotifications -* @brief This function is used to register network change notification callback. +* This function is used to register network change notification callback. * -* @param[in] netCallback CANetworkChangeCallback callback which will be set for the change in nwk. +* @param[in] netCallback CANetworkChangeCallback callback which will be +* set for the change in nwk. * * @return 0 on success otherwise a positive error value. -* @retval CA_STATUS_OK Successful -* @retval CA_STATUS_INVALID_PARAM Invalid input argumets -* @retval CA_STATUS_FAILED Operation failed +* @retval CA_STATUS_OK Successful. +* @retval CA_STATUS_INVALID_PARAM Invalid input argumets. +* @retval CA_STATUS_FAILED Operation failed. * */ CAResult_t CALERegisterNetworkNotifications(CANetworkChangeCallback netCallback); /** -* @fn CASetBleAdapterThreadPoolHandle -* @brief Used to Set the gThreadPool handle which is required for spawning new thread. +* Used to Set the gThreadPool handle which is required for spawning new thread. * -* @param[in] handle - Thread pool handle which is given by above layer for using thread -* creation task. -* -* @return void +* @param[in] handle - Thread pool handle which is given by above layer for +* using thread creation task. * */ void CASetLEAdapterThreadPoolHandle(ca_thread_pool_t handle); /** -* @fn CALEDeviceStateChangedCb -* @brief This function is used to call the callback to the upper layer when the device state gets -* changed. -* -* @param[in] adapter_state New state of the adapter to be notified to the upper layer. +* This function is used to call the callback to the upper layer when the +* device state gets changed. * -* @return None. +* @param[in] adapter_state New state of the adapter to be notified to the +* upper layer. * */ void CALEDeviceStateChangedCb( CAAdapterState_t adapter_state); /** -* @fn CAInitBleAdapterMutex -* @brief Used to initialize all required mutex variable for LE Adapter implementation. +* Used to initialize all required mutex variable for LE Adapter implementation. * * @return 0 on success otherwise a positive error value. -* @retval CA_STATUS_OK Successful -* @retval CA_STATUS_INVALID_PARAM Invalid input argumets -* @retval CA_STATUS_FAILED Operation failed +* @retval CA_STATUS_OK Successful. +* @retval CA_STATUS_INVALID_PARAM Invalid input argumets. +* @retval CA_STATUS_FAILED Operation failed. * */ CAResult_t CAInitLEAdapterMutex(); /** -* @fn CATerminateBleAdapterMutex -* @brief Used to terminate all required mutex variable for LE adapter implementation. +* Used to terminate all required mutex variable for LE adapter implementation. * -* @return void */ void CATerminateLEAdapterMutex(); /** -* @fn CALEErrorHandler -* @brief prepares and notify error through error callback +* prepares and notify error through error callback. * -* @return void */ static void CALEErrorHandler(const char *remoteAddress, const void *data, uint32_t dataLen, CAResult_t result); #ifndef SINGLE_THREAD /** - * @var g_dataReceiverHandlerState - * @brief Stop condition of recvhandler. + * Stop condition of recvhandler. */ static bool g_dataReceiverHandlerState = false; /** - * @var g_bleClientSendQueueHandle - * @brief Queue to process the outgoing packets from GATTClient. + * Queue to process the outgoing packets from GATTClient. */ static CAQueueingThread_t *g_bleClientSendQueueHandle = NULL; /** - * @var g_bleClientReceiverQueue - * @brief Queue to process the incoming packets to GATT Client. + * Queue to process the incoming packets to GATT Client. */ static CAQueueingThread_t *g_bleClientReceiverQueue = NULL; /** - * @var g_bleServerSendQueueHandle - * @brief Queue to process the outgoing packets from GATTServer. + * Queue to process the outgoing packets from GATTServer. */ static CAQueueingThread_t *g_bleServerSendQueueHandle = NULL; /** - * @var g_bleServerReceiverQueue - * @brief Queue to process the incoming packets to GATTServer + * Queue to process the incoming packets to GATTServer. */ static CAQueueingThread_t *g_bleServerReceiverQueue = NULL; /** -* @fn CALEDataDestroyer -* @brief Used to free data +* Used to free data. * -* @return void */ static void CALEDataDestroyer(void *data, uint32_t size); diff --git a/resource/csdk/connectivity/src/bt_le_adapter/tizen/cableclient.c b/resource/csdk/connectivity/src/bt_le_adapter/tizen/cableclient.c index 1fba87b..1f02fd3 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/tizen/cableclient.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/tizen/cableclient.c @@ -1,4 +1,4 @@ -/****************************************************************** +/* **************************************************************** * * Copyright 2014 Samsung Electronics All Rights Reserved. * @@ -39,103 +39,87 @@ #include "oic_malloc.h" /** - * @def TZ_BLE_CLIENT_TAG - * @brief Logging tag for module name + * Logging tag for module name. */ #define TZ_BLE_CLIENT_TAG "TZ_BLE_GATT_CLIENT" /** - * @var BLE_UUID_DESCRIPTOR_CLIENT_CHAR_CONFIG - * @brief Its the constant value for characteristic descriptor from spec. + * Its the constant value for characteristic descriptor from spec. */ #define BLE_UUID_DESCRIPTOR_CLIENT_CHAR_CONFIG "2902" /** - * @var g_bLEServiceList - * @brief This contains the list of OIC services a client connect tot. + * This contains the list of OIC services a client connect tot. */ static BLEServiceList *g_bLEServiceList = NULL; /** - * @var g_isBleGattClientStarted - * @brief Boolean variable to keep the state of the GATT Client. + * Boolean variable to keep the state of the GATT Client. */ static bool g_isBleGattClientStarted = false; /** - * @var g_bleServiceListMutex - * @brief Mutex to synchronize access to BleServiceList. + * Mutex to synchronize access to BleServiceList. */ static ca_mutex g_bleServiceListMutex = NULL; /** - * @var g_bleReqRespClientCbMutex - * @brief Mutex to synchronize access to the requestResponse callback to be called - * when the data needs to be sent from GATTClient. + * Mutex to synchronize access to the requestResponse callback to be called + * when the data needs to be sent from GATTClient. */ static ca_mutex g_bleReqRespClientCbMutex = NULL; /** - * @var g_bleReqRespClientCbMutex - * @brief Mutex to synchronize access to the requestResponse callback to be called - * when the data needs to be sent from GATTClient. + * Mutex to synchronize access to the requestResponse callback to be called + * when the data needs to be sent from GATTClient. */ static ca_mutex g_bleClientConnectMutex = NULL; /** - * @var g_bleClientStateMutex - * @brief Mutex to synchronize the calls to be done to the platform from GATTClient - * interfaces from different threads. + * Mutex to synchronize the calls to be done to the platform from GATTClient + * interfaces from different threads. */ static ca_mutex g_bleClientStateMutex = NULL; /** - * @var g_bleServerBDAddressMutex - * @brief Mutex to synchronize the Server BD Address update on client side. + * Mutex to synchronize the Server BD Address update on client side. */ static ca_mutex g_bleServerBDAddressMutex = NULL; /** - * @var g_bleClientSendCondWait - * @brief Condition used for notifying handler the presence of data in send queue. + * Condition used for notifying handler the presence of data in send queue. */ static ca_cond g_bleClientSendCondWait = NULL; /** - * @var g_bleClientThreadPoolMutex - * @brief Mutex to synchronize the task to be pushed to thread pool. + * Mutex to synchronize the task to be pushed to thread pool. */ static ca_mutex g_bleClientThreadPoolMutex = NULL; /** - * @var gNetworkPacketReceivedClientCallback - * @brief Maintains the callback to be notified on receival of network packets from other - * BLE devices + * Maintains the callback to be notified on receival of network packets + * from other BLE devices */ static CABLEClientDataReceivedCallback g_bleClientDataReceivedCallback = NULL; /** - * @var g_clientErrorCallback - * @brief callback to update the error to le adapter + * callback to update the error to le adapter */ static CABLEErrorHandleCallback g_clientErrorCallback; /** - * @var g_eventLoop - * @brief gmainLoop to manage the threads to receive the callback from the platfrom. + * gmainLoop to manage the threads to receive the callback from the platfrom. */ static GMainLoop *g_eventLoop = NULL; /** - * @var g_bleClientThreadPool - * @brief reference to threadpool + * reference to threadpool. */ static ca_thread_pool_t g_bleClientThreadPool = NULL; /** - * @struct stGattServiceInfo_t - * @brief structure to map the service attribute to BD Address. + * structure to map the service attribute to BD Address. */ typedef struct gattService { @@ -144,8 +128,7 @@ typedef struct gattService } stGattServiceInfo_t; /** - * @var g_remoteAddress - * @brief Remote address of Gatt Server + * Remote address of Gatt Server. */ static char *g_remoteAddress = NULL; @@ -1490,5 +1473,3 @@ CAResult_t CAUpdateCharacteristicsToAllGattServers(const char *data, OIC_LOG(DEBUG, TZ_BLE_CLIENT_TAG, "OUT "); return CA_STATUS_OK; } - - diff --git a/resource/csdk/connectivity/src/bt_le_adapter/tizen/cableclient.h b/resource/csdk/connectivity/src/bt_le_adapter/tizen/cableclient.h index b220a01..ed1adba 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/tizen/cableclient.h +++ b/resource/csdk/connectivity/src/bt_le_adapter/tizen/cableclient.h @@ -46,50 +46,50 @@ /** - * @brief This is the callback which will be called after the characteristic value changes happen. + * This is the callback which will be called after the characteristic + * value changes happen. * - * @param characteristic [IN] The attribute handle of characteristic - * @param value [IN] Value of the characteristics of a service. - * @param valueLen [IN] length of data. - * @param userData [IN] The user data passed from the request function - * @return NONE + * @param[in] characteristic The attribute handle of characteristic. + * @param[in] value Value of the characteristics of a service. + * @param[in] valueLen length of data. + * @param[in] userData The user data passed from the request function. */ void CABleGattCharacteristicChangedCb(bt_gatt_attribute_h characteristic, unsigned char *value, int valueLen, void *userData); /** - * @brief This is the callback which will be called after the characteristics changed. + * This is the callback which will be called after the characteristics changed. * - * @param result [IN] result of write value - * @param userData [IN] user context - * - * @return NONE + * @param[in] result result of write value. + * @param[in] userData user context. */ void CABleGattCharacteristicWriteCb(int result, void *userData); /** - * @brief This is the callback which will be called when descriptor of characteristics is found. + * This is the callback which will be called when descriptor of + * characteristics is found. * - * @param result [IN] The result of discovering - * @param format [IN] format of descriptor. - * @param total [IN] The total number of descriptor in a characteristic - * @param descriptor [IN] The attribute handle of descriptor - * @param characteristic [IN] The attribute handle of characteristic - * @param userData [IN] The user data passed from the request function - * @return NONE + * @param[in] result The result of discovering. + * @param[in] format format of descriptor. + * @param[in] total The total number of descriptor in a + * characteristic. + * @param[in] descriptor The attribute handle of descriptor. + * @param[in] characteristic The attribute handle of characteristic. + * @param[in] userData The user data passed from the request function. */ void CABleGattDescriptorDiscoveredCb(int result, unsigned char format, int total, bt_gatt_attribute_h descriptor, bt_gatt_attribute_h characteristic, void *userData); /** - * @brief This is the callback which will be called after the characteristics are discovered by - * bt_gatt_discover_characteristics() + * This is the callback which will be called after the characteristics are + * discovered by bt_gatt_discover_characteristics(). * - * @param result [IN] The result of discovering - * @param inputIndex [IN] The index of characteristics in a service, starts from 0 - * @param total [IN] The total number of characteristics in a service - * @param characteristic [IN] The attribute handle of characteristic - * @param userData [IN] The user data passed from the request function + * @param[in] result The result of discovering. + * @param[in] inputIndex The index of characteristics in a service, + * starts from 0. + * @param[in] total The total number of characteristics in a service. + * @param[in] characteristic The attribute handle of characteristic. + * @param[in] userData The user data passed from the request function. * * @return 0 on failure and 1 on success. */ @@ -97,12 +97,14 @@ bool CABleGattCharacteristicsDiscoveredCb(int result, int inputIndex, int total, bt_gatt_attribute_h characteristic, void *userData); /** - * @brief This is the callback which will be called when we get the primary services repeatedly. + * This is the callback which will be called when we get the primary + * services repeatedly. * - * @param service [IN] The attribute handle of service. Unique identifier for service. - * @param index [IN] The current index of the service - * @param count [IN] Total number of services available in remote device - * @param userData [IN] user data + * @param[in] service The attribute handle of service. Unique identifier + * for service. + * @param[in] index The current index of the service. + * @param[in] count Total number of services available in remote device. + * @param[in] userData user data. * * @return 0 on failure and 1 on success. */ @@ -110,28 +112,26 @@ bool CABleGattPrimaryServiceCb(bt_gatt_attribute_h service, int index, int count void *userData); /** - * @brief This is the callback which will be called whenever there is change in gatt connection - * with server(Connected/Disconnected) - * - * @param result [IN] The result of discovering - * @param connected [IN] State of connection - * @param remoteAddress [IN] Mac address of the remote device in which we made connection. - * @param userData [IN] The user data passed from the request function + * This is the callback which will be called whenever there is change in + * gatt connection with server(Connected/Disconnected) * - * @return NONE + * @param[in] result The result of discovering. + * @param[in] connected State of connection. + * @param[in] remoteAddress Mac address of the remote device in which we + * made connection. + * @param[in] userData The user data passed from the request function. */ void CABleGattConnectionStateChangedCb(int result, bool connected, const char *remoteAddress,void *userData); /** - * @brief This is the callback which will be called when the device discovery state changes. + * This is the callback which will be called when the device discovery + * state changes. * - * @param result [IN] The result of discovering - * @param discoveryState [IN] State of the discovery(FOUND/STARTED/ FINISHED) - * @param discoveryInfo [IN] Remote Device information. - * @param userData [IN] The user data passed from the request function - * - * @return NONE + * @param[in] result The result of discovering. + * @param[in] discoveryState State of the discovery(FOUND/STARTED/ FINISHED). + * @param[in] discoveryInfo Remote Device information. + * @param[in] userData The user data passed from the request function. */ void CABtAdapterLeDeviceDiscoveryStateChangedCb(int result, bt_adapter_le_device_discovery_state_e discoveryState, @@ -139,258 +139,256 @@ void CABtAdapterLeDeviceDiscoveryStateChangedCb(int result, void *userData); /** - * @brief Used to print device information(Util method) - * @param discoveryInfo [IN] Device information structure. - * @return NONE + * Used to print device information(Util method). + * @param[in] discoveryInfo Device information structure. */ void CAPrintDiscoveryInformation(const bt_adapter_le_device_discovery_info_s *discoveryInfo); /** - * @brief This thread will be used to initialize the Gatt Client and start device discovery. - * 1. Set scan parameters - * 2. Setting neccessary callbacks for connection, characteristics changed and discovery. - * 3. Start device discovery - * - * @param data [IN] Currently it will be NULL(no parameter) - * - * @return NONE + * This thread will be used to initialize the Gatt Client and start device + * discovery. + * 1. Set scan parameters. + * 2. Setting neccessary callbacks for connection, characteristics + * changed and discovery. + * 3. Start device discovery. * + * @param[in] data Currently it will be NULL(no parameter). */ void CAStartBleGattClientThread(void *data); /** - * @brief Used to initialize all required mutex variable for Gatt Client implementation. + * Used to initialize all required mutex variable for Gatt Client + * implementation. * - * @return #CA_STATUS_OK or Appropriate error code - * @retval #CA_STATUS_OK Successful - * @retval #CA_STATUS_INVALID_PARAM Invalid input argumets - * @retval #CA_STATUS_FAILED Operation failed + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_INVALID_PARAM Invalid input argumets. + * @retval ::CA_STATUS_FAILED Operation failed. */ CAResult_t CAInitGattClientMutexVariables(); /** - * @brief Used to terminate all required mutex variable for Gatt Client implementation. - * @return NONE + * Used to terminate all required mutex variable for Gatt Client implementation. */ void CATerminateGattClientMutexVariables(); /** - * @brief Used to clear NonOICDeviceList - * @return NONE + * Used to clear NonOICDeviceList. */ void CAClearNonOICDeviceList(); /** - * @brief Used to set scan parameter of starting discovery. + * Used to set scan parameter of starting discovery. * - * @return #CA_STATUS_OK or Appropriate error code - * @retval #CA_STATUS_OK Successful - * @retval #CA_STATUS_INVALID_PARAM Invalid input argumets - * @retval #CA_STATUS_FAILED Operation failed + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_INVALID_PARAM Invalid input argumets. + * @retval ::CA_STATUS_FAILED Operation failed. */ CAResult_t CABleGattSetScanParameter(); /** - * @brief Used to register required callbacks to BLE platform(connection, discovery, etc). + * Used to register required callbacks to BLE platform(connection, + * discovery, etc). * - * @return #CA_STATUS_OK or Appropriate error code - * @retval #CA_STATUS_OK Successful - * @retval #CA_STATUS_INVALID_PARAM Invalid input argumets - * @retval #CA_STATUS_FAILED Operation failed + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_INVALID_PARAM Invalid input argumets. + * @retval ::CA_STATUS_FAILED Operation failed. */ CAResult_t CABleGattSetCallbacks(); /** - * @brief Used to unset all the registerd callbacks to BLE platform - * @return NONE + * Used to unset all the registerd callbacks to BLE platform. */ void CABleGattUnSetCallbacks(); /** - * @brief Used to watch all the changes happening in characteristics of the service. + * Used to watch all the changes happening in characteristics of the service. * - * @param service [IN] The attribute handle of the service. + * @param[in] service The attribute handle of the service. * - * @return #CA_STATUS_OK or Appropriate error code - * @retval #CA_STATUS_OK Successful - * @retval #CA_STATUS_INVALID_PARAM Invalid input argumets - * @retval #CA_STATUS_FAILED Operation failed + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_INVALID_PARAM Invalid input argumets. + * @retval ::CA_STATUS_FAILED Operation failed. */ CAResult_t CABleGattWatchCharacteristicChanges(bt_gatt_attribute_h service); /** - * @brief Used to unwatch characteristics changes using bt_gatt_unwatch_characteristic_changes - * @return NONE + * Used to unwatch characteristics changes using + * bt_gatt_unwatch_characteristic_changes(). */ void CABleGattUnWatchCharacteristicChanges(); /** - * @brief Used to start LE discovery for BLE devices + * Used to start LE discovery for BLE devices. * - * @return #CA_STATUS_OK or Appropriate error code - * @retval #CA_STATUS_OK Successful - * @retval #CA_STATUS_INVALID_PARAM Invalid input argumets - * @retval #CA_STATUS_FAILED Operation failed + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_INVALID_PARAM Invalid input argumets. + * @retval ::CA_STATUS_FAILED Operation failed. */ CAResult_t CABleGattStartDeviceDiscovery(); /** - * @brief Used to stop LE discovery for BLE devices - * @return NONE + * Used to stop LE discovery for BLE devices. */ void CABleGattStopDeviceDiscovery(); /** - * @brief This is the thread which will be used for making gatt connection with remote devices - * @param remoteAddress [IN] MAC address of remote device to connect - * @return NONE + * This is the thread which will be used for making gatt connection with + * remote devices. + * @param[in] remoteAddress MAC address of remote device to connect. */ void CAGattConnectThread (void *remoteAddress); /** - * @brief Used to do connection with remote device + * Used to do connection with remote device. * - * @param remoteAddress [IN] Remote address inwhich we wants to connect with + * @param[in] remoteAddress Remote address inwhich we wants to connect with. * - * @return #CA_STATUS_OK or Appropriate error code - * @retval #CA_STATUS_OK Successful - * @retval #CA_STATUS_INVALID_PARAM Invalid input argumets - * @retval #CA_STATUS_FAILED Operation failed + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_INVALID_PARAM Invalid input argumets. + * @retval ::CA_STATUS_FAILED Operation failed. */ CAResult_t CABleGattConnect(const char *remoteAddress); /** - * @brief Used to do disconnection with remote device - * @param remoteAddress [IN] Remote address inwhich we wants to disconnect with + * Used to do disconnection with remote device. + * @param[in] remoteAddress Remote address inwhich we wants to disconnect with. * - * @return #CA_STATUS_OK or Appropriate error code - * @retval #CA_STATUS_OK Successful - * @retval #CA_STATUS_INVALID_PARAM Invalid input argumets - * @retval #CA_STATUS_FAILED Operation failed + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_INVALID_PARAM Invalid input argumets. + * @retval ::CA_STATUS_FAILED Operation failed. */ CAResult_t CABleGattDisConnect(const char *remoteAddress); /** - * @brief This is thread which will be spawned for discovering ble services. Once called discover - * api, then it will be terminated. - * @param remoteAddress [IN] Mac address of the remote device in which we want to search services. - * @return NONE + * This is thread which will be spawned for discovering ble services. Once + * called discover api, then it will be terminated. + * @param[in] remoteAddress Mac address of the remote device in which we + * want to search services. */ void CADiscoverBLEServicesThread (void *remoteAddress); /** - * @brief Used to discover the services that is advertised by Gatt Server asynchrounously. + * Used to discover the services that is advertised by Gatt Server + * asynchrounously. * - * @param remoteAddress [IN] MAC address of remote device in which we want to discover the services. + * @param[in] remoteAddress MAC address of remote device in which we want + * to discover the services. * - * @return #CA_STATUS_OK or Appropriate error code - * @retval #CA_STATUS_OK Successful - * @retval #CA_STATUS_INVALID_PARAM Invalid input argumets - * @retval #CA_STATUS_FAILED Operation failed + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_INVALID_PARAM Invalid input argumets. + * @retval ::CA_STATUS_FAILED Operation failed. */ CAResult_t CABleGattDiscoverServices(const char *remoteAddress); /** - * @brief This is the thread which will be used for finding characteristic of a service. + * This is the thread which will be used for finding characteristic of a + * service. * - * @param stServiceInfo [IN] Service Information which contains the remote address, service - * handle and characteristic handle. - * @return NONE + * @param[in] stServiceInfo Service Information which contains the remote + * address, service handle and characteristic handle. */ void CADiscoverCharThread(void *stServiceInfo); /** - * @brief Used to discover characteristics of service using bt_gatt_discover_characteristics api. + * Used to discover characteristics of service using + * bt_gatt_discover_characteristics() api. * - * @param service [IN] The attribute handle for service. - * @param remoteAddress [IN] Remote address inwhich we wants to discover characteristics of - * given service handle. - * @return #CA_STATUS_OK or Appropriate error code - * @retval #CA_STATUS_OK Successful - * @retval #CA_STATUS_INVALID_PARAM Invalid input argumets - * @retval #CA_STATUS_FAILED Operation failed + * @param[in] service The attribute handle for service. + * @param[in] remoteAddress Remote address inwhich we wants to discover + * characteristics of given service handle. + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_INVALID_PARAM Invalid input argumets. + * @retval ::CA_STATUS_FAILED Operation failed. */ CAResult_t CABleGattDiscoverCharacteristics(bt_gatt_attribute_h service, const char *remoteAddress); /** - * @brief This is the thread which will be used for finding descriptor of characteristic. + * This is the thread which will be used for finding descriptor of + * characteristic. * - * @param stServiceInfo [IN] Service Information which contains the remote address, service - * handle and characteristic handle. - * @return NONE + * @param[in] stServiceInfo Service Information which contains the remote + * address, service handle and characteristic handle. */ void CADiscoverDescriptorThread(void *stServiceInfo); /** - * @brief This is thread which will be used for calling CASetCharacteristicDescriptorValue api. + * This is thread which will be used for calling + * CASetCharacteristicDescriptorValue() api. * - * @param service [IN] The attribute handle for characteristics. - * @param remoteAddress [IN] Remote address inwhich we wants to discover descriptor of given - * char handle. - * @return #CA_STATUS_OK or Appropriate error code - * @retval #CA_STATUS_OK Successful - * @retval #CA_STATUS_INVALID_PARAM Invalid input argumets - * @retval #CA_STATUS_FAILED Operation failed + * @param[in] service The attribute handle for characteristics. + * @param[in] remoteAddress Remote address inwhich we wants to discover + * descriptor of given char handle. + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_INVALID_PARAM Invalid input argumets. + * @retval ::CA_STATUS_FAILED Operation failed. */ CAResult_t CABleGattDiscoverDescriptor(bt_gatt_attribute_h service, const char *remoteAddress); /** - * @brief This is thread which will be used for calling CASetCharacteristicDescriptorValue api. + * This is thread which will be used for calling + * CASetCharacteristicDescriptorValue() api. * - * @param stServiceInfo [IN] Service Information which contains the remote address, service - * handle and characteristic handle. - * @return NONE + * @param[in] stServiceInfo Service Information which contains the remote + * address, service handle and characteristic handle. */ void CASetCharacteristicDescriptorValueThread(void *stServiceInfo); /** - * @brief Used to set characteristic descriptor value using - * bt_gatt_set_characteristic_desc_value_request api. - * @param stGattCharDescriptorInfo [IN] Structure which contains char handle and descriptor handle. + * Used to set characteristic descriptor value using + * bt_gatt_set_characteristic_desc_value_request() api. + * @param[in] stGattCharDescriptorInfo Structure which contains char + * handle and descriptor handle. * - * @return #CA_STATUS_OK or Appropriate error code - * @retval #CA_STATUS_OK Successful - * @retval #CA_STATUS_INVALID_PARAM Invalid input argumets - * @retval #CA_STATUS_FAILED Operation failed + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_INVALID_PARAM Invalid input argumets. + * @retval ::CA_STATUS_FAILED Operation failed. */ CAResult_t CASetCharacteristicDescriptorValue (stGattCharDescriptor_t *stGattCharDescriptorInfo); /** - * @brief Used to enqueue the message into sender queue using CAAdapterEnqueueMessage and make - * signal to the thread to process. + * Used to enqueue the message into sender queue using + * CAAdapterEnqueueMessage() and make signal to the thread to process. * - * @param remoteEndpoint [IN] Remote device information - * @param data [IN] Data to be sent to remote device - * @param dataLen [IN] Length of data. + * @param[in] remoteEndpoint Remote device information. + * @param[in] data Data to be sent to remote device. + * @param[in] dataLen Length of data.. * - * @return #CA_STATUS_OK or Appropriate error code - * @retval #CA_STATUS_OK Successful - * @retval #CA_STATUS_INVALID_PARAM Invalid input argumets - * @retval #CA_STATUS_FAILED Operation failed + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_INVALID_PARAM Invalid input argumets. + * @retval ::CA_STATUS_FAILED Operation failed. */ CAResult_t CABleClientSenderQueueEnqueueMessage (const CAEndpoint_t *remoteEndpoint, const void *data, uint32_t dataLen); /** - * @brief This is the thread which will be used for processing sender queue. - * - * @return NONE + * This is the thread which will be used for processing sender queue. */ void CABleClientSenderQueueProcessor(); /** - * @brief Synchronous function for reading characteristic value. + * Synchronous function for reading characteristic value. * - * @return #CA_STATUS_OK or Appropriate error code - * @retval #CA_STATUS_OK Successful - * @retval #CA_STATUS_INVALID_PARAM Invalid input argumets - * @retval #CA_STATUS_FAILED Operation failed + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_INVALID_PARAM Invalid input argumets. + * @retval ::CA_STATUS_FAILED Operation failed. */ CAResult_t CALEReadDataFromLEClient(); #endif /* TZ_BLE_CLIENT_H_ */ - diff --git a/resource/csdk/connectivity/src/ip_adapter/caipadapter.c b/resource/csdk/connectivity/src/ip_adapter/caipadapter.c index da89ab9..dd9ceca2 100644 --- a/resource/csdk/connectivity/src/ip_adapter/caipadapter.c +++ b/resource/csdk/connectivity/src/ip_adapter/caipadapter.c @@ -1,4 +1,4 @@ -/****************************************************************** +/* **************************************************************** * * Copyright 2014 Samsung Electronics All Rights Reserved. * @@ -38,15 +38,13 @@ #include "oic_string.h" /** - * @def TAG - * @brief Logging tag for module name + * Logging tag for module name. */ #define TAG "IP_ADAP" #ifndef SINGLE_THREAD /** - * @var CAIPData - * @brief Holds inter thread ip data information. + * Holds inter thread ip data information. */ typedef struct { @@ -57,27 +55,23 @@ typedef struct } CAIPData; /** - * @var g_sendQueueHandle - * @brief Queue handle for Send Data + * Queue handle for Send Data. */ static CAQueueingThread_t *g_sendQueueHandle = NULL; #endif /** - * @var g_networkPacketCallback - * @brief Network Packet Received Callback to CA + * Network Packet Received Callback to CA. */ static CANetworkPacketReceivedCallback g_networkPacketCallback = NULL; /** - * @var g_networkChangeCallback - * @brief Network Changed Callback to CA + * Network Changed Callback to CA. */ static CANetworkChangeCallback g_networkChangeCallback = NULL; /** - * @var g_errorCallback - * @brief error Callback to CA adapter + * error Callback to CA adapter. */ static CAErrorHandleCallback g_errorCallback = NULL; @@ -539,4 +533,3 @@ void CADataDestroyer(void *data, uint32_t size) } #endif // SINGLE_THREAD - diff --git a/resource/csdk/connectivity/src/ra_adapter/caraadapter.c b/resource/csdk/connectivity/src/ra_adapter/caraadapter.c index 7413035..4ae741f 100644 --- a/resource/csdk/connectivity/src/ra_adapter/caraadapter.c +++ b/resource/csdk/connectivity/src/ra_adapter/caraadapter.c @@ -1,4 +1,4 @@ -/****************************************************************** +//***************************************************************** // // Copyright 2015 Intel Mobile Communications GmbH All Rights Reserved. // @@ -16,7 +16,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -******************************************************************/ +//**************************************************************** #include "caraadapter.h" @@ -36,26 +36,22 @@ #include "cacommon.h" /** - * @def RA_ADAPTER_TAG - * @brief Logging tag for module name + * Logging tag for module name. */ #define RA_ADAPTER_TAG "RA_ADAP" /** - * @var g_networkPacketCallback - * @brief Network Packet Received Callback to CA + * Network Packet Received Callback to CA. */ static CANetworkPacketReceivedCallback g_networkPacketCallback = NULL; /** - * @var g_networkChangeCallback - * @brief Network Changed Callback to CA + * Network Changed Callback to CA. */ static CANetworkChangeCallback g_networkChangeCallback = NULL; /** - * @var CARAXmppData - * @brief Holds XMPP data information. + * Holds XMPP data information. */ typedef struct { -- 2.7.4