Skip to content

Use ESP_PWR_LVL_P9 enum for BLE TX power#99

Merged
zjwhitehead merged 2 commits intoesp-idffrom
copilot/sub-pr-89
Mar 25, 2026
Merged

Use ESP_PWR_LVL_P9 enum for BLE TX power#99
zjwhitehead merged 2 commits intoesp-idffrom
copilot/sub-pr-89

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 25, 2026

NimBLEDevice::setPower(9) used a raw integer which is ambiguous — in ESP-IDF the esp_power_level_t enum indices don't map 1:1 to dBm values, so 9 does not mean +9 dBm at the ESP-IDF layer.

Change

  • src/sp140/ble/ble_core.cpp: Replace setPower(9) with setPowerLevel(ESP_PWR_LVL_P9), using the enum-based API available in NimBLE-Arduino v2.x on ESP32 platforms.
// Before
NimBLEDevice::setPower(9);

// After
NimBLEDevice::setPowerLevel(ESP_PWR_LVL_P9);

ESP_PWR_LVL_P9 is the correct esp_power_level_t constant for +9 dBm and makes the intent unambiguous.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] [WIP] Address feedback from review on ESP-IDF + BLE OTA pull request Use ESP_PWR_LVL_P9 enum for BLE TX power Mar 25, 2026
Copilot AI requested a review from zjwhitehead March 25, 2026 22:47
@zjwhitehead zjwhitehead marked this pull request as ready for review March 25, 2026 22:48
@zjwhitehead zjwhitehead merged commit 6e1491c into esp-idf Mar 25, 2026
1 check passed
@zjwhitehead zjwhitehead deleted the copilot/sub-pr-89 branch March 25, 2026 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants