ESP32-A2DP icon indicating copy to clipboard operation
ESP32-A2DP copied to clipboard

fix issue with logging struct

Open WouterVandeWiele opened this issue 2 years ago • 0 comments

Problem Description

The wiki suggest configuring build_flags = -DCORE_DEBUG_LEVEL=5 to see more debug messages. https://github.com/pschatzmann/ESP32-A2DP/wiki/PlatformIO

However, one of the debug logs tries to access a non existent struct member.

...
Compiling .pio\build\esp32dev\libc9e\ESP32-A2DP\SoundData.cpp.o
In file included from .pio/libdeps/esp32dev/ESP32-A2DP/src/BluetoothA2DPCommon.h:67,
                 from .pio/libdeps/esp32dev/ESP32-A2DP/src/BluetoothA2DPSource.h:22,
                 from .pio/libdeps/esp32dev/ESP32-A2DP/src/BluetoothA2DPSource.cpp:16:
.pio/libdeps/esp32dev/ESP32-A2DP/src/BluetoothA2DPSource.cpp: In member function 'virtual void BluetoothA2DPSource::bt_av_hdl_avrc_ct_evt(uint16_t, void*)':
.pio/libdeps/esp32dev/ESP32-A2DP/src/BluetoothA2DPSource.cpp:967:69: error: 'struct esp_avrc_ct_cb_param_t::avrc_ct_psth_rsp_param' has no member named 'rsp_code'; did you mean 'key_code'?
         rc->psth_rsp.key_code, rc->psth_rsp.key_state, rc->psth_rsp.rsp_code);
                                                                     ^~~~~~~~
C:/Users/wvand/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-log.h:127:72: note: in definition of macro 'log_i'
 #define log_i(format, ...) log_printf(ARDUHAL_LOG_FORMAT(I, format), ##__VA_ARGS__)
                                                                        ^~~~~~~~~~~
.pio/libdeps/esp32dev/ESP32-A2DP/src/BluetoothA2DPSource.cpp:964:5: note: in expansion of macro 'ESP_LOGI'
     ESP_LOGI(
     ^~~~~~~~
*** [.pio\build\esp32dev\libc9e\ESP32-A2DP\BluetoothA2DPSource.cpp.o] Error 1
Compiling .pio\build\esp32dev\lib9d8\AUDIO_APP\audio_mux.cpp.o

Proposed fix: change it to the "transaction label" member, which is not printed in the debug message.

Sketch

Custom sketch adapted from:

  • https://github.com/pschatzmann/ESP32-A2DP/blob/main/examples/bt_music_receiver_with_metadata/bt_music_receiver_with_metadata.ino
  • https://pschatzmann.github.io/ESP32-A2DP/html/index.html

Other Steps to Reproduce

No response

Device Description

Custom board

  • ESP32-D0WDQ6
  • 4MB flash

Provide your Version of the EP32 Arduino Core (or the IDF Version)

CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (6.3.2+sha.f1fce6c) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-arduinoespressif32 @ 3.20009.0 (2.0.9) 
 - tool-esptoolpy @ 1.40501.0 (4.5.1) 
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5

WouterVandeWiele avatar Feb 24 '24 17:02 WouterVandeWiele