From 5f4e6cade716a05169922979a027f244d2b10137 Mon Sep 17 00:00:00 2001 From: Chris Manton Date: Thu, 17 Sep 2020 17:11:20 -0700 Subject: [PATCH] Use correct typed values BTM_BLE BTM_BLE_CONNECT_EVT == BTM_BLE_ADV_IND_EVT == 0 btm_cb.ble_ctr_cb.inq_var.directed_conn Towards readable code Bug: 163134718 Tag: #refactor Test: compile & verify basic functions working Change-Id: I88ee710608613a840e0347e9b7dcd9e3ede667f5 --- stack/btm/btm_ble.cc | 2 +- stack/btm/btm_ble_gap.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/stack/btm/btm_ble.cc b/stack/btm/btm_ble.cc index 60cf59db6..8c8aa19a9 100644 --- a/stack/btm/btm_ble.cc +++ b/stack/btm/btm_ble.cc @@ -1751,7 +1751,7 @@ void btm_ble_connected(const RawAddress& bda, uint16_t handle, uint8_t enc_mode, if (!addr_matched && p_dev_rec->ble.ble_addr_type == BLE_ADDR_RANDOM) { p_dev_rec->ble.cur_rand_addr = bda; } - btm_cb.ble_ctr_cb.inq_var.directed_conn = BTM_BLE_CONNECT_EVT; + btm_cb.ble_ctr_cb.inq_var.directed_conn = BTM_BLE_ADV_IND_EVT; } void btm_ble_connected_from_address_with_type( diff --git a/stack/btm/btm_ble_gap.cc b/stack/btm/btm_ble_gap.cc index 61fdf579f..34e0c37f6 100644 --- a/stack/btm/btm_ble_gap.cc +++ b/stack/btm/btm_ble_gap.cc @@ -2304,7 +2304,7 @@ static void btm_ble_update_link_topology_mask(uint8_t link_role, if (link_role == HCI_ROLE_SLAVE && increase) { btm_cb.ble_ctr_cb.inq_var.adv_mode = BTM_BLE_ADV_DISABLE; /* make device fall back into undirected adv mode by default */ - btm_cb.ble_ctr_cb.inq_var.directed_conn = BTM_BLE_CONNECT_EVT; + btm_cb.ble_ctr_cb.inq_var.directed_conn = BTM_BLE_ADV_IND_EVT; /* clear all adv states */ btm_ble_clear_topology_mask(BTM_BLE_STATE_ALL_ADV_MASK); } @@ -2333,7 +2333,7 @@ void btm_ble_update_mode_operation(uint8_t link_role, const RawAddress* bd_addr, if (status == HCI_ERR_ADVERTISING_TIMEOUT) { btm_cb.ble_ctr_cb.inq_var.adv_mode = BTM_BLE_ADV_DISABLE; /* make device fall back into undirected adv mode by default */ - btm_cb.ble_ctr_cb.inq_var.directed_conn = BTM_BLE_CONNECT_EVT; + btm_cb.ble_ctr_cb.inq_var.directed_conn = BTM_BLE_ADV_IND_EVT; /* clear all adv states */ btm_ble_clear_topology_mask(BTM_BLE_STATE_ALL_ADV_MASK); } -- 2.11.0