Added set/get_max_tx_power for Wifi - #584
Closed
nandee95 wants to merge 1 commit into
Closed
Conversation
ivmarkov
requested changes
Jul 2, 2025
ivmarkov
left a comment
Collaborator
There was a problem hiding this comment.
Just change &mut self to &self in the getter and document the power param.
| } | ||
|
|
||
| /// As per [`crate::sys::esp_wifi_get_max_tx_power`](crate::sys::esp_wifi_get_max_tx_power) | ||
| pub fn get_max_tx_power(&mut self) -> Result<i8, EspError> { |
Collaborator
There was a problem hiding this comment.
Just &self instead of &mut self.
| esp!(unsafe { esp_wifi_set_mac(interface.into(), mac.as_ptr() as *mut _) }) | ||
| } | ||
|
|
||
| /// As per [`crate::sys::esp_wifi_set_max_tx_power`](crate::sys::esp_wifi_set_max_tx_power) |
Collaborator
There was a problem hiding this comment.
Nit: shall we rather document here (and in the get method) that power is N*0.25dBm?
Collaborator
|
Not going anywhere, closing. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Submission Checklist 📝
cargo fmtcommand to ensure that all changed code is formatted correctly.cargo clippycommand to ensure that all changed code passes latest Clippy nightly lints.CHANGELOG.mdin the proper section.Pull Request Details 📖
Description
I needed a way to increase wifi tx power. So I added a wrapper to esp idf
esp_wifi_set_max_tx_powerandesp_wifi_get_max_tx_powermethods.Testing
Set the power to maximum value of 2dBm (set value 8) -> ESP32C6 was able to connect to wifi from a shorter range
Set the power to maximum value of 20dBm (set value 80) -> ESP32C6 was able to connect to wifi from a greater range