Page 1 of 1

how to include esp32 ble component in a custom component

Posted: Thu Apr 30, 2020 8:45 am
by trustmiao
Hi all
While i was writing a component about ble functions, i've met this error:

Code: Select all

../components/ble/ble.h:9:20: fatal error: esp_bt.h: No such file or directory
although i've put bt in cmakelists for the custom component

Code: Select all

set(COMPONENT_ADD_INCLUDEDIRS .)

set(COMPONENT_SRCS "ble.cpp")

set(COMPONENT_REQUIRES spi_flash mbedtls mdns ethernet)
set(COMPONENT_PRIV_REQUIRES freertos fatfs nvs_flash app_update spiffs bootloader_support openssl bt esp32)
register_component()
is it because the bt needed to be enable or some? it normally work for me this way to make a component, just not ble before.
thanks in advance

Re: how to include esp32 ble component in a custom component

Posted: Thu Apr 30, 2020 4:39 pm
by SlavaDev503
It seems that your bluetooth disabled, you need to enable it in menu config, you should not directly add it in your cmake.
Image

Re: how to include esp32 ble component in a custom component

Posted: Wed May 06, 2020 9:34 am
by trustmiao
SlavaDev503 wrote:
Thu Apr 30, 2020 4:39 pm
It seems that your bluetooth disabled, you need to enable it in menu config, you should not directly add it in your cmake.
Image
this solves the problem perfectly, thanks alot