EasyManuals Logo

Espressif ESP32-S2 User Manual

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #534 background imageLoading...
Page #534 background image
Chapter 2. API Reference
0 If connection establishment is in progress.
1 If connection establishment is successful.
Parameters
[in] url: url of host.
[in] cfg: TLS configuration as esp_tls_cfg_t.
[in] tls: pointer to esp-tls as esp-tls handle.
static ssize_t esp_tls_conn_write(esp_tls_t *tls, const void *data, size_t datalen)
Write from buffer datainto specified tls connection.
Return
>=0 if write operation was successful, the return value is the number of bytes actually written to the
TLS/SSL connection.
<0 if write operation was not successful, because either an error occured or an action must be taken
by the calling process.
ESP_TLS_ERR_SSL_WANT_READ/ ESP_TLS_ERR_SSL_WANT_WRITE. if the handshake
is incomplete and waiting for data to be available for reading. In this case this functions needs to be
called again when the underlying transport is ready for operation.
Parameters
[in] tls: pointer to esp-tls as esp-tls handle.
[in] data: Buffer from which data will be written.
[in] datalen: Length of data buffer.
static ssize_t esp_tls_conn_read(esp_tls_t *tls, void *data, size_t datalen)
Read from specified tls connection into the buffer data.
Return
>0 if read operation was successful, the return value is the number of bytes actually read from the
TLS/SSL connection.
0 if read operation was not successful. The underlying connection was closed.
<0 if read operation was not successful, because either an error occured or an action must be taken
by the calling process.
Parameters
[in] tls: pointer to esp-tls as esp-tls handle.
[in] data: Buffer to hold read data.
[in] datalen: Length of data buffer.
void esp_tls_conn_delete(esp_tls_t *tls)
Compatible version of esp_tls_conn_destroy() to close the TLS/SSL connection.
Note This API will be removed in IDFv5.0
Parameters
[in] tls: pointer to esp-tls as esp-tls handle.
int esp_tls_conn_destroy(esp_tls_t *tls)
Close the TLS/SSL connection and free any allocated resources.
This function should be called to close each tls connection opened with esp_tls_conn_new() or
esp_tls_conn_http_new() APIs.
Return - 0 on success
-1 if socket error or an invalid argument
Parameters
[in] tls: pointer to esp-tls as esp-tls handle.
ssize_t esp_tls_get_bytes_avail(esp_tls_t *tls)
Return the number of application data bytes remaining to be read from the current record.
This API is a wrapper over mbedtlss mbedtls_ssl_get_bytes_avail() API.
Return
-1 in case of invalid arg
bytes available in the application data record read buffer
Parameters
Espressif Systems 523
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

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

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish