From a6ca6916c23f312f4e3f234e1ab3d06fef8e4074 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Tue, 23 Mar 2021 12:15:14 -0500 Subject: [PATCH] Fix compile error when ENABLE_LE_CENTRAL is not set This fixes the following errors: ../../lib/btstack/src/ble/sm.c: In function 'sm_pdu_handler': ../../lib/btstack/src/ble/sm.c:3823:13: error: unused variable 'ltk' [-Werror=unused-variable] 3823 | uint8_t ltk[16]; | ^~~ ../../lib/btstack/src/ble/sm.c:3822:9: error: unused variable 'have_ltk' [-Werror=unused-variable] 3822 | int have_ltk; | ^~~~~~~~ --- src/ble/sm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ble/sm.c b/src/ble/sm.c index 6a16b8467..546e04c69 100644 --- a/src/ble/sm.c +++ b/src/ble/sm.c @@ -3819,8 +3819,10 @@ static void sm_pdu_handler(uint8_t packet_type, hci_con_handle_t con_handle, uin return; } +#ifdef ENABLE_LE_CENTRAL int have_ltk; uint8_t ltk[16]; +#endif switch (sm_conn->sm_engine_state){