Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions components/comms/CommsChannels/CommsChannelManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ void CommsChannelManager::loop()
// (inbound messages from other tasks are just queued and don't need the codec)
ensureProtocolCodecExists(channelID);

// Inbound messages - possibly multiple messages. These are handled before the outbound queue is serviced
// so that the response to a request is sent in this pass (if the channel can take it) and not the next,
// which is a whole main-loop period later
for (int msgIdx = 0; msgIdx < MAX_INBOUND_MSGS_IN_LOOP; msgIdx++)
{
if (!pChannel->processInboundQueue())
break;
}

// Check for an outbound message (its type, without copying it)
CommsChannelMsg msg;
CommsMsgTypeCode nextMsgType = MSG_TYPE_COMMAND;
Expand Down Expand Up @@ -138,12 +147,6 @@ void CommsChannelManager::loop()
}
}

// Inbound messages - possibly multiple messages
for (int msgIdx = 0; msgIdx < MAX_INBOUND_MSGS_IN_LOOP; msgIdx++)
{
if (!pChannel->processInboundQueue())
break;
}
}

// Service bridges
Expand Down
Loading