Hi,
I am using BLE Peripheral mode with following configurations:
CONFIG_GPIO=y CONFIG_SERIAL=y CONFIG_UART_ASYNC_API=y CONFIG_BT=y CONFIG_BT_DEBUG_LOG=y CONFIG_BT_SMP=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_DIS=y CONFIG_BT_DIS_PNP=n CONFIG_BT_BAS=y CONFIG_BT_HRS=y CONFIG_BT_DEVICE_NAME="Nordic HW Test Device" CONFIG_BT_DEVICE_APPEARANCE=833 CONFIG_BT_FIXED_PASSKEY=y CONFIG_LOG_BACKEND_UART_OUTPUT_SYST=n
If a host disconnects the device during pairing, the device cannot be paired with another device.
So I made following code inside the disconnect callback function:
void bleDisconnected(struct bt_conn *bleconn, uint8_t err){ aPiBLEDevConnectionNotify(bleconn,BLE_Disconnected); bt_conn_create_auto_stop(); uartSendDataText(UART0,"BLE : > BLE Host Disconnected & Advertising restarted.\n\r",2000); }
However, i am getting a compilation error when using bt_conn_create_auto_stop() method as below:
C:\SCODE\nrf\test1\blinky\src\BluetoothLib\BLE.c:28: undefined reference to `bt_conn_create_auto_stop'
So, I added following header files in my respective api (header file):
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/conn.h>
#include <zephyr/bluetooth/uuid.h>
#include <zephyr/bluetooth/gatt.h>
#include <zephyr/bluetooth/services/bas.h>
#include <zephyr/bluetooth/services/hrs.h>
#include <zephyr/bluetooth/conn.h>
But it didn't work. So I tried to add following line as published in one of the blogs, but it too didn't work.
cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(blinky)
target_sources(app PRIVATE src/main.c)
target_link_libraries(app PRIVATE ${ZEPHYR_BASE}/subsys/bluetooth/lib/bluetooth)
It gave me an error that the folder bluetooth cannot be found in the given path. Actually it does not exist as illustrated in the below image.
How to manage this situation?
Please help.