I have a project that want to divide into some subcomponent like
/projects
├───components
│ ├───ble_server
│ │ └───include
│ │ │ └───ble_server.h
└───main
│ ├───app_main.c
I've tried to import the bluetooth library
"#include "esp_bt.h" "
It works normally in app_main.c but when I include them on the ble_server.h file, I got error
fatal error: esp_bt.h: No such file or directory
10 | #include "esp_bt.h"
| ^~~~~~~~~~
So how to include idf component in subfolder like /components
Components cannot include system component
Re: Components cannot include system component
hallo
if you are at idf-version > 5.0 you have to edit your CMakeLists.txt in your "component" root folder and add the 'REQUIRES' argument.
it also seems you have an older version because after 5.2 you have to include 'esp_bt_main.h' or 'esp_bt_device.h'.
hope this helps
if you are at idf-version > 5.0 you have to edit your CMakeLists.txt in your "component" root folder and add the 'REQUIRES' argument.
Code: Select all
idf_component_register(
REQUIRES "bt"
SRCS "ble_server.c"
INCLUDE_DIRS "."
)Code: Select all
#include "esp_bt_main.h"
/* if you use device functions uncomment next line */
// #include "esp_bt_device.h"
Visit my github account
https://github.com/avjui
Who is online
Users browsing this forum: No registered users and 4 guests