F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
TmFramer.hpp
Go to the documentation of this file.
1
// ======================================================================
2
// \title TmFramer.hpp
3
// \author thomas-bc
4
// \brief hpp file for TmFramer component implementation class
5
// ======================================================================
6
7
#ifndef Svc_Ccsds_TmFramer_HPP
8
#define Svc_Ccsds_TmFramer_HPP
9
10
#include "
Svc/Ccsds/TmFramer/TmFramerComponentAc.hpp
"
11
#include "
Svc/Ccsds/Types/FppConstantsAc.hpp
"
12
#include "
Svc/Ccsds/Types/TMHeaderSerializableAc.hpp
"
13
#include "
Svc/Ccsds/Types/TMTrailerSerializableAc.hpp
"
14
15
namespace
Svc
{
16
17
namespace
Ccsds {
18
19
class
TmFramer
final :
public
TmFramerComponentBase
{
20
friend
class
TmFramerTester
;
21
22
static_assert(
ComCfg::TmFrameFixedSize
>
TMHeader::SERIALIZED_SIZE
+
TMTrailer::SERIALIZED_SIZE
,
23
"TM Frame Fixed Size must be at least large enough to hold header, trailer and data"
);
24
25
static_assert(static_cast<FwSizeType>(
TMHeader::SERIALIZED_SIZE
) == static_cast<FwSizeType>(
TmHeaderSize
),
26
"Svc.Ccsds.TmHeaderSize must match TMHeader"
);
27
static_assert(static_cast<FwSizeType>(
TMTrailer::SERIALIZED_SIZE
) == static_cast<FwSizeType>(
TmTrailerSize
),
28
"Svc.Ccsds.TmTrailerSize must match TMTrailer"
);
29
31
static
constexpr
FwSizeType
TmPayloadCapacity =
static_cast<
FwSizeType
>
(
TmDataFieldSize
);
32
33
enum class
BufferOwnershipState {
34
NOT_OWNED,
35
OWNED,
36
};
37
38
public
:
39
// ----------------------------------------------------------------------
40
// Component construction and destruction
41
// ----------------------------------------------------------------------
42
44
TmFramer
(
const
char
*
const
compName
45
);
46
48
~TmFramer
();
49
50
private
:
51
// ----------------------------------------------------------------------
52
// Handler implementations for typed input ports
53
// ----------------------------------------------------------------------
54
59
void
comStatusIn_handler(
FwIndexType
portNum,
60
Fw::Success
& condition
61
)
override
;
62
69
void
dataIn_handler(
FwIndexType
portNum,
70
Fw::Buffer
& data,
71
const
ComCfg::FrameContext
& context)
override
;
72
76
void
dataReturnIn_handler(
FwIndexType
portNum,
77
Fw::Buffer
& data,
78
const
ComCfg::FrameContext
& context)
override
;
79
80
// ----------------------------------------------------------------------
81
// Members
82
// ----------------------------------------------------------------------
83
private
:
84
// Because the TM protocol use fixed width frames, and only one frame is in transit between ComQueue and
85
// ComInterface at a time, we can use a member fixed-size buffer to hold the frame data
86
U8
m_frameBuffer[
ComCfg::TmFrameFixedSize
];
87
BufferOwnershipState m_bufferState = BufferOwnershipState::OWNED;
88
89
// Current implementation uses a single virtual channel, so we can use a single virtual frame count
90
U8
m_masterFrameCount;
91
U8
m_virtualFrameCount;
92
};
93
94
}
// namespace Ccsds
95
}
// namespace Svc
96
97
#endif
TmFramerComponentAc.hpp
FwSizeType
PlatformSizeType FwSizeType
Definition:
FwSizeTypeAliasAc.h:15
Svc::Ccsds::TMHeader::SERIALIZED_SIZE
The size of the serial representation.
Definition:
TMHeaderSerializableAc.hpp:32
FppConstantsAc.hpp
Svc::Ccsds::TmFramer::~TmFramer
~TmFramer()
Destroy TmFramer object.
Definition:
TmFramer.cpp:22
Svc::Ccsds::TmDataFieldSize
Definition:
FppConstantsAc.hpp:166
TMTrailerSerializableAc.hpp
ComCfg::TmFrameFixedSize
Definition:
FppConstantsAc.hpp:278
Svc::Ccsds::TmFramer::TmFramerTester
friend class TmFramerTester
Definition:
TmFramer.hpp:20
Svc::Ccsds::TmFramer
Definition:
TmFramer.hpp:19
Svc::Ccsds::TmTrailerSize
Definition:
FppConstantsAc.hpp:161
U8
uint8_t U8
8-bit unsigned integer
Definition:
BasicTypes.h:54
TMHeaderSerializableAc.hpp
Svc::Ccsds::TmFramerComponentBase
Auto-generated base for TmFramer component.
Definition:
TmFramerComponentAc.hpp:35
Svc::Ccsds::TmFramer::TmFramer
TmFramer(const char *const compName)
Construct TmFramer object.
Definition:
TmFramer.cpp:19
FwIndexType
PlatformIndexType FwIndexType
Definition:
FwIndexTypeAliasAc.h:15
Svc::Ccsds::TmHeaderSize
Definition:
FppConstantsAc.hpp:156
ComCfg::FrameContext
Type used to pass context info between components during framing/deframing.
Definition:
FrameContextSerializableAc.hpp:22
Svc
RateGroupDivider component implementation.
Definition:
ActiveRateGroupCfg.hpp:18
Fw::Buffer
Definition:
Buffer.hpp:53
Svc::Ccsds::TMTrailer::SERIALIZED_SIZE
The size of the serial representation.
Definition:
TMTrailerSerializableAc.hpp:32
Fw::Success
Success/Failure.
Definition:
SuccessEnumAc.hpp:18
Svc
Ccsds
TmFramer
TmFramer.hpp
Generated by
1.8.14