Skip to content

IDF release/v3.3 c33fc7821 #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libraries/WiFi/src/WiFiClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ int WiFiClient::connect(IPAddress ip, uint16_t port, int32_t timeout)

uint32_t ip_addr = ip;
struct sockaddr_in serveraddr;
bzero((char *) &serveraddr, sizeof(serveraddr));
memset((char *) &serveraddr, 0, sizeof(serveraddr));
serveraddr.sin_family = AF_INET;
bcopy((const void *)(&ip_addr), (void *)&serveraddr.sin_addr.s_addr, 4);
memcpy((void *)&serveraddr.sin_addr.s_addr, (const void *)(&ip_addr), 4);
serveraddr.sin_port = htons(port);
fd_set fdset;
struct timeval tv;
Expand Down
2 changes: 1 addition & 1 deletion libraries/WiFiClientSecure/src/ssl_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ int start_ssl_client(sslclient_context *ssl_client, const char *host, uint32_t p
log_v("Verifying peer X.509 certificate...");

if ((flags = mbedtls_ssl_get_verify_result(&ssl_client->ssl_ctx)) != 0) {
bzero(buf, sizeof(buf));
memset(buf, 0, sizeof(buf));
mbedtls_x509_crt_verify_info(buf, sizeof(buf), " ! ", flags);
log_e("Failed to verify peer certificate! verification info: %s", buf);
stop_ssl_socket(ssl_client, rootCABuff, cli_cert, cli_key); //It's not safe continue.
Expand Down
Binary file modified tools/sdk/bin/bootloader_dio_40m.bin
Binary file not shown.
Binary file modified tools/sdk/bin/bootloader_qout_40m.bin
Binary file not shown.
Binary file modified tools/sdk/bin/bootloader_qout_80m.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion tools/sdk/include/config/sdkconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -393,5 +393,5 @@
#define CONFIG_BTDM_MODEM_SLEEP_MODE_ORIG 1
#define CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_ERROR 1
#define CONFIG_FATFS_API_ENCODING_ANSI_OEM 1
#define CONFIG_ARDUINO_IDF_COMMIT "68b237fe5"
#define CONFIG_ARDUINO_IDF_COMMIT "c33fc7821"
#define CONFIG_ARDUINO_IDF_BRANCH "release/v3.3"
26 changes: 23 additions & 3 deletions tools/sdk/include/mqtt/mqtt_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,17 @@ typedef enum {
*/
typedef enum {
MQTT_ERROR_TYPE_NONE = 0,
MQTT_ERROR_TYPE_ESP_TLS,
MQTT_ERROR_TYPE_TCP_TRANSPORT,
MQTT_ERROR_TYPE_CONNECTION_REFUSED,
} esp_mqtt_error_type_t;

/**
* MQTT_ERROR_TYPE_TCP_TRANSPORT error type hold all sorts of transport layer errors,
* including ESP-TLS error, but in the past only the errors from MQTT_ERROR_TYPE_ESP_TLS layer
* were reported, so the ESP-TLS error type is re-defined here for backward compatibility
*/
#define MQTT_ERROR_TYPE_ESP_TLS MQTT_ERROR_TYPE_TCP_TRANSPORT

typedef enum {
MQTT_TRANSPORT_UNKNOWN = 0x0,
MQTT_TRANSPORT_OVER_TCP, /*!< MQTT over TCP, using scheme: ``mqtt`` */
Expand All @@ -110,7 +117,7 @@ typedef enum {
* Use this structure directly checking error_type first and then appropriate error code depending on the source of the error:
*
* | error_type | related member variables | note |
* | MQTT_ERROR_TYPE_ESP_TLS | esp_tls_last_esp_err, esp_tls_stack_err, esp_tls_cert_verify_flags | Error reported from esp-tls |
* | MQTT_ERROR_TYPE_TCP_TRANSPORT | esp_tls_last_esp_err, esp_tls_stack_err, esp_tls_cert_verify_flags, sock_errno | Error reported from tcp_transport/esp-tls |
* | MQTT_ERROR_TYPE_CONNECTION_REFUSED | connect_return_code | Internal error reported from MQTT broker on connection |
*/
typedef struct esp_mqtt_error_codes {
Expand All @@ -121,6 +128,9 @@ typedef struct esp_mqtt_error_codes {
/* esp-mqtt specific structure extension */
esp_mqtt_error_type_t error_type; /*!< error type referring to the source of the error */
esp_mqtt_connect_return_code_t connect_return_code; /*!< connection refused error code reported from MQTT broker on connection */
/* tcp_transport extension */
int esp_transport_sock_errno; /*!< errno from the underlying socket */

} esp_mqtt_error_codes_t;

/**
Expand Down Expand Up @@ -179,7 +189,7 @@ typedef struct {
int refresh_connection_after_ms; /*!< Refresh connection after this value (in milliseconds) */
const struct psk_key_hint* psk_hint_key; /*!< Pointer to PSK struct defined in esp_tls.h to enable PSK authentication (as alternative to certificate verification). If not NULL and server/client certificates are NULL, PSK is enabled */
bool use_global_ca_store; /*!< Use a global ca_store for all the connections in which this bool is set. */
int reconnect_timeout_ms; /*!< Reconnect to the broker after this value in miliseconds if auto reconnect is not disabled */
int reconnect_timeout_ms; /*!< Reconnect to the broker after this value in miliseconds if auto reconnect is not disabled (defaults to 10s) */
const char **alpn_protos; /*!< NULL-terminated list of supported application protocols to be used for ALPN */
const char *clientkey_password; /*!< Client key decryption password string */
int clientkey_password_len; /*!< String length of the password pointed to by clientkey_password */
Expand All @@ -188,6 +198,8 @@ typedef struct {
bool skip_cert_common_name_check; /*!< Skip any validation of server certificate CN field, this reduces the security of TLS and makes the mqtt client susceptible to MITM attacks */
bool use_secure_element; /*!< enable secure element for enabling SSL connection */
void *ds_data; /*!< carrier of handle for digital signature parameters */
int network_timeout_ms; /*!< Abort network operation if it is not completed after this value, in milliseconds (defaults to 10s) */
bool disable_keepalive; /*!< Set disable_keepalive=true to turn off keep-alive mechanism, false by default (keepalive is active by default). Note: setting the config value `keepalive` to `0` doesn't disable keepalive feature, but uses a default keepalive period */
} esp_mqtt_client_config_t;

/**
Expand Down Expand Up @@ -347,6 +359,14 @@ esp_err_t esp_mqtt_set_config(esp_mqtt_client_handle_t client, const esp_mqtt_cl
*/
esp_err_t esp_mqtt_client_register_event(esp_mqtt_client_handle_t client, esp_mqtt_event_id_t event, esp_event_handler_t event_handler, void* event_handler_arg);

/**
* @brief Get outbox size
*
* @param client mqtt client handle
* @return outbox size
*/
int esp_mqtt_client_get_outbox_size(esp_mqtt_client_handle_t client);

#ifdef __cplusplus
}
#endif //__cplusplus
Expand Down
4 changes: 2 additions & 2 deletions tools/sdk/include/mqtt/mqtt_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
#endif
#endif

#ifdef CONFIG_OUTBOX_EXPIRED_TIMEOUT_MS
#define OUTBOX_EXPIRED_TIMEOUT_MS CONFIG_OUTBOX_EXPIRED_TIMEOUT_MS
#ifdef CONFIG_MQTT_OUTBOX_EXPIRED_TIMEOUT_MS
#define OUTBOX_EXPIRED_TIMEOUT_MS CONFIG_MQTT_OUTBOX_EXPIRED_TIMEOUT_MS
#else
#define OUTBOX_EXPIRED_TIMEOUT_MS (30*1000)
#endif
Expand Down
1 change: 1 addition & 0 deletions tools/sdk/include/mqtt/mqtt_supported_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 3, 0)
// Features supported in 4.3
#define MQTT_SUPPORTED_FEATURE_DIGITAL_SIGNATURE
#define MQTT_SUPPORTED_FEATURE_TRANSPORT_SOCK_ERRNO_REPORTING
#endif

#endif /* ESP_IDF_VERSION */
Expand Down
Binary file modified tools/sdk/lib/libapp_trace.a
Binary file not shown.
Binary file modified tools/sdk/lib/libapp_update.a
Binary file not shown.
Binary file modified tools/sdk/lib/libasio.a
Binary file not shown.
Binary file modified tools/sdk/lib/libbootloader_support.a
Binary file not shown.
Binary file modified tools/sdk/lib/libbt.a
Binary file not shown.
Binary file modified tools/sdk/lib/libcoap.a
Binary file not shown.
Binary file modified tools/sdk/lib/libconsole.a
Binary file not shown.
Binary file modified tools/sdk/lib/libcxx.a
Binary file not shown.
Binary file modified tools/sdk/lib/libdriver.a
Binary file not shown.
Binary file modified tools/sdk/lib/libefuse.a
Binary file not shown.
Binary file modified tools/sdk/lib/libesp-tls.a
Binary file not shown.
Binary file modified tools/sdk/lib/libesp32-camera.a
Binary file not shown.
Binary file modified tools/sdk/lib/libesp32.a
Binary file not shown.
Binary file modified tools/sdk/lib/libesp_adc_cal.a
Binary file not shown.
Binary file modified tools/sdk/lib/libesp_event.a
Binary file not shown.
Binary file modified tools/sdk/lib/libesp_http_client.a
Binary file not shown.
Binary file modified tools/sdk/lib/libesp_http_server.a
Binary file not shown.
Binary file modified tools/sdk/lib/libesp_https_ota.a
Binary file not shown.
Binary file modified tools/sdk/lib/libesp_https_server.a
Binary file not shown.
Binary file modified tools/sdk/lib/libesp_ringbuf.a
Binary file not shown.
Binary file modified tools/sdk/lib/libesp_websocket_client.a
Binary file not shown.
Binary file modified tools/sdk/lib/libespcoredump.a
Binary file not shown.
Binary file modified tools/sdk/lib/libethernet.a
Binary file not shown.
Binary file modified tools/sdk/lib/libexpat.a
Binary file not shown.
Binary file modified tools/sdk/lib/libface_detection.a
Binary file not shown.
Binary file modified tools/sdk/lib/libface_recognition.a
Binary file not shown.
Binary file modified tools/sdk/lib/libfatfs.a
Binary file not shown.
Binary file modified tools/sdk/lib/libfb_gfx.a
Binary file not shown.
Binary file modified tools/sdk/lib/libfreemodbus.a
Binary file not shown.
Binary file modified tools/sdk/lib/libfreertos.a
Binary file not shown.
Binary file modified tools/sdk/lib/libheap.a
Binary file not shown.
Binary file modified tools/sdk/lib/libimage_util.a
Binary file not shown.
Binary file modified tools/sdk/lib/libjsmn.a
Binary file not shown.
Binary file modified tools/sdk/lib/libjson.a
Binary file not shown.
Binary file modified tools/sdk/lib/liblibsodium.a
Binary file not shown.
Binary file modified tools/sdk/lib/liblog.a
Binary file not shown.
Binary file modified tools/sdk/lib/liblwip.a
Binary file not shown.
Binary file modified tools/sdk/lib/libmbedtls.a
Binary file not shown.
Binary file modified tools/sdk/lib/libmdns.a
Binary file not shown.
Binary file modified tools/sdk/lib/libmicro-ecc.a
Binary file not shown.
Binary file modified tools/sdk/lib/libmqtt.a
Binary file not shown.
Binary file modified tools/sdk/lib/libnewlib.a
Binary file not shown.
Binary file modified tools/sdk/lib/libnghttp.a
Binary file not shown.
Binary file modified tools/sdk/lib/libnvs_flash.a
Binary file not shown.
Binary file modified tools/sdk/lib/libopenssl.a
Binary file not shown.
Binary file modified tools/sdk/lib/libprotobuf-c.a
Binary file not shown.
Binary file modified tools/sdk/lib/libprotocomm.a
Binary file not shown.
Binary file modified tools/sdk/lib/libpthread.a
Binary file not shown.
Binary file modified tools/sdk/lib/libsdmmc.a
Binary file not shown.
Binary file modified tools/sdk/lib/libsmartconfig_ack.a
Binary file not shown.
Binary file modified tools/sdk/lib/libsoc.a
Binary file not shown.
Binary file modified tools/sdk/lib/libspi_flash.a
Binary file not shown.
Binary file modified tools/sdk/lib/libspiffs.a
Binary file not shown.
Binary file modified tools/sdk/lib/libtcp_transport.a
Binary file not shown.
Binary file modified tools/sdk/lib/libtcpip_adapter.a
Binary file not shown.
Binary file modified tools/sdk/lib/libulp.a
Binary file not shown.
Binary file modified tools/sdk/lib/libunity.a
Binary file not shown.
Binary file modified tools/sdk/lib/libvfs.a
Binary file not shown.
Binary file modified tools/sdk/lib/libwear_levelling.a
Binary file not shown.
Binary file modified tools/sdk/lib/libwifi_provisioning.a
Binary file not shown.
Binary file modified tools/sdk/lib/libwpa_supplicant.a
Binary file not shown.
Binary file modified tools/sdk/lib/libxtensa-debug-module.a
Binary file not shown.