F´ Flight Software - C/C++ Documentation
NASA-v1.6.0
A framework for building embedded system applications to NASA flight quality standards.
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
z
Functions
a
b
c
d
g
h
i
m
r
s
t
v
w
Variables
Typedefs
Enumerations
Enumerator
a
b
f
h
i
n
o
p
s
v
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
~
Functions
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
~
Variables
a
b
d
e
f
g
h
i
l
m
n
p
q
r
s
t
u
v
w
x
Typedefs
Enumerations
Enumerator
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
w
Related Functions
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
Functions
i
m
p
s
u
Variables
Typedefs
Enumerations
Enumerator
c
d
e
f
m
o
p
r
s
t
v
Macros
_
a
c
d
f
g
h
i
k
l
m
n
p
r
s
t
u
v
►
F´ Flight Software - C/C++ Documentation
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
PortBase.cpp
Go to the documentation of this file.
1
#include <
Fw/Port/PortBase.hpp
>
2
#include <Fw/Types/BasicTypes.hpp>
3
#include <
Fw/Logger/Logger.hpp
>
4
#include <cstdio>
5
#include "Fw/Types/Assert.hpp"
6
7
#if FW_PORT_TRACING
8
void
setConnTrace(
bool
trace) {
9
Fw::PortBase::setTrace(trace);
10
}
11
12
namespace
Fw
{
13
bool
PortBase::s_trace =
false
;
14
}
15
16
#endif // FW_PORT_TRACING
17
18
namespace
Fw
{
19
20
PortBase::PortBase
()
21
:
22
Fw
::
ObjBase
(nullptr),
23
m_connObj(nullptr)
24
#if
FW_PORT_TRACING
== 1
25
,m_trace(false),
26
m_ovr_trace(false)
27
#endif
28
{
29
30
}
31
32
PortBase::~PortBase
() {
33
34
}
35
36
void
PortBase::init
() {
37
ObjBase::init
();
38
39
}
40
41
bool
PortBase::isConnected
() {
42
return
m_connObj
==
nullptr
?
false
:
true
;
43
}
44
45
#if FW_PORT_TRACING == 1
46
47
void
PortBase::trace() {
48
bool
do_trace =
false
;
49
50
if
(this->m_ovr_trace) {
51
if
(this->m_trace) {
52
do_trace =
true
;
53
}
54
}
else
if
(PortBase::s_trace) {
55
do_trace =
true
;
56
}
57
58
if
(do_trace) {
59
#if FW_OBJECT_NAMES == 1
60
Fw::Logger::logMsg
(
"Trace: %s\n"
,
reinterpret_cast<
POINTER_CAST
>
(this->m_objName), 0, 0, 0, 0, 0);
61
#else
62
Fw::Logger::logMsg
(
"Trace: %p\n"
,
reinterpret_cast<
POINTER_CAST
>
(
this
), 0, 0, 0, 0, 0);
63
#endif
64
}
65
}
66
67
void
PortBase::setTrace(
bool
trace) {
68
PortBase::s_trace = trace;
69
}
70
71
void
PortBase::ovrTrace(
bool
ovr,
bool
trace) {
72
this->m_ovr_trace = ovr;
73
this->m_trace = trace;
74
}
75
76
#endif // FW_PORT_TRACING
77
78
#if FW_OBJECT_NAMES == 1
79
#if FW_OBJECT_TO_STRING == 1
80
void
PortBase::toString(
char
* buffer,
NATIVE_INT_TYPE
size) {
81
FW_ASSERT
(size > 0);
82
if
(snprintf(buffer, size,
"Port: %s %s->(%s)"
, this->m_objName, this->
m_connObj
?
"C"
:
"NC"
,
83
this->
m_connObj
? this->
m_connObj
->getObjName() :
"None"
) < 0) {
84
buffer[0] = 0;
85
}
86
}
87
#endif // FW_OBJECT_TO_STRING
88
#endif // FW_OBJECT_NAMES
89
90
91
}
92
Fw::ObjBase
Brief class description.
Definition:
ObjBase.hpp:33
FW_PORT_TRACING
#define FW_PORT_TRACING
Indicates whether port calls are traced (more code, more visibility into execution)
Definition:
FpConfig.hpp:122
Fw::PortBase::PortBase
PortBase()
Definition:
PortBase.cpp:20
Fw::PortBase::init
virtual void init()
Definition:
PortBase.cpp:36
NATIVE_INT_TYPE
int NATIVE_INT_TYPE
native integer type declaration
Definition:
BasicTypes.hpp:27
Fw::ObjBase::init
void init()
Object initializer.
Definition:
ObjBase.cpp:27
FW_ASSERT
#define FW_ASSERT(...)
Definition:
Assert.hpp:9
PortBase.hpp
Fw::Logger::logMsg
static void logMsg(const char *fmt, POINTER_CAST a0=0, POINTER_CAST a1=0, POINTER_CAST a2=0, POINTER_CAST a3=0, POINTER_CAST a4=0, POINTER_CAST a5=0, POINTER_CAST a6=0, POINTER_CAST a7=0, POINTER_CAST a8=0, POINTER_CAST a9=0)
Definition:
Logger.cpp:18
Fw::PortBase::isConnected
bool isConnected()
Definition:
PortBase.cpp:41
Fw::PortBase::~PortBase
virtual ~PortBase()
Definition:
PortBase.cpp:32
Fw::PortBase::m_connObj
Fw::ObjBase * m_connObj
Definition:
PortBase.hpp:33
Logger.hpp
Fw
Definition:
SerIds.hpp:20
Fw
Port
PortBase.cpp
Generated by
1.8.17