F´ Flight Software - C/C++ Documentation  NASA-v2.1.0
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OutputSerializePort.cpp
Go to the documentation of this file.
2 #include <Fw/Types/Assert.hpp>
3 #include <stdio.h>
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 
17  void OutputSerializePort::init(void) {
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
Fw::OutputPortBase::init
virtual void init(void)
Definition: OutputPortBase.cpp:23
Assert.hpp
FW_ASSERT
#define FW_ASSERT(...)
Definition: Assert.hpp:9
NATIVE_INT_TYPE
int NATIVE_INT_TYPE
native integer type declaration
Definition: BasicTypes.hpp:29
OutputSerializePort.hpp
Fw
Definition: Buffer.cpp:21