F´ Flight Software - C/C++ Documentation
NASA-v1.6.0
A framework for building embedded system applications to NASA flight quality standards.
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
Functions
a
b
c
d
e
f
g
h
i
j
l
m
o
p
r
s
t
u
v
w
Variables
b
c
f
g
k
l
m
o
p
r
s
t
u
w
z
Typedefs
a
b
c
d
e
f
g
h
i
l
n
o
p
r
s
t
u
v
w
Enumerations
Enumerator
a
b
f
h
i
k
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
k
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
x
z
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Typedefs
a
b
c
e
f
i
m
r
s
t
w
Enumerations
b
c
d
f
g
h
m
o
q
r
s
t
u
w
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Related Symbols
:
a
b
c
d
f
g
h
l
p
q
r
s
t
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
Functions
f
g
i
m
p
r
s
t
u
Variables
_
b
c
f
g
i
l
p
r
s
w
Typedefs
a
b
c
e
f
i
n
p
s
t
u
Enumerations
Enumerator
a
b
c
f
g
h
p
r
s
t
Macros
_
a
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Loading...
Searching...
No Matches
LogPortAc.cpp
Go to the documentation of this file.
1
// ======================================================================
2
// \title LogPortAc.cpp
3
// \author Generated by fpp-to-cpp
4
// \brief cpp file for Log port
5
// ======================================================================
6
7
#include "
F-Prime/Fw/Log/LogPortAc.hpp
"
8
#include "
Fw/Types/Assert.hpp
"
9
#include "
Fw/Types/StringUtils.hpp
"
10
11
namespace
Fw
{
12
13
namespace
{
14
15
// ----------------------------------------------------------------------
16
// Port buffer class
17
// ----------------------------------------------------------------------
18
19
class
LogPortBuffer :
public
Fw::SerializeBufferBase
{
20
21
public
:
22
23
NATIVE_UINT_TYPE
getBuffCapacity()
const
{
24
return
InputLogPort::SERIALIZED_SIZE
;
25
}
26
27
U8
* getBuffAddr() {
28
return
m_buff;
29
}
30
31
const
U8
* getBuffAddr()
const
{
32
return
m_buff;
33
}
34
35
private
:
36
37
U8
m_buff[
InputLogPort::SERIALIZED_SIZE
];
38
39
};
40
41
}
42
43
// ----------------------------------------------------------------------
44
// Input Port Member functions
45
// ----------------------------------------------------------------------
46
47
InputLogPort ::
48
InputLogPort() :
49
Fw
::
InputPortBase
(),
50
m_func(nullptr)
51
{
52
53
}
47
InputLogPort :: {
…
}
54
55
void
InputLogPort ::
56
init()
57
{
58
Fw::InputPortBase::init
();
59
}
55
void
InputLogPort :: {
…
}
60
61
void
InputLogPort ::
62
addCallComp(
63
Fw::PassiveComponentBase
* callComp,
64
CompFuncPtr funcPtr
65
)
66
{
67
FW_ASSERT
(callComp !=
nullptr
);
68
FW_ASSERT
(funcPtr !=
nullptr
);
69
70
this->m_comp = callComp;
71
this->m_func = funcPtr;
72
this->m_connObj = callComp;
73
}
61
void
InputLogPort :: {
…
}
74
75
void
InputLogPort ::
76
invoke(
77
FwEventIdType
id
,
78
Fw::Time
& timeTag,
79
const
Fw::LogSeverity
& severity,
80
Fw::LogBuffer
& args
81
)
82
{
83
#if FW_PORT_TRACING == 1
84
this->trace();
85
#endif
86
87
FW_ASSERT
(this->m_comp !=
nullptr
);
88
FW_ASSERT
(this->m_func !=
nullptr
);
89
90
return
this->m_func(this->m_comp, this->m_portNum,
id
, timeTag, severity, args);
91
}
75
void
InputLogPort :: {
…
}
92
93
#if FW_PORT_SERIALIZATION == 1
94
95
Fw::SerializeStatus
InputLogPort ::
96
invokeSerial(
Fw::SerializeBufferBase
& _buffer)
97
{
98
Fw::SerializeStatus
_status;
99
100
#if FW_PORT_TRACING == 1
101
this->trace();
102
#endif
103
104
FW_ASSERT
(this->m_comp !=
nullptr
);
105
FW_ASSERT
(this->m_func !=
nullptr
);
106
107
FwEventIdType
id;
108
_status = _buffer.
deserialize
(
id
);
109
if
(_status !=
Fw::FW_SERIALIZE_OK
) {
110
return
_status;
111
}
112
113
Fw::Time
timeTag;
114
_status = _buffer.
deserialize
(timeTag);
115
if
(_status !=
Fw::FW_SERIALIZE_OK
) {
116
return
_status;
117
}
118
119
Fw::LogSeverity
severity;
120
_status = _buffer.
deserialize
(severity);
121
if
(_status !=
Fw::FW_SERIALIZE_OK
) {
122
return
_status;
123
}
124
125
Fw::LogBuffer
args;
126
_status = _buffer.
deserialize
(args);
127
if
(_status !=
Fw::FW_SERIALIZE_OK
) {
128
return
_status;
129
}
130
131
this->m_func(this->m_comp, this->m_portNum,
id
, timeTag, severity, args);
132
133
return
Fw::FW_SERIALIZE_OK
;
134
}
135
136
#endif
137
138
// ----------------------------------------------------------------------
139
// Output Port Member functions
140
// ----------------------------------------------------------------------
141
142
OutputLogPort ::
143
OutputLogPort() :
144
Fw
::
OutputPortBase
(),
145
m_port(nullptr)
146
{
147
148
}
142
OutputLogPort :: {
…
}
149
150
void
OutputLogPort ::
151
init()
152
{
153
Fw::OutputPortBase::init
();
154
}
150
void
OutputLogPort :: {
…
}
155
156
void
OutputLogPort ::
157
addCallPort(
InputLogPort
* callPort)
158
{
159
FW_ASSERT
(callPort !=
nullptr
);
160
161
this->m_port = callPort;
162
this->m_connObj = callPort;
163
164
#if FW_PORT_SERIALIZATION == 1
165
this->m_serPort =
nullptr
;
166
#endif
167
}
156
void
OutputLogPort :: {
…
}
168
169
void
OutputLogPort ::
170
invoke(
171
FwEventIdType
id
,
172
Fw::Time
& timeTag,
173
const
Fw::LogSeverity
& severity,
174
Fw::LogBuffer
& args
175
)
176
{
177
#if FW_PORT_TRACING == 1
178
this->trace();
179
#endif
180
181
#if FW_PORT_SERIALIZATION
182
FW_ASSERT
((this->m_port !=
nullptr
) || (this->m_serPort !=
nullptr
));
183
184
if
(this->m_port !=
nullptr
) {
185
this->m_port->invoke(
id
, timeTag, severity, args);
186
}
187
else
{
188
Fw::SerializeStatus
_status;
189
LogPortBuffer _buffer;
190
191
_status = _buffer.serialize(
id
);
192
FW_ASSERT
(_status ==
Fw::FW_SERIALIZE_OK
,
static_cast<
FwAssertArgType
>
(_status));
193
194
_status = _buffer.serialize(timeTag);
195
FW_ASSERT
(_status ==
Fw::FW_SERIALIZE_OK
,
static_cast<
FwAssertArgType
>
(_status));
196
197
_status = _buffer.serialize(severity);
198
FW_ASSERT
(_status ==
Fw::FW_SERIALIZE_OK
,
static_cast<
FwAssertArgType
>
(_status));
199
200
_status = _buffer.serialize(args);
201
FW_ASSERT
(_status ==
Fw::FW_SERIALIZE_OK
,
static_cast<
FwAssertArgType
>
(_status));
202
203
_status = this->m_serPort->invokeSerial(_buffer);
204
FW_ASSERT
(_status ==
Fw::FW_SERIALIZE_OK
,
static_cast<
FwAssertArgType
>
(_status));
205
}
206
#else
207
FW_ASSERT
(this->m_port !=
nullptr
);
208
this->m_port->invoke(
id
, timeTag, severity, args);
209
#endif
210
}
169
void
OutputLogPort :: {
…
}
211
212
}
Assert.hpp
FW_ASSERT
#define FW_ASSERT(...)
Definition
Assert.hpp:7
U8
uint8_t U8
8-bit unsigned integer
Definition
BasicTypes.h:26
NATIVE_UINT_TYPE
PlatformUIntType NATIVE_UINT_TYPE
Definition
BasicTypes.h:52
FwAssertArgType
PlatformAssertArgType FwAssertArgType
Definition
FpConfig.h:21
FwEventIdType
U32 FwEventIdType
Definition
FpConfig.h:62
LogPortAc.hpp
StringUtils.hpp
Fw::InputLogPort
Definition
LogPortAc.hpp:29
Fw::InputLogPort::SERIALIZED_SIZE
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
Definition
LogPortAc.hpp:39
Fw::InputPortBase
Definition
InputPortBase.hpp:12
Fw::InputPortBase::init
virtual void init()
Definition
InputPortBase.cpp:18
Fw::LogBuffer
Definition
LogBuffer.hpp:21
Fw::LogSeverity
Enum representing event severity.
Definition
LogSeverityEnumAc.hpp:19
Fw::OutputPortBase
Definition
OutputPortBase.hpp:11
Fw::OutputPortBase::init
virtual void init()
Definition
OutputPortBase.cpp:21
Fw::PassiveComponentBase
Definition
PassiveComponentBase.hpp:10
Fw::SerializeBufferBase
Definition
Serializable.hpp:41
Fw::SerializeBufferBase::deserialize
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
Definition
Serializable.cpp:290
Fw::Time
Definition
Time.hpp:9
Fw
Definition
BufferGetPortAc.cpp:11
Fw::SerializeStatus
SerializeStatus
forward declaration for string
Definition
Serializable.hpp:13
Fw::FW_SERIALIZE_OK
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.
Definition
Serializable.hpp:14
docs-cache
F-Prime
Fw
Log
LogPortAc.cpp
Generated by
1.10.0