-
Notifications
You must be signed in to change notification settings - Fork 14
feat(wifi): Allow configuration of wifi phy rate for AP and STA #500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
#pragma once | ||
|
||
#include <sdkconfig.h> | ||
|
||
#include "format.hpp" | ||
|
||
// for libfmt formtating of wifi_phy_rate_t | ||
finger563 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
template <> struct fmt::formatter<wifi_phy_rate_t> : fmt::formatter<std::string> { | ||
template <typename FormatContext> | ||
auto format(const wifi_phy_rate_t &value, FormatContext &ctx) const -> decltype(ctx.out()) { | ||
switch (value) { | ||
// base | ||
case WIFI_PHY_RATE_1M_L: | ||
return fmt::format_to(ctx.out(), "1 Mbps with long preamble"); | ||
case WIFI_PHY_RATE_2M_L: | ||
return fmt::format_to(ctx.out(), "2 Mbps with long preamble"); | ||
case WIFI_PHY_RATE_5M_L: | ||
return fmt::format_to(ctx.out(), "5.5 Mbps with long preamble"); | ||
case WIFI_PHY_RATE_11M_L: | ||
return fmt::format_to(ctx.out(), "11 Mbps with long preamble"); | ||
case WIFI_PHY_RATE_2M_S: | ||
return fmt::format_to(ctx.out(), "2 Mbps with short preamble"); | ||
case WIFI_PHY_RATE_5M_S: | ||
return fmt::format_to(ctx.out(), "5.5 Mbps with short preamble"); | ||
case WIFI_PHY_RATE_11M_S: | ||
return fmt::format_to(ctx.out(), "11 Mbps with short preamble"); | ||
|
||
// HT | ||
case WIFI_PHY_RATE_48M: | ||
return fmt::format_to(ctx.out(), "48 Mbps"); | ||
case WIFI_PHY_RATE_24M: | ||
return fmt::format_to(ctx.out(), "24 Mbps"); | ||
case WIFI_PHY_RATE_12M: | ||
return fmt::format_to(ctx.out(), "12 Mbps"); | ||
case WIFI_PHY_RATE_6M: | ||
return fmt::format_to(ctx.out(), "6 Mbps"); | ||
case WIFI_PHY_RATE_54M: | ||
return fmt::format_to(ctx.out(), "54 Mbps"); | ||
case WIFI_PHY_RATE_36M: | ||
return fmt::format_to(ctx.out(), "36 Mbps"); | ||
case WIFI_PHY_RATE_18M: | ||
return fmt::format_to(ctx.out(), "18 Mbps"); | ||
case WIFI_PHY_RATE_9M: | ||
return fmt::format_to(ctx.out(), "9 Mbps"); | ||
|
||
// Long GI | ||
case WIFI_PHY_RATE_MCS0_LGI: | ||
return fmt::format_to(ctx.out(), "MCS0_LGI (6.5-13.5 Mbps)"); | ||
case WIFI_PHY_RATE_MCS1_LGI: | ||
return fmt::format_to(ctx.out(), "MCS1_LGI (13-27 Mbps)"); | ||
case WIFI_PHY_RATE_MCS2_LGI: | ||
return fmt::format_to(ctx.out(), "MCS2_LGI (19.5-40.5 Mbps)"); | ||
case WIFI_PHY_RATE_MCS3_LGI: | ||
return fmt::format_to(ctx.out(), "MCS3_LGI (26-54 Mbps)"); | ||
case WIFI_PHY_RATE_MCS4_LGI: | ||
return fmt::format_to(ctx.out(), "MCS4_LGI (39-81 Mbps)"); | ||
case WIFI_PHY_RATE_MCS5_LGI: | ||
return fmt::format_to(ctx.out(), "MCS5_LGI (52-108 Mbps)"); | ||
case WIFI_PHY_RATE_MCS6_LGI: | ||
return fmt::format_to(ctx.out(), "MCS6_LGI (58.5-121.5 Mbps)"); | ||
case WIFI_PHY_RATE_MCS7_LGI: | ||
return fmt::format_to(ctx.out(), "MCS7_LGI (65-135 Mbps)"); | ||
#if CONFIG_SOC_WIFI_HE_SUPPORT || !CONFIG_SOC_WIFI_SUPPORTED | ||
case WIFI_PHY_RATE_MCS8_LGI: | ||
return fmt::format_to(ctx.out(), "MCS8_LGI (97.5 Mbps)"); | ||
case WIFI_PHY_RATE_MCS9_LGI: | ||
return fmt::format_to(ctx.out(), "MCS9_LGI (108.3 Mbps)"); | ||
#endif | ||
|
||
// Short GI | ||
case WIFI_PHY_RATE_MCS0_SGI: | ||
return fmt::format_to(ctx.out(), "MCS0_SGI (7.2-15 Mbps)"); | ||
case WIFI_PHY_RATE_MCS1_SGI: | ||
return fmt::format_to(ctx.out(), "MCS1_SGI (14.4-30 Mbps)"); | ||
case WIFI_PHY_RATE_MCS2_SGI: | ||
return fmt::format_to(ctx.out(), "MCS2_SGI (21.7-45 Mbps)"); | ||
case WIFI_PHY_RATE_MCS3_SGI: | ||
return fmt::format_to(ctx.out(), "MCS3_SGI (28.9-60 Mbps)"); | ||
case WIFI_PHY_RATE_MCS4_SGI: | ||
return fmt::format_to(ctx.out(), "MCS4_SGI (43.3-90 Mbps)"); | ||
case WIFI_PHY_RATE_MCS5_SGI: | ||
return fmt::format_to(ctx.out(), "MCS5_SGI (57.8-120 Mbps)"); | ||
case WIFI_PHY_RATE_MCS6_SGI: | ||
return fmt::format_to(ctx.out(), "MCS6_SGI (65.0-135 Mbps)"); | ||
case WIFI_PHY_RATE_MCS7_SGI: | ||
return fmt::format_to(ctx.out(), "MCS7_SGI (72.2-150 Mbps)"); | ||
#if CONFIG_SOC_WIFI_HE_SUPPORT || !CONFIG_SOC_WIFI_SUPPORTED | ||
case WIFI_PHY_RATE_MCS8_SGI: | ||
return fmt::format_to(ctx.out(), "MCS8_SGI (103.2 Mbps)"); | ||
case WIFI_PHY_RATE_MCS9_SGI: | ||
return fmt::format_to(ctx.out(), "MCS9_SGI (114.7 Mbps)"); | ||
#endif | ||
|
||
// LORA | ||
case WIFI_PHY_RATE_LORA_250K: | ||
return fmt::format_to(ctx.out(), "LoRa 250Kbps"); | ||
case WIFI_PHY_RATE_LORA_500K: | ||
return fmt::format_to(ctx.out(), "LoRa 500Kbps"); | ||
default: | ||
return fmt::format_to(ctx.out(), "Unknown PHY rate: {}", static_cast<int>(value)); | ||
} | ||
} | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.