mirror of
https://github.com/espressif/openthread.git
synced 2026-08-04 18:07:47 +00:00
[rcp] fix transaction ID caching and guard max power table code (#8408)
- Separate out max power table related code. - Cache the transaction ID for async response only if otLinkRawTransmit() succeeds.
This commit is contained in:
@@ -2388,6 +2388,7 @@ void RadioSpinel<InterfaceType, ProcessContextType>::RestoreProperties(void)
|
||||
SuccessOrDie(Set(SPINEL_PROP_PHY_FEM_LNA_GAIN, SPINEL_DATATYPE_INT8_S, mFemLnaGain));
|
||||
}
|
||||
|
||||
#if OPENTHREAD_POSIX_CONFIG_MAX_POWER_TABLE_ENABLE
|
||||
for (uint8_t channel = Radio::kChannelMin; channel <= Radio::kChannelMax; channel++)
|
||||
{
|
||||
int8_t power = mMaxPowerTable.GetTransmitPower(channel);
|
||||
@@ -2403,6 +2404,7 @@ void RadioSpinel<InterfaceType, ProcessContextType>::RestoreProperties(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // OPENTHREAD_POSIX_CONFIG_MAX_POWER_TABLE_ENABLE
|
||||
|
||||
CalcRcpTimeOffset();
|
||||
}
|
||||
|
||||
@@ -446,12 +446,12 @@ otError NcpBase::HandlePropertySet_SPINEL_PROP_STREAM_RAW(uint8_t aHeader)
|
||||
|
||||
SuccessOrExit(error = DecodeStreamRawTxRequest(*frame));
|
||||
|
||||
// Cache the transaction ID for async response
|
||||
mCurTransmitTID = SPINEL_HEADER_GET_TID(aHeader);
|
||||
|
||||
// Pass frame to the radio layer. Note, this fails if we
|
||||
// haven't enabled raw stream or are already transmitting.
|
||||
error = otLinkRawTransmit(mInstance, &NcpBase::LinkRawTransmitDone);
|
||||
SuccessOrExit(error = otLinkRawTransmit(mInstance, &NcpBase::LinkRawTransmitDone));
|
||||
|
||||
// Cache the transaction ID for async response
|
||||
mCurTransmitTID = SPINEL_HEADER_GET_TID(aHeader);
|
||||
|
||||
exit:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user