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

Commit 663ff0c1 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "eatt: Fix getting channel with the queue data to send"

parents 2baf98e3 e84baf9c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -175,7 +175,7 @@ bool EattExtension::IsOutstandingMsgInSendQueue(const RawAddress& bd_addr) {
  return pimpl_->eatt_impl_->is_outstanding_msg_in_send_queue(bd_addr);
}

EattChannel* EattExtension::GetChannelWithQueuedData(
EattChannel* EattExtension::GetChannelWithQueuedDataToSend(
    const RawAddress& bd_addr) {
  return pimpl_->eatt_impl_->get_channel_with_queued_data(bd_addr);
}
+2 −1
Original line number Diff line number Diff line
@@ -224,7 +224,8 @@ class EattExtension {
   *
   * @return pointer to EATT channel.
   */
  virtual EattChannel* GetChannelWithQueuedData(const RawAddress& bd_addr);
  virtual EattChannel* GetChannelWithQueuedDataToSend(
      const RawAddress& bd_addr);

  /**
   * Get EATT channel available to send GATT request.
+8 −2
Original line number Diff line number Diff line
@@ -706,7 +706,10 @@ struct eatt_impl {
    auto iter = find_if(
        eatt_dev->eatt_channels.begin(), eatt_dev->eatt_channels.end(),
        [](const std::pair<uint16_t, std::shared_ptr<EattChannel>>& el) {
          return !el.second->cl_cmd_q_.empty();
          if (el.second->cl_cmd_q_.empty()) return false;

          tGATT_CMD_Q& cmd = el.second->cl_cmd_q_.front();
          return cmd.to_send;
        });
    return (iter != eatt_dev->eatt_channels.end());
  }
@@ -718,7 +721,10 @@ struct eatt_impl {
    auto iter = find_if(
        eatt_dev->eatt_channels.begin(), eatt_dev->eatt_channels.end(),
        [](const std::pair<uint16_t, std::shared_ptr<EattChannel>>& el) {
          return !el.second->cl_cmd_q_.empty();
          if (el.second->cl_cmd_q_.empty()) return false;

          tGATT_CMD_Q& cmd = el.second->cl_cmd_q_.front();
          return cmd.to_send;
        });
    return (iter == eatt_dev->eatt_channels.end()) ? nullptr
                                                   : iter->second.get();
+2 −1
Original line number Diff line number Diff line
@@ -1138,7 +1138,8 @@ bool gatt_cl_send_next_cmd_inq(tGATT_TCB& tcb) {
      cl_cmd_q = &tcb.cl_cmd_q;
    } else {
      EattChannel* channel =
          EattExtension::GetInstance()->GetChannelWithQueuedData(tcb.peer_bda);
          EattExtension::GetInstance()->GetChannelWithQueuedDataToSend(
              tcb.peer_bda);
      cl_cmd_q = &channel->cl_cmd_q_;
    }

+2 −2
Original line number Diff line number Diff line
@@ -86,9 +86,9 @@ bool EattExtension::IsOutstandingMsgInSendQueue(const RawAddress& bd_addr) {
  return pimpl_->IsOutstandingMsgInSendQueue(bd_addr);
}

EattChannel* EattExtension::GetChannelWithQueuedData(
EattChannel* EattExtension::GetChannelWithQueuedDataToSend(
    const RawAddress& bd_addr) {
  return pimpl_->GetChannelWithQueuedData(bd_addr);
  return pimpl_->GetChannelWithQueuedDataToSend(bd_addr);
}

EattChannel* EattExtension::GetChannelAvailableForClientRequest(
Loading