]> granicus.if.org Git - esp-idf/commitdiff
esp32: modify the code according to review comments
authorLiu Zhi Fu <liuzhifu@espressif.com>
Tue, 8 Nov 2016 11:19:28 +0000 (19:19 +0800)
committerWu Jian Gang <wujiangang@espressif.com>
Tue, 8 Nov 2016 11:25:03 +0000 (19:25 +0800)
1. Adjust error code definition
2. Refractor the comments for esp_wifi_internal_tx

components/esp32/include/esp_err.h
components/esp32/include/esp_wifi.h
components/esp32/include/esp_wifi_internal.h
components/esp32/lib

index dc2c6c2d7710e2a75e760b9e6704e6da28e245ad..f8271ba2590a20c806f5f573525f5065640c1d87 100644 (file)
@@ -33,6 +33,7 @@ typedef int32_t esp_err_t;
 #define ESP_ERR_INVALID_STATE   0x103
 #define ESP_ERR_INVALID_SIZE    0x104
 #define ESP_ERR_NOT_FOUND       0x105
+#define ESP_ERR_NOT_SUPPORTED   0x106
 
 #define ESP_ERR_WIFI_BASE       0x3000 /*!< Starting number of WiFi error codes */
 
index 8e2c1df55820848430c4dd3b8ae483a0f680ed54..88ea0d9a6548b6620a0869fc06fcd76287d2cbd2 100644 (file)
@@ -74,18 +74,19 @@ extern "C" {
 #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 is not installed by esp_wifi_init */
 #define ESP_ERR_WIFI_NOT_START   (ESP_ERR_WIFI_BASE + 2)   /*!< WiFi driver is not started by esp_wifi_start */
-#define ESP_ERR_WIFI_NOT_SUPPORT (ESP_ERR_WIFI_BASE + 3)   /*!< WiFi API doesn't support */
-#define ESP_ERR_WIFI_IF          (ESP_ERR_WIFI_BASE + 4)   /*!< WiFi interface error */
-#define ESP_ERR_WIFI_MODE        (ESP_ERR_WIFI_BASE + 5)   /*!< WiFi mode error */
-#define ESP_ERR_WIFI_STATE       (ESP_ERR_WIFI_BASE + 6)   /*!< WiFi internal state error */
-#define ESP_ERR_WIFI_CONN        (ESP_ERR_WIFI_BASE + 7)   /*!< WiFi internal control block of station or soft-AP error */
-#define ESP_ERR_WIFI_NVS         (ESP_ERR_WIFI_BASE + 8)   /*!< WiFi internal NVS module error */
-#define ESP_ERR_WIFI_MAC         (ESP_ERR_WIFI_BASE + 9)   /*!< MAC address is invalid */
-#define ESP_ERR_WIFI_SSID        (ESP_ERR_WIFI_BASE + 10)  /*!< SSID is invalid */
-#define ESP_ERR_WIFI_PASSWORD    (ESP_ERR_WIFI_BASE + 11)  /*!< Passord is invalid */
-#define ESP_ERR_WIFI_TIMEOUT     (ESP_ERR_WIFI_BASE + 12)  /*!< Timeout error */
+#define ESP_ERR_WIFI_IF          (ESP_ERR_WIFI_BASE + 3)   /*!< WiFi interface error */
+#define ESP_ERR_WIFI_MODE        (ESP_ERR_WIFI_BASE + 4)   /*!< WiFi mode error */
+#define ESP_ERR_WIFI_STATE       (ESP_ERR_WIFI_BASE + 5)   /*!< WiFi internal state error */
+#define ESP_ERR_WIFI_CONN        (ESP_ERR_WIFI_BASE + 6)   /*!< WiFi internal control block of station or soft-AP error */
+#define ESP_ERR_WIFI_NVS         (ESP_ERR_WIFI_BASE + 7)   /*!< WiFi internal NVS module error */
+#define ESP_ERR_WIFI_MAC         (ESP_ERR_WIFI_BASE + 8)   /*!< MAC address is invalid */
+#define ESP_ERR_WIFI_SSID        (ESP_ERR_WIFI_BASE + 9)   /*!< SSID is invalid */
+#define ESP_ERR_WIFI_PASSWORD    (ESP_ERR_WIFI_BASE + 10)  /*!< Passord is invalid */
+#define ESP_ERR_WIFI_TIMEOUT     (ESP_ERR_WIFI_BASE + 11)  /*!< Timeout error */
 
 typedef struct {
     system_event_handler_t event_handler;  /**< WiFi event handler */
index 9aa05dc716db1ea5f2642473e978e0b1e57f8ce4..2015b5063d34fb1de20cfcf597c2d56619e99735 100644 (file)
@@ -62,14 +62,15 @@ void esp_wifi_internal_free_rx_buffer(void* buffer);
 /**
   * @brief  transmit the buffer via wifi driver
   *
-  * @attention1 TODO should modify the return type from bool to int
-  * 
   * @param  wifi_interface_t wifi_if : wifi interface id
   * @param  void *buffer : the buffer to be tansmit
   * @param  u16_t len : the length of buffer
   *
-  * @return True : success transmit the buffer to wifi driver
-  *         False : failed to transmit the buffer to wifi driver
+  * @return
+  *    - ERR_OK  : Successfully transmit the buffer to wifi driver
+  *    - ERR_MEM : Out of memory
+  *    - ERR_IF : WiFi driver error
+  *    - ERR_ARG : Invalid argument
   */
 int esp_wifi_internal_tx(wifi_interface_t wifi_if, void *buffer, u16_t len);
 
index 66236c85b3ef1a6d756d4e7d58cc6a1180e31365..76f91098061b0052fe1bb67e85001014f39b84a0 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 66236c85b3ef1a6d756d4e7d58cc6a1180e31365
+Subproject commit 76f91098061b0052fe1bb67e85001014f39b84a0