mirror of
https://github.com/espressif/openthread.git
synced 2026-09-03 15:50:06 +00:00
[mac] scope timeIeOffset variable to block it is being used (#4369)
This commit is contained in:
committed by
Jonathan Hui
parent
bec7fb0563
commit
e4fe479baf
+11
-11
@@ -954,9 +954,6 @@ void Mac::BeginTransmit(void)
|
||||
bool applyTransmitSecurity = true;
|
||||
bool processTransmitAesCcm = true;
|
||||
TxFrame &sendFrame = mSubMac.GetTransmitFrame();
|
||||
#if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
|
||||
uint8_t timeIeOffset = 0;
|
||||
#endif
|
||||
|
||||
VerifyOrExit(mEnabled, error = OT_ERROR_ABORT);
|
||||
|
||||
@@ -1021,15 +1018,18 @@ void Mac::BeginTransmit(void)
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
|
||||
timeIeOffset = GetTimeIeOffset(sendFrame);
|
||||
sendFrame.SetTimeIeOffset(timeIeOffset);
|
||||
|
||||
if (timeIeOffset != 0)
|
||||
{
|
||||
// Transmit security will be processed after time IE content is updated.
|
||||
processTransmitAesCcm = false;
|
||||
sendFrame.SetTimeSyncSeq(Get<TimeSync>().GetTimeSyncSeq());
|
||||
sendFrame.SetNetworkTimeOffset(Get<TimeSync>().GetNetworkTimeOffset());
|
||||
uint8_t timeIeOffset = GetTimeIeOffset(sendFrame);
|
||||
|
||||
sendFrame.SetTimeIeOffset(timeIeOffset);
|
||||
|
||||
if (timeIeOffset != 0)
|
||||
{
|
||||
// Transmit security will be processed after time IE content is updated.
|
||||
processTransmitAesCcm = false;
|
||||
sendFrame.SetTimeSyncSeq(Get<TimeSync>().GetTimeSyncSeq());
|
||||
sendFrame.SetNetworkTimeOffset(Get<TimeSync>().GetNetworkTimeOffset());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user