-
Notifications
You must be signed in to change notification settings - Fork 8k
Description
Answers checklist.
- I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
- I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
- I have searched the issue tracker for a similar issue and not found a similar issue.
IDF version.
ESP-IDF v5.2-dev-3903-g66992aca7a-dirty
Espressif SoC revision.
ESP32-U4WDH (revision v3.0)
Operating System used.
macOS
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
None
Development Kit.
Custom board as well as QtPy ESP32 PICO
Power Supply used.
USB
What is the expected behavior?
When calling esp_ble_create_sc_oob_data() I expect to get the ESP_GAP_BLE_SC_CR_LOC_OOB_EVT event and be able to use the generated local OOB data.
What is the actual behavior?
On ESP32 the event never fires.
After tracing through the stack, it seems that within esp-idf/components/bt/host/bluedroid/stack/btm/btm_ble.c, specifically the function UINT8 btm_proc_smp_cback(...), the SMP_SC_LOC_OOB_DATA_UP_EVT event is discarded within the branch if (p_dev_rec != NULL) and is only processed within the else condition which only occurs for an unknown device (according to the trace logs). I'm not sure why this condition check executes the else condition on ESP32s3 (where it does properly generate the OOB data), but on ESP32 it registers that p_dev_rec != NULL and therefore silently discards the OOB_DATA_UP_EVT. By simply adding a switch case for the SMP_SC_LOC_OOB_DATA_UP_EVT within the if branch, the OOB data is successfully generated.
Steps to reproduce.
- Call
esp_ble_create_sc_oob_data() - Notice that
ESP_GAP_BLE_SC_CR_LOC_OOB_EVTis never called
Debug Logs.
No response
More Information.
This is related to work I did for NFC OOB BLE pairing - see this comment.