Procházet zdrojové kódy

feature: optimize wifi API max tx power description

ronghulin před 5 roky
rodič
revize
cdaeef70c3
2 změnil soubory, kde provedl 39 přidání a 8 odebrání
  1. 38 7
      components/esp_wifi/include/esp_wifi.h
  2. 1 1
      components/esp_wifi/lib

+ 38 - 7
components/esp_wifi/include/esp_wifi.h

@@ -879,28 +879,59 @@ esp_err_t esp_wifi_set_vendor_ie(bool enable, wifi_vendor_ie_type_t type, wifi_v
 esp_err_t esp_wifi_set_vendor_ie_cb(esp_vendor_ie_cb_t cb, void *ctx);
 esp_err_t esp_wifi_set_vendor_ie_cb(esp_vendor_ie_cb_t cb, void *ctx);
 
 
 /**
 /**
-  * @brief     Set maximum WiFi transmitting power
-  *
-  * @param     power  Maximum WiFi transmitting power, unit is 0.25dBm, range is [40, 82] corresponding to 10dBm - 20.5dBm here.
+  * @brief     Set maximum transmitting power after WiFi start.
+  *
+  * @attention 1. Maximum power before wifi startup is limited by PHY init data bin.
+  * @attention 2. The value set by this API will be mapped to the max_tx_power of the structure wifi_country_t variable.
+  * @attention 3. Mapping Table {Power, max_tx_power} = {{8,   2}, {20,  5}, {28,  7}, {34,  8}, {44, 11},
+  *                                                      {52, 13}, {56, 14}, {60, 15}, {66, 16}, {72, 18}, {78, 20}}.
+  * @attention 4. Param power unit is 0.25dBm, range is [8, 78] corresponding to 2dBm - 20dBm.
+  * @attention 5. Relationship between set value and actual value. As follows:
+  *              +------------+--------------+
+  *              | set value  | actual value |
+  *              +============+==============+
+  *              |  [8,  19]  |      8       |
+  *              +------------+--------------+
+  *              |  [20, 27]  |      20      |
+  *              +------------+--------------+
+  *              |  [28, 33]  |      28      |
+  *              +------------+--------------+
+  *              |  [34, 43]  |      34      |
+  *              +------------+--------------+
+  *              |  [44, 51]  |      44      |
+  *              +------------+--------------+
+  *              |  [52, 55]  |      52      |
+  *              +------------+--------------+
+  *              |  [56, 59]  |      56      |
+  *              +------------+--------------+
+  *              |  [60, 65]  |      60      |
+  *              +------------+--------------+
+  *              |  [66, 71]  |      66      |
+  *              +------------+--------------+
+  *              |  [72, 77]  |      72      |
+  *              +------------+--------------+
+  *              |     78     |      78      |
+  *              +------------+--------------+
+  * @param     power  Maximum WiFi transmitting power.
   *
   *
   * @return
   * @return
   *    - ESP_OK: succeed
   *    - ESP_OK: succeed
   *    - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
   *    - 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_NOT_START: WiFi is not started by esp_wifi_start
-  *    - ESP_ERR_WIFI_NOT_ARG: invalid argument
+  *    - ESP_ERR_WIFI_ARG: invalid argument, e.g. parameter is out of range
   */
   */
 esp_err_t esp_wifi_set_max_tx_power(int8_t power);
 esp_err_t esp_wifi_set_max_tx_power(int8_t power);
 
 
 /**
 /**
-  * @brief     Get maximum WiFi transmiting power
+  * @brief     Get maximum transmiting power after WiFi start
   *
   *
-  * @param     power  Maximum WiFi transmitting power, unit is 0.25dBm.
+  * @param     power Maximum WiFi transmitting power, unit is 0.25dBm.
   *
   *
   * @return
   * @return
   *    - ESP_OK: succeed
   *    - ESP_OK: succeed
   *    - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
   *    - 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_NOT_START: WiFi is not started by esp_wifi_start
-  *    - ESP_ERR_INVALID_ARG: invalid argument
+  *    - ESP_ERR_WIFI_ARG: invalid argument
   */
   */
 esp_err_t esp_wifi_get_max_tx_power(int8_t *power);
 esp_err_t esp_wifi_get_max_tx_power(int8_t *power);
 
 

+ 1 - 1
components/esp_wifi/lib

@@ -1 +1 @@
-Subproject commit 6d5c01d883a2081d869d0baa8eedd4ef40228bdc
+Subproject commit ae9f44c7fd3a983b61bbf860566d649e7fa2549a