#define ESP_OK 0 /*!< esp_err_t value indicating success (no error) */
#define ESP_FAIL -1 /*!< Generic esp_err_t code indicating failure */
-#define ESP_ERR_NO_MEM 0x101 /*!< Out of memory */
-#define ESP_ERR_INVALID_ARG 0x102 /*!< Invalid argument */
-#define ESP_ERR_INVALID_STATE 0x103 /*!< Invalid state */
-#define ESP_ERR_INVALID_SIZE 0x104 /*!< Invalid size */
-#define ESP_ERR_NOT_FOUND 0x105 /*!< Requested resource not found */
-#define ESP_ERR_NOT_SUPPORTED 0x106 /*!< Operation or feature not supported */
-#define ESP_ERR_TIMEOUT 0x107 /*!< Operation timed out */
+#define ESP_ERR_NO_MEM 0x101 /*!< Out of memory */
+#define ESP_ERR_INVALID_ARG 0x102 /*!< Invalid argument */
+#define ESP_ERR_INVALID_STATE 0x103 /*!< Invalid state */
+#define ESP_ERR_INVALID_SIZE 0x104 /*!< Invalid size */
+#define ESP_ERR_NOT_FOUND 0x105 /*!< Requested resource not found */
+#define ESP_ERR_NOT_SUPPORTED 0x106 /*!< Operation or feature not supported */
+#define ESP_ERR_TIMEOUT 0x107 /*!< Operation timed out */
#define ESP_ERR_INVALID_RESPONSE 0x108 /*!< Received response was invalid */
-#define ESP_ERR_INVALID_CRC 0x109 /*!< CRC or checksum was invalid */
+#define ESP_ERR_INVALID_CRC 0x109 /*!< CRC or checksum was invalid */
#define ESP_ERR_INVALID_VERSION 0x10A /*!< Version was invalid */
-#define ESP_ERR_INVALID_MAC 0x10B /*!< MAC address was invalid */
+#define ESP_ERR_INVALID_MAC 0x10B /*!< MAC address was invalid */
-#define ESP_ERR_WIFI_BASE 0x3000 /*!< Starting number of WiFi error codes */
-#define ESP_ERR_MESH_BASE 0x4000 /*!< Starting number of MESH error codes */
+#define ESP_ERR_WIFI_BASE 0x3000 /*!< Starting number of WiFi error codes */
+#define ESP_ERR_MESH_BASE 0x4000 /*!< Starting number of MESH error codes */
/**
* @brief Returns string for esp_err_t error codes
#include "esp_system.h"
#include "esp_event_loop.h"
#include "esp_wifi.h"
+#include "esp_wifi_types.h"
#include "esp_log.h"
#include "nvs_flash.h"
static void test_wifi_init_deinit(wifi_init_config_t *cfg, wifi_config_t* wifi_config)
{
+ ESP_LOGI(TAG, EMPH_STR("esp_wifi_deinit"));
+ TEST_ESP_ERR(ESP_ERR_WIFI_NOT_INIT, esp_wifi_deinit());
+ ESP_LOGI(TAG, EMPH_STR("esp_wifi_get_mode"));
+ wifi_mode_t mode_get;
+ TEST_ESP_ERR(ESP_ERR_WIFI_NOT_INIT, esp_wifi_get_mode(&mode_get));
ESP_LOGI(TAG, EMPH_STR("esp_wifi_init"));
TEST_ESP_OK(esp_wifi_init(cfg));
ESP_LOGI(TAG, EMPH_STR("esp_wifi_set_mode"));
static void test_wifi_start_stop(wifi_init_config_t *cfg, wifi_config_t* wifi_config)
{
+ ESP_LOGI(TAG, EMPH_STR("esp_wifi_stop"));
+ TEST_ESP_ERR(ESP_ERR_WIFI_NOT_INIT, esp_wifi_stop());
ESP_LOGI(TAG, EMPH_STR("esp_wifi_init"));
TEST_ESP_OK(esp_wifi_init(cfg));
ESP_LOGI(TAG, EMPH_STR("esp_wifi_set_mode"));