diff --git a/src/messaging/ExchangeContext.cpp b/src/messaging/ExchangeContext.cpp index ce43b77dc599b9..b0aeac785b9beb 100644 --- a/src/messaging/ExchangeContext.cpp +++ b/src/messaging/ExchangeContext.cpp @@ -302,7 +302,6 @@ ExchangeContext::ExchangeContext(ExchangeManager * em, uint16_t ExchangeId, cons mFlags.Set(Flags::kFlagInitiator, Initiator); mDelegate = delegate; - SetDropAckDebug(false); SetAckPending(false); // Do not request Ack for multicast diff --git a/src/messaging/ReliableMessageContext.cpp b/src/messaging/ReliableMessageContext.cpp index ec4264d3742331..d2b47cf52dd64c 100644 --- a/src/messaging/ReliableMessageContext.cpp +++ b/src/messaging/ReliableMessageContext.cpp @@ -103,10 +103,6 @@ void ReliableMessageContext::HandleRcvdAck(uint32_t ackMessageCounter) CHIP_ERROR ReliableMessageContext::HandleNeedsAck(uint32_t messageCounter, BitFlags messageFlags) { - // Skip processing ack if drop ack debug is enabled. - if (ShouldDropAckDebug()) - return CHIP_NO_ERROR; - CHIP_ERROR err = HandleNeedsAckInner(messageCounter, messageFlags); // Schedule next physical wakeup on function exit diff --git a/src/messaging/ReliableMessageContext.h b/src/messaging/ReliableMessageContext.h index 804b358ea294cb..6ebc8227f87a4a 100644 --- a/src/messaging/ReliableMessageContext.h +++ b/src/messaging/ReliableMessageContext.h @@ -67,9 +67,9 @@ class ReliableMessageContext } /** - * Check whether we have an ack to piggyback on the message we are sending. - * If true, TakePendingPeerAckMessageCounter will return a valid value that - * should be included as an ack in the message. + * Check whether we have a mPendingPeerAckMessageCounter. The counter is + * valid once we receive a message which requests an ack. Once + * mPendingPeerAckMessageCounter is valid, it never stops being valid. */ bool HasPiggybackAckPending() const; @@ -102,26 +102,6 @@ class ReliableMessageContext */ void SetAutoRequestAck(bool autoReqAck); - /** - * Determine whether the ChipExchangeManager should not send an - * acknowledgement. - * - * For internal, debug use only. - */ - bool ShouldDropAckDebug() const; - - /** - * Set whether the ChipExchangeManager should not send acknowledgements - * for this context. - * - * For internal, debug use only. - * - * @param[in] inDropAckDebug A Boolean indicating whether (true) or not - * (false) the acknowledgements should be not - * sent for the exchange. - */ - void SetDropAckDebug(bool inDropAckDebug); - /** * Determine whether there is already an acknowledgment pending to be sent to the peer on this exchange. * @@ -159,29 +139,25 @@ class ReliableMessageContext /// When set, automatically request an acknowledgment whenever a message is sent via UDP. kFlagAutoRequestAck = (1u << 2), - /// Internal and debug only: when set, the exchange layer does not send an acknowledgment. - kFlagDropAckDebug = (1u << 3), - /// When set, signifies there is a message which hasn't been acknowledged. - kFlagMessageNotAcked = (1u << 4), + kFlagMessageNotAcked = (1u << 3), /// When set, signifies that there is an acknowledgment pending to be sent back. - kFlagAckPending = (1u << 5), + kFlagAckPending = (1u << 4), - /// When set, signifies that there has once been an acknowledgment - /// pending to be sent back. In that case, - /// mPendingPeerAckMessageCounter is a valid message counter value for - /// some message we have needed to acknowledge in the past. - kFlagAckMessageCounterIsValid = (1u << 6), + /// When set, signifies that mPendingPeerAckMessageCounter is valid. + /// The counter is valid once we receive a message which requests an ack. + /// Once mPendingPeerAckMessageCounter is valid, it never stops being valid. + kFlagAckMessageCounterIsValid = (1u << 5), /// When set, signifies that this exchange is waiting for a call to SendMessage. - kFlagWillSendMessage = (1u << 7), + kFlagWillSendMessage = (1u << 6), /// When set, we have had Close() or Abort() called on us already. - kFlagClosed = (1u << 8), + kFlagClosed = (1u << 7), /// When set, signifies that the exchange is requesting Sleepy End Device active mode. - kFlagActiveMode = (1u << 9), + kFlagActiveMode = (1u << 8), }; BitFlags mFlags; // Internal state flags @@ -228,11 +204,6 @@ inline bool ReliableMessageContext::IsMessageNotAcked() const return mFlags.Has(Flags::kFlagMessageNotAcked); } -inline bool ReliableMessageContext::ShouldDropAckDebug() const -{ - return mFlags.Has(Flags::kFlagDropAckDebug); -} - inline bool ReliableMessageContext::HasPiggybackAckPending() const { return mFlags.Has(Flags::kFlagAckMessageCounterIsValid); @@ -253,11 +224,6 @@ inline void ReliableMessageContext::SetAckPending(bool inAckPending) mFlags.Set(Flags::kFlagAckPending, inAckPending); } -inline void ReliableMessageContext::SetDropAckDebug(bool inDropAckDebug) -{ - mFlags.Set(Flags::kFlagDropAckDebug, inDropAckDebug); -} - inline void ReliableMessageContext::SetMessageNotAcked(bool messageNotAcked) { mFlags.Set(Flags::kFlagMessageNotAcked, messageNotAcked);