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.
This pull request introduces BLE (Bluetooth Low Energy) support to the Jaculus ESP32 project, enabling it as an additional communication transport. The changes include updates to the build configuration, new BLE-specific functionality, and integration into the existing system.
Using this feature, users can now connect to the Jaculus ESP32 device over BLE also from the Web Browser - tested with a modified version of https://github.com/C2Coder/JacLy.
Online version is available at https://f.kubaandrysek.cz/JacLy-BLE. Tested with ESP32-S3.
Changes: https://gist.github.com/JakubAndrysek/3000812b2758116b8d814edc71826c3f
Everything seems to work well. I have tested simultaneous connections over BLE and Wi-Fi socket, and it works as expected. The BLE connection is stable and allows sending and receiving codes without issues.
Needs additional testing and review, especially regarding BLE performance and stability.
I haven't also updated sdkconfig files.
Below is a summary of the most important changes:
BLE Support Implementation
Added
BleStreamclass: Implemented a BLE GATT server inmain/util/bleStream.hto provide duplex communication. The class includes features like configurable MTU size, device name generation, and event handling for GAP and GATTS. It integrates with the existing transport system as a new stream type.Conditional BLE initialization: Updated
main.cppto conditionally include and initialize the BLE stream based on theCONFIG_JAC_ESP32_ENABLE_BLEflag. This includes creating a BLE stream instance, starting it, and binding it to the multiplexer. [1] [2] [3]Build System Enhancements
Refactored
CMakeLists.txt: Modularized the component registration process and added conditional inclusion of BLE-related files and dependencies. This ensures BLE support is included only when enabled via configuration.Updated CMake version requirement: Increased the minimum required version of CMake to 3.10 in
main/resources/CMakeLists.txtto support newer features.Configuration Options
main/Kconfig.projbuildfor configuring BLE features, including enabling/disabling BLE, setting the device name prefix, configuring GATT service/characteristic UUIDs, and specifying the MTU size. Debug logging for BLE operations can also be toggled.