OSDN Git Service

Create stack/include/ble_hci_link_interface
authorChris Manton <cmanton@google.com>
Thu, 27 Aug 2020 00:53:57 +0000 (17:53 -0700)
committerChris Manton <cmanton@google.com>
Sat, 29 Aug 2020 01:21:46 +0000 (18:21 -0700)
Towards proper interfaces

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I99a8e02fa0f6448245271aa722f92b0943fd6849

stack/btm/btm_ble_int.h
stack/btu/btu_hcif.cc
stack/include/ble_hci_link_interface.h [new file with mode: 0644]

index a108807..05363cd 100644 (file)
@@ -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);
 
index 111eb15..93513ae 100644 (file)
@@ -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 (file)
index 0000000..f605dde
--- /dev/null
@@ -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);