mirror of
https://github.com/espressif/openthread.git
synced 2026-10-03 06:17:41 +00:00
[ncp] allow log/prints while an async property update is pending (#2454)
This commit changes the `StreamWrite` logic to allow logs/prints when there is a pending async property update.
This commit is contained in:
committed by
Jonathan Hui
parent
442289a104
commit
ca493393a4
@@ -770,12 +770,11 @@ otError NcpBase::StreamWrite(int aStreamId, const uint8_t *aDataPtr, int aDataLe
|
||||
VerifyOrExit(!mDisableStreamWrite, error = OT_ERROR_INVALID_STATE);
|
||||
VerifyOrExit(!mChangedPropsSet.IsPropertyFiltered(streamPropKey), error = OT_ERROR_INVALID_STATE);
|
||||
|
||||
// If there is a pending queued response or unsolicited property update,
|
||||
// we do not allow any new log stream writes. This is to ensure that log
|
||||
// messages can not continue to use the NCP buffer space and block other
|
||||
// spinel frames.
|
||||
// If there is a pending queued response we do not allow any new log
|
||||
// stream writes. This is to ensure that log messages can not continue
|
||||
// to use the NCP buffer space and block other spinel frames.
|
||||
|
||||
VerifyOrExit(IsResponseQueueEmpty() && mChangedPropsSet.IsEmpty(), error = OT_ERROR_NO_BUFS);
|
||||
VerifyOrExit(IsResponseQueueEmpty(), error = OT_ERROR_NO_BUFS);
|
||||
|
||||
SuccessOrExit(error = mEncoder.BeginFrame(header, SPINEL_CMD_PROP_VALUE_IS, streamPropKey));
|
||||
SuccessOrExit(error = mEncoder.WriteData(aDataPtr, static_cast<uint16_t>(aDataLen)));
|
||||
|
||||
Reference in New Issue
Block a user