diff --git a/src/gap.h b/src/gap.h index 16abd06dc..40846060b 100644 --- a/src/gap.h +++ b/src/gap.h @@ -44,7 +44,10 @@ extern "C" { #include "btstack_defines.h" #include "btstack_util.h" + +#ifdef ENABLE_CLASSIC #include "classic/btstack_link_key_db.h" +#endif typedef enum { @@ -117,6 +120,19 @@ typedef enum { // Classic + LE +/** + * @brief Read RSSI + * @param con_handle + * @events: GAP_EVENT_RSSI_MEASUREMENT + */ +int gap_read_rssi(hci_con_handle_t con_handle); + + +/** + * @brief Gets local address. + */ +void gap_local_bd_addr(bd_addr_t address_buffer); + /** * @brief Disconnect connection with handle * @param handle @@ -574,6 +590,7 @@ authorization_state_t gap_authorization_state(hci_con_handle_t con_handle); bool gap_bonded(hci_con_handle_t con_handle); // Classic +#ifdef ENABLE_CLASSIC /** * @brief Override page scan mode. Page scan mode enabled by l2cap when services are registered @@ -587,11 +604,6 @@ void gap_connectable_control(uint8_t enable); */ void gap_discoverable_control(uint8_t enable); -/** - * @brief Gets local address. - */ -void gap_local_bd_addr(bd_addr_t address_buffer); - /** * @brief Deletes link key for remote device with baseband address. * @param addr @@ -685,13 +697,6 @@ int gap_inquiry_stop(void); */ int gap_remote_name_request(const bd_addr_t addr, uint8_t page_scan_repetition_mode, uint16_t clock_offset); -/** - * @brief Read RSSI - * @param con_handle - * @events: GAP_EVENT_RSSI_MEASUREMENT - */ -int gap_read_rssi(hci_con_handle_t con_handle); - /** * @brief Legacy Pairing Pin Code Response * @note data is not copied, pointer has to stay valid @@ -823,6 +828,8 @@ uint8_t gap_sniff_subrating_configure(hci_con_handle_t con_handle, uint16_t max_ */ uint8_t gap_qos_set(hci_con_handle_t con_handle, hci_service_type_t service_type, uint32_t token_rate, uint32_t peak_bandwidth, uint32_t latency, uint32_t delay_variation); +#endif + // LE /** diff --git a/src/hci.c b/src/hci.c index eabd2c363..a87ad8c0d 100644 --- a/src/hci.c +++ b/src/hci.c @@ -3302,11 +3302,14 @@ void hci_set_control(const btstack_control_t *hardware_control){ } void hci_close(void){ + +#ifdef ENABLE_CLASSIC // close remote device db if (hci_stack->link_key_db) { hci_stack->link_key_db->close(); } - +#endif + btstack_linked_list_iterator_t lit; btstack_linked_list_iterator_init(&lit, &hci_stack->connections); while (btstack_linked_list_iterator_has_next(&lit)){ diff --git a/src/hci.h b/src/hci.h index 5b9acbb21..d1bb34b9b 100644 --- a/src/hci.h +++ b/src/hci.h @@ -801,8 +801,10 @@ typedef struct { // hardware power controller const btstack_control_t * control; +#ifdef ENABLE_CLASSIC /* link key db */ const btstack_link_key_db_t * link_key_db; +#endif // list of existing baseband connections btstack_linked_list_t connections; @@ -1073,10 +1075,12 @@ void hci_set_control(const btstack_control_t *hardware_control); void hci_set_sco_transport(const btstack_sco_transport_t *sco_transport); #endif +#ifdef ENABLE_CLASSIC /** * @brief Configure Bluetooth hardware control. Has to be called before power on. */ void hci_set_link_key_db(btstack_link_key_db_t const * link_key_db); +#endif /** * @brief Set callback for Bluetooth Hardware Error