Page 1 of 1

Unresolved inclusion: "esp_gap_ble_api.h"

Posted: Sun Aug 13, 2023 2:39 pm
by sureace
Hi Espress if team,
i am new to esp idf framework. I am working BLE using nimble libaray. I am getting the Unresolved inclusion: "esp_gap_ble_api.h" error. I include bt component in cmakelist.txt.

[Codebox]
#include <stdio.h>
#include <stdio.h>
#include "esp_log.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_bt.h"
#include "esp_gap_ble_api.h"
#include "esp_gatts_api.h"


#include "ble_server_client_demo.h"

#define GATTS_TAG "GATTS_DEMO"

void ble_server_demo(void){

}
[/Codebox]

[Codebox]
idf_component_register(SRCS "ble_server_client_demo.c"
INCLUDE_DIRS "include"
REQUIRES bt driver nvs_flash esp_event)

[/Codebox]

Re: Unresolved inclusion: "esp_gap_ble_api.h"

Posted: Sun Aug 13, 2023 10:32 pm
by felixcollins
Have you tried a clean and rebuild?

Re: Unresolved inclusion: "esp_gap_ble_api.h"

Posted: Sun Aug 13, 2023 10:44 pm
by MicroController
Check if the NimBLE BT stack is selected (instead of Bluedroid) in menuconfig under "Component config" -> "Bluetooth".

Re: Unresolved inclusion: "esp_gap_ble_api.h"

Posted: Mon Oct 09, 2023 9:00 am
by irahul
sureace wrote:
Sun Aug 13, 2023 2:39 pm
Hi Espress if team,
i am new to esp idf framework. I am working BLE using nimble libaray. I am getting the Unresolved inclusion: "esp_gap_ble_api.h" error. I include bt component in cmakelist.txt.

[Codebox]
#include <stdio.h>
#include <stdio.h>
#include "esp_log.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_bt.h"
#include "esp_gap_ble_api.h"
#include "esp_gatts_api.h"


#include "ble_server_client_demo.h"

#define GATTS_TAG "GATTS_DEMO"

void ble_server_demo(void){

}
[/Codebox]

[Codebox]
idf_component_register(SRCS "ble_server_client_demo.c"
INCLUDE_DIRS "include"
REQUIRES bt driver nvs_flash esp_event)

[/Codebox]
Seems like you are trying to compile bluedroid example code .The files esp_gap_ble_api.h doesn't exist for nimble and hence the error. you can refer to nimble examples instead