-
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
BLE Mesh Stack Overrides Custom BLE Advertising Parameters (IDFGH-14437) #15217
Comments
Hi, @lebrislo Do you mean mesh proxy adveritising data to carry your UUID information? This shouldn't be the case, your UUID information should be included in your own broadcast message! |
Hi, @lebrislo Why did you set adv data len and scan response len to 0? How did you set the service uuid information when using ble mesh? |
Hi,
Because it doesn't change anything, if I change it to the following code I get the same result : g_bleMeshAdvData.adv_data_len = sizeof(g_serviceUuidList);
memcpy(g_bleMeshAdvData.adv_data, g_serviceUuidList, sizeof(g_serviceUuidList));
g_bleMeshAdvData.scan_rsp_data_len = sizeof(g_serviceUuidList);
memcpy(g_bleMeshAdvData.scan_rsp_data, g_serviceUuidList, sizeof(g_serviceUuidList));
err = esp_ble_mesh_start_ble_advertising(&g_bleMeshAdvParam, &g_bleMeshAdvData);
if (err != ESP_OK)
{
ESP_LOGE(TAG, "Failed to start BLE advertising: %d", err);
goto error;
}
Just how I explain to you above. I set it into the static esp_ble_adv_data_t g_advertisingData = {
.set_scan_rsp = false,
.include_name = true,
.include_txpower = true,
.min_interval = ADV_INT_MIN,
.max_interval = ADV_INT_MAX,
.manufacturer_len = 0,
.p_manufacturer_data = NULL,
.service_data_len = 0,
.p_service_data = NULL,
.service_uuid_len = sizeof(g_serviceUuidList),
.p_service_uuid = g_serviceUuidList,
.flag = (ESP_BLE_ADV_FLAG_GEN_DISC | ESP_BLE_ADV_FLAG_BREDR_NOT_SPT),
};
static esp_ble_adv_data_t g_scanResponseData = {
.set_scan_rsp = true,
.include_name = true,
.include_txpower = true,
.min_interval = ADV_INT_MIN,
.max_interval = ADV_INT_MAX,
.manufacturer_len = 0,
.p_manufacturer_data = NULL,
.service_data_len = 0,
.p_service_data = NULL,
.service_uuid_len = 0,
.p_service_uuid = NULL,
.flag = (ESP_BLE_ADV_FLAG_GEN_DISC | ESP_BLE_ADV_FLAG_BREDR_NOT_SPT),
};
static esp_ble_adv_params_t g_advertisingParams = {
.adv_int_min = ADV_INT_MIN,
.adv_int_max = ADV_INT_MAX,
.adv_type = ADV_TYPE_IND,
.own_addr_type = BLE_ADDR_TYPE_PUBLIC,
.channel_map = ADV_CHNL_ALL,
.adv_filter_policy = ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY,
};
static esp_ble_mesh_ble_adv_param_t g_bleMeshAdvParam = {
.interval = 0x20,
.adv_type = ADV_TYPE_DIRECT_IND_HIGH,
.own_addr_type = BLE_ADDR_TYPE_PUBLIC,
.peer_addr_type = BLE_ADDR_TYPE_PUBLIC,
.peer_addr = {0},
.duration = 2000,
.period = 4000,
.count = ESP_BLE_MESH_BLE_ADV_INFINITE,
.priority = ESP_BLE_MESH_BLE_ADV_PRIO_HIGH,
};
err = esp_ble_gap_config_adv_data(&g_advertisingData);
err = esp_ble_gap_config_adv_data(&g_scanResponseData);
err = esp_ble_mesh_start_ble_advertising(&g_bleMeshAdvParam, &g_bleMeshAdvData);
err = esp_ble_gap_start_advertising(&g_advertisingParams); |
Hi, @lebrislo Sorry for the late reply. After my testing and confirmation, it is not possible to broadcast your own private service uuid when using ble mesh to coexist with ble adv, you can submit a feature request in github and we will support it in the future and sync the information to you. |
Answers checklist.
IDF version.
v5.4
Espressif SoC revision.
ESP32
Operating System used.
Linux
How did you build your project?
VS Code IDE
If you are using Windows, please specify command line type.
None
Development Kit.
ESP32-MINI-1
Power Supply used.
USB
What is the expected behavior?
When using the ESP BLE Mesh stack along with BLE GATT advertising, I encounter an issue where my custom BLE advertising data is overridden by the BLE Mesh stack after the advertising duration ends. Specifically:
I configure BLE advertising parameters to include my vendor-specific service UUID in the complete list of service UUIDs.
Advertising works as expected for the specified duration (e.g., 19 seconds).
After the BLE advertising duration ends, only the BLE Mesh Proxy Service UUID (0x1828) is advertised, and my vendor-specific UUID is no longer included.
This behavior prevents the coexistence of BLE Mesh Proxy and custom BLE GATT advertising.
The BLE advertising should continue periodically with the configured parameters, including both the BLE Mesh Proxy Service UUID (0x1828) and my vendor-specific service UUID.
What is the actual behavior?
After the BLE advertising duration ends, the ESP BLE Mesh stack takes control of the advertising process and only advertises the Mesh Proxy Service UUID (0x1828). My vendor-specific UUID is no longer included.
Steps to reproduce.
Start BLE advertising with the above parameters.
Observe the advertising data using a BLE scanner app (e.g., nRF Connect).
Debug Logs.
No response
More Information.
Is there a supported way to include custom vendor-specific UUIDs alongside the Mesh Proxy Service UUID in the BLE advertising data?
If not, can you suggest an alternative approach or API updates to allow coexistence of BLE Mesh and custom BLE GATT advertising?
Thank you for your support!
The text was updated successfully, but these errors were encountered: