Icmp Echo - Espressif ESP32-S2 Programming Manual

Table of Contents

Advertisement

Chapter 2. API Reference
uint16_t port_secure
Port used when transport mode is secure (default 443)
uint16_t port_insecure
Port used when transport mode is insecure (default 80)
bool session_tickets
Enable tls session tickets
esp_https_server_user_cb
User callback for esp_https_server
Macros
HTTPD_SSL_CONFIG_DEFAULT()
Default config struct init
(http_server default config had to be copied for customization)
Notes:
• port is set when starting the server, according to 'transport_mode'
• one socket uses ~ 40kB RAM with SSL, we reduce the default socket count to 4
• SSL sockets are usually long-lived, closing LRU prevents pool exhaustion DOS
• Stack size may need adjustments depending on the user application
Type Definitions
typedef struct
esp_https_server_user_cb_arg
Callback data struct, contains the ESP-TLS connection handle.
typedef void
esp_https_server_user_cb(esp_https_server_user_cb_arg_t
Callback function prototype Can be used to get connection or client information (SSL context) E.g. Client
certificate, Socket FD, Connection state, etc.
Parameters
• user_cb: Callback data struct
typedef struct
httpd_ssl_config
Enumerations
enum httpd_ssl_transport_mode_t
Values:
HTTPD_SSL_TRANSPORT_SECURE
HTTPD_SSL_TRANSPORT_INSECURE

2.3.8 ICMP Echo

Overview
ICMP (Internet Control Message Protocol) is used for diagnostic or control purposes or generated in response to
errors in IP operations. The common network util ping is implemented based on the ICMP packets with the type
field value of 0, also called Echo Reply.
During a ping session, the source host firstly sends out an ICMP echo request packet and wait for an ICMP echo reply
with specific times. In this way, it also measures the round-trip time for the messages. After receiving a valid ICMP
echo reply, the source host will generate statistics about the IP link layer (e.g. packet loss, elapsed time, etc).
It is common that IoT device needs to check whether a remote server is alive or not. The device should show the
warnings to users when it got offline. It can be achieved by creating a ping session and sending/parsing ICMP echo
packets periodically.
To make this internal procedure much easier for users, ESP-IDF provides some out-of-box APIs.
Espressif Systems
*user_cb
esp_https_server_user_cb_arg_t
httpd_ssl_config_t
595
Submit Document Feedback
*user_cb)
Release v4.4

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32-S2 and is the answer not in the manual?

Table of Contents

Save PDF