mirror of
https://github.com/nasa/fprime.git
synced 2025-12-10 00:44:37 -06:00
* Refactored type organization * Creating better configuration/types header hierarchy * Replace FpConfig type aliases with FPP generated aliases * Add the aliases to the FPP model * Config + Type Aliases builds * Renamed Fw/Types.h,hpp to Fw/FPrimeBasicTypes.h,hpp * Updating to FPP-a7 * Adding newline * sp * Fixing minor nit from review * Spurious ; --------- Co-authored-by: Andrei Tumbar <andrei.tumbar@jpl.nasa.gov>
58 lines
1.6 KiB
C++
58 lines
1.6 KiB
C++
// ======================================================================
|
|
// \title StreamCrossover.cpp
|
|
// \author ethanchee
|
|
// \brief cpp file for StreamCrossover component implementation class
|
|
// ======================================================================
|
|
|
|
|
|
#include <Drv/StreamCrossover/StreamCrossover.hpp>
|
|
#include <Fw/FPrimeBasicTypes.hpp>
|
|
|
|
namespace Drv {
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Construction, initialization, and destruction
|
|
// ----------------------------------------------------------------------
|
|
|
|
StreamCrossover ::
|
|
StreamCrossover(
|
|
const char *const compName
|
|
) : StreamCrossoverComponentBase(compName)
|
|
{
|
|
|
|
}
|
|
|
|
StreamCrossover ::
|
|
~StreamCrossover()
|
|
{
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Handler implementations for user-defined typed input ports
|
|
// ----------------------------------------------------------------------
|
|
|
|
void StreamCrossover ::
|
|
streamIn_handler(
|
|
const FwIndexType portNum,
|
|
Fw::Buffer &recvBuffer,
|
|
const Drv::RecvStatus &recvStatus
|
|
)
|
|
{
|
|
if(recvStatus == Drv::RecvStatus::RECV_ERROR || recvBuffer.getSize() == 0)
|
|
{
|
|
this->log_WARNING_HI_StreamOutError(Drv::SendStatus::SEND_ERROR);
|
|
this->errorDeallocate_out(0, recvBuffer);
|
|
return;
|
|
}
|
|
|
|
Drv::SendStatus sendStatus = this->streamOut_out(0, recvBuffer);
|
|
|
|
if(sendStatus != Drv::SendStatus::SEND_OK)
|
|
{
|
|
this->log_WARNING_HI_StreamOutError(sendStatus);
|
|
}
|
|
}
|
|
|
|
} // end namespace Drv
|