Unresolved inclusion: "esp_gap_ble_api.h"

sureace
Posts: 4
Joined: Sun Jul 31, 2022 3:02 pm

Unresolved inclusion: "esp_gap_ble_api.h"

Postby sureace » 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]

felixcollins
Posts: 125
Joined: Fri May 24, 2019 2:02 am

Re: Unresolved inclusion: "esp_gap_ble_api.h"

Postby felixcollins » Sun Aug 13, 2023 10:32 pm

Have you tried a clean and rebuild?

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

Re: Unresolved inclusion: "esp_gap_ble_api.h"

Postby MicroController » Sun Aug 13, 2023 10:44 pm

Check if the NimBLE BT stack is selected (instead of Bluedroid) in menuconfig under "Component config" -> "Bluetooth".

irahul
Posts: 46
Joined: Fri Jun 18, 2021 10:07 am

Re: Unresolved inclusion: "esp_gap_ble_api.h"

Postby irahul » Mon Oct 09, 2023 9:00 am

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

Who is online

Users browsing this forum: cdollar, jmarple4 and 68 guests