[radio-spinel] always be ready to ready from socket (#3319)

This commit changes the logic in `RadioSpinel` such that the HDLC
socket is always added to read fd set in `UpdateFdSet()` replacing
the existing code where read was not allowed during an ongoing 15.4
frame transmission. Note that during a frame transmission, radio can
potentially receive a frame (e.g. during CSMA backoffs). Also other
spinel frames such as logs can be received during tx.
This commit is contained in:
Abtin Keshavarzian
2018-11-26 12:44:50 -08:00
committed by Jonathan Hui
parent fac323d548
commit 0190f9bd9c
+4 -12
View File
@@ -680,24 +680,16 @@ void RadioSpinel::UpdateFdSet(fd_set &aReadFdSet, fd_set &aWriteFdSet, int &aMax
{
int sockFd = mHdlcInterface.GetSocket();
if ((mState != kStateTransmitPending) && (mState != kStateTransmitDone))
{
FD_SET(sockFd, &aReadFdSet);
FD_SET(sockFd, &aReadFdSet);
if (aMaxFd < sockFd)
{
aMaxFd = sockFd;
}
if (aMaxFd < sockFd)
{
aMaxFd = sockFd;
}
if (mState == kStateTransmitPending)
{
FD_SET(sockFd, &aWriteFdSet);
if (aMaxFd < sockFd)
{
aMaxFd = sockFd;
}
}
if (!mFrameQueue.IsEmpty() || (mState == kStateTransmitDone))