Skip to content

Commit 519c80d

Browse files
committed
[radio] use new implementation of time sync
1 parent 943b91b commit 519c80d

1 file changed

Lines changed: 2 additions & 25 deletions

File tree

src/src/radio.c

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ static uint8_t sTransmitPsdu[OT_RADIO_FRAME_MAX_SIZE + 1];
103103

104104
#if OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT
105105
static otExtAddress sExtAddress;
106-
static otRadioIeInfo sTransmitIeInfo;
107106
static otInstance *sInstance = NULL;
108107
#endif
109108

@@ -172,9 +171,6 @@ static void dataInit(void)
172171

173172
sDefaultTxPower = OT_RADIO_POWER_INVALID;
174173
sTransmitFrame.mPsdu = sTransmitPsdu + 1;
175-
#if OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT
176-
sTransmitFrame.mInfo.mTxInfo.mIeInfo = &sTransmitIeInfo;
177-
#endif
178174

179175
sReceiveError = OT_ERROR_NONE;
180176

@@ -1220,8 +1216,6 @@ int8_t otPlatRadioGetReceiveSensitivity(otInstance *aInstance)
12201216
#if OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT
12211217
void nrf_802154_tx_started(const uint8_t *aFrame)
12221218
{
1223-
bool processSecurity = false;
1224-
12251219
assert(aFrame == sTransmitPsdu);
12261220
OT_UNUSED_VARIABLE(aFrame);
12271221

@@ -1234,34 +1228,17 @@ void nrf_802154_tx_started(const uint8_t *aFrame)
12341228

12351229
// Update IE and secure transmit frame
12361230
#if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
1237-
if (sTransmitFrame.mInfo.mTxInfo.mIeInfo->mTimeIeOffset != 0)
1238-
{
1239-
uint8_t *timeIe = sTransmitFrame.mPsdu + sTransmitFrame.mInfo.mTxInfo.mIeInfo->mTimeIeOffset;
1240-
uint64_t time = otPlatTimeGet() + sTransmitFrame.mInfo.mTxInfo.mIeInfo->mNetworkTimeOffset;
1241-
1242-
*timeIe = sTransmitFrame.mInfo.mTxInfo.mIeInfo->mTimeSyncSeq;
1243-
1244-
*(++timeIe) = (uint8_t)(time & 0xff);
1245-
for (uint8_t i = 1; i < sizeof(uint64_t); i++)
1246-
{
1247-
time = time >> 8;
1248-
*(++timeIe) = (uint8_t)(time & 0xff);
1249-
}
1250-
1251-
processSecurity = true;
1252-
}
1231+
otMacFrameUpdateTimeIe(&sTransmitFrame, otPlatTimeGet());
12531232
#endif // OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
12541233

12551234
#if OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2
12561235
otEXPECT(otMacFrameIsSecurityEnabled(&sTransmitFrame) && otMacFrameIsKeyIdMode1(&sTransmitFrame) &&
12571236
!sTransmitFrame.mInfo.mTxInfo.mIsSecurityProcessed);
12581237

12591238
sTransmitFrame.mInfo.mTxInfo.mAesKey = &sCurrKey;
1260-
1261-
processSecurity = true;
12621239
#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2
12631240

1264-
otEXPECT(processSecurity);
1241+
otEXPECT(!sTransmitFrame.mInfo.mTxInfo.mIsSecurityProcessed);
12651242
otMacFrameProcessTransmitAesCcm(&sTransmitFrame, &sExtAddress);
12661243

12671244
exit:

0 commit comments

Comments
 (0)