mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-30 19:19:21 +00:00
esp_tls: Renamed public API to indicate the Plain TCP connection
Also added parameter checks if used from as a public API and updated the `is_plein_tcp` description that it's possible to connect directly using plain tcp transport with the new API.
This commit is contained in:
@@ -171,7 +171,10 @@ typedef struct esp_tls_cfg {
|
||||
|
||||
void *ds_data; /*!< Pointer for digital signature peripheral context */
|
||||
bool is_plain_tcp; /*!< Use non-TLS connection: When set to true, the esp-tls uses
|
||||
plain TCP transport rather then TLS/SSL connection */
|
||||
plain TCP transport rather then TLS/SSL connection.
|
||||
Note, that it is possible to connect using a plain tcp transport
|
||||
directly with esp_tls_plain_tcp_connect() API */
|
||||
|
||||
struct ifreq *if_name; /*!< The name of interface for data to go through. Use the default interface without setting */
|
||||
} esp_tls_cfg_t;
|
||||
|
||||
@@ -609,9 +612,10 @@ void esp_tls_server_session_delete(esp_tls_t *tls);
|
||||
* @param[out] error_handle ESP-TLS error handle holding potential errors occurred during connection
|
||||
* @param[out] sockfd Socket descriptor if successfully connected on TCP layer
|
||||
* @return ESP_OK on success
|
||||
* ESP_ERR_INVALID_ARG if invalid output parameters
|
||||
* ESP-TLS based error codes on failure
|
||||
*/
|
||||
esp_err_t esp_tls_tcp_connect(const char *host, int hostlen, int port, const esp_tls_cfg_t *cfg, esp_tls_error_handle_t error_handle, int *sockfd);
|
||||
esp_err_t esp_tls_plain_tcp_connect(const char *host, int hostlen, int port, const esp_tls_cfg_t *cfg, esp_tls_error_handle_t error_handle, int *sockfd);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
Reference in New Issue
Block a user