From 0190f9bd9c3df6069b4d1740b9bf2dc8e77b700c Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Mon, 26 Nov 2018 12:44:50 -0800 Subject: [PATCH] [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. --- src/posix/platform/radio_spinel.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/posix/platform/radio_spinel.cpp b/src/posix/platform/radio_spinel.cpp index f7102a630..8cd57df8a 100644 --- a/src/posix/platform/radio_spinel.cpp +++ b/src/posix/platform/radio_spinel.cpp @@ -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))