mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-10 06:44:32 +00:00
windows: use windows btstack_tlv and hci dump implementations
This commit is contained in:
parent
b8fd168e43
commit
3086bccee3
@ -1,7 +1,7 @@
|
||||
# Makefile for windows-h4-da14585 examples
|
||||
BTSTACK_ROOT ?= ../..
|
||||
|
||||
CORE += main.c btstack_stdin_windows.c btstack_tlv_posix.c hci_dump_posix_fs.c
|
||||
CORE += main.c btstack_stdin_windows.c btstack_tlv_windows.c hci_dump_windows_fs.c
|
||||
|
||||
COMMON += \
|
||||
btstack_run_loop_windows.c \
|
||||
|
@ -59,12 +59,12 @@
|
||||
#include "btstack_run_loop_windows.h"
|
||||
#include "btstack_stdin.h"
|
||||
#include "btstack_stdin_windows.h"
|
||||
#include "btstack_tlv_posix.h"
|
||||
#include "btstack_tlv_windows.h"
|
||||
#include "hal_led.h"
|
||||
#include "hci.h"
|
||||
#include "hci_585.h"
|
||||
#include "hci_dump.h"
|
||||
#include "hci_dump_posix_fs.h"
|
||||
#include "hci_dump_windows_fs.h"
|
||||
#include "hci_transport.h"
|
||||
#include "hci_transport_h4.h"
|
||||
|
||||
@ -77,7 +77,7 @@ static btstack_uart_config_t uart_config;
|
||||
#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_tlv_windows_t tlv_context;
|
||||
static bd_addr_t local_addr;
|
||||
static bool shutdown_triggered;
|
||||
|
||||
@ -104,7 +104,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
||||
btstack_strcpy(tlv_db_path, sizeof(tlv_db_path), TLV_DB_PATH_PREFIX);
|
||||
btstack_strcat(tlv_db_path, sizeof(tlv_db_path), bd_addr_to_str_with_delimiter(local_addr, '-'));
|
||||
btstack_strcat(tlv_db_path, sizeof(tlv_db_path), TLV_DB_PATH_POSTFIX);
|
||||
tlv_impl = btstack_tlv_posix_init_instance(&tlv_context, tlv_db_path);
|
||||
tlv_impl = btstack_tlv_windows_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));
|
||||
@ -114,7 +114,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
||||
#endif
|
||||
break;
|
||||
case HCI_STATE_OFF:
|
||||
btstack_tlv_posix_deinit(&tlv_context);
|
||||
btstack_tlv_windows_deinit(&tlv_context);
|
||||
if (!shutdown_triggered) break;
|
||||
// reset stdin
|
||||
btstack_stdin_reset();
|
||||
@ -177,8 +177,8 @@ int main(int argc, const char * argv[]){
|
||||
|
||||
// log into file using HCI_DUMP_PACKETLOGGER format
|
||||
const char * pklg_path = "hci_dump.pklg";
|
||||
hci_dump_posix_fs_open(pklg_path, HCI_DUMP_PACKETLOGGER);
|
||||
const hci_dump_t * hci_dump_impl = hci_dump_posix_fs_get_instance();
|
||||
hci_dump_windows_fs_open(pklg_path, HCI_DUMP_PACKETLOGGER);
|
||||
const hci_dump_t * hci_dump_impl = hci_dump_windows_fs_get_instance();
|
||||
hci_dump_init(hci_dump_impl);
|
||||
printf("Packet Log: %s\n", pklg_path);
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Makefile for windows-h4 examples
|
||||
BTSTACK_ROOT ?= ../..
|
||||
|
||||
CORE += main.c btstack_stdin_windows.c btstack_tlv_posix.c hci_dump_posix_fs.c
|
||||
CORE += main.c btstack_stdin_windows.c btstack_tlv_windows.c hci_dump_windows_fs.c
|
||||
|
||||
COMMON += \
|
||||
btstack_chipset_zephyr.c \
|
||||
|
@ -60,11 +60,11 @@
|
||||
#include "btstack_run_loop_windows.h"
|
||||
#include "btstack_stdin.h"
|
||||
#include "btstack_stdin_windows.h"
|
||||
#include "btstack_tlv_posix.h"
|
||||
#include "btstack_tlv_windows.h"
|
||||
#include "hal_led.h"
|
||||
#include "hci.h"
|
||||
#include "hci_dump.h"
|
||||
#include "hci_dump_posix_fs.h"
|
||||
#include "hci_dump_windows_fs.h"
|
||||
#include "hci_transport.h"
|
||||
#include "hci_transport_h4.h"
|
||||
|
||||
@ -87,7 +87,7 @@ static bd_addr_t static_address;
|
||||
#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_tlv_windows_t tlv_context;
|
||||
static bool shutdown_triggered;
|
||||
|
||||
static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
|
||||
@ -100,14 +100,14 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
||||
btstack_strcpy(tlv_db_path, sizeof(tlv_db_path), TLV_DB_PATH_PREFIX);
|
||||
btstack_strcat(tlv_db_path, sizeof(tlv_db_path), bd_addr_to_str_with_delimiter(static_address, '-'));
|
||||
btstack_strcat(tlv_db_path, sizeof(tlv_db_path), TLV_DB_PATH_POSTFIX);
|
||||
tlv_impl = btstack_tlv_posix_init_instance(&tlv_context, tlv_db_path);
|
||||
tlv_impl = btstack_tlv_windows_init_instance(&tlv_context, tlv_db_path);
|
||||
btstack_tlv_set_instance(tlv_impl, &tlv_context);
|
||||
#ifdef ENABLE_BLE
|
||||
le_device_db_tlv_configure(tlv_impl, &tlv_context);
|
||||
#endif
|
||||
break;
|
||||
case HCI_STATE_OFF:
|
||||
btstack_tlv_posix_deinit(&tlv_context);
|
||||
btstack_tlv_windows_deinit(&tlv_context);
|
||||
if (!shutdown_triggered) break;
|
||||
// reset stdin
|
||||
btstack_stdin_reset();
|
||||
@ -150,8 +150,8 @@ int main(int argc, const char * argv[]){
|
||||
|
||||
// log into file using HCI_DUMP_PACKETLOGGER format
|
||||
const char * pklg_path = "hci_dump.pklg";
|
||||
hci_dump_posix_fs_open(pklg_path, HCI_DUMP_PACKETLOGGER);
|
||||
const hci_dump_t * hci_dump_impl = hci_dump_posix_fs_get_instance();
|
||||
hci_dump_windows_fs_open(pklg_path, HCI_DUMP_PACKETLOGGER);
|
||||
const hci_dump_t * hci_dump_impl = hci_dump_windows_fs_get_instance();
|
||||
hci_dump_init(hci_dump_impl);
|
||||
printf("Packet Log: %s\n", pklg_path);
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Makefile for windows-h4 examples
|
||||
BTSTACK_ROOT ?= ../..
|
||||
|
||||
CORE += main.c btstack_stdin_windows.c btstack_tlv_posix.c hci_dump_posix_fs.c
|
||||
CORE += main.c btstack_stdin_windows.c btstack_tlv_windows.c hci_dump_windows_fs.c
|
||||
|
||||
COMMON += \
|
||||
btstack_run_loop_windows.c \
|
||||
|
@ -59,12 +59,12 @@
|
||||
#include "btstack_run_loop_windows.h"
|
||||
#include "btstack_stdin.h"
|
||||
#include "btstack_stdin_windows.h"
|
||||
#include "btstack_tlv_posix.h"
|
||||
#include "btstack_tlv_windows.h"
|
||||
#include "classic/btstack_link_key_db_tlv.h"
|
||||
#include "hal_led.h"
|
||||
#include "hci.h"
|
||||
#include "hci_dump.h"
|
||||
#include "hci_dump_posix_fs.h"
|
||||
#include "hci_dump_windows_fs.h"
|
||||
#include "hci_transport.h"
|
||||
#include "hci_transport_h4.h"
|
||||
|
||||
@ -87,7 +87,7 @@ static int led_state = 0;
|
||||
#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_tlv_windows_t tlv_context;
|
||||
static bd_addr_t local_addr;
|
||||
static bool shutdown_triggered;
|
||||
|
||||
@ -116,7 +116,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
||||
btstack_strcpy(tlv_db_path, sizeof(tlv_db_path), TLV_DB_PATH_PREFIX);
|
||||
btstack_strcat(tlv_db_path, sizeof(tlv_db_path), bd_addr_to_str_with_delimiter(local_addr, '-'));
|
||||
btstack_strcat(tlv_db_path, sizeof(tlv_db_path), TLV_DB_PATH_POSTFIX);
|
||||
tlv_impl = btstack_tlv_posix_init_instance(&tlv_context, tlv_db_path);
|
||||
tlv_impl = btstack_tlv_windows_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));
|
||||
@ -126,7 +126,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
||||
#endif
|
||||
break;
|
||||
case HCI_STATE_OFF:
|
||||
btstack_tlv_posix_deinit(&tlv_context);
|
||||
btstack_tlv_windows_deinit(&tlv_context);
|
||||
if (!shutdown_triggered) break;
|
||||
// reset stdin
|
||||
btstack_stdin_reset();
|
||||
@ -232,8 +232,8 @@ int main(int argc, const char * argv[]){
|
||||
|
||||
// log into file using HCI_DUMP_PACKETLOGGER format
|
||||
const char * pklg_path = "hci_dump.pklg";
|
||||
hci_dump_posix_fs_open(pklg_path, HCI_DUMP_PACKETLOGGER);
|
||||
const hci_dump_t * hci_dump_impl = hci_dump_posix_fs_get_instance();
|
||||
hci_dump_windows_fs_open(pklg_path, HCI_DUMP_PACKETLOGGER);
|
||||
const hci_dump_t * hci_dump_impl = hci_dump_windows_fs_get_instance();
|
||||
hci_dump_init(hci_dump_impl);
|
||||
printf("Packet Log: %s\n", pklg_path);
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Makefile for windows WinUSB based examples
|
||||
BTSTACK_ROOT ?= ../..
|
||||
|
||||
CORE += main.c btstack_stdin_windows.c btstack_tlv_posix.c hci_dump_posix_fs.c
|
||||
CORE += main.c btstack_stdin_windows.c btstack_tlv_windows.c hci_dump_windows_fs.c
|
||||
|
||||
COMMON += hci_transport_h2_winusb.c btstack_run_loop_windows.c le_device_db_tlv.c btstack_link_key_db_tlv.c wav_util.c
|
||||
COMMON += btstack_chipset_intel_firmware.c rijndael.c
|
||||
|
@ -59,12 +59,12 @@
|
||||
#include "btstack_run_loop_windows.h"
|
||||
#include "btstack_stdin.h"
|
||||
#include "btstack_stdin_windows.h"
|
||||
#include "btstack_tlv_posix.h"
|
||||
#include "btstack_tlv_windows.h"
|
||||
#include "classic/btstack_link_key_db_tlv.h"
|
||||
#include "hal_led.h"
|
||||
#include "hci.h"
|
||||
#include "hci_dump.h"
|
||||
#include "hci_dump_posix_fs.h"
|
||||
#include "hci_dump_windows_fs.h"
|
||||
#include "hci_transport.h"
|
||||
#include "hci_transport_usb.h"
|
||||
|
||||
@ -75,7 +75,7 @@ int btstack_main(int argc, const char * argv[]);
|
||||
#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_tlv_windows_t tlv_context;
|
||||
static bd_addr_t local_addr;
|
||||
|
||||
static btstack_packet_callback_registration_t hci_event_callback_registration;
|
||||
@ -95,7 +95,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
||||
btstack_strcpy(tlv_db_path, sizeof(tlv_db_path), TLV_DB_PATH_PREFIX);
|
||||
btstack_strcat(tlv_db_path, sizeof(tlv_db_path), bd_addr_to_str_with_delimiter(local_addr, '-'));
|
||||
btstack_strcat(tlv_db_path, sizeof(tlv_db_path), TLV_DB_PATH_POSTFIX);
|
||||
tlv_impl = btstack_tlv_posix_init_instance(&tlv_context, tlv_db_path);
|
||||
tlv_impl = btstack_tlv_windows_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));
|
||||
@ -105,7 +105,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
||||
#endif
|
||||
break;
|
||||
case HCI_STATE_OFF:
|
||||
btstack_tlv_posix_deinit(&tlv_context);
|
||||
btstack_tlv_windows_deinit(&tlv_context);
|
||||
if (!shutdown_triggered) break;
|
||||
// reset stdin
|
||||
btstack_stdin_reset();
|
||||
@ -165,8 +165,8 @@ int main(int argc, const char * argv[]){
|
||||
|
||||
// log into file using HCI_DUMP_PACKETLOGGER format
|
||||
const char * pklg_path = "hci_dump.pklg";
|
||||
hci_dump_posix_fs_open(pklg_path, HCI_DUMP_PACKETLOGGER);
|
||||
const hci_dump_t * hci_dump_impl = hci_dump_posix_fs_get_instance();
|
||||
hci_dump_windows_fs_open(pklg_path, HCI_DUMP_PACKETLOGGER);
|
||||
const hci_dump_t * hci_dump_impl = hci_dump_windows_fs_get_instance();
|
||||
hci_dump_init(hci_dump_impl);
|
||||
printf("Packet Log: %s\n", pklg_path);
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Makefile for windows WinUSB based examples
|
||||
BTSTACK_ROOT ?= ../..
|
||||
|
||||
CORE += main.c btstack_stdin_windows.c btstack_tlv_posix.c hci_dump_posix_fs.c
|
||||
CORE += main.c btstack_stdin_windows.c btstack_tlv_windows.c hci_dump_windows_fs.c
|
||||
|
||||
COMMON += hci_transport_h2_winusb.c btstack_run_loop_windows.c le_device_db_tlv.c btstack_link_key_db_tlv.c wav_util.c
|
||||
COMMON += rijndael.c
|
||||
|
@ -59,12 +59,12 @@
|
||||
#include "btstack_run_loop_windows.h"
|
||||
#include "btstack_stdin.h"
|
||||
#include "btstack_stdin_windows.h"
|
||||
#include "btstack_tlv_posix.h"
|
||||
#include "btstack_tlv_windows.h"
|
||||
#include "classic/btstack_link_key_db_tlv.h"
|
||||
#include "hal_led.h"
|
||||
#include "hci.h"
|
||||
#include "hci_dump.h"
|
||||
#include "hci_dump_posix_fs.h"
|
||||
#include "hci_dump_windows_fs.h"
|
||||
#include "hci_transport.h"
|
||||
#include "hci_transport_usb.h"
|
||||
|
||||
@ -76,7 +76,7 @@ static btstack_packet_callback_registration_t hci_event_callback_registration;
|
||||
#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_tlv_windows_t tlv_context;
|
||||
static bd_addr_t local_addr;
|
||||
static bool shutdown_triggered;
|
||||
|
||||
@ -90,7 +90,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
||||
btstack_strcpy(tlv_db_path, sizeof(tlv_db_path), TLV_DB_PATH_PREFIX);
|
||||
btstack_strcat(tlv_db_path, sizeof(tlv_db_path), bd_addr_to_str_with_delimiter(local_addr, '-'));
|
||||
btstack_strcat(tlv_db_path, sizeof(tlv_db_path), TLV_DB_PATH_POSTFIX);
|
||||
tlv_impl = btstack_tlv_posix_init_instance(&tlv_context, tlv_db_path);
|
||||
tlv_impl = btstack_tlv_windows_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));
|
||||
@ -100,7 +100,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
||||
#endif
|
||||
break;
|
||||
case HCI_STATE_OFF:
|
||||
btstack_tlv_posix_deinit(&tlv_context);
|
||||
btstack_tlv_windows_deinit(&tlv_context);
|
||||
if (!shutdown_triggered) break;
|
||||
// reset stdin
|
||||
btstack_stdin_reset();
|
||||
@ -139,8 +139,8 @@ int main(int argc, const char * argv[]){
|
||||
|
||||
// log into file using HCI_DUMP_PACKETLOGGER format
|
||||
const char * pklg_path = "hci_dump.pklg";
|
||||
hci_dump_posix_fs_open(pklg_path, HCI_DUMP_PACKETLOGGER);
|
||||
const hci_dump_t * hci_dump_impl = hci_dump_posix_fs_get_instance();
|
||||
hci_dump_windows_fs_open(pklg_path, HCI_DUMP_PACKETLOGGER);
|
||||
const hci_dump_t * hci_dump_impl = hci_dump_windows_fs_get_instance();
|
||||
hci_dump_init(hci_dump_impl);
|
||||
printf("Packet Log: %s\n", pklg_path);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user