[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.
diff --git a/src/posix/platform/radio_spinel.cpp b/src/posix/platform/radio_spinel.cpp
index f7102a6..8cd57df 100644
--- a/src/posix/platform/radio_spinel.cpp
+++ b/src/posix/platform/radio_spinel.cpp
@@ -680,24 +680,16 @@
{
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))