F´ Flight Software - C/C++ Documentation devel
A framework for building embedded system applications to NASA flight quality standards.
Loading...
Searching...
No Matches
DpContainer.hpp
Go to the documentation of this file.
1// ======================================================================
2// \title DpContainer.hpp
3// \author bocchino
4// \brief hpp file for DpContainer
5// ======================================================================
6
7#ifndef Fw_DpContainer_HPP
8#define Fw_DpContainer_HPP
9
10#include "Fw/Buffer/Buffer.hpp"
12#include "Fw/Time/Time.hpp"
13#include "Utils/Hash/Hash.hpp"
16
17namespace Fw {
18
21 public:
22 // ----------------------------------------------------------------------
23 // Constants and Types
24 // ----------------------------------------------------------------------
25
49
58
59 public:
60 // ----------------------------------------------------------------------
61 // Constructor
62 // ----------------------------------------------------------------------
63
66 const Fw::Buffer& buffer
67 );
68
71
72 public:
73 // ----------------------------------------------------------------------
74 // Public member functions
75 // ----------------------------------------------------------------------
76
79 FwDpIdType getId() const { return this->m_id; }
80
83 FwSizeType getDataSize() const { return this->m_dataSize; }
84
87 Fw::Buffer getBuffer() const { return this->m_buffer; }
88
91
94 FwDpPriorityType getPriority() const { return this->m_priority; }
95
98 Fw::Time getTimeTag() const { return this->m_timeTag; }
99
103
108
111 void serializeHeader();
112
115 ) {
116 this->m_id = id;
117 }
118
121 ) {
122 this->m_priority = priority;
123 }
124
126 void setTimeTag(Fw::Time timeTag
127 ) {
128 this->m_timeTag = timeTag;
129 }
130
133 ) {
134 this->m_procTypes = procTypes;
135 }
136
138 void setDpState(DpState dpState
139 ) {
140 this->m_dpState = dpState;
141 }
142
144 void setDataSize(FwSizeType dataSize
145 ) {
146 this->m_dataSize = dataSize;
147 }
148
150 void setBuffer(const Buffer& buffer
151 );
152
154 void updateHeaderHash();
155
158 // Data hash goes after the header, the header hash, and the data
160 }
161
163 void updateDataHash();
164
165 public:
166 // ----------------------------------------------------------------------
167 // Public static functions
168 // ----------------------------------------------------------------------
169
172 ) {
173 return Header::SIZE + dataSize + 2 * HASH_DIGEST_LENGTH;
174 }
175
176 PRIVATE:
177 // ----------------------------------------------------------------------
178 // Private member functions
179 // ----------------------------------------------------------------------
180
182 void initUserDataField();
183
184 public:
185 // ----------------------------------------------------------------------
186 // Public member variables
187 // ----------------------------------------------------------------------
188
191
192 PROTECTED:
193 // ----------------------------------------------------------------------
194 // Protected member variables
195 // ----------------------------------------------------------------------
196
200
203
206
209
212
215
218
221};
222
223} // end namespace Fw
224
225#endif
uint8_t U8
8-bit unsigned integer
Definition BasicTypes.h:26
#define HASH_DIGEST_LENGTH
Definition CRC32.hpp:18
U32 FwDpPriorityType
Definition FpConfig.h:74
U32 FwDpIdType
Definition FpConfig.h:71
U32 FwPacketDescriptorType
Definition FpConfig.h:53
PlatformSizeType FwSizeType
Definition FpConfig.h:18
U8 SerialType
The serial representation type.
A data product Container.
DpCfg::ProcType::SerialType m_procTypes
The processing types.
void setPriority(FwDpPriorityType priority)
Set the priority.
Fw::Time getTimeTag() const
static constexpr FwSizeType DATA_OFFSET
The data offset.
DpContainer()
Constructor for container with default initialization.
DpCfg::ProcType::SerialType getProcTypes() const
FwDpPriorityType m_priority
The priority.
Fw::ExternalSerializeBuffer m_dataBuffer
The data buffer.
Header::UserData m_userData
The user data.
FwDpIdType getId() const
void setId(FwDpIdType id)
Set the id.
static constexpr FwSizeType MIN_PACKET_SIZE
void updateHeaderHash()
Update the header hash.
void setTimeTag(Fw::Time timeTag)
Set the time tag.
void setDpState(DpState dpState)
Set the data product state.
FwDpPriorityType getPriority() const
Fw::Buffer getBuffer() const
Fw::SerializeStatus deserializeHeader()
Time m_timeTag
The time tag.
static constexpr FwSizeType getPacketSizeForDataSize(FwSizeType dataSize)
Get the packet size for a given data size.
FwSizeType getPacketSize() const
Get the packet size corresponding to the data size.
Buffer m_buffer
The packet buffer.
FwSizeType m_dataSize
The data size.
FwSizeType getDataSize() const
void setBuffer(const Buffer &buffer)
Set the packet buffer.
FwSizeType getDataHashOffset() const
Get the data hash offset.
static constexpr FwSizeType HEADER_HASH_OFFSET
The header hash offset.
void setDataSize(FwSizeType dataSize)
Set the data size.
void updateDataHash()
Update the data hash.
DpState m_dpState
The data product state.
void setProcTypes(DpCfg::ProcType::SerialType procTypes)
Set the processing types bit mask.
@ SERIALIZED_SIZE
The size of the serial representation.
@ SERIALIZED_SIZE
Definition Time.hpp:13
SerializeStatus
forward declaration for string
A DpContainer packet header.
static constexpr FwSizeType ID_OFFSET
The offset for the id field.
static constexpr FwSizeType TIME_TAG_OFFSET
The offset for the time tag field.
static constexpr FwSizeType DP_STATE_OFFSET
The offset of the data product state field.
static constexpr FwSizeType PACKET_DESCRIPTOR_OFFSET
The offset for the packet descriptor field.
static constexpr FwSizeType PROC_TYPES_OFFSET
The offset for the processing types field.
static constexpr FwSizeType DATA_SIZE_OFFSET
The offset for the data size field.
static constexpr FwSizeType SIZE
The header size.
U8[DpCfg::CONTAINER_USER_DATA_SIZE] UserData
The type of user data.
static constexpr FwSizeType USER_DATA_OFFSET
The offset for the user data field.
static constexpr FwDpPriorityType PRIORITY_OFFSET
The offset for the priority field.