Проблема с a2dp_sink.end() #578
-
Good afternoon, I am facing the following problem in ESP-IDF VSCode: I attach debugging information: Before holding the button (everything works stable):
After holding the button (attempt to disable Bluetooth followed by ESP32 hang):
Code fragment of a task that attempts to disable Bleutooth: void vSettingButtonTask(void* pvParameters)
{
for(;;)
{
buttonTick(&settingButton);
if (buttonIsHolded(&settingButton))
{
ESP_LOGI(tag, "%d state", (uint8_t)bluetoothStatus);
bluetoothStatus = bluetoothStatus == BluetoothStatus::OFF_BT_STATUS ? BluetoothStatus::SEARCH_BT_STATUS : BluetoothStatus::OFF_BT_STATUS;
switch (bluetoothStatus)
{
case BluetoothStatus::OFF_BT_STATUS:
//a2dp_sink.set_connectable(false);
a2dp_sink.end();
break;
default:
a2dp_sink.start("Mah");
//a2dp_sink.set_connectable(true);
break;
}
}
vTaskDelay(pdMS_TO_TICKS(10));
}
} Initialising BluetoothA2DPSink: a2dp_sink.set_avrc_connection_state_callback(onConnectionStateChanged);
a2dp_sink.set_auto_reconnect(true);
a2dp_sink.start("Mah"); Thank you very much in advance for your reply! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
You forgot to debounce! |
Beta Was this translation helpful? Give feedback.
-
Can you provide me with a simple test case ? The following test sketch works w/o any issues: #include "AudioTools.h"
#include "BluetoothA2DPSink.h"
I2SStream out;
BluetoothA2DPSink a2dp_sink(out);
void setup() {
Serial.begin(115200);
while(!Serial) delay(100);
a2dp_sink.end();
Serial.println("ended 0");
a2dp_sink.start("Test");
a2dp_sink.end();
Serial.println("ended 1");
a2dp_sink.end();
Serial.println("ended 2");
}
void loop() {
delay(1000); // do nothing
} if gives
|
Beta Was this translation helpful? Give feedback.
-
No, for me this is working perfectly as well. |
Beta Was this translation helpful? Give feedback.
Can you provide me with a simple test case ?
The following test sketch works w/o any issues:
if gives