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

Commit 079e122b authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

Minor improvements in LE Create Connection handling

1. According to spec, controller should never send "Command Complete" event
after "LE Create Connection" or "LE Extened Create Connection" command.
Add error message in such case.

2. Parse Comand Status for LE Enhanced Create Connection.

3. Fix NPE in btm_ble_update_mode_operation, when called from
btm_ble_create_ll_conn_complete.

Test: Bond/unbond with few LE devices while connected.
Change-Id: Ic135d9a8d096634afe33997afb42d054237598c2
parent 1fc5965e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2569,7 +2569,7 @@ void btm_ble_update_mode_operation(uint8_t link_role, const RawAddress* bd_addr,

  /* in case of disconnected, we must cancel bgconn and restart
     in order to add back device to white list in order to reconnect */
  btm_ble_bgconn_cancel_if_disconnected(*bd_addr);
  if (bd_addr) btm_ble_bgconn_cancel_if_disconnected(*bd_addr);

  /* when no connection is attempted, and controller is not rejecting last
     request
+4 −1
Original line number Diff line number Diff line
@@ -968,7 +968,9 @@ static void btu_hcif_hdl_command_complete(uint16_t opcode, uint8_t* p,
      break;

    case HCI_BLE_CREATE_LL_CONN:
      btm_ble_create_ll_conn_complete(*p);
    case HCI_LE_EXTENDED_CREATE_CONNECTION:
      // No command complete event for those commands according to spec
      LOG(ERROR) << "No command complete expected, but received!";
      break;

    case HCI_BLE_TRANSMITTER_TEST:
@@ -1143,6 +1145,7 @@ static void btu_hcif_hdl_command_status(uint16_t opcode, uint8_t status,
            break;

          case HCI_BLE_CREATE_LL_CONN:
          case HCI_LE_EXTENDED_CREATE_CONNECTION:
            btm_ble_create_ll_conn_complete(status);
            break;