From a73588f0fecfd843352abc2f18ee418793566c4d Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 18 Dec 2024 12:20:44 +0100 Subject: [PATCH] hci: add hci_get_stack for testing --- src/hci.c | 6 ++++++ src/hci.h | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/src/hci.c b/src/hci.c index 4b73e40d4..8fbfaa631 100644 --- a/src/hci.c +++ b/src/hci.c @@ -10948,4 +10948,10 @@ void hci_simulate_working_fuzz(void){ hci_init_done(); hci_stack->num_cmd_packets = 255; } + +// get hci struct +hci_stack_t * hci_get_stack() { + return hci_stack; +} + #endif diff --git a/src/hci.h b/src/hci.h index f33e6644c..1d4ce490b 100644 --- a/src/hci.h +++ b/src/hci.h @@ -1881,6 +1881,7 @@ uint8_t hci_dedicated_bonding_defer_disconnect(hci_con_handle_t con_handle, bool // Disable automatic L2CAP disconnect if no L2CAP connection is established void hci_disable_l2cap_timeout_check(void); +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION // setup test connections, used for fuzzing void hci_setup_test_connections_fuzz(void); @@ -1890,6 +1891,10 @@ void hci_free_connections_fuzz(void); // simulate stack bootup void hci_simulate_working_fuzz(void); +// get hci struct +hci_stack_t * hci_get_stack(); + +#endif #if defined __cplusplus }