From aa83ca2ab1f72b047d3f277fed59d8b4fa3708a3 Mon Sep 17 00:00:00 2001 From: Chris Manton Date: Thu, 27 Aug 2020 09:44:19 -0700 Subject: [PATCH] Add API stack/btm/btm_ble::btm_ble_connected_from_address_with_type Towards readable code Bug: 163134718 Tag: #refactor Test: compile & verify basic functions working Change-Id: I829bd8c510a41a2d56faeacb91a4478d4f0e4ce9 --- stack/btm/btm_ble.cc | 7 +++++++ stack/btm/btm_ble_int.h | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/stack/btm/btm_ble.cc b/stack/btm/btm_ble.cc index 93216e9dc..4fdd3496a 100644 --- a/stack/btm/btm_ble.cc +++ b/stack/btm/btm_ble.cc @@ -1758,6 +1758,13 @@ void btm_ble_connected(const RawAddress& bda, uint16_t handle, uint8_t enc_mode, btm_cb.ble_ctr_cb.inq_var.directed_conn = BTM_BLE_CONNECT_EVT; } +void btm_ble_connected_from_address_with_type( + const tBLE_BD_ADDR& address_with_type, uint16_t handle, uint8_t enc_mode, + uint8_t role, bool addr_matched) { + btm_ble_connected(address_with_type.bda, handle, enc_mode, role, + address_with_type.type, addr_matched); +} + /***************************************************************************** * Function btm_proc_smp_cback * diff --git a/stack/btm/btm_ble_int.h b/stack/btm/btm_ble_int.h index 05363cd7e..91dddc926 100644 --- a/stack/btm/btm_ble_int.h +++ b/stack/btm/btm_ble_int.h @@ -58,6 +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_connected_from_address_with_type( + const tBLE_BD_ADDR& address_with_type, uint16_t handle, uint8_t enc_mode, + uint8_t role, bool addr_matched); + extern void btm_ble_write_adv_enable_complete(uint8_t* p); extern tBTM_BLE_CONN_ST btm_ble_get_conn_st(void); extern tBTM_STATUS btm_ble_start_adv(void); -- 2.11.0