Corrected @file tags and restored 'Files' section.
[platform/upstream/iotivity.git] / resource / csdk / connectivity / inc / caethernetadapter.h
index 118fee1..9f77a00 100644 (file)
@@ -1,4 +1,4 @@
-/******************************************************************
+/* ****************************************************************
  *
  * Copyright 2014 Samsung Electronics All Rights Reserved.
  *
  ******************************************************************/
 
 /**
- * @file caethernetadapter.h
- * @brief This file contains the APIs for Ethernet Adapter.
+ * @file
+ *
+ * This file contains the APIs for Ethernet Adapter.
  */
+
 #ifndef __CA_ETHERNET_ADAPTER_H__
 #define __CA_ETHERNET_ADAPTER_H__
 
 #include "cacommon.h"
 #include "caadapterinterface.h"
-#include "uthreadpool.h" /* for thread pool */
+#include "uthreadpool.h"
 
 #ifdef __cplusplus
 extern "C"
@@ -36,102 +38,89 @@ extern "C"
 
 /**
  * @brief API to initialize Ethernet Interface.
- * @param registerCallback [IN] To register Ethernet interfaces to Connectivity Abstraction Layer
- * @param reqRespCallback [IN] sending responses and discovery messages from unicast,
- * multicast servers
- * @param netCallback [IN] Intimate the network additions to Connectivity Abstraction Layer.
- * @return CA_STATUS_OK or ERROR CODES ( CAResult_t error codes in cacommon.h)
+ * @param registerCallback      [IN] Callback to register ETHERNET interfaces to Connectivity
+ *                                   Abstraction Layer
+ * @param networkPacketCallback [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 handle                [IN] Threadpool Handle
+ * @return  #CA_STATUS_OK or Appropriate error code
  */
 CAResult_t CAInitializeEthernet(CARegisterConnectivityCallback registerCallback,
-                                CANetworkPacketReceivedCallback reqRespCallback, CANetworkChangeCallback netCallback,
-                                u_thread_pool_t handle);
+                                CANetworkPacketReceivedCallback networkPacketCallback,
+                                CANetworkChangeCallback netCallback, u_thread_pool_t handle);
 
 /**
  * @brief Start Ethernet Interface adapter.
- * @return CA_STATUS_OK or ERROR CODES ( CAResult_t error codes in cacommon.h)
+ * @return  #CA_STATUS_OK or Appropriate error code
  */
 CAResult_t CAStartEthernet();
 
 /**
- * @brief Starting listening server for receiving multicast search requests
+ * @brief Start listening server for receiving multicast search requests
  * Transport Specific Behavior:
- * Ethernet Starts Multicast Server on  all available IPs and prefixed port number and
+ * Ethernet Starts Multicast Server on a particular interface and prefixed port number and
  * as per OIC Specification.
- * @return CA_STATUS_OK or ERROR CODES ( CAResult_t error codes in cacommon.h)
+ * @return  #CA_STATUS_OK or Appropriate error code
  */
 CAResult_t CAStartEthernetListeningServer();
 
 /**
- * @brief for starting discovery servers for receiving multicast advertisements
+ * @brief Start discovery servers for receiving multicast advertisements
  * Transport Specific Behavior:
- * Ethernet Starts Start multicast server on all available IPs and prefixed port number as per
- * OIC Specification
- * @return CA_STATUS_OK or ERROR CODES ( CAResult_t error codes in cacommon.h)
+ * Ethernet Starts Start multicast server on a particular interface and prefixed port
+ * number as per OIC Specification
+ * @return  #CA_STATUS_OK or Appropriate error code
  */
 CAResult_t CAStartEthernetDiscoveryServer();
 
 /**
  * @brief Sends data to the endpoint using the adapter connectivity.
- * Note: length must be > 0.
- * @param   endpoint    [IN]    Remote Endpoint information (like ipaddress , port, reference
- * uri and connectivity type) to which the unicast data has to be sent.
- * @param   data        [IN]    Data which required to be sent.
+ * @param   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 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 zero indicates error.
+ * @return The number of bytes sent on the network. Return value equal to -1 indicates error.
+ * @remarks dataLen must be > 0.
  */
-uint32_t CASendEthernetUnicastData(const CARemoteEndpoint_t *endpoint, void *data,
+int32_t CASendEthernetUnicastData(const CARemoteEndpoint_t *endpoint, const void *data,
                                    uint32_t dataLen);
 
 /**
  * @brief Sends Multicast data to the endpoint using the Ethernet connectivity.
- * Note: length must be > 0.
  * @param   data        [IN]    Data which required to be sent.
  * @param   dataLen     [IN]    Size of data to be sent.
- * @return - The number of bytes sent on the network. Return value equal to zero indicates error.
- */
-uint32_t CASendEthernetMulticastData(void *data, uint32_t dataLen);
-
-/**
- * @brief Starts notification server on Ethernet adapters.
- * @return CA_STATUS_OK or ERROR CODES ( CAResult_t error codes in cacommon.h)
+ * @return The number of bytes sent on the network. Return value equal to -1 indicates error.
+ * @remarks dataLen must be > 0.
  */
-CAResult_t CAStartEthernetNotifyRecvServers();
+int32_t CASendEthernetMulticastData(const void *data, uint32_t dataLen);
 
 /**
- * @brief Send notification information.
- * Note: length must be > 0.
- * @param   endpoint    [IN]    Remote Endpoint information (like ipaddress , port,
- * reference uri and connectivity type) to which the unicast data has to be sent.
- * @param   data        [IN]    Data which required to be sent.
- * @param   dataLen     [IN]    Size of data to be sent.
- * @return - The number of bytes sent on the network. Return value equal to zero indicates error.
- */
-uint32_t CASendEthernetNotification(const CARemoteEndpoint_t *endpoint, void *data,
-                                    uint32_t dataLen);
-/**
  * @brief Get Ethernet Connectivity network information
  * @param   info        [OUT]   Local connectivity information structures
  * @param   size        [OUT]   Number of local connectivity structures.
- * @return CA_STATUS_OK or ERROR CODES ( CAResult_t error codes in cacommon.h)
+ * @return  #CA_STATUS_OK or Appropriate error code
+ * @remarks info is allocated in this API and should be freed by the caller.
  */
 CAResult_t CAGetEthernetInterfaceInformation(CALocalConnectivity_t **info, uint32_t *size);
 
 /**
  * @brief Read Synchronous API callback.
- * @return CA_STATUS_OK or ERROR CODES ( CAResult_t error codes in cacommon.h)
+ * @return  #CA_STATUS_OK or Appropriate error code
  */
 CAResult_t CAReadEthernetData();
 
 /**
- * @brief Stopping the adapters and close socket connections
- *   Ethernet Stops all multicast and unicast servers and close sockets.
- * @return CA_STATUS_OK or ERROR CODES ( CAResult_t error codes in cacommon.h)
+ * @brief Stops Unicast, Multicast servers and close the sockets.
+ * @return  #CA_STATUS_OK or Appropriate error code
  */
 CAResult_t CAStopEthernet();
 
 /**
  * @brief Terminate the Ethernet connectivity adapter.
  * Configuration information will be deleted from further use
+ * @return  NONE
  */
 void CATerminateEthernet();
 
@@ -139,4 +128,5 @@ void CATerminateEthernet();
 } /* extern "C" */
 #endif
 
-#endif//#ifndef __CA_ETHERNET_ADAPTER_H__
+#endif  // #ifndef __CA_ETHERNET_ADAPTER_H__
+