F´ Flight Software - C/C++ Documentation NASA-v1.6.0
A framework for building embedded system applications to NASA flight quality standards.
Loading...
Searching...
No Matches
OutputSerializePort.cpp
Go to the documentation of this file.
2#include <Fw/Types/Assert.hpp>
3#include <cstdio>
4
5#if FW_PORT_SERIALIZATION
6
7namespace Fw {
8
9 // SerializePort has no call interface. It is to pass through serialized data
10
11 OutputSerializePort::OutputSerializePort() : OutputPortBase() {
12 }
13
14 OutputSerializePort::~OutputSerializePort() {
15 }
16
17 void OutputSerializePort::init() {
18 OutputPortBase::init();
19 }
20
21#if FW_OBJECT_TO_STRING == 1
22 void OutputSerializePort::toString(char* buffer, NATIVE_INT_TYPE size) {
23#if FW_OBJECT_NAMES == 1
24 FW_ASSERT(size > 0);
25 if (snprintf(buffer, size, "Output Serial Port: %s %s->(%s)", this->m_objName, this->isConnected() ? "C" : "NC",
26 this->isConnected() ? this->m_connObj->getObjName() : "None") < 0) {
27 buffer[0] = 0;
28 }
29#else
30 (void)snprintf(buffer,size,"%s","OutputSerializePort");
31#endif
32 }
33#endif
34
35
36}
37
38#endif // FW_PORT_SERIALIZATION
#define FW_ASSERT(...)
Definition Assert.hpp:7
PlatformIntType NATIVE_INT_TYPE
Definition BasicTypes.h:51
Definition Buffer.cpp:21