Differentiate sync/async ByteStreamDriver and update ComStub to work with both#3987
Differentiate sync/async ByteStreamDriver and update ComStub to work with both#3987thomas-bc merged 12 commits intonasa:develfrom
Conversation
| } | ||
|
|
||
| void LinuxUartDriver ::send_handler(const FwIndexType portNum, Fw::Buffer& serBuffer) { | ||
| Drv::ByteStreamStatus LinuxUartDriver ::send_handler(const FwIndexType portNum, Fw::Buffer& serBuffer) { |
Check notice
Code scanning / CodeQL
Long function without assertion Note
| // ---------------------------------------------------------------------- | ||
|
|
||
| void TcpClientComponentImpl::send_handler(const FwIndexType portNum, Fw::Buffer& fwBuffer) { | ||
| Drv::ByteStreamStatus TcpClientComponentImpl::send_handler(const FwIndexType portNum, Fw::Buffer& fwBuffer) { |
Check notice
Code scanning / CodeQL
Long function without assertion Note
| // ---------------------------------------------------------------------- | ||
|
|
||
| void TcpServerComponentImpl::send_handler(const FwIndexType portNum, Fw::Buffer& fwBuffer) { | ||
| Drv::ByteStreamStatus TcpServerComponentImpl::send_handler(const FwIndexType portNum, Fw::Buffer& fwBuffer) { |
Check notice
Code scanning / CodeQL
Long function without assertion Note
| // ---------------------------------------------------------------------- | ||
|
|
||
| void UdpComponentImpl::send_handler(const FwIndexType portNum, Fw::Buffer& fwBuffer) { | ||
| Drv::ByteStreamStatus UdpComponentImpl::send_handler(const FwIndexType portNum, Fw::Buffer& fwBuffer) { |
Check notice
Code scanning / CodeQL
Long function without assertion Note
| // A message should never get here if we need to reinitialize | ||
| FW_ASSERT(!this->m_reinitialize || !this->isConnected_comStatusOut_OutputPort(0)); | ||
| if (this->isConnected_drvSendOut_OutputPort(0)) { | ||
| this->handleSynchronousSend(sendBuffer, context); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| // A message should never get here if we need to reinitialize | ||
| FW_ASSERT(!this->m_reinitialize || !this->isConnected_comStatusOut_OutputPort(0)); | ||
| if (this->isConnected_drvSendOut_OutputPort(0)) { | ||
| this->handleSynchronousSend(sendBuffer, context); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| if (this->isConnected_drvSendOut_OutputPort(0)) { | ||
| this->handleSynchronousSend(sendBuffer, context); | ||
| } else if (this->isConnected_drvAsyncSendOut_OutputPort(0)) { | ||
| this->handleAsynchronousSend(sendBuffer, context); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| if (this->isConnected_drvSendOut_OutputPort(0)) { | ||
| this->handleSynchronousSend(sendBuffer, context); | ||
| } else if (this->isConnected_drvAsyncSendOut_OutputPort(0)) { | ||
| this->handleAsynchronousSend(sendBuffer, context); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| } else { | ||
| // Receive successful - forward data with empty context | ||
| ComCfg::FrameContext emptyContext; // ComStub knows nothing about the received bytes, empty context | ||
| this->dataOut_out(0, recvBuffer, emptyContext); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| if (this->m_retry_count < this->RETRY_LIMIT) { | ||
| // Attempt retry if under the limit | ||
| this->m_retry_count++; | ||
| this->drvAsyncSendOut_out(0, fwBuffer); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| this->drvAsyncSendOut_out(0, fwBuffer); | ||
| } else { | ||
| // Exceeded retry limit - return buffer and notify failure | ||
| this->dataReturnOut_out(0, fwBuffer, this->m_storedContext); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| const Drv::ByteStreamStatus& sendStatus) { | ||
| if (sendStatus != Drv::ByteStreamStatus::SEND_RETRY) { | ||
| // Not retrying - return buffer ownership and send status | ||
| void ComStub::drvAsyncSendReturnIn_handler(FwIndexType portNum, //!< The port number |
Check notice
Code scanning / CodeQL
Long function without assertion Note
| // Helper method implementations | ||
| // ---------------------------------------------------------------------- | ||
|
|
||
| void ComStub::handleSynchronousSend(Fw::Buffer& sendBuffer, const ComCfg::FrameContext& context) { |
Check notice
Code scanning / CodeQL
Long function without assertion Note
| this->comStatusOut_out(0, comSuccess); | ||
| } | ||
|
|
||
| void ComStub::handleAsyncRetry(Fw::Buffer& fwBuffer) { |
Check notice
Code scanning / CodeQL
Long function without assertion Note
…123) Remove async ComStub to ComDriver connection for nasa/fprime#3987
…3987) (#282) * remove async comdriver connection * remove packets include nasa/fprime#3987
…3987) (nasa#282) * remove async comdriver connection * remove packets include nasa/fprime#3987
Change Description
Fix #3770
This reverts the
Drv.ByteStreamDriverinterface to be synchronous, and adds in aDrv.AsyncByteStreamDriver.Svc.ComStubcan work with either, depending on which ports are connected.Testing/Review Recommendations
Svc.ComStubcode has a lot of branching and stuff - needs careful review.Future Work
Double check with Hub pattern