[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:
Abtin Keshavarzian
2018-01-08 19:09:16 +00:00
committed by Jonathan Hui
parent 442289a104
commit ca493393a4
+4 -5
View File
@@ -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)));