Skip to content

undefined reference to `esp_hf_client_outgoing_data_ready' #6748

@jokubasver

Description

@jokubasver

Board

ESP32 Dev Module

Device Description

Generic 36 pin ESP32 dev module

Hardware Configuration

UDA1334A DAC board, MCP2515 CAN board

Version

latest master (checkout manually)

IDE Name

PlatformIO

Operating System

Windows 10

Flash frequency

80MHz

PSRAM enabled

no

Upload speed

115200

Description

I'm using some of the HFP Client features in my sketch to use car steering wheel buttons to control my phone via Bluetooth.
These are the parts that work just fine:

esp_hf_client_register_callback
esp_hf_client_init
esp_hf_client_start_voice_recognition
esp_hf_client_answer_call
esp_hf_client_reject_call

And I'm able to trigger the voice assistant, answer and reject phone calls using the car's steering wheel buttons, which is great.

Now I'm trying to route phone call audio, and it seems like I need to use esp_hf_client_outgoing_data_ready. The code compiles fine, but fails at the linking stage:

`Compiling .pio\build\esp32dev\src\main.cpp.o
Linking .pio\build\esp32dev\firmware.elf
c:/users/xxxxxx/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\src\main.cpp.o:(.literal._Z5setupv+0x34): undefined reference to `esp_hf_client_outgoing_data_ready'
c:/users/xxxxxx/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\src\main.cpp.o: in function `setup()':
C:\Users\xxxxxx\Documents\GitHub\xxxxxx/src/main.cpp:149: undefined reference to `esp_hf_client_outgoing_data_ready`

I've tried now and old versions of arduino-esp32, same with platformio esp32 platform - no difference.

Sketch

#include <Arduino.h>
#include <esp_hf_client_api.h>
#include "BluetoothA2DPSink.h"

BluetoothA2DPSink a2dp_sink;

void bt_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_t *param)
{
}

void setup() {
  // Enable serial
  Serial.begin(115200);

  // Start the A2DP sink
  a2dp_sink.start("BT");  

  // Setup HFP
  esp_hf_client_register_callback(bt_hf_client_cb);
  esp_hf_client_init();
  esp_hf_client_outgoing_data_ready();
}

void loop() {
  // HF Client functions that work just fine on Arduino-ESP32
  esp_hf_client_start_voice_recognition();
  delay(1000);
  esp_hf_client_answer_call();
  delay(1000);
  esp_hf_client_reject_call();
  delay(1000);
}

Debug Message

Compiling .pio\build\esp32dev\src\main.cpp.o
Linking .pio\build\esp32dev\firmware.elf
c:/users/xxxxxx/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\src\main.cpp.o:(.literal._Z5setupv+0x34): undefined reference to `esp_hf_client_outgoing_data_ready'
c:/users/xxxxxx/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\src\main.cpp.o: in function `setup()':
C:\Users\xxxxxx\Documents\GitHub\xxxxxx/src/main.cpp:149: undefined reference to `esp_hf_client_outgoing_data_ready

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions