mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-07-01 06:08:27 +08:00
feat(esp8266): make tx rate start from 1M when ap is too close with station
This commit is contained in:
@ -38,6 +38,8 @@ void esp_wifi_set_rx_pbuf_mem_type(wifi_rx_pbuf_mem_type_t type);
|
|||||||
*/
|
*/
|
||||||
wifi_rx_pbuf_mem_type_t esp_wifi_get_rx_pbuf_mem_type(void);
|
wifi_rx_pbuf_mem_type_t esp_wifi_get_rx_pbuf_mem_type(void);
|
||||||
|
|
||||||
|
int8_t esp_wifi_get_ap_rssi(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
#include "esp_libc.h"
|
#include "esp_libc.h"
|
||||||
#include "esp_system.h"
|
#include "esp_system.h"
|
||||||
#include "esp_wifi.h"
|
#include "esp_wifi.h"
|
||||||
|
#include "internal/esp_wifi_internal.h"
|
||||||
#include "esp_socket.h"
|
#include "esp_socket.h"
|
||||||
#include "net/sockio.h"
|
#include "net/sockio.h"
|
||||||
#include "phy.h"
|
#include "phy.h"
|
||||||
@ -61,8 +62,13 @@ size_t __attribute__((weak)) esp_wifi_scan_get_ap_num_max(void)
|
|||||||
|
|
||||||
bool IRAM_ATTR esp_wifi_try_rate_from_high(void) {
|
bool IRAM_ATTR esp_wifi_try_rate_from_high(void) {
|
||||||
#if CONFIG_WIFI_TX_RATE_SEQUENCE_FROM_HIGH
|
#if CONFIG_WIFI_TX_RATE_SEQUENCE_FROM_HIGH
|
||||||
return true;
|
int8_t rssi;
|
||||||
#else
|
rssi = esp_wifi_get_ap_rssi();
|
||||||
return false;
|
wifi_mode_t mode;
|
||||||
|
esp_wifi_get_mode( &mode );
|
||||||
|
if (rssi < -26 && mode == WIFI_MODE_STA) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
return false;
|
||||||
}
|
}
|
Reference in New Issue
Block a user