diff --git a/features/netsocket/SocketStats.h b/features/netsocket/SocketStats.h index 8850b35dd0..cfd42bf994 100644 --- a/features/netsocket/SocketStats.h +++ b/features/netsocket/SocketStats.h @@ -29,13 +29,13 @@ /** Enum of socket states * - * Can be used to specify current state of socket - Open / Close / Connected / Listen + * Can be used to specify current state of socket - open, closed, connected or listen. * * @enum socket_state */ typedef enum { SOCK_CLOSED, /**< Socket is closed and does not exist anymore in the system */ - SOCK_OPEN, /**< Socket is open, but not associated to any peer address */ + SOCK_OPEN, /**< Socket is open but not associated to any peer address */ SOCK_CONNECTED, /**< Socket is associated to peer address, either by connect() or sendto()/recvfrom() calls */ SOCK_LISTEN, /**< Socket is listening for incoming connections */ } socket_state; @@ -63,7 +63,7 @@ public: /** Create an socket statictics object * * Application users must not create class objects. - * The class object will be created by entities reporting network statistics. + * Entities reporting network statistics create the class object. * Application can fetch network statistics using static `mbed_stats_socket_get_each` API * without creating an object. */ @@ -79,7 +79,7 @@ public: * @param count The number of mbed_stats_socket_t structures in the provided array * @return The number of mbed_stats_socket_t structures that have been filled. * If the number of sockets on the system is less than or equal to count, - * it will equal the number of sockets created (active / closed). + * it will equal the number of sockets created (active or closed). * If the number of sockets on the system is greater than count, * it will equal count. */ @@ -87,58 +87,58 @@ public: #if !defined(DOXYGEN_ONLY) /** Add entry of newly created socket in statistics array. - * API used by socket (TCP / UDP) layers only, not to be used by application. + * API used by socket (TCP or UDP) layers only, not to be used by application. * - * @param reference_id Id to identify socket in data array. + * @param reference_id ID to identify socket in data array. * - * @Note: Entry in the array will be maintained even after socket is closed. - * Entry will be over-written for sockets which were closed first, in case - * we socket creation count exceeds `MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT`. + * @Note: The entry in the array is maintained even after the socket is closed. + * The entry is overwritten for sockets that were closed first, in case + * the socket creation count exceeds `MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT`. * */ void stats_new_socket_entry(const Socket *const reference_id); - /** Updates the state of socket and along with that records tick_last_change. - * API used by socket (TCP / UDP) layers only, not to be used by application. + /** Updates the state of the socket and records `tick_last_change`. + * API used by socket (TCP or UDP) layers only, not to be used by application. * - * @param reference_id Id to identify socket in data array. - * @param state Parameter to update current state of socket. + * @param reference_id ID to identify socket in data array. + * @param state Parameter to update the current state of the socket. * */ void stats_update_socket_state(const Socket *const reference_id, socket_state state); /** Update the peer information of the socket. - * API used by socket (TCP / UDP) layers only, not to be used by application. + * API used by socket (TCP or UDP) layers only, not to be used by application. * - * @param reference_id Id to identify socket in data array. - * @param peer Parameter to update destination peer information + * @param reference_id ID to identify socket in data array. + * @param peer Parameter to update destination peer information. * */ void stats_update_peer(const Socket *const reference_id, const SocketAddress &peer); /** Update socket protocol. - * API used by socket (TCP / UDP) layers only, not to be used by application. + * API used by socket (TCP or UDP) layers only, not to be used by application. * - * @param reference_id Id to identify socket in data array. + * @param reference_id ID to identify socket in data array. * @param proto Parameter to update the protocol type of socket. * */ void stats_update_proto(const Socket *const reference_id, nsapi_protocol_t proto); /** Update bytes sent on socket, which is cumulative count per socket. - * API used by socket (TCP / UDP) layers only, not to be used by application. + * API used by socket (TCP or UDP) layers only, not to be used by application. * - * @param reference_id Id to identify socket in data array. + * @param reference_id ID to identify socket in data array. * @param sent_bytes Parameter to append bytes sent over the socket. * */ void stats_update_sent_bytes(const Socket *const reference_id, size_t sent_bytes); /** Update bytes received on socket, which is cumulative count per socket - * API used by socket (TCP / UDP) layers only, not to be used by application. + * API used by socket (TCP or UDP) layers only, not to be used by application. * - * @param reference_id Id to identify socket in data array. - * @param recv_bytes Parameter to append bytes received by the socket + * @param reference_id ID to identify socket in data array. + * @param recv_bytes Parameter to append bytes the socket receives. * */ void stats_update_recv_bytes(const Socket *const reference_id, size_t recv_bytes); @@ -149,9 +149,9 @@ private: static SingletonPtr _mutex; static uint32_t _size; - /** Internal function to scan the array and get position of element in the list. + /** Internal function to scan the array and get the position of the element in the list. * - * @param reference_id Id to identify socket in data array. + * @param reference_id ID to identify the socket in the data array. * */ int get_entry_position(const Socket *const reference_id);