mirror of
https://github.com/espressif/openthread.git
synced 2026-08-07 11:17:46 +00:00
[spinel] add an API to enable/disable the RCP restoration feature (#11011)
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user