Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d2ab73a3 authored by Chris Manton's avatar Chris Manton
Browse files

Enforce internal linkage stack/btm/btm_ble_bgconn

Towards readable code

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I7e87665aa40fbd32f1add3120edd17cc2be7f963
parent 5d23d9ff
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -43,7 +43,9 @@ extern void btm_send_hci_create_connection(
    uint16_t conn_timeout, uint16_t min_ce_len, uint16_t max_ce_len,
    uint8_t phy);
extern void btm_ble_create_conn_cancel();
void wl_remove_complete(uint8_t* p_data, uint16_t /* evt_len */);

static bool btm_ble_stop_auto_conn();
static void wl_remove_complete(uint8_t* p_data, uint16_t /* evt_len */);

// Unfortunately (for now?) we have to maintain a copy of the device whitelist
// on the host to determine if a device is pending to be connected or not. This
@@ -203,7 +205,7 @@ bool BTM_BackgroundConnectAddressKnown(const RawAddress& address) {
 *
 * Description      This function load the device into controller white list
 ******************************************************************************/
bool btm_add_dev_to_controller(bool to_add, const RawAddress& bd_addr) {
static bool btm_add_dev_to_controller(bool to_add, const RawAddress& bd_addr) {
  tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr);

  if (p_dev_rec != NULL && p_dev_rec->device_type & BT_DEVICE_TYPE_BLE) {
@@ -250,14 +252,14 @@ bool btm_add_dev_to_controller(bool to_add, const RawAddress& bd_addr) {
}

/** White list add complete */
void wl_add_complete(uint8_t* p_data, uint16_t /* evt_len */) {
static void wl_add_complete(uint8_t* p_data, uint16_t /* evt_len */) {
  uint8_t status;
  STREAM_TO_UINT8(status, p_data);
  VLOG(2) << __func__ << ": status=" << loghex(status);
}

/** White list element remove complete */
void wl_remove_complete(uint8_t* p_data, uint16_t /* evt_len */) {
static void wl_remove_complete(uint8_t* p_data, uint16_t /* evt_len */) {
  uint8_t status;
  STREAM_TO_UINT8(status, p_data);
  VLOG(2) << __func__ << ": status=" << loghex(status);
@@ -270,7 +272,7 @@ void wl_remove_complete(uint8_t* p_data, uint16_t /* evt_len */) {
 * Description      execute the pending whitelist device operation (loading or
 *                                                                  removing)
 ******************************************************************************/
bool btm_execute_wl_dev_operation(void) {
static bool btm_execute_wl_dev_operation(void) {
  // handle removals first to avoid filling up controller's white list
  for (auto map_it = background_connections.begin();
       map_it != background_connections.end();) {
@@ -352,7 +354,7 @@ void BTM_SetLeConnectionModeToSlow() {
}

/** This function is to start auto connection procedure */
bool btm_ble_start_auto_conn() {
static bool btm_ble_start_auto_conn() {
  tBTM_BLE_CB* p_cb = &btm_cb.ble_ctr_cb;

  BTM_TRACE_EVENT("%s", __func__);
@@ -409,7 +411,7 @@ bool btm_ble_start_auto_conn() {
}

/** This function is to stop auto connection procedure */
bool btm_ble_stop_auto_conn() {
static bool btm_ble_stop_auto_conn() {
  BTM_TRACE_EVENT("%s", __func__);

  if (!btm_cb.ble_ctr_cb.is_connection_state_connecting()) {
+0 −3
Original line number Diff line number Diff line
@@ -115,12 +115,9 @@ extern void btm_ble_white_list_init(uint8_t white_list_size);
/* background connection function */
extern bool btm_ble_suspend_bg_conn(void);
extern bool btm_ble_resume_bg_conn(void);
extern bool btm_ble_start_auto_conn();
extern bool btm_ble_stop_auto_conn();
extern void btm_ble_update_mode_operation(uint8_t link_role,
                                          const RawAddress* bda,
                                          uint8_t status);
extern bool btm_execute_wl_dev_operation(void);
extern void btm_ble_update_link_topology_mask(uint8_t role, bool increase);
extern void btm_ble_bgconn_cancel_if_disconnected(const RawAddress& bd_addr);