From cc6fa77b4275b1a638d0cce1b096715a4fea7e09 Mon Sep 17 00:00:00 2001 From: Eduardo Montoya Date: Wed, 5 Jul 2023 19:02:11 +0200 Subject: [PATCH] [mac] remove duplicated method for getting the MAC frame length (#9254) --- src/core/mac/mac_frame.cpp | 2 +- src/core/mac/mac_frame.hpp | 10 +--------- src/core/radio/radio_callbacks.cpp | 2 +- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/core/mac/mac_frame.cpp b/src/core/mac/mac_frame.cpp index a31350b19..f109d2723 100644 --- a/src/core/mac/mac_frame.cpp +++ b/src/core/mac/mac_frame.cpp @@ -1214,7 +1214,7 @@ void TxFrame::CopyFrom(const TxFrame &aFromFrame) // different FCS size. We adjust the PSDU length after the // copy to account for this. - SetLength(aFromFrame.GetPsduLength() - aFromFrame.GetFcsSize() + GetFcsSize()); + SetLength(aFromFrame.GetLength() - aFromFrame.GetFcsSize() + GetFcsSize()); } #endif } diff --git a/src/core/mac/mac_frame.hpp b/src/core/mac/mac_frame.hpp index fb4af8825..695f8c7ef 100644 --- a/src/core/mac/mac_frame.hpp +++ b/src/core/mac/mac_frame.hpp @@ -784,7 +784,7 @@ public: bool IsDataRequestCommand(void) const; /** - * Returns the MAC Frame Length. + * Returns the MAC Frame Length, namely the IEEE 802.15.4 PSDU length. * * @returns The MAC Frame Length. * @@ -845,14 +845,6 @@ public: */ uint8_t GetChannel(void) const { return mChannel; } - /** - * Returns the IEEE 802.15.4 PSDU length. - * - * @returns The IEEE 802.15.4 PSDU length. - * - */ - uint16_t GetPsduLength(void) const { return mLength; } - /** * Returns a pointer to the PSDU. * diff --git a/src/core/radio/radio_callbacks.cpp b/src/core/radio/radio_callbacks.cpp index b66f82ac8..ae85c7780 100644 --- a/src/core/radio/radio_callbacks.cpp +++ b/src/core/radio/radio_callbacks.cpp @@ -51,7 +51,7 @@ void Radio::Callbacks::HandleTransmitStarted(Mac::TxFrame &aFrame) { Get().RecordTxDone(aError, aFrame.GetPsduLength()); + Get().RecordTxDone(aError, aFrame.GetLength()); #endif Get().HandleTransmitDone(aFrame, aAckFrame, aError); }