Skip to content
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

bleutooth: add ble tx power configuration #355

Open
wants to merge 1 commit into
base: zephyr
Choose a base branch
from

Conversation

sylvioalves
Copy link
Collaborator

Allow bluetooth controller to be initialized with
default custom tx power level.

else if (tx_power >= 6) return ESP_PWR_LVL_P6;
else if (tx_power >= 3) return ESP_PWR_LVL_P3;
else if (tx_power >= 0) return ESP_PWR_LVL_N0;
else if (tx_power >= -3) return ESP_PWR_LVL_N3;
Copy link
Collaborator

@raffarost raffarost Nov 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure it is intended but for 2 it maps ESP_PWR_LVL_N0, but -2 it maps ESP_PWR_LVL_N3, so for negative values it rounds to the more negative (asymmetric?)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-1 maps to ESP_PWR_LVL_N3 (-1 > -3) instead of ESP_PWR_LVL_N0, which is closer

@sylvioalves sylvioalves force-pushed the bt/add_tx_power branch 2 times, most recently from 837fe77 to f799d1d Compare November 1, 2024 19:47
@raffarost
Copy link
Collaborator

commit and PR name (nit) -> bleutooth

Allow bluetooth controller to be initialized with
default custom tx power level.

Signed-off-by: Sylvio Alves <[email protected]>
@@ -1398,3 +1402,19 @@ static void esp_bt_free(void *mem)
{
esp_bt_free_func(mem);
}

esp_power_level_t zephyr_to_esp_ble_power_level(int tx_power) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use a code style with opening parentheses on the new line?

}

esp_power_level_t zephyr_to_esp_ble_power_level(int tx_power) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here and in other esp_bt_adapter.c

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will change this approach and ping you back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants