[diag] set mIsSecurityProcessed field before sending frames (#11235)

The radio driver will set the `mInfo.mTxInfo.mIsSecurityProcessed` field
to True after the radio driver encrypts the frame. Which causes subsequent
frames to be sent will not be encrypted.

This commit sets the `mInfo.mTxInfo.mIsSecurityProcessed` field before
sending each frame.
This commit is contained in:
Zhanglong Xia
2025-02-11 14:14:27 -08:00
committed by GitHub
parent f7080a9343
commit 68a5ce3abe
2 changed files with 7 additions and 5 deletions
+6 -5
View File
@@ -211,6 +211,7 @@ Diags::Diags(Instance &aInstance)
void Diags::ResetTxPacket(void)
{
mIsHeaderUpdated = false;
mIsSecurityProcessed = false;
mTxPacket->mInfo.mTxInfo.mTxDelayBaseTime = 0;
mTxPacket->mInfo.mTxInfo.mTxDelay = 0;
mTxPacket->mInfo.mTxInfo.mMaxCsmaBackoffs = 0;
@@ -221,7 +222,6 @@ void Diags::ResetTxPacket(void)
mTxPacket->mInfo.mTxInfo.mIsARetx = false;
mTxPacket->mInfo.mTxInfo.mCsmaCaEnabled = false;
mTxPacket->mInfo.mTxInfo.mCslPresent = false;
mTxPacket->mInfo.mTxInfo.mIsSecurityProcessed = false;
}
Error Diags::ProcessFrame(uint8_t aArgsLength, char *aArgs[])
@@ -312,7 +312,6 @@ Error Diags::ProcessFrame(uint8_t aArgsLength, char *aArgs[])
ResetTxPacket();
mTxPacket->mInfo.mTxInfo.mCsmaCaEnabled = csmaCaEnabled;
mTxPacket->mInfo.mTxInfo.mIsSecurityProcessed = securityProcessed;
mTxPacket->mInfo.mTxInfo.mTxPower = txPower;
mTxPacket->mInfo.mTxInfo.mTxDelayBaseTime = txDelayBaseTime;
mTxPacket->mInfo.mTxInfo.mTxDelay = txDelay;
@@ -321,6 +320,7 @@ Error Diags::ProcessFrame(uint8_t aArgsLength, char *aArgs[])
mTxPacket->mInfo.mTxInfo.mRxChannelAfterTxDone = rxChannelAfterTxDone;
mTxPacket->mLength = size;
mIsHeaderUpdated = isHeaderUpdated;
mIsSecurityProcessed = securityProcessed;
mIsTxPacketSet = true;
exit:
@@ -561,9 +561,10 @@ Error Diags::TransmitPacket(void)
if (mIsTxPacketSet)
{
// The `mInfo.mTxInfo.mIsHeaderUpdated` field may be updated by the radio driver after the frame is sent,
// set the `mInfo.mTxInfo.mIsHeaderUpdated` field before transmitting the frame.
mTxPacket->mInfo.mTxInfo.mIsHeaderUpdated = mIsHeaderUpdated;
// The `mInfo.mTxInfo.mIsHeaderUpdated` and `mInfo.mTxInfo.mIsSecurityProcessed` fields may be updated by
// the radio driver after the frame is sent. Here sets these fields field before transmitting the frame.
mTxPacket->mInfo.mTxInfo.mIsHeaderUpdated = mIsHeaderUpdated;
mTxPacket->mInfo.mTxInfo.mIsSecurityProcessed = mIsSecurityProcessed;
}
else
{
+1
View File
@@ -264,6 +264,7 @@ private:
uint8_t mTxLen;
TxCmd mCurTxCmd;
bool mIsHeaderUpdated : 1;
bool mIsSecurityProcessed : 1;
bool mIsTxPacketSet : 1;
bool mIsAsyncSend : 1;
bool mDiagSendOn : 1;