Chapter 2. API Reference
Public Members
uint16_t start_offset
Modbus start address for area descriptor
mb_param_type_t
type
Type of storage area descriptor
void *address
Instance address for storage area descriptor
size_t size
Instance size for area descriptor (bytes)
2.3.12 ESP WebSocket Client
Overview
The ESP WebSocket client is an implementation of
Features
• Supports WebSocket over TCP, TLS with mbedtls
• Easy to setup with URI
• Multiple instances (Multiple clients in one application)
Configuration
URI
• Supports ws, wss schemes
• WebSocket samples:
– ws://echo.websocket.org: WebSocket over TCP, default port 80
– wss://echo.websocket.org: WebSocket over SSL, default port 443
Minimal configurations:
const
esp_websocket_client_config_t ws_cfg
.uri
=
"ws://echo.websocket.org",
};
The WebSocket client supports the use of both path and query in the URI. Sample:
const
esp_websocket_client_config_t ws_cfg
.uri
=
"ws://echo.websocket.org/connectionhandler?id=104",
};
If there are any options related to the URI in esp_websocket_client_config_t, the option defined by the
URI will be overridden. Sample:
const
esp_websocket_client_config_t ws_cfg
.uri
=
"ws://echo.websocket.org:123",
.port
=
4567,
};
//WebSocket client will connect to websocket.org using port 4567
Espressif Systems
WebSocket protocol client
=
{
=
{
=
{
642
Submit Document Feedback
for ESP32-S2
Release v4.4
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?