-
Notifications
You must be signed in to change notification settings - Fork 7.7k
feat(ble): Enable BLE for ESP32-P4 through esp-hosted #11804
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
Conversation
👋 Hello lucasssvaz, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
Test Results 76 files 76 suites 13m 14s ⏱️ Results for commit 99c7ceb. ♻️ This comment has been updated with latest results. |
Memory usage test (comparing PR against master branch)The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.
Click to expand the detailed deltas report [usage change in BYTES]
|
0c47190
to
f794498
Compare
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.
Tested with the lib-builder PR libs and all good :)
@lucasssvaz you can enable the examples on P4 now |
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.
Pull Request Overview
This PR enables BLE functionality on ESP32-P4 through the esp-hosted transport layer. It consolidates ESP-Hosted related functions into reusable components for both Wi-Fi and BLE, and extends BLE library support to chips without native BLE hardware.
- Moved ESP-Hosted initialization code from WiFi-specific to generic implementation
- Extended BLE library compilation guards to support hosted BLE via
CONFIG_ESP_HOSTED_ENABLE_BT_NIMBLE
- Added hosted BLE transport management functions with proper lifecycle handling
Reviewed Changes
Copilot reviewed 71 out of 71 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
libraries/WiFi/src/WiFiGeneric.cpp | Refactored ESP-Hosted functions to use generic hosted API |
libraries/BLE/src/*.h | Extended compilation guards to support hosted BLE |
libraries/BLE/src/*.cpp | Extended compilation guards to support hosted BLE |
cores/esp32/esp32-hal-hosted.* | New generic ESP-Hosted management API |
CMakeLists.txt | Added hosted HAL source file to build |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
int tx_power = 0; | ||
#if SOC_BLE_SUPPORTED | ||
switch (advertisedTxPower) { | ||
case ESP_PWR_LVL_N12: // 12dbm | ||
tx_power = -12; | ||
break; | ||
case ESP_PWR_LVL_N9: // -9dbm | ||
tx_power = -9; | ||
break; | ||
case ESP_PWR_LVL_N6: // -6dbm | ||
tx_power = -6; | ||
break; | ||
case ESP_PWR_LVL_N3: // -3dbm | ||
tx_power = -3; | ||
break; | ||
case ESP_PWR_LVL_N0: // 0dbm | ||
tx_power = 0; | ||
break; | ||
case ESP_PWR_LVL_P3: // +3dbm | ||
tx_power = +3; | ||
break; | ||
case ESP_PWR_LVL_P6: // +6dbm | ||
tx_power = +6; | ||
break; | ||
case ESP_PWR_LVL_P9: // +9dbm | ||
tx_power = +9; | ||
break; | ||
default: tx_power = 0; | ||
case ESP_PWR_LVL_N12: tx_power = -12; break; | ||
case ESP_PWR_LVL_N9: tx_power = -9; break; | ||
case ESP_PWR_LVL_N6: tx_power = -6; break; | ||
case ESP_PWR_LVL_N3: tx_power = -3; break; | ||
case ESP_PWR_LVL_N0: tx_power = 0; break; | ||
case ESP_PWR_LVL_P3: tx_power = +3; break; | ||
case ESP_PWR_LVL_P6: tx_power = +6; break; | ||
case ESP_PWR_LVL_P9: tx_power = +9; break; | ||
default: tx_power = 0; break; | ||
} |
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.
Variable tx_power
is initialized to 0 on line 177, then potentially reassigned in the switch statement. However, the default case also sets it to 0, making the initial assignment redundant. Consider removing the initial assignment or moving the declaration inside the #if SOC_BLE_SUPPORTED
block.
Copilot uses AI. Check for mistakes.
@SuGlider PTAL |
Description of Change
Added support for BLE on ESP32-P4 via esp-hosted. Also moved esp-hosted related functions to a generic file that can be used by both Wi-Fi and BLE.
Requires espressif/esp32-arduino-lib-builder#318
Test Scenarios
Tested locally
Related links
Closes #11788
#10278