-
Notifications
You must be signed in to change notification settings - Fork 52
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
base: zephyr
Are you sure you want to change the base?
Conversation
d1efcb4
to
e779f5f
Compare
zephyr/esp32/src/bt/esp_bt_adapter.c
Outdated
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; |
There was a problem hiding this comment.
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?)
There was a problem hiding this comment.
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
837fe77
to
f799d1d
Compare
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]>
f799d1d
to
69bc894
Compare
@@ -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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
Allow bluetooth controller to be initialized with
default custom tx power level.