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  }
12  InputSerializePort::~InputSerializePort() {
13  }
14 
17 
18  }
19 
20  SerializeStatus InputSerializePort::invokeSerial(SerializeBufferBase &buffer) {
21  FW_ASSERT(this->m_comp);
22  FW_ASSERT(this->m_func);
23 
24  this->m_func(this->m_comp,this->m_portNum,buffer);
25 
26  // The normal input ports perform deserialize() on the passed buffer,
27  // which is what this status is based on. This is not the case for the
28  // InputSerializePort, so just return an okay status
29  return FW_SERIALIZE_OK;
30  }
31 
32  void InputSerializePort::addCallComp(Fw::PassiveComponentBase* callComp, CompFuncPtr funcPtr) {
33  FW_ASSERT(callComp);
34  FW_ASSERT(funcPtr);
35  this->m_comp = callComp;
36  this->m_func = funcPtr;
37  }
38 
39 #if FW_OBJECT_TO_STRING == 1
40  const char* InputSerializePort::getToStringFormatString() {
41  return "Input Serial Port: %s %s->(%s)";
42  }
43 #endif
44 
45 }
46 #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