EasyManua.ls Logo

Espressif ESP32-S2 - Page 533

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
Loading...
Chapter 2. API Reference
[in] hostname: Hostname of the host.
[in] hostlen: Length of hostname.
[in] port: Port number of the host.
[in] cfg: TLS configuration as esp_tls_cfg_t. If you wish to open non-TLS connection, keep this
NULL. For TLS connection, a pass pointer to esp_tls_cfg_t. At a minimum, this structure should
be zero-initialized.
int esp_tls_conn_new_sync(const char *hostname, int hostlen, int port, const esp_tls_cfg_t *cfg,
esp_tls_t *tls)
Create a new blocking TLS/SSL connection.
This function establishes a TLS/SSL connection with the specified host in blocking manner.
Return
-1 If connection establishment fails.
1 If connection establishment is successful.
0 If connection state is in progress.
Parameters
[in] hostname: Hostname of the host.
[in] hostlen: Length of hostname.
[in] port: Port number of the host.
[in] cfg: TLS configuration as esp_tls_cfg_t. If you wish to open non-TLS connection, keep this
NULL. For TLS connection, a pass pointer to esp_tls_cfg_t. At a minimum, this structure should
be zero-initialized.
[in] tls: Pointer to esp-tls as esp-tls handle.
esp_tls_t *esp_tls_conn_http_new(const char *url, const esp_tls_cfg_t *cfg)
Create a new blocking TLS/SSL connection with a given HTTPurl.
The behaviour is same as esp_tls_conn_new() API. However this API accepts hosts url.
Return pointer to esp_tls_t, or NULL if connection couldnt be opened.
Parameters
[in] url: url of host.
[in] cfg: TLS configuration as esp_tls_cfg_t. If you wish to open non-TLS connection, keep
this NULL. For TLS connection, a pass pointer to esp_tls_cfg_t. At a minimum, this structure
should be zero-initialized.
int esp_tls_conn_new_async(const char *hostname, int hostlen, int port, const esp_tls_cfg_t *cfg,
esp_tls_t *tls)
Create a new non-blocking TLS/SSL connection.
This function initiates a non-blocking TLS/SSL connection with the specified host, but due to its non-blocking
nature, it doesnt wait for the connection to get established.
Return
-1 If connection establishment fails.
0 If connection establishment is in progress.
1 If connection establishment is successful.
Parameters
[in] hostname: Hostname of the host.
[in] hostlen: Length of hostname.
[in] port: Port number of the host.
[in] cfg: TLS configuration as esp_tls_cfg_t. non_block member of this structure should be
set to be true.
[in] tls: pointer to esp-tls as esp-tls handle.
int esp_tls_conn_http_new_async(const char *url, const esp_tls_cfg_t *cfg, esp_tls_t *tls)
Create a new non-blocking TLS/SSL connection with a given HTTPurl.
The behaviour is same as esp_tls_conn_new() API. However this API accepts hosts url.
Return
-1 If connection establishment fails.
Espressif Systems 522
Submit Document Feedback
Release v4.4

Table of Contents