pschatzmann / ESP32-A2DP

A Simple ESP32 Bluetooth A2DP Library (to implement a Music Receiver or Sender) that supports Arduino, PlatformIO and Espressif IDF
Apache License 2.0
1.65k stars 270 forks source link

Compile Error(ESP_BT_GAP_ACL_CONN_CMPL_STAT_EVT was not declared) #470

Closed mongonta0716 closed 1 year ago

mongonta0716 commented 1 year ago

Hi,

I am getting the following error when building with arduino-esp32. Probably, esp-idf does not give this error. The cause is this commit.

793aac4fec7d49958a50d1cdb88548835d573034

There is a definition in esp-idf but not in esp_gap_bt_api.h of arduino-esp32.

How should it be handled?

https://github.com/espressif/arduino-esp32/blob/master/tools/sdk/esp32/include/bt/host/bluedroid/api/include/api/esp_gap_bt_api.h#L209-L227

.pio/libdeps/m5stack-core-esp32/ESP32-A2DP/src/BluetoothA2DPSource.cpp:547:8: error: 'ESP_BT_GAP_ACL_CONN_CMPL_STAT_EVT' was not declared in this scope
   case ESP_BT_GAP_ACL_CONN_CMPL_STAT_EVT:
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.pio/libdeps/m5stack-core-esp32/ESP32-A2DP/src/BluetoothA2DPSource.cpp:547:8: note: suggested alternative: 'ESP_BT_GAP_QOS_CMPL_EVT'
   case ESP_BT_GAP_ACL_CONN_CMPL_STAT_EVT:
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        ESP_BT_GAP_QOS_CMPL_EVT
Compiling .pio/build/m5stack-core-esp32/libecb/YAMLDuino/ArduinoYaml.cpp.o
Compiling .pio/build/m5stack-core-esp32/libecb/YAMLDuino/cJSON/cJSON.c.o
*** [.pio/build/m5stack-core-esp32/lib523/ESP32-A2DP/BluetoothA2DPSource.cpp.o] Error 1

I have been using ESP32-A2DP for a long time. Thank you.

pschatzmann commented 1 year ago

https://github.com/pschatzmann/ESP32-A2DP#support https://github.com/pschatzmann/ESP32-A2DP/wiki/Reporting-Bugs

I guess you just forget to upgrate the ESP32...

mongonta0716 commented 1 year ago

arduino-esp32 is using 2.0.8 (platform:espressif@6.2.0).

Well, if I set the version of esp32-a2dp to fixed (v1.7.3) in the tag, there is no problem, so I will go with that solution.

pschatzmann commented 1 year ago

The actual version is 2.0.11. I suggest that you just upgrade to something more recent...

Alternatively you can prevent your error excluding the offending lines with the the following correction:

if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(2, 0, 8)

endif

I suggest that in this case you submit a pull reqest.

mongonta0716 commented 1 year ago

I built it with arduino-esp32 2.0.11 (espressif@6.4.0) as you said and it went through. Sorry for taking your time.