Skip to content

Commit

Permalink
[spinel] replace otLinkGetFrameCounter with otPlatRadioGetFrameCounte…
Browse files Browse the repository at this point in the history
…r in radio spinel
  • Loading branch information
gytxxsy committed Nov 6, 2024
1 parent 7169561 commit d2b3ab9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/openthread/platform/radio.h
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,8 @@ void otPlatRadioSetMacFrameCounterIfLarger(otInstance *aInstance, uint32_t aMacF
*/
uint64_t otPlatRadioGetNow(otInstance *aInstance);

uint32_t otPlatRadioGetFrameCounter(otInstance *aInstance);

/**
* Get the bus speed in bits/second between the host and the radio chip.
*
Expand Down
5 changes: 5 additions & 0 deletions src/core/radio/radio_platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,11 @@ extern "C" OT_TOOL_WEAK uint64_t otPlatRadioGetNow(otInstance *aInstance)
return otPlatTimeGet();
}

extern "C" OT_TOOL_WEAK uint32_t otPlatRadioGetFrameCounter(otInstance *aInstance)
{
return otLinkGetFrameCounter(aInstance);
}

extern "C" OT_TOOL_WEAK uint32_t otPlatRadioGetBusSpeed(otInstance *aInstance)
{
OT_UNUSED_VARIABLE(aInstance);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/spinel/radio_spinel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2181,7 +2181,7 @@ void RadioSpinel::RestoreProperties(void)
static constexpr uint16_t kFrameCounterGuard = 1000;

SuccessOrDie(Set(SPINEL_PROP_RCP_MAC_FRAME_COUNTER, SPINEL_DATATYPE_UINT32_S,
otLinkGetFrameCounter(mInstance) + kFrameCounterGuard));
otPlatRadioGetFrameCounter(mInstance) + kFrameCounterGuard));
}

for (int i = 0; i < mSrcMatchShortEntryCount; ++i)
Expand Down

0 comments on commit d2b3ab9

Please sign in to comment.