Skip to content

Commit 81fc940

Browse files
Amanda Butlerdeepikabhavnani
authored andcommitted
Edit SocketStats.h
Edit file.
1 parent 117eb0b commit 81fc940

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

features/netsocket/SocketStats.h

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@
2929

3030
/** Enum of socket states
3131
*
32-
* Can be used to specify current state of socket - Open / Close / Connected / Listen
32+
* Can be used to specify current state of socket - open, closed, connected or listen.
3333
*
3434
* @enum socket_state
3535
*/
3636
typedef enum {
3737
SOCK_CLOSED, /**< Socket is closed and does not exist anymore in the system */
38-
SOCK_OPEN, /**< Socket is open, but not associated to any peer address */
38+
SOCK_OPEN, /**< Socket is open but not associated to any peer address */
3939
SOCK_CONNECTED, /**< Socket is associated to peer address, either by connect() or sendto()/recvfrom() calls */
4040
SOCK_LISTEN, /**< Socket is listening for incoming connections */
4141
} socket_state;
@@ -63,7 +63,7 @@ class SocketStats {
6363
/** Create an socket statictics object
6464
*
6565
* Application users must not create class objects.
66-
* The class object will be created by entities reporting network statistics.
66+
* Entities reporting network statistics create the class object.
6767
* Application can fetch network statistics using static `mbed_stats_socket_get_each` API
6868
* without creating an object.
6969
*/
@@ -79,66 +79,66 @@ class SocketStats {
7979
* @param count The number of mbed_stats_socket_t structures in the provided array
8080
* @return The number of mbed_stats_socket_t structures that have been filled.
8181
* If the number of sockets on the system is less than or equal to count,
82-
* it will equal the number of sockets created (active / closed).
82+
* it will equal the number of sockets created (active or closed).
8383
* If the number of sockets on the system is greater than count,
8484
* it will equal count.
8585
*/
8686
static size_t mbed_stats_socket_get_each(mbed_stats_socket_t *stats, size_t count);
8787

8888
#if !defined(DOXYGEN_ONLY)
8989
/** Add entry of newly created socket in statistics array.
90-
* API used by socket (TCP / UDP) layers only, not to be used by application.
90+
* API used by socket (TCP or UDP) layers only, not to be used by application.
9191
*
92-
* @param reference_id Id to identify socket in data array.
92+
* @param reference_id ID to identify socket in data array.
9393
*
94-
* @Note: Entry in the array will be maintained even after socket is closed.
95-
* Entry will be over-written for sockets which were closed first, in case
96-
* we socket creation count exceeds `MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT`.
94+
* @Note: The entry in the array is maintained even after the socket is closed.
95+
* The entry is overwritten for sockets that were closed first, in case
96+
* the socket creation count exceeds `MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT`.
9797
*
9898
*/
9999
void stats_new_socket_entry(const Socket *const reference_id);
100100

101-
/** Updates the state of socket and along with that records tick_last_change.
102-
* API used by socket (TCP / UDP) layers only, not to be used by application.
101+
/** Updates the state of the socket and records `tick_last_change`.
102+
* API used by socket (TCP or UDP) layers only, not to be used by application.
103103
*
104-
* @param reference_id Id to identify socket in data array.
105-
* @param state Parameter to update current state of socket.
104+
* @param reference_id ID to identify socket in data array.
105+
* @param state Parameter to update the current state of the socket.
106106
*
107107
*/
108108
void stats_update_socket_state(const Socket *const reference_id, socket_state state);
109109

110110
/** Update the peer information of the socket.
111-
* API used by socket (TCP / UDP) layers only, not to be used by application.
111+
* API used by socket (TCP or UDP) layers only, not to be used by application.
112112
*
113-
* @param reference_id Id to identify socket in data array.
114-
* @param peer Parameter to update destination peer information
113+
* @param reference_id ID to identify socket in data array.
114+
* @param peer Parameter to update destination peer information.
115115
*
116116
*/
117117
void stats_update_peer(const Socket *const reference_id, const SocketAddress &peer);
118118

119119
/** Update socket protocol.
120-
* API used by socket (TCP / UDP) layers only, not to be used by application.
120+
* API used by socket (TCP or UDP) layers only, not to be used by application.
121121
*
122-
* @param reference_id Id to identify socket in data array.
122+
* @param reference_id ID to identify socket in data array.
123123
* @param proto Parameter to update the protocol type of socket.
124124
*
125125
*/
126126
void stats_update_proto(const Socket *const reference_id, nsapi_protocol_t proto);
127127

128128
/** Update bytes sent on socket, which is cumulative count per socket.
129-
* API used by socket (TCP / UDP) layers only, not to be used by application.
129+
* API used by socket (TCP or UDP) layers only, not to be used by application.
130130
*
131-
* @param reference_id Id to identify socket in data array.
131+
* @param reference_id ID to identify socket in data array.
132132
* @param sent_bytes Parameter to append bytes sent over the socket.
133133
*
134134
*/
135135
void stats_update_sent_bytes(const Socket *const reference_id, size_t sent_bytes);
136136

137137
/** Update bytes received on socket, which is cumulative count per socket
138-
* API used by socket (TCP / UDP) layers only, not to be used by application.
138+
* API used by socket (TCP or UDP) layers only, not to be used by application.
139139
*
140-
* @param reference_id Id to identify socket in data array.
141-
* @param recv_bytes Parameter to append bytes received by the socket
140+
* @param reference_id ID to identify socket in data array.
141+
* @param recv_bytes Parameter to append bytes the socket receives.
142142
*
143143
*/
144144
void stats_update_recv_bytes(const Socket *const reference_id, size_t recv_bytes);
@@ -149,9 +149,9 @@ class SocketStats {
149149
static SingletonPtr<PlatformMutex> _mutex;
150150
static uint32_t _size;
151151

152-
/** Internal function to scan the array and get position of element in the list.
152+
/** Internal function to scan the array and get the position of the element in the list.
153153
*
154-
* @param reference_id Id to identify socket in data array.
154+
* @param reference_id ID to identify the socket in the data array.
155155
*
156156
*/
157157
int get_entry_position(const Socket *const reference_id);

0 commit comments

Comments
 (0)