mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-20 18:40:31 +00:00
raspi: switch to TLV for link key and le device db, allow to compile without classic
This commit is contained in:
parent
2310501b70
commit
8c8a87ee5d
@ -5,14 +5,13 @@ CORE += \
|
||||
btstack_chipset_bcm.c \
|
||||
btstack_chipset_bcm_download_firmware.c \
|
||||
btstack_control_raspi.c \
|
||||
btstack_link_key_db_fs.c \
|
||||
btstack_run_loop_posix.c \
|
||||
btstack_tlv_posix.c \
|
||||
btstack_uart_block_posix.c \
|
||||
btstack_slip.c \
|
||||
hci_transport_h4.c \
|
||||
hci_transport_h5.c \
|
||||
le_device_db_fs.c \
|
||||
le_device_db_tlv.c \
|
||||
main.c \
|
||||
wav_util.c \
|
||||
btstack_stdin_posix.c \
|
||||
|
@ -33,6 +33,8 @@
|
||||
#define HCI_INCOMING_PRE_BUFFER_SIZE 14 // sizeof benep heade, avoid memcpy
|
||||
#define HCI_ACL_PAYLOAD_SIZE (1691 + 4)
|
||||
|
||||
#define NVM_NUM_DEVICE_DB_ENTRIES 20
|
||||
|
||||
// Mesh Configuration
|
||||
#define ENABLE_MESH
|
||||
#define ENABLE_MESH_ADV_BEARER
|
||||
|
@ -59,7 +59,8 @@
|
||||
|
||||
#include "btstack_debug.h"
|
||||
#include "btstack_event.h"
|
||||
#include "btstack_link_key_db_fs.h"
|
||||
#include "ble/le_device_db_tlv.h"
|
||||
#include "classic/btstack_link_key_db_tlv.h"
|
||||
#include "btstack_memory.h"
|
||||
#include "btstack_run_loop.h"
|
||||
#include "btstack_run_loop_posix.h"
|
||||
@ -212,6 +213,12 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
||||
strcat(tlv_db_path, TLV_DB_PATH_POSTFIX);
|
||||
tlv_impl = btstack_tlv_posix_init_instance(&tlv_context, tlv_db_path);
|
||||
btstack_tlv_set_instance(tlv_impl, &tlv_context);
|
||||
#ifdef ENABLE_CLASSIC
|
||||
hci_set_link_key_db(btstack_link_key_db_tlv_get_instance(tlv_impl, &tlv_context));
|
||||
#endif
|
||||
#ifdef ENABLE_BLE
|
||||
le_device_db_tlv_configure(tlv_impl, &tlv_context);
|
||||
#endif
|
||||
break;
|
||||
case HCI_EVENT_COMMAND_COMPLETE:
|
||||
if (HCI_EVENT_IS_COMMAND_COMPLETE(packet, hci_read_local_name)){
|
||||
@ -377,11 +384,9 @@ int main(int argc, const char * argv[]){
|
||||
}
|
||||
|
||||
// setup HCI (to be able to use bcm chipset driver)
|
||||
const btstack_link_key_db_t * link_key_db = btstack_link_key_db_fs_instance();
|
||||
hci_init(transport, (void*) &transport_config);
|
||||
hci_set_bd_addr( addr );
|
||||
hci_set_chipset(btstack_chipset_bcm_instance());
|
||||
hci_set_link_key_db(link_key_db);
|
||||
|
||||
// inform about BTstack state
|
||||
hci_event_callback_registration.callback = &packet_handler;
|
||||
|
Loading…
x
Reference in New Issue
Block a user