Espressif ESP32-S2 Programming Manual page 536

Table of Contents

Advertisement

Chapter 2. API Reference
Return
• ESP_ERR_INVALID_STATE if invalid parameters
• ESP_OK if a valid error returned and was cleared
Parameters
• [in] h: esp-tls error handle.
• [in] err_type: specific error type
• [out] error_code: last error code returned from mbedtls api (set to zero if none) This pointer
could be NULL if caller does not care about esp_tls_code
mbedtls_x509_crt *esp_tls_get_global_ca_store(void)
Get the pointer to the global CA store currently being used.
The application must first call esp_tls_set_global_ca_store(). Then the same CA store could be used by the
application for APIs other than esp_tls.
Note Modifying the pointer might cause a failure in verifying the certificates.
Return
• Pointer to the global CA store currently being used if successful.
• NULL if there is no global CA store set.
esp_err_t
esp_tls_plain_tcp_connect(const char *host, int hostlen, int port, const
Creates a plain TCP connection, returning a valid socket fd on success or an error handle.
Return ESP_OK on success ESP_ERR_INVALID_ARG if invalid output parameters ESP-TLS based error
codes on failure
Parameters
• [in] host: Hostname of the host.
• [in] hostlen: Length of hostname.
• [in] port: Port number of the host.
• [in] cfg: ESP-TLS configuration as esp_tls_cfg_t.
• [out] error_handle: ESP-TLS error handle holding potential errors occurred during con-
nection
• [out] sockfd: Socket descriptor if successfully connected on TCP layer
Structures
struct psk_key_hint
ESP-TLS preshared key and hint structure.
Public Members
const uint8_t *key
key in PSK authentication mode in binary format
const size_t key_size
length of the key
const char *hint
hint in PSK authentication mode in string format
struct tls_keep_alive_cfg
esp-tls client session ticket ctx
Keep alive parameters structure
Public Members
bool keep_alive_enable
Enable keep-alive timeout
int keep_alive_idle
Keep-alive idle time (second)
Espressif Systems
*cfg, esp_tls_error_handle_t error_handle, int *sockfd)
525
Submit Document Feedback
esp_tls_cfg_t
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?

Questions and answers

Table of Contents

Save PDF