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
►
F´ Flight Software - C/C++ Documentation
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Loading...
Searching...
No Matches
SerialBuffer.cpp
Go to the documentation of this file.
1
// ======================================================================
2
// \title SerialBuffer.cpp
3
// \author bocchino
4
// \brief cpp file for SerialBuffer type
5
//
6
// \copyright
7
// Copyright (C) 2016 California Institute of Technology.
8
// ALL RIGHTS RESERVED. United States Government Sponsorship
9
// acknowledged.
10
//
11
// ======================================================================
12
13
#include "
Fw/Types/SerialBuffer.hpp
"
14
#include "
Fw/Types/Assert.hpp
"
15
16
namespace
Fw
{
17
18
SerialBuffer ::
19
SerialBuffer(
20
U8
*
const
data,
21
const
U32 capacity
22
) :
23
data(data),
24
capacity(capacity)
25
{
26
27
}
18
SerialBuffer :: {
…
}
28
29
NATIVE_UINT_TYPE
SerialBuffer ::
30
getBuffCapacity()
const
31
{
32
return
capacity;
33
}
29
NATIVE_UINT_TYPE
SerialBuffer :: {
…
}
34
35
U8
* SerialBuffer ::
36
getBuffAddr()
37
{
38
return
data;
39
}
35
U8
* SerialBuffer :: {
…
}
40
41
const
U8
* SerialBuffer ::
42
getBuffAddr()
const
43
{
44
return
data;
45
}
41
const
U8
* SerialBuffer :: {
…
}
46
47
void
SerialBuffer ::
48
fill()
49
{
50
const
SerializeStatus
status = this->setBuffLen(this->capacity);
51
FW_ASSERT
(status ==
FW_SERIALIZE_OK
);
52
}
47
void
SerialBuffer :: {
…
}
53
54
SerializeStatus
SerialBuffer ::
55
pushBytes(
const
U8
*
const
addr,
const
NATIVE_UINT_TYPE
n)
56
{
57
// "true" means "just push the bytes"
58
return
this->serialize(
const_cast<
U8
*
>
(addr), n,
true
);
59
}
54
SerializeStatus
SerialBuffer :: {
…
}
60
61
SerializeStatus
SerialBuffer ::
62
popBytes(
U8
*
const
addr,
NATIVE_UINT_TYPE
n)
63
{
64
// "true" means "just pop the bytes"
65
return
this->deserialize(addr, n,
true
);
66
}
61
SerializeStatus
SerialBuffer :: {
…
}
67
68
}
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
SerialBuffer.hpp
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
Fw
Types
SerialBuffer.cpp
Generated by
1.10.0