forked from espressif/esp-idf
Merge branch 'fix/fix_ot_set_mac_framecounter' into 'master'
feat(openthread): add a function to ensure monotonically increasing frame counter See merge request espressif/esp-idf!37363
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)
|
||||||
|
@@ -379,6 +379,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