F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
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 
7 namespace 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 
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, static_cast<size_t>(size), "Output Serial Port: %s %s->(%s)", this->m_objName.toChar(), 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:14
PlatformIntType NATIVE_INT_TYPE
Definition: BasicTypes.h:55
void init()
Initialize the OS Abstraction Layer (OSAL)
Definition: Os.cpp:15