Fix future compile error

This commit is contained in:
Theo Arends 2023-04-14 14:14:14 +02:00
parent d88d42341d
commit 36ae802924
3 changed files with 24 additions and 10 deletions

View File

@ -137,10 +137,10 @@ int WiFiClass32::getPhyMode() {
int phy_mode = 0; // " BGNL"
uint8_t protocol_bitmap;
if (esp_wifi_get_protocol(WIFI_IF_STA, &protocol_bitmap) == ESP_OK) {
if (protocol_bitmap & 1) { phy_mode = WIFI_PHY_MODE_11B; } // 1 = 11b
if (protocol_bitmap & 2) { phy_mode = WIFI_PHY_MODE_11G; } // 2 = 11bg
if (protocol_bitmap & 4) { phy_mode = WIFI_PHY_MODE_11N; } // 3 = 11bgn
if (protocol_bitmap & 8) { phy_mode = 4; } // Low rate
if (protocol_bitmap & 1) { phy_mode = TAS_WIFI_PHY_MODE_11B; } // 1 = 11b (WIFI_PHY_MODE_11B)
if (protocol_bitmap & 2) { phy_mode = TAS_WIFI_PHY_MODE_11G; } // 2 = 11bg (WIFI_PHY_MODE_11G)
if (protocol_bitmap & 4) { phy_mode = TAS_WIFI_PHY_MODE_11N; } // 3 = 11bgn (WIFI_PHY_MODE_11N)
if (protocol_bitmap & 8) { phy_mode = 4; } // Low rate (WIFI_PHY_MODE_LR)
}
return phy_mode;
}

View File

@ -29,11 +29,25 @@
#define WIFI_LIGHT_SLEEP 1
#define WIFI_MODEM_SLEEP 2
// ESP8266
typedef enum WiFiPhyMode
{
WIFI_PHY_MODE_11B = 1, WIFI_PHY_MODE_11G = 2, WIFI_PHY_MODE_11N = 3
TAS_WIFI_PHY_MODE_LR = 0, TAS_WIFI_PHY_MODE_11B = 1, TAS_WIFI_PHY_MODE_11G = 2, TAS_WIFI_PHY_MODE_11N = 3
} WiFiPhyMode_t;
/*
// ESP32 was never defined until IDF 4.4
typedef enum
{
WIFI_PHY_MODE_LR, // PHY mode for Low Rate
WIFI_PHY_MODE_11B, // PHY mode for 11b
WIFI_PHY_MODE_11G, // PHY mode for 11g
WIFI_PHY_MODE_HT20, // PHY mode for 11n Bandwidth HT20
WIFI_PHY_MODE_HT40, // PHY mode for 11n Bandwidth HT40
WIFI_PHY_MODE_HE20, // PHY mode for 11n Bandwidth HE20
} wifi_phy_mode_t;
*/
class WiFiClass32 : public WiFiClass
{
public: