F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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
11namespace Drv {
12
13 // ----------------------------------------------------------------------
14 // Construction, initialization, and destruction
15 // ----------------------------------------------------------------------
16
17 StreamCrossover ::
18 StreamCrossover(
19 const char *const compName
21 {
22
23 }
24
25 StreamCrossover ::
26 ~StreamCrossover()
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 {
44 this->log_WARNING_HI_StreamOutError(Drv::SendStatus::SEND_ERROR);
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.
U32 getSize() const
Definition Buffer.cpp:72