21#include "platform/SingletonPtr.h"
22#include "rtos/Mutex.h"
25#include "hal/ticker_api.h"
27#ifndef MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT
28#define MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT 10
63#if !defined(DOXYGEN_ONLY)
86#if !defined(DOXYGEN_ONLY)
97 void stats_new_socket_entry(
Socket *reference_id);
106 void stats_update_socket_state(
const Socket *reference_id, socket_state state);
124 void stats_update_proto(
const Socket *reference_id, nsapi_protocol_t proto);
133 void stats_update_sent_bytes(
const Socket *reference_id,
size_t sent_bytes);
142 void stats_update_recv_bytes(
const Socket *reference_id,
size_t recv_bytes);
144#if MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
148 static uint32_t _size;
155 int get_entry_position(
const Socket *reference_id);
160#if !MBED_CONF_NSAPI_SOCKET_STATS_ENABLED
161#if !defined(DOXYGEN_ONLY)
167inline void SocketStats::stats_new_socket_entry(
Socket *)
171inline void SocketStats::stats_update_socket_state(
const Socket *, socket_state)
179inline void SocketStats::stats_update_proto(
const Socket *, nsapi_protocol_t)
183inline void SocketStats::stats_update_sent_bytes(
const Socket *,
size_t)
187inline void SocketStats::stats_update_recv_bytes(
const Socket *,
size_t)
Abstract Socket interface.
static size_t mbed_stats_socket_get_each(mbed_stats_socket_t *stats, size_t count)
Fill the passed array of structures with the socket statistics for each created socket.
uint64_t us_timestamp_t
A us timestamp stored in a 64 bit integer.
Utility class for creating and using a singleton.
Structure to parse socket statistics.
size_t sent_bytes
Data sent through this socket.
socket_state state
State of this socket.
nsapi_protocol_t proto
Specifies a protocol used with socket.
size_t recv_bytes
Data received through this socket.
Socket * reference_id
Used for identifying socket.
us_timestamp_t last_change_tick
osKernelGetTick() when state last changed
SocketAddress peer
Last associated peername of this socket (Destination address)