From b3264428f7d07eb51a100b045d535f2773170716 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 26 Apr 2017 15:38:12 +0200 Subject: [PATCH] ble: fix compile ifndef ENABLE_CLASSIC --- src/hci.c | 4 ++++ src/l2cap.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/hci.c b/src/hci.c index d2a4625cb..406c1eafb 100644 --- a/src/hci.c +++ b/src/hci.c @@ -790,8 +790,10 @@ static void acl_handler(uint8_t *packet, int size){ static void hci_shutdown_connection(hci_connection_t *conn){ log_info("Connection closed: handle 0x%x, %s", conn->con_handle, bd_addr_to_str(conn->address)); +#ifdef ENABLE_CLASSIC #ifdef ENABLE_SCO_OVER_HCI int addr_type = conn->address_type; +#endif #endif btstack_run_loop_remove_timer(&conn->timeout); @@ -802,12 +804,14 @@ static void hci_shutdown_connection(hci_connection_t *conn){ // now it's gone hci_emit_nr_connections_changed(); +#ifdef ENABLE_CLASSIC #ifdef ENABLE_SCO_OVER_HCI // update SCO if (addr_type == BD_ADDR_TYPE_SCO && hci_stack->hci_transport && hci_stack->hci_transport->set_sco_config){ hci_stack->hci_transport->set_sco_config(hci_stack->sco_voice_setting_active, hci_number_sco_connections()); } #endif +#endif } #ifdef ENABLE_CLASSIC diff --git a/src/l2cap.c b/src/l2cap.c index 8320b803a..26f6fa3c0 100644 --- a/src/l2cap.c +++ b/src/l2cap.c @@ -569,9 +569,11 @@ static void l2cap_run(void){ uint8_t sig_id = signaling_responses[0].sig_id; uint8_t response_code = signaling_responses[0].code; - uint16_t source_cid = signaling_responses[0].cid; // CONNECTION_REQUEST uint16_t infoType = signaling_responses[0].data; // INFORMATION_REQUEST uint16_t result = signaling_responses[0].data; // CONNECTION_REQUEST, COMMAND_REJECT +#ifdef ENABLE_CLASSIC + uint16_t source_cid = signaling_responses[0].cid; // CONNECTION_REQUEST +#endif UNUSED(infoType); // remove first item before sending (to avoid sending response mutliple times)