File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -450,6 +450,7 @@ static bool espWiFiStop() {
450
450
451
451
bool WiFiGenericClass::_persistent = true ;
452
452
bool WiFiGenericClass::_long_range = false ;
453
+ bool WiFiGenericClass::_disable_sta_11b = true ;
453
454
wifi_mode_t WiFiGenericClass::_forceSleepLastMode = WIFI_MODE_NULL;
454
455
#if CONFIG_IDF_TARGET_ESP32S2
455
456
wifi_ps_type_t WiFiGenericClass::_sleepEnabled = WIFI_PS_NONE;
@@ -563,6 +564,15 @@ void WiFiGenericClass::enableLongRange(bool enable) {
563
564
_long_range = enable;
564
565
}
565
566
567
+ /* *
568
+ * disable 11b rates
569
+ * @param disable
570
+ */
571
+ void WiFiGenericClass::disableSTA11b (bool disable)
572
+ {
573
+ _disable_sta_11b = disable;
574
+ }
575
+
566
576
/* *
567
577
* set new mode
568
578
* @param m WiFiMode_t
@@ -672,6 +682,12 @@ bool WiFiGenericClass::mode(wifi_mode_t m) {
672
682
}
673
683
}
674
684
}
685
+ // 11b is long obsolete. true = disable. Don't care if it can't be disabled.
686
+ // Disable both because neither can be changed when trying to switch mode later.
687
+ // Always disable 11b on AP because beacons are sent at minimum rate.
688
+ esp_wifi_config_11b_rate (WIFI_IF_STA, _disable_sta_11b);
689
+ esp_wifi_config_11b_rate (WIFI_IF_AP, true );
690
+
675
691
if (!espWiFiStart ()) {
676
692
return false ;
677
693
}
Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ class WiFiGenericClass {
102
102
103
103
void persistent (bool persistent);
104
104
void enableLongRange (bool enable);
105
+ void disableSTA11b (bool disable);
105
106
106
107
static bool mode (wifi_mode_t );
107
108
static wifi_mode_t getMode ();
@@ -143,6 +144,7 @@ class WiFiGenericClass {
143
144
protected:
144
145
static bool _persistent;
145
146
static bool _long_range;
147
+ static bool _disable_sta_11b;
146
148
static wifi_mode_t _forceSleepLastMode;
147
149
static wifi_ps_type_t _sleepEnabled;
148
150
static bool _wifiUseStaticBuffers;
You can’t perform that action at this time.
0 commit comments