mirror of
https://github.com/espressif/openthread.git
synced 2026-08-19 17:09:51 +00:00
[rcp] fix DecodeStreamRawTxRequest() to handle missing optional fields (#8844)
This commit updates `DecodeStreamRawTxRequest()` to set the read boolean flags immediately after they are decoded (not wait till all fields are read). This ensures correct processing of optional fields.
This commit is contained in:
@@ -425,17 +425,22 @@ otError NcpBase::DecodeStreamRawTxRequest(otRadioFrame &aFrame)
|
||||
|
||||
SuccessOrExit(mDecoder.ReadUint8(aFrame.mInfo.mTxInfo.mMaxCsmaBackoffs));
|
||||
SuccessOrExit(mDecoder.ReadUint8(aFrame.mInfo.mTxInfo.mMaxFrameRetries));
|
||||
|
||||
SuccessOrExit(mDecoder.ReadBool(csmaEnable));
|
||||
aFrame.mInfo.mTxInfo.mCsmaCaEnabled = csmaEnable;
|
||||
|
||||
SuccessOrExit(mDecoder.ReadBool(isHeaderUpdated));
|
||||
aFrame.mInfo.mTxInfo.mIsHeaderUpdated = isHeaderUpdated;
|
||||
|
||||
SuccessOrExit(mDecoder.ReadBool(isARetx));
|
||||
aFrame.mInfo.mTxInfo.mIsARetx = isARetx;
|
||||
|
||||
SuccessOrExit(mDecoder.ReadBool(isSecurityProcessed));
|
||||
aFrame.mInfo.mTxInfo.mIsSecurityProcessed = isSecurityProcessed;
|
||||
|
||||
SuccessOrExit(mDecoder.ReadUint32(aFrame.mInfo.mTxInfo.mTxDelay));
|
||||
SuccessOrExit(mDecoder.ReadUint32(aFrame.mInfo.mTxInfo.mTxDelayBaseTime));
|
||||
SuccessOrExit(mDecoder.ReadUint8(aFrame.mInfo.mTxInfo.mRxChannelAfterTxDone));
|
||||
aFrame.mInfo.mTxInfo.mCsmaCaEnabled = csmaEnable;
|
||||
aFrame.mInfo.mTxInfo.mIsHeaderUpdated = isHeaderUpdated;
|
||||
aFrame.mInfo.mTxInfo.mIsARetx = isARetx;
|
||||
aFrame.mInfo.mTxInfo.mIsSecurityProcessed = isSecurityProcessed;
|
||||
|
||||
exit:
|
||||
return error;
|
||||
|
||||
Reference in New Issue
Block a user