Skip to content

ExtAdvertisement on ESP32 - data length issue #910

Closed
@Jeronimo59

Description

@Jeronimo59

Hello,

Thank you for this great work.

When trying to send/receive extended advertisements (using NimBLEExt.setManufacturerdata()) with more than 28 bytes, I get the following message on the receiver's logs:
E (22095) NimBLE: Received HCI data length at host (74) exceeds maximum configured HCI event buffer size (70).

After some investigation, I found the log originates from file esp_nimble_hci.c (line 198):

if (totlen > MYNEWT_VAL(BLE_TRANSPORT_EVT_SIZE)) {
            ESP_LOGE(LOG_TAG, "Received HCI data length at host (%d) exceeds maximum configured HCI event buffer size (%d).",
                     totlen, MYNEWT_VAL(BLE_TRANSPORT_EVT_SIZE));  
            ble_hs_sched_reset(BLE_HS_ECONTROLLER);  
            return 0;  
        }

The message size appears to be limited by MYNEWT_VAL(BLE_TRANSPORT_EVT_SIZE)) that translates after macro processing to MYNEWT_VAL_BLE_TRANSPORT_EVT_SIZE, which is defined (for ESP platform) in esp_nimble_cfg.h (line 1592) with a value of 70 (in line with the log message) :

#ifndef MYNEWT_VAL_BLE_TRANSPORT_EVT_SIZE
#   define MYNEWT_VAL_BLE_TRANSPORT_EVT_SIZE (70)
#endif

Changing the value to 200 seems to solve the problem, as I managed to receive the data properly.

I guess this definition of MYNEWT_VAL_BLE_TRANSPORT_EVT_SIZE should be somehow increased to over 200 when Extended Advertisement is enabled (CONFIG_BT_NIMBLE_EXT_ADV defined).

Any help on how to do this properly (not sure what should be the correct value) will be welcome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions