[message] remove child mask from message metadata in MTD (#9213)

Saves a few bytes in MTD message metadata since they don't need the
child mask.
This commit is contained in:
Lorenzo Rai
2023-06-28 07:42:27 -07:00
committed by GitHub
parent 52e157b17b
commit d91ecc5cdd
3 changed files with 10 additions and 0 deletions
+2
View File
@@ -785,6 +785,7 @@ exit:
return messageCopy;
}
#if OPENTHREAD_FTD
bool Message::GetChildMask(uint16_t aChildIndex) const { return GetMetadata().mChildMask.Get(aChildIndex); }
void Message::ClearChildMask(uint16_t aChildIndex) { GetMetadata().mChildMask.Set(aChildIndex, false); }
@@ -792,6 +793,7 @@ void Message::ClearChildMask(uint16_t aChildIndex) { GetMetadata().mChildMask.Se
void Message::SetChildMask(uint16_t aChildIndex) { GetMetadata().mChildMask.Set(aChildIndex, true); }
bool Message::IsChildPending(void) const { return GetMetadata().mChildMask.HasAny(); }
#endif
void Message::SetLinkInfo(const ThreadLinkInfo &aLinkInfo)
{
+4
View File
@@ -203,7 +203,9 @@ protected:
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
LqiAverager mLqiAverager; // The averager maintaining the Link quality indicator (LQI) average.
#endif
#if OPENTHREAD_FTD
ChildMask mChildMask; // ChildMask to indicate which sleepy children need to receive this.
#endif
uint8_t mType : 3; // The message type.
uint8_t mSubType : 4; // The message sub type.
@@ -940,6 +942,7 @@ public:
*/
void SetDatagramTag(uint32_t aTag) { GetMetadata().mDatagramTag = aTag; }
#if OPENTHREAD_FTD
/**
* Returns whether or not the message forwarding is scheduled for the child.
*
@@ -975,6 +978,7 @@ public:
*
*/
bool IsChildPending(void) const;
#endif // OPENTHREAD_FTD
/**
* Returns the RLOC16 of the mesh destination.
+4
View File
@@ -1268,7 +1268,11 @@ exit:
void MeshForwarder::RemoveMessageIfNoPendingTx(Message &aMessage)
{
#if OPENTHREAD_FTD
VerifyOrExit(!aMessage.IsDirectTransmission() && !aMessage.IsChildPending());
#else
VerifyOrExit(!aMessage.IsDirectTransmission());
#endif
if (mSendMessage == &aMessage)
{