F´ Flight Software - C/C++ Documentation
devel
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
l
m
n
o
p
r
s
t
u
v
w
z
Functions
a
b
c
d
g
h
i
m
o
p
r
s
t
v
w
Variables
Typedefs
a
b
c
d
e
f
g
h
l
o
p
r
s
t
u
w
Enumerations
Enumerator
a
b
c
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
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
g
h
i
l
m
n
o
p
q
r
s
t
u
w
Typedefs
c
e
s
t
u
w
Enumerations
b
c
d
g
h
m
o
q
s
t
u
w
Enumerator
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Related Symbols
a
b
c
d
f
g
h
l
p
r
s
t
u
Files
File List
File Members
All
_
a
b
c
d
f
g
h
i
l
m
n
p
r
s
t
u
v
Functions
c
i
m
p
s
u
Variables
_
b
c
f
i
l
p
r
s
Typedefs
b
c
f
i
n
p
s
u
Enumerations
Enumerator
a
b
c
d
f
g
h
p
r
s
t
Macros
_
a
c
d
f
g
h
i
l
m
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
m_data(data),
24
m_capacity(capacity)
25
{
26
27
}
18
SerialBuffer :: {
…
}
28
29
NATIVE_UINT_TYPE
SerialBuffer ::
30
getBuffCapacity()
const
31
{
32
return
m_capacity;
33
}
29
NATIVE_UINT_TYPE
SerialBuffer :: {
…
}
34
35
U8
* SerialBuffer ::
36
getBuffAddr()
37
{
38
return
m_data;
39
}
35
U8
* SerialBuffer :: {
…
}
40
41
const
U8
* SerialBuffer ::
42
getBuffAddr()
const
43
{
44
return
m_data;
45
}
41
const
U8
* SerialBuffer :: {
…
}
46
47
void
SerialBuffer ::
48
fill()
49
{
50
const
SerializeStatus
status = this->setBuffLen(this->m_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:14
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
FppConstantsAc.hpp:98
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