F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
StreamCrossover.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title StreamCrossover.cpp
3 // \author ethanchee
4 // \brief cpp file for StreamCrossover component implementation class
5 // ======================================================================
6 
7 
9 #include <FpConfig.hpp>
10 
11 namespace Drv {
12 
13  // ----------------------------------------------------------------------
14  // Construction, initialization, and destruction
15  // ----------------------------------------------------------------------
16 
19  const char *const compName
20  ) : StreamCrossoverComponentBase(compName)
21  {
22 
23  }
24 
27  {
28 
29  }
30 
31  // ----------------------------------------------------------------------
32  // Handler implementations for user-defined typed input ports
33  // ----------------------------------------------------------------------
34 
35  void StreamCrossover ::
36  streamIn_handler(
37  const NATIVE_INT_TYPE portNum,
38  Fw::Buffer &recvBuffer,
39  const Drv::RecvStatus &recvStatus
40  )
41  {
42  if(recvStatus == Drv::RecvStatus::RECV_ERROR || recvBuffer.getSize() == 0)
43  {
45  this->errorDeallocate_out(0, recvBuffer);
46  return;
47  }
48 
49  Drv::SendStatus sendStatus = this->streamOut_out(0, recvBuffer);
50 
51  if(sendStatus != Drv::SendStatus::SEND_OK)
52  {
53  this->log_WARNING_HI_StreamOutError(sendStatus);
54  }
55  }
56 
57 } // end namespace Drv
PlatformIntType NATIVE_INT_TYPE
Definition: BasicTypes.h:55
C++-compatible configuration header for fprime configuration.
Status associated with the received data.
@ RECV_ERROR
Receive error occurred retrying may succeed.
Status returned by the send call.
@ SEND_ERROR
Send error occurred retrying may succeed.
@ SEND_OK
Send worked as expected.
Auto-generated base for StreamCrossover component.
void log_WARNING_HI_StreamOutError(Drv::SendStatus sendStatus)
void errorDeallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port errorDeallocate.
Drv::SendStatus streamOut_out(FwIndexType portNum, Fw::Buffer &sendBuffer)
Invoke output port streamOut.
StreamCrossover(const char *const compName)
U32 getSize() const
Definition: Buffer.cpp:72