F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
InputSerializePort.cpp
Go to the documentation of this file.
2 #include <Fw/Types/Assert.hpp>
3 #include <cstdio>
4 
5 #if FW_PORT_SERIALIZATION == 1
6 
7 namespace Fw {
8 
9 // SerializePort has no call interface. It is to pass through serialized data
10 InputSerializePort::InputSerializePort() : InputPortBase(), m_func(nullptr) {}
11 InputSerializePort::~InputSerializePort() {}
12 
15 }
16 
17 SerializeStatus InputSerializePort::invokeSerial(SerializeBufferBase& buffer) {
18  FW_ASSERT(this->m_comp);
19  FW_ASSERT(this->m_func);
20 
21  this->m_func(this->m_comp, this->m_portNum, buffer);
22 
23  // The normal input ports perform deserialize() on the passed buffer,
24  // which is what this status is based on. This is not the case for the
25  // InputSerializePort, so just return an okay status
26  return FW_SERIALIZE_OK;
27 }
28 
29 void InputSerializePort::addCallComp(Fw::PassiveComponentBase* callComp, CompFuncPtr funcPtr) {
30  FW_ASSERT(callComp);
31  FW_ASSERT(funcPtr);
32  this->m_comp = callComp;
33  this->m_func = funcPtr;
34 }
35 
36 #if FW_OBJECT_TO_STRING == 1
37 const char* InputSerializePort::getToStringFormatString() {
38  return "Input Serial Port: %s %s->(%s)";
39 }
40 #endif
41 
42 } // namespace Fw
43 #endif
Serialization/Deserialization operation was successful.
SerializeStatus
forward declaration for string
void init()
Initialize the OS Abstraction Layer (OSAL)
Definition: Os.cpp:15
void init() override
#define FW_ASSERT(...)
Definition: Assert.hpp:14