| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include <Fw/Port/InputSerializePort.hpp> | ||
| 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 | 1725 | InputSerializePort::InputSerializePort() : InputPortBase(), m_func(nullptr) {} | |
| 11 | 3450 | InputSerializePort::~InputSerializePort() {} | |
| 12 | |||
| 13 | 1725 | void InputSerializePort::init() { | |
| 14 | 1725 | InputPortBase::init(); | |
| 15 | 1725 | } | |
| 16 | |||
| 17 | 10062 | SerializeStatus InputSerializePort::invokeSerial(LinearBufferBase& buffer) { | |
| 18 | 10062 | FW_ASSERT(this->m_comp != nullptr); | |
| 19 | 10062 | FW_ASSERT(this->m_func != nullptr); | |
| 20 | |||
| 21 | 10062 | 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 | 10062 | return FW_SERIALIZE_OK; | |
| 27 | } | ||
| 28 | |||
| 29 | 1725 | void InputSerializePort::addCallComp(Fw::PassiveComponentBase* callComp, CompFuncPtr funcPtr) { | |
| 30 | 1725 | FW_ASSERT(callComp != nullptr); | |
| 31 | 1725 | FW_ASSERT(funcPtr != nullptr); | |
| 32 | 1725 | this->m_comp = callComp; | |
| 33 | 1725 | this->m_func = funcPtr; | |
| 34 | 1725 | } | |
| 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 | ||
| 44 |