From 648c5bb5a086518bba66ffd6eca9fa6fd8383fa9 Mon Sep 17 00:00:00 2001 From: Chris Manton Date: Wed, 26 Aug 2020 17:53:57 -0700 Subject: [PATCH] Create stack/include/ble_hci_link_interface Towards proper interfaces Bug: 163134718 Tag: #refactor Test: compile & verify basic functions working Change-Id: I99a8e02fa0f6448245271aa722f92b0943fd6849 --- stack/btm/btm_ble_int.h | 6 ------ stack/btu/btu_hcif.cc | 2 +- stack/include/ble_hci_link_interface.h | 29 +++++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 stack/include/ble_hci_link_interface.h diff --git a/stack/btm/btm_ble_int.h b/stack/btm/btm_ble_int.h index a10880735..05363cd7e 100644 --- a/stack/btm/btm_ble_int.h +++ b/stack/btm/btm_ble_int.h @@ -37,9 +37,6 @@ extern bool ble_evt_type_is_connectable(uint16_t evt_type); extern void btm_ble_refresh_raddr_timer_timeout(void* data); -extern void btm_ble_process_adv_pkt(uint8_t len, uint8_t* p); -extern void btm_ble_process_phy_update_pkt(uint8_t len, uint8_t* p); -extern void btm_ble_process_ext_adv_pkt(uint8_t len, uint8_t* p); extern tBTM_STATUS btm_ble_read_remote_name(const RawAddress& remote_bda, tBTM_CMPL_CB* p_cb); extern bool btm_ble_cancel_remote_name(const RawAddress& remote_bda); @@ -61,13 +58,10 @@ extern void btm_ble_init(void); extern void btm_ble_connected(const RawAddress& bda, uint16_t handle, uint8_t enc_mode, uint8_t role, tBLE_ADDR_TYPE addr_type, bool addr_matched); -extern void btm_ble_read_remote_features_complete(uint8_t* p); extern void btm_ble_write_adv_enable_complete(uint8_t* p); -extern void btm_ble_conn_complete(uint8_t* p, uint16_t evt_len, bool enhanced); extern tBTM_BLE_CONN_ST btm_ble_get_conn_st(void); extern tBTM_STATUS btm_ble_start_adv(void); extern tBTM_STATUS btm_ble_stop_adv(void); -extern void btm_le_on_advertising_set_terminated(uint8_t* p, uint16_t length); extern tBTM_STATUS btm_ble_start_scan(void); extern void btm_ble_create_ll_conn_complete(uint8_t status); diff --git a/stack/btu/btu_hcif.cc b/stack/btu/btu_hcif.cc index 111eb151b..93513aeb4 100644 --- a/stack/btu/btu_hcif.cc +++ b/stack/btu/btu_hcif.cc @@ -35,9 +35,9 @@ #include "common/metrics.h" #include "device/include/controller.h" #include "osi/include/log.h" -#include "stack/btm/btm_ble_int.h" #include "stack/btm/btm_int.h" #include "stack/include/acl_hci_link_interface.h" +#include "stack/include/ble_hci_link_interface.h" #include "stack/include/btm_iso_api.h" #include "stack/include/btu.h" #include "stack/include/hci_evt_length.h" diff --git a/stack/include/ble_hci_link_interface.h b/stack/include/ble_hci_link_interface.h new file mode 100644 index 000000000..f605dded8 --- /dev/null +++ b/stack/include/ble_hci_link_interface.h @@ -0,0 +1,29 @@ +/* + * Copyright 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#pragma once + +#include "bt_common.h" + +// This header contains functions for HCI-ble to invoke +void btm_ble_conn_complete(uint8_t* p, UNUSED_ATTR uint16_t evt_len, + bool enhanced); +void btm_ble_process_adv_pkt(uint8_t len, uint8_t* p); +void btm_ble_process_ext_adv_pkt(uint8_t len, uint8_t* p); +void btm_ble_process_phy_update_pkt(uint8_t len, uint8_t* p); +void btm_ble_read_remote_features_complete(uint8_t* p); +void btm_le_on_advertising_set_terminated(uint8_t* p, uint16_t length); -- 2.11.0