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

Commit 13006bdb authored by Hansong Zhang's avatar Hansong Zhang
Browse files

L2CAP Allow updating ERTM config and FCS

Bug: 144770885
Test: run_cert.sh
Change-Id: I34e0deb7b30d0c0c65bdc3c8f91fd74ab6ecde06
parent a90bd92d
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -102,21 +102,17 @@ void DynamicChannelImpl::SetSender(l2cap::internal::Sender* sender) {
  sender_ = sender;
}

Mtu DynamicChannelImpl::GetIncomingMtu() const {
  return incoming_mtu_;
}

void DynamicChannelImpl::SetIncomingMtu(Mtu mtu) {
  incoming_mtu_ = mtu;
  sender_->SetIncomingMtu(mtu);
}

void DynamicChannelImpl::SetRetransmissionFlowControlConfig(
    const RetransmissionAndFlowControlConfigurationOption& option) {
  sender_->SetChannelRetransmissionFlowControlMode(option.mode_);
  sender_->SetChannelRetransmissionFlowControlMode(option);
}

void DynamicChannelImpl::SetFcsType(FcsType fcs_type) {
  fcs_type_ = fcs_type;
  sender_->SetFcsType(fcs_type);
}

}  // namespace internal
+0 −4
Original line number Diff line number Diff line
@@ -82,7 +82,6 @@ class DynamicChannelImpl : public l2cap::internal::ChannelImpl {
   */
  void SetSender(l2cap::internal::Sender* sender) override;

  virtual Mtu GetIncomingMtu() const;
  virtual void SetIncomingMtu(Mtu mtu);

  virtual void SetRetransmissionFlowControlConfig(const RetransmissionAndFlowControlConfigurationOption& mode);
@@ -114,9 +113,6 @@ class DynamicChannelImpl : public l2cap::internal::ChannelImpl {
  ConfigurationStatus incoming_configuration_status_ = ConfigurationStatus::NOT_CONFIGURED;

  l2cap::internal::Sender* sender_ = nullptr;
  Mtu incoming_mtu_ = kDefaultClassicMtu;
  // TODO: Add all RetransmissionAndFlowControlConfigurationOptions
  FcsType fcs_type_ = FcsType::DEFAULT;

  DISALLOW_COPY_AND_ASSIGN(DynamicChannelImpl);
};
+0 −1
Original line number Diff line number Diff line
@@ -310,7 +310,6 @@ void ClassicSignallingManager::OnConfigurationResponse(SignalId signal_id, Cid c
    return;
  }

  RetransmissionAndFlowControlConfigurationOption rfc_option;
  channel->SetOutgoingConfigurationStatus(DynamicChannelImpl::ConfigurationStatus::CONFIGURED);
  if (channel->GetIncomingConfigurationStatus() == DynamicChannelImpl::ConfigurationStatus::CONFIGURED) {
    std::unique_ptr<DynamicChannel> user_channel = std::make_unique<DynamicChannel>(channel, handler_);
+3 −0
Original line number Diff line number Diff line
@@ -50,6 +50,9 @@ class BasicModeDataController : public DataController {

  std::unique_ptr<BasicFrameBuilder> GetNextPacket() override;

  void EnableFcs(bool enabled) override {}
  void SetRetransmissionAndFlowControlOptions(const RetransmissionAndFlowControlConfigurationOption& option) override {}

 private:
  Cid cid_;
  Cid remote_cid_;
+8 −0
Original line number Diff line number Diff line
@@ -38,6 +38,14 @@ class DataController {

  // Used by Scheduler to get next PDU
  virtual std::unique_ptr<BasicFrameBuilder> GetNextPacket() = 0;

  // Set FCS mode. This only applies to some modes (ERTM).
  virtual void EnableFcs(bool enabled) = 0;

  // Set retransmission and flow control. Ignore the mode option because each DataController only handles one mode.
  // This only applies to some modes (ERTM).
  virtual void SetRetransmissionAndFlowControlOptions(
      const RetransmissionAndFlowControlConfigurationOption& option) = 0;
};

}  // namespace internal
Loading