mirror of
https://github.com/espressif/openthread.git
synced 2026-10-11 18:27:43 +00:00
[spinel] restore the source match feature setting (#10055)
The RCP Restoration feature missed restoring the source address match feature configuration. It causes the source match table to be disabled by default after the RCP restarts. This commit restores the source address match feature configuration.
This commit is contained in:
@@ -93,6 +93,7 @@ RadioSpinel::RadioSpinel(void)
|
||||
, mRcpFailure(kRcpFailureNone)
|
||||
, mSrcMatchShortEntryCount(0)
|
||||
, mSrcMatchExtEntryCount(0)
|
||||
, mSrcMatchEnabled(false)
|
||||
, mMacKeySet(false)
|
||||
, mCcaEnergyDetectThresholdSet(false)
|
||||
, mTransmitPowerSet(false)
|
||||
@@ -100,6 +101,7 @@ RadioSpinel::RadioSpinel(void)
|
||||
, mFemLnaGainSet(false)
|
||||
, mEnergyScanning(false)
|
||||
, mMacFrameCounterSet(false)
|
||||
, mSrcMatchSet(false)
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
, mDiagMode(false)
|
||||
@@ -944,7 +946,17 @@ exit:
|
||||
|
||||
otError RadioSpinel::EnableSrcMatch(bool aEnable)
|
||||
{
|
||||
return Set(SPINEL_PROP_MAC_SRC_MATCH_ENABLED, SPINEL_DATATYPE_BOOL_S, aEnable);
|
||||
otError error;
|
||||
|
||||
SuccessOrExit(error = Set(SPINEL_PROP_MAC_SRC_MATCH_ENABLED, SPINEL_DATATYPE_BOOL_S, aEnable));
|
||||
|
||||
#if OPENTHREAD_SPINEL_CONFIG_RCP_RESTORATION_MAX_COUNT > 0
|
||||
mSrcMatchSet = true;
|
||||
mSrcMatchEnabled = aEnable;
|
||||
#endif
|
||||
|
||||
exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
otError RadioSpinel::AddSrcMatchShortEntry(uint16_t aShortAddress)
|
||||
@@ -2077,6 +2089,11 @@ void RadioSpinel::RestoreProperties(void)
|
||||
Insert(SPINEL_PROP_MAC_SRC_MATCH_EXTENDED_ADDRESSES, SPINEL_DATATYPE_EUI64_S, mSrcMatchExtEntries[i].m8));
|
||||
}
|
||||
|
||||
if (mSrcMatchSet)
|
||||
{
|
||||
SuccessOrDie(Set(SPINEL_PROP_MAC_SRC_MATCH_ENABLED, SPINEL_DATATYPE_BOOL_S, mSrcMatchEnabled));
|
||||
}
|
||||
|
||||
if (mCcaEnergyDetectThresholdSet)
|
||||
{
|
||||
SuccessOrDie(Set(SPINEL_PROP_PHY_CCA_THRESHOLD, SPINEL_DATATYPE_INT8_S, mCcaEnergyDetectThreshold));
|
||||
|
||||
@@ -1278,6 +1278,7 @@ private:
|
||||
int8_t mFemLnaGain;
|
||||
uint32_t mMacFrameCounter;
|
||||
bool mCoexEnabled : 1;
|
||||
bool mSrcMatchEnabled : 1;
|
||||
|
||||
bool mMacKeySet : 1; ///< Whether MAC key has been set.
|
||||
bool mCcaEnergyDetectThresholdSet : 1; ///< Whether CCA energy detect threshold has been set.
|
||||
@@ -1286,6 +1287,7 @@ private:
|
||||
bool mFemLnaGainSet : 1; ///< Whether FEM LNA gain has been set.
|
||||
bool mEnergyScanning : 1; ///< If fails while scanning, restarts scanning.
|
||||
bool mMacFrameCounterSet : 1; ///< Whether the MAC frame counter has been set.
|
||||
bool mSrcMatchSet : 1; ///< Whether the source match feature has been set.
|
||||
|
||||
#endif // OPENTHREAD_SPINEL_CONFIG_RCP_RESTORATION_MAX_COUNT > 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user