mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 10:47:19 +02:00
feat(openthread): add a function to ensure monotonically increasing frame counter
This commit is contained in:
@ -528,6 +528,15 @@ void otPlatRadioSetMacFrameCounter(otInstance *aInstance, uint32_t aMacFrameCoun
|
|||||||
|
|
||||||
s_mac_frame_counter = aMacFrameCounter;
|
s_mac_frame_counter = aMacFrameCounter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void otPlatRadioSetMacFrameCounterIfLarger(otInstance *aInstance, uint32_t aMacFrameCounter)
|
||||||
|
{
|
||||||
|
OT_UNUSED_VARIABLE(aInstance);
|
||||||
|
|
||||||
|
if (aMacFrameCounter > s_mac_frame_counter) {
|
||||||
|
s_mac_frame_counter = aMacFrameCounter;
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2
|
#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2
|
||||||
|
|
||||||
uint64_t otPlatRadioGetNow(otInstance *aInstance)
|
uint64_t otPlatRadioGetNow(otInstance *aInstance)
|
||||||
|
@ -380,6 +380,11 @@ void otPlatRadioSetMacKey(otInstance *aInstance, uint8_t aKeyIdMode, uint8_t aKe
|
|||||||
}
|
}
|
||||||
|
|
||||||
void otPlatRadioSetMacFrameCounter(otInstance *aInstance, uint32_t aMacFrameCounter)
|
void otPlatRadioSetMacFrameCounter(otInstance *aInstance, uint32_t aMacFrameCounter)
|
||||||
|
{
|
||||||
|
SuccessOrDie(s_radio.SetMacFrameCounter(aMacFrameCounter, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
void otPlatRadioSetMacFrameCounterIfLarger(otInstance *aInstance, uint32_t aMacFrameCounter)
|
||||||
{
|
{
|
||||||
SuccessOrDie(s_radio.SetMacFrameCounter(aMacFrameCounter, true));
|
SuccessOrDie(s_radio.SetMacFrameCounter(aMacFrameCounter, true));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user