-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
(ESP32-S3 / BLE 5.0 Feature) Sending and receiving chained extended advertisements using Bluedroid stack. (IDFGH-11053) #12234
Comments
@B-Perederei |
@zhp0406 Also, could you provide a documentation reference that explains smaller packets creation sized from 13 to 19 bytes (Maybe this behavior is explained in the documentation Controller section) |
the two images below mey help you solve the issue: |
@B-Perederei |
@zhp0406 Last two questions:
|
@B-Perederei |
@zhp0406 |
This is our latest feature, which has not been updated to GitHub yet. You can apply this feature using the following patch: 0001-feat-bt-bluedroid-Support-adv-report-event-construct.patch |
@zhp0406 |
@zhp0406 |
@B-Perederei |
@zhp0406 |
Hi everyone who will read this post,
Currently, I am trying to use extended advertisements for sending and receiving 1650 bytes of data from one ESP32-S3 to another.
For the sender, I am using code from this example:
https://github.com/espressif/esp-idf/blob/master/examples/bluetooth/bluedroid/ble_50/peroidic_adv/main/periodic_adv_demo.c
commenting out periodic advertisement logic and generating a 1650-byte array for an adv packet.
For the receiver, I am using code from this example:
https://github.com/espressif/esp-idf/blob/master/examples/bluetooth/bluedroid/ble_50/peroidic_sync/main/periodic_sync_demo.c
In this code, I added ESP_GAP_BLE_EXT_ADV_REPORT_EVT case in gap_event_handler for processing extended advertisement packets and printing caught data into logs.
As a result, I was able to receive chained extended advertisements in the following way:
I spent some time searching the web, and reading BLE 5.0 core documentation and documentation on ESP32 Bluedroid, but haven’t found anything about how I need to format and structure my 1650 packet. From reading the source code in this file:
https://github.com/espressif/esp-idf/blob/master/components/bt/host/bluedroid/api/include/api/esp_gap_ble_api.h
and BLE 5.0 chained extended advertisements documentation I concluded, that the logic of receiving several packets and composing them together into a final one after receiving all chained packages is supported neither on the controller nor on the host level.
Still, I don’t understand why I have such strange packet sizes. Firstly – why maximum size of one extended advertisement packet I managed to reach is 229, but not 251 as it is allocated in esp_ble_gap_ext_adv_reprot_t.adv_data (esp_gap_ble_api.h). Secondly – why do I have small packets with not consistent size at the start and bigger ones mixed with them? For example, the first packet is 229, then 13, then 229 again, then 19, and so on.
My current guesses are that I didn’t configure properly esp_ble_gap_ext_adv_params_t in the sender code or/and extended advertisement packets need to be properly formatted. Also, this behavior may be related to specifics of Bluedroid implementation in the ESP32 library.
Could you provide me with any information that can clarify, why I am getting such a behavior and how I can send and receive chained extended advertisement packets properly using Bluedroid stack?
The text was updated successfully, but these errors were encountered: