# ifdef ESP_FAIL
ERR_TBL_IT(ESP_FAIL), /* -1 */
# endif
- // components/esp32/include/esp_wifi.h
-# ifdef ESP_ERR_WIFI_FAIL
- ERR_TBL_IT(ESP_ERR_WIFI_FAIL), /* -1 General fail code */
-# endif
- // components/esp32/include/esp_err.h
# ifdef ESP_OK
ERR_TBL_IT(ESP_OK), /* 0 */
# endif
- // components/esp32/include/esp_wifi.h
-# ifdef ESP_ERR_WIFI_OK
- ERR_TBL_IT(ESP_ERR_WIFI_OK), /* 0 No error */
-# endif
- // components/esp32/include/esp_err.h
# ifdef ESP_ERR_NO_MEM
ERR_TBL_IT(ESP_ERR_NO_MEM), /* 257 0x101 */
# endif
- // components/esp32/include/esp_wifi.h
-# ifdef ESP_ERR_WIFI_NO_MEM
- ERR_TBL_IT(ESP_ERR_WIFI_NO_MEM), /* 257 0x101 Out of memory */
-# endif
- // components/esp32/include/esp_err.h
# ifdef ESP_ERR_INVALID_ARG
ERR_TBL_IT(ESP_ERR_INVALID_ARG), /* 258 0x102 */
# endif
- // components/esp32/include/esp_wifi.h
-# ifdef ESP_ERR_WIFI_ARG
- ERR_TBL_IT(ESP_ERR_WIFI_ARG), /* 258 0x102 Invalid argument */
-# endif
- // components/esp32/include/esp_err.h
# ifdef ESP_ERR_INVALID_STATE
ERR_TBL_IT(ESP_ERR_INVALID_STATE), /* 259 0x103 */
# endif
# ifdef ESP_ERR_NOT_SUPPORTED
ERR_TBL_IT(ESP_ERR_NOT_SUPPORTED), /* 262 0x106 */
# endif
- // components/esp32/include/esp_wifi.h
-# ifdef ESP_ERR_WIFI_NOT_SUPPORT
- ERR_TBL_IT(ESP_ERR_WIFI_NOT_SUPPORT), /* 262 0x106 Indicates that API is not supported yet */
-# endif
- // components/esp32/include/esp_err.h
# ifdef ESP_ERR_TIMEOUT
ERR_TBL_IT(ESP_ERR_TIMEOUT), /* 263 0x107 */
# endif
ERR_TBL_IT(ESP_ERR_WIFI_WPS_SM), /* 12341 0x3035 WPS state machine is not initialized */
# endif
// components/esp32/include/esp_now.h
+# ifdef ESP_ERR_ESPNOW_BASE
+ ERR_TBL_IT(ESP_ERR_ESPNOW_BASE), /* 12388 0x3064 ESPNOW error number base. */
+# endif
# ifdef ESP_ERR_ESPNOW_NOT_INIT
ERR_TBL_IT(ESP_ERR_ESPNOW_NOT_INIT), /* 12389 0x3065 ESPNOW is not initialized. */
# endif
-# ifdef ESP_ERR_ESPNOW_BASE
- ERR_TBL_IT(ESP_ERR_ESPNOW_BASE), /* 12389 0x3065 ESPNOW error number base. */
-# endif
# ifdef ESP_ERR_ESPNOW_ARG
ERR_TBL_IT(ESP_ERR_ESPNOW_ARG), /* 12390 0x3066 Invalid argument */
# endif
ERR_TBL_IT(ESP_ERR_ESPNOW_IF), /* 12396 0x306c Interface error */
# endif
// components/tcpip_adapter/include/tcpip_adapter.h
-# ifdef ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS
- ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS), /* 20480 0x5000 */
-# endif
# ifdef ESP_ERR_TCPIP_ADAPTER_BASE
ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_BASE), /* 20480 0x5000 */
# endif
+# ifdef ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS
+ ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS), /* 20481 0x5001 */
+# endif
# ifdef ESP_ERR_TCPIP_ADAPTER_IF_NOT_READY
- ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_IF_NOT_READY), /* 20481 0x5001 */
+ ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_IF_NOT_READY), /* 20482 0x5002 */
# endif
# ifdef ESP_ERR_TCPIP_ADAPTER_DHCPC_START_FAILED
- ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_DHCPC_START_FAILED), /* 20482 0x5002 */
+ ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_DHCPC_START_FAILED), /* 20483 0x5003 */
# endif
# ifdef ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STARTED
- ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STARTED), /* 20483 0x5003 */
+ ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STARTED), /* 20484 0x5004 */
# endif
# ifdef ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STOPPED
- ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STOPPED), /* 20484 0x5004 */
+ ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STOPPED), /* 20485 0x5005 */
# endif
# ifdef ESP_ERR_TCPIP_ADAPTER_NO_MEM
- ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_NO_MEM), /* 20485 0x5005 */
+ ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_NO_MEM), /* 20486 0x5006 */
# endif
# ifdef ESP_ERR_TCPIP_ADAPTER_DHCP_NOT_STOPPED
- ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_DHCP_NOT_STOPPED), /* 20486 0x5006 */
+ ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_DHCP_NOT_STOPPED), /* 20487 0x5007 */
# endif
// components/lwip/apps/ping/esp_ping.h
-# ifdef ESP_ERR_PING_INVALID_PARAMS
- ERR_TBL_IT(ESP_ERR_PING_INVALID_PARAMS), /* 24576 0x6000 */
-# endif
# ifdef ESP_ERR_PING_BASE
ERR_TBL_IT(ESP_ERR_PING_BASE), /* 24576 0x6000 */
# endif
+# ifdef ESP_ERR_PING_INVALID_PARAMS
+ ERR_TBL_IT(ESP_ERR_PING_INVALID_PARAMS), /* 24577 0x6001 */
+# endif
# ifdef ESP_ERR_PING_NO_MEM
- ERR_TBL_IT(ESP_ERR_PING_NO_MEM), /* 24577 0x6001 */
+ ERR_TBL_IT(ESP_ERR_PING_NO_MEM), /* 24578 0x6002 */
# endif
// components/spi_flash/include/esp_spi_flash.h
# ifdef ESP_ERR_FLASH_BASE
* @{
*/
-#define ESP_ERR_ESPNOW_BASE (ESP_ERR_WIFI_BASE + 101) /*!< ESPNOW error number base. */
-#define ESP_ERR_ESPNOW_NOT_INIT (ESP_ERR_ESPNOW_BASE) /*!< ESPNOW is not initialized. */
-#define ESP_ERR_ESPNOW_ARG (ESP_ERR_ESPNOW_BASE + 1) /*!< Invalid argument */
-#define ESP_ERR_ESPNOW_NO_MEM (ESP_ERR_ESPNOW_BASE + 2) /*!< Out of memory */
-#define ESP_ERR_ESPNOW_FULL (ESP_ERR_ESPNOW_BASE + 3) /*!< ESPNOW peer list is full */
-#define ESP_ERR_ESPNOW_NOT_FOUND (ESP_ERR_ESPNOW_BASE + 4) /*!< ESPNOW peer is not found */
-#define ESP_ERR_ESPNOW_INTERNAL (ESP_ERR_ESPNOW_BASE + 5) /*!< Internal error */
-#define ESP_ERR_ESPNOW_EXIST (ESP_ERR_ESPNOW_BASE + 6) /*!< ESPNOW peer has existed */
-#define ESP_ERR_ESPNOW_IF (ESP_ERR_ESPNOW_BASE + 7) /*!< Interface error */
+#define ESP_ERR_ESPNOW_BASE (ESP_ERR_WIFI_BASE + 100) /*!< ESPNOW error number base. */
+#define ESP_ERR_ESPNOW_NOT_INIT (ESP_ERR_ESPNOW_BASE + 1) /*!< ESPNOW is not initialized. */
+#define ESP_ERR_ESPNOW_ARG (ESP_ERR_ESPNOW_BASE + 2) /*!< Invalid argument */
+#define ESP_ERR_ESPNOW_NO_MEM (ESP_ERR_ESPNOW_BASE + 3) /*!< Out of memory */
+#define ESP_ERR_ESPNOW_FULL (ESP_ERR_ESPNOW_BASE + 4) /*!< ESPNOW peer list is full */
+#define ESP_ERR_ESPNOW_NOT_FOUND (ESP_ERR_ESPNOW_BASE + 5) /*!< ESPNOW peer is not found */
+#define ESP_ERR_ESPNOW_INTERNAL (ESP_ERR_ESPNOW_BASE + 6) /*!< Internal error */
+#define ESP_ERR_ESPNOW_EXIST (ESP_ERR_ESPNOW_BASE + 7) /*!< ESPNOW peer has existed */
+#define ESP_ERR_ESPNOW_IF (ESP_ERR_ESPNOW_BASE + 8) /*!< Interface error */
#define ESP_NOW_ETH_ALEN 6 /*!< Length of ESPNOW peer MAC address */
#define ESP_NOW_KEY_LEN 16 /*!< Length of ESPNOW peer local master key */
extern "C" {
#endif
-#define ESP_ERR_WIFI_OK ESP_OK /*!< No error */
-#define ESP_ERR_WIFI_FAIL ESP_FAIL /*!< General fail code */
-#define ESP_ERR_WIFI_NO_MEM ESP_ERR_NO_MEM /*!< Out of memory */
-#define ESP_ERR_WIFI_ARG ESP_ERR_INVALID_ARG /*!< Invalid argument */
-#define ESP_ERR_WIFI_NOT_SUPPORT ESP_ERR_NOT_SUPPORTED /*!< Indicates that API is not supported yet */
-
#define ESP_ERR_WIFI_NOT_INIT (ESP_ERR_WIFI_BASE + 1) /*!< WiFi driver was not installed by esp_wifi_init */
#define ESP_ERR_WIFI_NOT_STARTED (ESP_ERR_WIFI_BASE + 2) /*!< WiFi driver was not started by esp_wifi_start */
#define ESP_ERR_WIFI_NOT_STOPPED (ESP_ERR_WIFI_BASE + 3) /*!< WiFi driver was not stopped by esp_wifi_stop */
*
* @return
* - ESP_OK: succeed
- * - ESP_ERR_WIFI_NO_MEM: out of memory
+ * - ESP_ERR_NO_MEM: out of memory
* - others: refer to error code esp_err.h
*/
esp_err_t esp_wifi_init(const wifi_init_config_t *config);
* @return
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
- * - ESP_ERR_WIFI_ARG: invalid argument
+ * - ESP_ERR_INVALID_ARG: invalid argument
* - others: refer to error code in esp_err.h
*/
esp_err_t esp_wifi_set_mode(wifi_mode_t mode);
* @return
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
- * - ESP_ERR_WIFI_ARG: invalid argument
+ * - ESP_ERR_INVALID_ARG: invalid argument
*/
esp_err_t esp_wifi_get_mode(wifi_mode_t *mode);
* @return
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
- * - ESP_ERR_WIFI_ARG: invalid argument
- * - ESP_ERR_WIFI_NO_MEM: out of memory
+ * - ESP_ERR_INVALID_ARG: invalid argument
+ * - ESP_ERR_NO_MEM: out of memory
* - ESP_ERR_WIFI_CONN: WiFi internal error, station or soft-AP control block wrong
- * - ESP_ERR_WIFI_FAIL: other WiFi internal errors
+ * - ESP_FAIL: other WiFi internal errors
*/
esp_err_t esp_wifi_start(void);
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi was not initialized by esp_wifi_init
* - ESP_ERR_WIFI_NOT_STARTED: WiFi was not started by esp_wifi_start
- * - ESP_ERR_WIFI_FAIL: other WiFi internal errors
+ * - ESP_FAIL: other WiFi internal errors
*/
esp_err_t esp_wifi_disconnect(void);
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
* - ESP_ERR_WIFI_NOT_STARTED: WiFi was not started by esp_wifi_start
- * - ESP_ERR_WIFI_ARG: invalid argument
+ * - ESP_ERR_INVALID_ARG: invalid argument
* - ESP_ERR_WIFI_MODE: WiFi mode is wrong
*/
esp_err_t esp_wifi_deauth_sta(uint16_t aid);
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
* - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start
- * - ESP_ERR_WIFI_ARG: invalid argument
+ * - ESP_ERR_INVALID_ARG: invalid argument
*/
esp_err_t esp_wifi_scan_get_ap_num(uint16_t *number);
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
* - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start
- * - ESP_ERR_WIFI_ARG: invalid argument
- * - ESP_ERR_WIFI_NO_MEM: out of memory
+ * - ESP_ERR_INVALID_ARG: invalid argument
+ * - ESP_ERR_NO_MEM: out of memory
*/
esp_err_t esp_wifi_scan_get_ap_records(uint16_t *number, wifi_ap_record_t *ap_records);
*
* @param type power save type
*
- * @return ESP_ERR_WIFI_NOT_SUPPORT: not supported yet
+ * @return ESP_ERR_NOT_SUPPORTED: not supported yet
*/
esp_err_t esp_wifi_set_ps(wifi_ps_type_t type);
*
* @param[out] type: store current power save type
*
- * @return ESP_ERR_WIFI_NOT_SUPPORT: not supported yet
+ * @return ESP_ERR_NOT_SUPPORTED: not supported yet
*/
esp_err_t esp_wifi_get_ps(wifi_ps_type_t *type);
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
* - ESP_ERR_WIFI_IF: invalid interface
- * - ESP_ERR_WIFI_ARG: invalid argument
+ * - ESP_ERR_INVALID_ARG: invalid argument
* - others: refer to error codes in esp_err.h
*/
esp_err_t esp_wifi_get_protocol(wifi_interface_t ifx, uint8_t *protocol_bitmap);
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
* - ESP_ERR_WIFI_IF: invalid interface
- * - ESP_ERR_WIFI_ARG: invalid argument
+ * - ESP_ERR_INVALID_ARG: invalid argument
* - others: refer to error codes in esp_err.h
*/
esp_err_t esp_wifi_set_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t bw);
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
* - ESP_ERR_WIFI_IF: invalid interface
- * - ESP_ERR_WIFI_ARG: invalid argument
+ * - ESP_ERR_INVALID_ARG: invalid argument
*/
esp_err_t esp_wifi_get_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t *bw);
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
* - ESP_ERR_WIFI_IF: invalid interface
- * - ESP_ERR_WIFI_ARG: invalid argument
+ * - ESP_ERR_INVALID_ARG: invalid argument
*/
esp_err_t esp_wifi_set_channel(uint8_t primary, wifi_second_chan_t second);
* @return
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
- * - ESP_ERR_WIFI_ARG: invalid argument
+ * - ESP_ERR_INVALID_ARG: invalid argument
*/
esp_err_t esp_wifi_get_channel(uint8_t *primary, wifi_second_chan_t *second);
* @return
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
- * - ESP_ERR_WIFI_ARG: invalid argument
+ * - ESP_ERR_INVALID_ARG: invalid argument
*/
esp_err_t esp_wifi_set_country(const wifi_country_t *country);
* @return
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
- * - ESP_ERR_WIFI_ARG: invalid argument
+ * - ESP_ERR_INVALID_ARG: invalid argument
*/
esp_err_t esp_wifi_get_country(wifi_country_t *country);
* @return
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
- * - ESP_ERR_WIFI_ARG: invalid argument
+ * - ESP_ERR_INVALID_ARG: invalid argument
* - ESP_ERR_WIFI_IF: invalid interface
* - ESP_ERR_WIFI_MAC: invalid mac address
* - ESP_ERR_WIFI_MODE: WiFi mode is wrong
* @return
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
- * - ESP_ERR_WIFI_ARG: invalid argument
+ * - ESP_ERR_INVALID_ARG: invalid argument
* - ESP_ERR_WIFI_IF: invalid interface
*/
esp_err_t esp_wifi_get_mac(wifi_interface_t ifx, uint8_t mac[6]);
* @return
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
- * - ESP_ERR_WIFI_ARG: invalid argument
+ * - ESP_ERR_INVALID_ARG: invalid argument
*/
esp_err_t esp_wifi_get_promiscuous(bool *en);
* @return
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
- * - ESP_ERR_WIFI_ARG: invalid argument
+ * - ESP_ERR_INVALID_ARG: invalid argument
*/
esp_err_t esp_wifi_get_promiscuous_filter(wifi_promiscuous_filter_t *filter);
* @return
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
- * - ESP_ERR_WIFI_ARG: invalid argument
+ * - ESP_ERR_INVALID_ARG: invalid argument
* - ESP_ERR_WIFI_IF: invalid interface
* - ESP_ERR_WIFI_MODE: invalid mode
* - ESP_ERR_WIFI_PASSWORD: invalid password
* @return
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
- * - ESP_ERR_WIFI_ARG: invalid argument
+ * - ESP_ERR_INVALID_ARG: invalid argument
* - ESP_ERR_WIFI_IF: invalid interface
*/
esp_err_t esp_wifi_get_config(wifi_interface_t interface, wifi_config_t *conf);
* @return
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
- * - ESP_ERR_WIFI_ARG: invalid argument
+ * - ESP_ERR_INVALID_ARG: invalid argument
* - ESP_ERR_WIFI_MODE: WiFi mode is wrong
* - ESP_ERR_WIFI_CONN: WiFi internal error, the station/soft-AP control block is invalid
*/
* @return
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
- * - ESP_ERR_WIFI_ARG: invalid argument
+ * - ESP_ERR_INVALID_ARG: invalid argument
*/
esp_err_t esp_wifi_set_storage(wifi_storage_t storage);
* @return
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
- * - ESP_ERR_WIFI_ARG: invalid argument
+ * - ESP_ERR_INVALID_ARG: invalid argument
*/
esp_err_t esp_wifi_get_auto_connect(bool *en);
* @return
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init()
- * - ESP_ERR_WIFI_ARG: Invalid argument, including if first byte of vnd_ie is not WIFI_VENDOR_IE_ELEMENT_ID (0xDD)
+ * - ESP_ERR_INVALID_ARG: Invalid argument, including if first byte of vnd_ie is not WIFI_VENDOR_IE_ELEMENT_ID (0xDD)
* or second byte is an invalid length.
- * - ESP_ERR_WIFI_NO_MEM: Out of memory
+ * - ESP_ERR_NO_MEM: Out of memory
*/
esp_err_t esp_wifi_set_vendor_ie(bool enable, wifi_vendor_ie_type_t type, wifi_vendor_ie_id_t idx, const void *vnd_ie);
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
* - ESP_ERR_WIFI_NOT_START: WiFi is not started by esp_wifi_start
- * - ESP_ERR_WIFI_ARG: invalid argument
+ * - ESP_ERR_INVALID_ARG: invalid argument
*/
esp_err_t esp_wifi_get_max_tx_power(int8_t *power);
*
* @return
* - ESP_OK: succeed
- * - ESP_ERR_WIFI_NO_MEM: out of memory
+ * - ESP_ERR_NO_MEM: out of memory
* - others: refer to error code esp_err.h
*/
esp_err_t esp_wifi_init_internal(const wifi_init_config_t *config);
* @attention 2. wpa2 enterprise authentication can only support TLS, PEAP-MSCHAPv2 and TTLS-MSCHAPv2 method.
*
* @return
- * - ESP_ERR_WIFI_OK: succeed.
- * - ESP_ERR_WIFI_NO_MEM: fail(internal memory malloc fail)
+ * - ESP_OK: succeed.
+ * - ESP_ERR_NO_MEM: fail(internal memory malloc fail)
*/
esp_err_t esp_wifi_sta_wpa2_ent_enable(const esp_wpa2_config_t *config);
* @attention 2. wpa2 enterprise authentication can only support TLS, PEAP-MSCHAPv2 and TTLS-MSCHAPv2 method.
*
* @return
- * - ESP_ERR_WIFI_OK: succeed.
+ * - ESP_OK: succeed.
*/
esp_err_t esp_wifi_sta_wpa2_ent_disable(void);
* @param len: length of identity, limited to 1~127
*
* @return
- * - ESP_ERR_WIFI_OK: succeed
- * - ESP_ERR_WIFI_ARG: fail(len <= 0 or len >= 128)
- * - ESP_ERR_WIFI_NO_MEM: fail(internal memory malloc fail)
+ * - ESP_OK: succeed
+ * - ESP_ERR_INVALID_ARG: fail(len <= 0 or len >= 128)
+ * - ESP_ERR_NO_MEM: fail(internal memory malloc fail)
*/
esp_err_t esp_wifi_sta_wpa2_ent_set_identity(const unsigned char *identity, int len);
* @param len: length of username, limited to 1~127
*
* @return
- * - ESP_ERR_WIFI_OK: succeed
- * - ESP_ERR_WIFI_ARG: fail(len <= 0 or len >= 128)
- * - ESP_ERR_WIFI_NO_MEM: fail(internal memory malloc fail)
+ * - ESP_OK: succeed
+ * - ESP_ERR_INVALID_ARG: fail(len <= 0 or len >= 128)
+ * - ESP_ERR_NO_MEM: fail(internal memory malloc fail)
*/
esp_err_t esp_wifi_sta_wpa2_ent_set_username(const unsigned char *username, int len);
* @param len: length of password(len > 0)
*
* @return
- * - ESP_ERR_WIFI_OK: succeed
- * - ESP_ERR_WIFI_ARG: fail(len <= 0)
- * - ESP_ERR_WIFI_NO_MEM: fail(internal memory malloc fail)
+ * - ESP_OK: succeed
+ * - ESP_ERR_INVALID_ARG: fail(len <= 0)
+ * - ESP_ERR_NO_MEM: fail(internal memory malloc fail)
*/
esp_err_t esp_wifi_sta_wpa2_ent_set_password(const unsigned char *password, int len);
* @param len: length of password
*
* @return
- * - ESP_ERR_WIFI_OK: succeed
- * - ESP_ERR_WIFI_ARG: fail(len <= 0)
- * - ESP_ERR_WIFI_NO_MEM: fail(internal memory malloc fail)
+ * - ESP_OK: succeed
+ * - ESP_ERR_INVALID_ARG: fail(len <= 0)
+ * - ESP_ERR_NO_MEM: fail(internal memory malloc fail)
*/
esp_err_t esp_wifi_sta_wpa2_ent_set_new_password(const unsigned char *password, int len);
* @param len: length of ca_cert
*
* @return
- * - ESP_ERR_WIFI_OK: succeed
+ * - ESP_OK: succeed
*/
esp_err_t esp_wifi_sta_wpa2_ent_set_ca_cert(const unsigned char *ca_cert, int len);
* @param private_key_password_len: length of private key password;
*
* @return
- * - ESP_ERR_WIFI_OK: succeed
+ * - ESP_OK: succeed
*/
esp_err_t esp_wifi_sta_wpa2_ent_set_cert_key(const unsigned char *client_cert, int client_cert_len, const unsigned char *private_key, int private_key_len, const unsigned char *private_key_passwd, int private_key_passwd_len);
* - ESP_OK : succeed
* - ESP_ERR_WIFI_WPS_TYPE : wps type is invalid
* - ESP_ERR_WIFI_WPS_MODE : wifi is not in station mode or sniffer mode is on
- * - ESP_ERR_WIFI_FAIL : wps initialization fails
+ * - ESP_FAIL : wps initialization fails
*/
esp_err_t esp_wifi_wps_enable(const esp_wps_config_t *config);
* - ESP_ERR_WIFI_WPS_TYPE : wps type is invalid
* - ESP_ERR_WIFI_WPS_MODE : wifi is not in station mode or sniffer mode is on
* - ESP_ERR_WIFI_WPS_SM : wps state machine is not initialized
- * - ESP_ERR_WIFI_FAIL : wps initialization fails
+ * - ESP_FAIL : wps initialization fails
*/
esp_err_t esp_wifi_wps_start(int timeout_ms);
#define ESP_ERR_PING_BASE 0x6000
-#define ESP_ERR_PING_INVALID_PARAMS ESP_ERR_PING_BASE + 0x00
-#define ESP_ERR_PING_NO_MEM ESP_ERR_PING_BASE + 0x01
+#define ESP_ERR_PING_INVALID_PARAMS ESP_ERR_PING_BASE + 0x01
+#define ESP_ERR_PING_NO_MEM ESP_ERR_PING_BASE + 0x02
#define ESP_PING_CHECK_OPTLEN(optlen, opttype) do { if ((optlen) < sizeof(opttype)) { return ESP_ERR_PING_INVALID_PARAMS; }}while(0)
#define ESP_ERR_TCPIP_ADAPTER_BASE 0x5000 // TODO: move base address to esp_err.h
-#define ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS ESP_ERR_TCPIP_ADAPTER_BASE + 0x00
-#define ESP_ERR_TCPIP_ADAPTER_IF_NOT_READY ESP_ERR_TCPIP_ADAPTER_BASE + 0x01
-#define ESP_ERR_TCPIP_ADAPTER_DHCPC_START_FAILED ESP_ERR_TCPIP_ADAPTER_BASE + 0x02
-#define ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STARTED ESP_ERR_TCPIP_ADAPTER_BASE + 0x03
-#define ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STOPPED ESP_ERR_TCPIP_ADAPTER_BASE + 0x04
-#define ESP_ERR_TCPIP_ADAPTER_NO_MEM ESP_ERR_TCPIP_ADAPTER_BASE + 0x05
-#define ESP_ERR_TCPIP_ADAPTER_DHCP_NOT_STOPPED ESP_ERR_TCPIP_ADAPTER_BASE + 0x06
+#define ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS ESP_ERR_TCPIP_ADAPTER_BASE + 0x01
+#define ESP_ERR_TCPIP_ADAPTER_IF_NOT_READY ESP_ERR_TCPIP_ADAPTER_BASE + 0x02
+#define ESP_ERR_TCPIP_ADAPTER_DHCPC_START_FAILED ESP_ERR_TCPIP_ADAPTER_BASE + 0x03
+#define ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STARTED ESP_ERR_TCPIP_ADAPTER_BASE + 0x04
+#define ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STOPPED ESP_ERR_TCPIP_ADAPTER_BASE + 0x05
+#define ESP_ERR_TCPIP_ADAPTER_NO_MEM ESP_ERR_TCPIP_ADAPTER_BASE + 0x06
+#define ESP_ERR_TCPIP_ADAPTER_DHCP_NOT_STOPPED ESP_ERR_TCPIP_ADAPTER_BASE + 0x07
/* TODO: add Ethernet interface */
typedef enum {
ESP32 Wi-Fi API Error Code
---------------------------
All of the ESP32 Wi-Fi APIs have well-defined return values, namely, the error code. The error code can be categorized into:
- - No errors, e.g. ESP_ERR_WIFI_OK means that the API returns successfully
- - Recoverable errors, such as ESP_ERR_WIFI_NO_MEM, etc.
+ - No errors, e.g. ESP_OK means that the API returns successfully
+ - Recoverable errors, such as ESP_ERR_NO_MEM, etc.
- Non-recoverable, non-critical errors
- Non-recoverable, critical errors
**The primary principle to write a robust application with Wi-Fi API is to always check the error code and write the error-handling code.** Generally, the error-handling code can be used:
- - for recoverable errors, in which case you can write a recoverable-error code. For example, when esp_wifi_start returns ESP_ERR_WIFI_NO_MEM, the recoverable-error code vTaskDelay can be called, in order to get a microseconds' delay for another try.
+ - for recoverable errors, in which case you can write a recoverable-error code. For example, when esp_wifi_start returns ESP_ERR_NO_MEM, the recoverable-error code vTaskDelay can be called, in order to get a microseconds' delay for another try.
- for non-recoverable, yet non-critical, errors, in which case printing the error code is a good method for error handling.
- for non-recoverable, critical errors, in which case "assert" may be a good method for error handling. For example, if esp_wifi_set_mode returns ESP_ERR_WIFI_NOT_INIT, it means that the Wi-Fi driver is not initialized by esp_wifi_init successfully. You can detect this kind of error very quickly in the application development phase.
| | |
| | If the buffer is wrong, or violates the Wi-Fi |
| | driver's restrictions, the API returns |
-| | ESP_ERR_WIFI_ARG or results in unexpected |
+| | ESP_ERR_INVALID_ARG or results in unexpected |
| | behavior. **Please read the following section |
| | carefully to make sure you understand the |
| | restrictions on encapsulating the buffer.** |
| | |
+-----------------------------+---------------------------------------------------+
| len | The length must be <= 1500; otherwise, the API |
-| | will return ESP_ERR_WIFI_ARG. |
+| | will return ESP_ERR_INVALID_ARG. |
| | |
+-----------------------------+---------------------------------------------------+
| en_sys_seq | If en_sys_seq is true, it means that the Wi-Fi |
++++++++++++++++++++++++++++++++++++++++++++
- The Wi-Fi mode is Station, or SoftAP, or Station+SoftAP.
- - Either esp_wifi_set_promiscuous(true), or esp_wifi_start(), or both of these APIs return ESP_ERR_WIFI_OK. This is because we need to make sure that Wi-Fi hardware is initialized before esp_wifi_80211_tx() is called. In ESP32, both esp_wifi_set_promiscuous(true) and esp_wifi_start() can trigger the initialization of Wi-Fi hardware.
+ - Either esp_wifi_set_promiscuous(true), or esp_wifi_start(), or both of these APIs return ESP_OK. This is because we need to make sure that Wi-Fi hardware is initialized before esp_wifi_80211_tx() is called. In ESP32, both esp_wifi_set_promiscuous(true) and esp_wifi_start() can trigger the initialization of Wi-Fi hardware.
- The parameters of esp_wifi_80211_tx are hereby correctly provided.
Side-Effects to Avoid in Different Scenarios