I am trying to build a esp32 application, where I have bluetooth and wifi enabled at the same time.
Bluetooth is used with the a2dp profile, where the esp is a sink. After receiving the data, it should be published over a UDP socket as a broadcast to the network.
The problem is the antenna. Both bt and wifi are sharing it. The a2dp stream seems to permanently acquiring the antenna and releasing it very rarely (~2 packages/min, I have ~3000 packages/min).
So my question: Is there some kind of semaphore, which can be acquired to have the full control over the antenna? So my socket would be able to send the data to the network?
I am using my esp32 with freeRTOS. The freeRTOS lib is written in C, but I am trying to wrap everything in C++. Still I think this problem is related to a C lib so I tag it with C.
I am open for any suggestions how to build that. Thanks in advance.
UPDATE:
I am using release/v3.3
from the official esp-idf
repo.
I have: CONFIG_SW_COEXIST_ENABLE=y
and CONFIG_SW_COEXIST_PREFERENCE_WIFI=y
I can't find CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE
in my config.
The mentioned configuration doesn't work.
I tried reading the post, but can't find any "scan_window
" or "scan_interval
" in my lib. It was written that it is somewhere in the gap_api
but can't find it.
Here is my code + config: https://github.com/Dimfred/esp32_bt_streamer
The socket client task, which should broadcast the a2dp_msg
, is started here:
https://github.com/Dimfred/esp32_bt_streamer/blob/master/main/app/event_handler.cpp#L22
All events popped from station/access point/bluetooth/a2dp are all caught in event_handler.hpp/cpp
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…