mirror of
https://github.com/espressif/openthread.git
synced 2026-10-02 05:47:40 +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));
|
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++)
|
for (uint8_t channel = Radio::kChannelMin; channel <= Radio::kChannelMax; channel++)
|
||||||
{
|
{
|
||||||
int8_t power = mMaxPowerTable.GetTransmitPower(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();
|
CalcRcpTimeOffset();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -446,12 +446,12 @@ otError NcpBase::HandlePropertySet_SPINEL_PROP_STREAM_RAW(uint8_t aHeader)
|
|||||||
|
|
||||||
SuccessOrExit(error = DecodeStreamRawTxRequest(*frame));
|
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
|
// Pass frame to the radio layer. Note, this fails if we
|
||||||
// haven't enabled raw stream or are already transmitting.
|
// 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:
|
exit:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user