Skip to content

Commit

Permalink
[mac] skip logging trel frame tx error when trel interface is disabled (
Browse files Browse the repository at this point in the history
openthread#9522)

This commit updates `Mac::LogFrameTxFailure` to skip logging when
`Trel::Interface` is disabled.
  • Loading branch information
abtink authored Oct 13, 2023
1 parent 094bae0 commit 17e433c
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions src/core/mac/mac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2210,12 +2210,9 @@ void Mac::LogFrameRxFailure(const RxFrame *aFrame, Error aError) const

void Mac::LogFrameTxFailure(const TxFrame &aFrame, Error aError, uint8_t aRetryCount, bool aWillRetx) const
{
#if OPENTHREAD_CONFIG_RADIO_LINK_IEEE_802_15_4_ENABLE && OPENTHREAD_CONFIG_MULTI_RADIO
#if OPENTHREAD_CONFIG_RADIO_LINK_IEEE_802_15_4_ENABLE
#if OPENTHREAD_CONFIG_MULTI_RADIO
if (aFrame.GetRadioType() == kRadioTypeIeee802154)
#elif OPENTHREAD_CONFIG_RADIO_LINK_IEEE_802_15_4_ENABLE
if (true)
#else
if (false)
#endif
{
uint8_t maxAttempts = aFrame.GetMaxFrameRetries() + 1;
Expand All @@ -2224,10 +2221,22 @@ void Mac::LogFrameTxFailure(const TxFrame &aFrame, Error aError, uint8_t aRetryC
LogInfo("Frame tx attempt %u/%u failed, error:%s, %s", curAttempt, maxAttempts, ErrorToString(aError),
aFrame.ToInfoString().AsCString());
}
else
#else
OT_UNUSED_VARIABLE(aRetryCount);
OT_UNUSED_VARIABLE(aWillRetx);
#endif

#if OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE
#if OPENTHREAD_CONFIG_MULTI_RADIO
if (aFrame.GetRadioType() == kRadioTypeTrel)
#endif
{
LogInfo("Frame tx failed, error:%s, %s", ErrorToString(aError), aFrame.ToInfoString().AsCString());
if (Get<Trel::Interface>().IsEnabled())
{
LogInfo("Frame tx failed, error:%s, %s", ErrorToString(aError), aFrame.ToInfoString().AsCString());
}
}
#endif
}

void Mac::LogBeacon(const char *aActionText) const { LogInfo("%s Beacon", aActionText); }
Expand Down

0 comments on commit 17e433c

Please sign in to comment.