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

Commit 80625aaa authored by Chris Manton's avatar Chris Manton
Browse files

Expand clever stack/btm/btm_ble_gap::btm_set_conn_mode_adv_init_addr

Towards readable code

Bug: 163134718
Tag: #refactor
Test: acts -tc BleCocTest
Test: ble paired 2 phones

Change-Id: Ibf79e13860f728277f6377db91a4865881b3a048
parent 22b4f2b6
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -673,10 +673,15 @@ static uint8_t btm_set_conn_mode_adv_init_addr(
  uint8_t evt_type;
  tBTM_SEC_DEV_REC* p_dev_rec;

  evt_type =
      (p_cb->connectable_mode == BTM_BLE_NON_CONNECTABLE)
          ? ((p_cb->scan_rsp) ? BTM_BLE_DISCOVER_EVT : BTM_BLE_NON_CONNECT_EVT)
          : BTM_BLE_CONNECT_EVT;
  if (p_cb->connectable_mode == BTM_BLE_NON_CONNECTABLE) {
    if (p_cb->scan_rsp) {
      evt_type = BTM_BLE_DISCOVER_EVT;
    } else {
      evt_type = BTM_BLE_NON_CONNECT_EVT;
    }
  } else {
    evt_type = BTM_BLE_CONNECT_EVT;
  }

  if (evt_type == BTM_BLE_CONNECT_EVT) {
    evt_type = p_cb->directed_conn;