F´ Flight Software - C/C++ Documentation
NASA-v1.5.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
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Functions
a
b
c
d
g
h
i
m
r
s
t
v
w
Variables
Typedefs
Enumerations
Enumerator
a
b
c
f
h
i
l
m
n
o
p
s
t
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
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
c
d
e
f
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Typedefs
c
t
u
w
Enumerations
b
c
d
e
f
g
h
i
m
o
p
q
s
t
w
Enumerator
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
w
Related Functions
a
b
c
f
g
h
l
p
r
s
t
Files
File List
File Members
All
_
a
b
c
d
f
g
h
i
k
l
m
n
p
r
s
t
u
v
w
Functions
f
i
m
s
u
Variables
_
c
f
i
l
p
t
Typedefs
Enumerations
Enumerator
a
c
d
f
i
m
p
r
s
t
w
Macros
a
c
d
f
g
h
i
k
l
m
n
p
r
s
t
u
v
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Header.cpp
Go to the documentation of this file.
1
// ======================================================================
2
// \title Header.cpp
3
// \author bocchino
4
// \brief cpp file for FilePacket::Header
5
//
6
// \copyright
7
// Copyright 2009-2016, by the California Institute of Technology.
8
// ALL RIGHTS RESERVED. United States Government Sponsorship
9
// acknowledged.
10
//
11
// ======================================================================
12
13
#include <
Fw/FilePacket/FilePacket.hpp
>
14
#include <
Fw/Types/Assert.hpp
>
15
16
namespace
Fw
{
17
18
void
FilePacket::Header ::
19
initialize(
20
const
Type type,
21
const
U32 sequenceIndex
22
)
23
{
24
this->type =
type
;
25
this->sequenceIndex =
sequenceIndex
;
26
}
27
28
U32
FilePacket::Header ::
29
bufferSize
(
void
)
const
30
{
31
return
sizeof
(
U8
) +
sizeof
(this->sequenceIndex);
32
}
33
34
SerializeStatus
FilePacket::Header ::
35
fromSerialBuffer
(
SerialBuffer
& serialBuffer)
36
{
37
38
U8
type;
39
SerializeStatus
status;
40
41
status = serialBuffer.
deserialize
(type);
42
if
(status !=
FW_SERIALIZE_OK
) {
43
return
status;
44
}
45
this->type =
static_cast<
Type
>
(type);
46
47
status = serialBuffer.
deserialize
(this->sequenceIndex);
48
49
return
status;
50
51
}
52
53
SerializeStatus
FilePacket::Header ::
54
toSerialBuffer
(
SerialBuffer
& serialBuffer)
const
55
{
56
57
const
U8
type =
static_cast<
U8
>
(this->type);
58
SerializeStatus
status;
59
60
status = serialBuffer.
serialize
(type);
61
if
(status !=
FW_SERIALIZE_OK
)
62
return
status;
63
64
status = serialBuffer.
serialize
(this->sequenceIndex);
65
if
(status !=
FW_SERIALIZE_OK
)
66
return
status;
67
68
return
FW_SERIALIZE_OK
;
69
70
}
71
72
}
Fw::SerialBuffer
A variable-length serializable buffer.
Definition:
SerialBuffer.hpp:26
Fw::SerializeStatus
SerializeStatus
forward declaration for string
Definition:
Serializable.hpp:14
Fw::SerializeBufferBase::serialize
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
Definition:
Serializable.cpp:67
Fw::FilePacket::Header::toSerialBuffer
SerializeStatus toSerialBuffer(SerialBuffer &serialBuffer) const
Write this Header to a SerialBuffer.
Definition:
Header.cpp:54
U8
uint8_t U8
8-bit unsigned integer
Definition:
BasicTypes.hpp:76
Assert.hpp
Fw::FW_SERIALIZE_OK
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.
Definition:
Serializable.hpp:15
Fw::FilePacket::Header::bufferSize
U32 bufferSize(void) const
Compute the buffer size needed to hold this Header.
Definition:
Header.cpp:29
Fw::FilePacket::Header::sequenceIndex
U32 sequenceIndex
The sequence index.
Definition:
FilePacket.hpp:93
Fw::FilePacket::Type
Type
Packet type.
Definition:
FilePacket.hpp:36
FilePacket.hpp
Fw::FilePacket::Header::fromSerialBuffer
SerializeStatus fromSerialBuffer(SerialBuffer &serialBuffer)
Initialize this Header from a SerialBuffer.
Definition:
Header.cpp:35
Fw::SerializeBufferBase::deserialize
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
Definition:
Serializable.cpp:292
Fw::FilePacket::Header::type
Type type
The packet type.
Definition:
FilePacket.hpp:90
Fw
Definition:
BufferGetPortAc.cpp:6
Fw
FilePacket
Header.cpp
Generated by
1.8.19