Skip to content

Commit

Permalink
ExchageContext: remove unused flag (#17661)
Browse files Browse the repository at this point in the history
  • Loading branch information
kghost authored and pull[bot] committed Sep 21, 2023
1 parent 0228453 commit 9715251
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 42 deletions.
1 change: 0 additions & 1 deletion src/messaging/ExchangeContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@ ExchangeContext::ExchangeContext(ExchangeManager * em, uint16_t ExchangeId, cons

SetDropAckDebug(false);
SetAckPending(false);
SetMsgRcvdFromPeer(false);

// Do not request Ack for multicast
SetAutoRequestAck(!session->IsGroupSession());
Expand Down
7 changes: 0 additions & 7 deletions src/messaging/ExchangeMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,6 @@ void ExchangeManager::OnMessageReceived(const PacketHeader & packetHeader, const
mContextPool.ForEachActiveObject([&](auto * ec) {
if (ec->MatchExchange(session, packetHeader, payloadHeader))
{
// Found a matching exchange. Set flag for correct subsequent MRP
// retransmission timeout selection.
if (!ec->HasRcvdMsgFromPeer())
{
ec->SetMsgRcvdFromPeer(true);
}

ChipLogDetail(ExchangeManager, "Found matching exchange: " ChipLogFormatExchange ", Delegate: %p",
ChipLogValueExchange(ec), ec->GetDelegate());

Expand Down
37 changes: 3 additions & 34 deletions src/messaging/ReliableMessageContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,24 +129,6 @@ class ReliableMessageContext
*/
bool IsAckPending() const;

/**
* Determine whether at least one message has been received
* on this exchange from peer.
*
* @return Returns 'true' if message received, else 'false'.
*/
bool HasRcvdMsgFromPeer() const;

/**
* Set if a message has been received from the peer
* on this exchange.
*
* @param[in] inMsgRcvdFromPeer A Boolean indicating whether (true) or not
* (false) a message has been received
* from the peer on this exchange context.
*/
void SetMsgRcvdFromPeer(bool inMsgRcvdFromPeer);

/// Determine whether there is message hasn't been acknowledged.
bool IsMessageNotAcked() const;

Expand Down Expand Up @@ -192,17 +174,14 @@ class ReliableMessageContext
/// some message we have needed to acknowledge in the past.
kFlagAckMessageCounterIsValid = (1u << 6),

/// When set, signifies that at least one message has been received from peer on this exchange context.
kFlagMsgRcvdFromPeer = (1u << 7),

/// When set, signifies that this exchange is waiting for a call to SendMessage.
kFlagWillSendMessage = (1u << 8),
kFlagWillSendMessage = (1u << 7),

/// When set, we have had Close() or Abort() called on us already.
kFlagClosed = (1u << 9),
kFlagClosed = (1u << 8),

/// When set, signifies that the exchange is requesting Sleepy End Device fast-polling mode.
kFlagFastPollingMode = (1u << 10),
kFlagFastPollingMode = (1u << 9),
};

BitFlags<Flags> mFlags; // Internal state flags
Expand Down Expand Up @@ -244,11 +223,6 @@ inline bool ReliableMessageContext::IsAckPending() const
return mFlags.Has(Flags::kFlagAckPending);
}

inline bool ReliableMessageContext::HasRcvdMsgFromPeer() const
{
return mFlags.Has(Flags::kFlagMsgRcvdFromPeer);
}

inline bool ReliableMessageContext::IsMessageNotAcked() const
{
return mFlags.Has(Flags::kFlagMessageNotAcked);
Expand All @@ -274,11 +248,6 @@ inline void ReliableMessageContext::SetAutoRequestAck(bool autoReqAck)
mFlags.Set(Flags::kFlagAutoRequestAck, autoReqAck);
}

inline void ReliableMessageContext::SetMsgRcvdFromPeer(bool inMsgRcvdFromPeer)
{
mFlags.Set(Flags::kFlagMsgRcvdFromPeer, inMsgRcvdFromPeer);
}

inline void ReliableMessageContext::SetAckPending(bool inAckPending)
{
mFlags.Set(Flags::kFlagAckPending, inAckPending);
Expand Down

0 comments on commit 9715251

Please sign in to comment.