diff --git a/port/esp32/template/components/btstack/include/btstack_config.h b/port/esp32/template/components/btstack/include/btstack_config.h index 9ee4c4220..2e6219bc6 100644 --- a/port/esp32/template/components/btstack/include/btstack_config.h +++ b/port/esp32/template/components/btstack/include/btstack_config.h @@ -16,13 +16,13 @@ #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_CENTRAL #define ENABLE_LE_DATA_LENGTH_EXTENSION +#define ENABLE_LE_SECURE_CONNECTIONS #define ENABLE_LOG_ERROR #define ENABLE_LOG_INFO // #define ENABLE_LOG_DEBUG // BTstack configuration. buffers, sizes, ... #define HCI_ACL_PAYLOAD_SIZE (1691 + 4) -#define MAX_NR_LE_DEVICE_DB_ENTRIES 4 // HCI Controller to Host Flow Control // @@ -38,3 +38,6 @@ #define HCI_HOST_SCO_PACKET_LEN 60 #endif +// Link Key DB and LE Device DB using TLV on top of Flash Sector interface +#define NVM_NUM_LINK_KEYS 16 +#define NVM_NUM_DEVICE_DB_ENTRIES 16 \ No newline at end of file diff --git a/port/esp32/template/components/btstack/main.c b/port/esp32/template/components/btstack/main.c index 48c32849a..8bf7bf1bb 100644 --- a/port/esp32/template/components/btstack/main.c +++ b/port/esp32/template/components/btstack/main.c @@ -50,6 +50,7 @@ #include "btstack_ring_buffer.h" #include "btstack_tlv.h" #include "btstack_tlv_esp32.h" +#include "ble/le_device_db_tlv.h" #include "classic/btstack_link_key_db.h" #include "classic/btstack_link_key_db_tlv.h" #include "hci.h" @@ -310,7 +311,7 @@ int app_main(void){ printf("BTstack: setup\n"); // enable packet logger - // hci_dump_open(NULL, HCI_DUMP_STDOUT); + hci_dump_open(NULL, HCI_DUMP_STDOUT); /// GET STARTED with BTstack /// btstack_memory_init(); @@ -319,11 +320,16 @@ int app_main(void){ // init HCI hci_init(transport_get_instance(), NULL); - // setup link key deb using esp32 btstack_tlv instance + // setup TLV ESP32 implementation const btstack_tlv_t * btstack_tlv_impl = btstack_tlv_esp32_get_instance(); + + // setup Link Key DB using TLV const btstack_link_key_db_t * btstack_link_key_db = btstack_link_key_db_tlv_get_instance(btstack_tlv_impl, NULL); hci_set_link_key_db(btstack_link_key_db); + // setup LE Device DB using TLV + le_device_db_tlv_configure(btstack_tlv_impl, NULL); + // inform about BTstack state hci_event_callback_registration.callback = &packet_handler; hci_add_event_handler(&hci_event_callback_registration);