[spinel] add an API to enable/disable the RCP restoration feature (#11011)

This commit is contained in:
Zhanglong Xia
2024-12-10 07:42:29 -08:00
committed by GitHub
parent fe7d34f9d8
commit 124f0508cb
4 changed files with 24 additions and 0 deletions
+3
View File
@@ -90,6 +90,7 @@ RadioSpinel::RadioSpinel(void)
, mSrcMatchShortEntryCount(0)
, mSrcMatchExtEntryCount(0)
, mSrcMatchEnabled(false)
, mRcpRestorationEnabled(true)
, mMacKeySet(false)
, mCcaEnergyDetectThresholdSet(false)
, mTransmitPowerSet(false)
@@ -2039,6 +2040,8 @@ void RadioSpinel::RecoverFromRcpFailure(void)
State recoveringState = mState;
bool skipReset = false;
VerifyOrExit(mRcpRestorationEnabled);
if (mRcpFailure == kRcpFailureNone)
{
ExitNow();
+10
View File
@@ -1078,6 +1078,15 @@ public:
*/
void SetTimeSyncState(bool aOn) { mTimeSyncOn = aOn; }
#if OPENTHREAD_SPINEL_CONFIG_RCP_RESTORATION_MAX_COUNT > 0
/**
* Enables or disables the RCP restoration feature.
*
* @param[in] aEnabled TRUE to enable the RCP restoration feature, FALSE otherwise.
*/
void SetRcpRestorationEnabled(bool aEnabled) { mRcpRestorationEnabled = aEnabled; }
#endif
private:
enum
{
@@ -1283,6 +1292,7 @@ private:
int8_t mFemLnaGain;
bool mCoexEnabled : 1;
bool mSrcMatchEnabled : 1;
bool mRcpRestorationEnabled : 1;
bool mMacKeySet : 1; ///< Whether MAC key has been set.
bool mCcaEnergyDetectThresholdSet : 1; ///< Whether CCA energy detect threshold has been set.
@@ -320,6 +320,13 @@ void otSysTrelInit(const char *aInterfaceName);
*/
void otSysTrelDeinit(void);
/**
* Enables or disables the RCP restoration feature.
*
* @param[in] aEnabled TRUE to enable the RCP restoration feature, FALSE otherwise.
*/
void otSysSetRcpRestorationEnabled(bool aEnabled);
#ifdef __cplusplus
} // end of extern "C"
#endif
+4
View File
@@ -1070,3 +1070,7 @@ const otRcpInterfaceMetrics *otSysGetRcpInterfaceMetrics(void)
{
return sRadio.GetSpinelInterface().GetRcpInterfaceMetrics();
}
#if OPENTHREAD_SPINEL_CONFIG_RCP_RESTORATION_MAX_COUNT > 0
void otSysSetRcpRestorationEnabled(bool aEnabled) { return GetRadioSpinel().SetRcpRestorationEnabled(aEnabled); }
#endif