BLE as ESP-IDF Component - Can't Include Header Files

rehxes
Posts: 1
Joined: Mon Mar 27, 2023 8:03 pm

BLE as ESP-IDF Component - Can't Include Header Files

Postby rehxes » Tue May 30, 2023 1:49 pm

I have a problem with my ESP-IDF component's CMakeLists file. While I am trying to use "bt" component in ESP-IDF v5.0.2 , compiler is not seeing some files inside the bt component. It seems weird from my point of view. Can you help me out :?: :?:

Here is my CMakeLists.txt:
idf_component_register(SRCS "ble_server.c"
INCLUDE_DIRS "include"
REQUIRES bt nvs_flash)

What I am trying to run in component is basically the official example of esp-idf in here https://github.com/espressif/esp-idf/bl ... eat_demo.c

Bluetooth cfg in menuconfig:
Bluetooth on
Host (NimBLE - BLE only)
Controller (Enabled)
I can share more if needed..

Here is the error from terminal while compiling:
/components/ble_server/ble_server.c:26:10: fatal error: esp_gap_ble_api.h: No such file or directory
26 | #include "esp_gap_ble_api.h"
| ^~~~~~~~~~~~~~~~~~~
compilation terminated.

Hope someone knows what I am doing wrong. :roll: :?:

MicroController
Posts: 1136
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: BLE as ESP-IDF Component - Can't Include Header Files

Postby MicroController » Thu Jun 01, 2023 1:26 pm

Host (NimBLE - BLE only)

Code: Select all

#include "esp_gap_ble_api.h" // <-- This is Bluedroid API
You're trying to compile a Bluedroid example against the NimBLE stack. Won't work.
If you want to use NimBLE check the NimBLE examples @ https://github.com/espressif/esp-idf/tr ... oth/nimble

Who is online

Users browsing this forum: Alexa [Bot], spenderIng and 119 guests