|
|
@@ -58,7 +58,7 @@
|
|
|
#include "btstack_run_loop_rtthread.h"
|
|
|
#include "btstack_uart.h"
|
|
|
#include "bluetooth_company_id.h"
|
|
|
-#include "ble/le_device_db_tlv.h"
|
|
|
+#include "ble/le_device_db.h"
|
|
|
#include "hci.h"
|
|
|
#include "hci_dump.h"
|
|
|
#include "hci_dump_rtthread_stdout.h"
|
|
|
@@ -67,16 +67,9 @@
|
|
|
#include "hm_hci_transport_h4.h"
|
|
|
#include "btstack_stdin.h"
|
|
|
#include "btstack_chipset_zephyr.h"
|
|
|
-#include "btstack_tlv_posix.h"
|
|
|
|
|
|
int btstack_main(int argc, const char * argv[]);
|
|
|
|
|
|
-#define TLV_DB_PATH_PREFIX "/tmp/btstack_"
|
|
|
-#define TLV_DB_PATH_POSTFIX ".tlv"
|
|
|
-static char tlv_db_path[100];
|
|
|
-static const btstack_tlv_t * tlv_impl;
|
|
|
-static btstack_tlv_posix_t tlv_context;
|
|
|
-
|
|
|
static btstack_packet_callback_registration_t hci_event_callback_registration;
|
|
|
|
|
|
static const uint8_t read_static_address_command_complete_prefix[] = { 0x0e, 0x1b, 0x01, 0x09, 0xfc };
|
|
|
@@ -88,13 +81,9 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
|
|
case BTSTACK_EVENT_STATE:
|
|
|
if (btstack_event_state_get_state(packet) != HCI_STATE_WORKING) break;
|
|
|
printf("BTstack up and running as %s\n", bd_addr_to_str(static_address));
|
|
|
- // setup TLV
|
|
|
- strcpy(tlv_db_path, TLV_DB_PATH_PREFIX);
|
|
|
- strcat(tlv_db_path, bd_addr_to_str(static_address));
|
|
|
- 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);
|
|
|
- le_device_db_tlv_configure(tlv_impl, &tlv_context);
|
|
|
+
|
|
|
+ le_device_db_init();
|
|
|
+
|
|
|
break;
|
|
|
case HCI_EVENT_COMMAND_COMPLETE:
|
|
|
if (memcmp(packet, read_static_address_command_complete_prefix, sizeof(read_static_address_command_complete_prefix)) == 0){
|
|
|
@@ -113,8 +102,8 @@ static int rt_btstack_main(int argc, const char * argv[]){
|
|
|
btstack_memory_init();
|
|
|
btstack_run_loop_init(btstack_run_loop_rtthread_get_instance());
|
|
|
|
|
|
- const hci_dump_t * hci_dump_impl = hci_dump_rtthread_stdout_get_instance();
|
|
|
- hci_dump_init(hci_dump_impl);
|
|
|
+ // const hci_dump_t * hci_dump_impl = hci_dump_rtthread_stdout_get_instance();
|
|
|
+ // hci_dump_init(hci_dump_impl);
|
|
|
|
|
|
// init HCI
|
|
|
const hci_transport_t *transport = hci_transport_h4_instance(NULL);
|