27 m_lastSequenceIndex(0),
28 m_filesReceived(this),
29 m_packetsReceived(this),
57 switch (header_type) {
68 this->handleCancelPacket();
100 this->m_packetsReceived.packetReceived();
101 if (this->m_receiveMode != START) {
102 this->m_file.osFile.close();
107 this->goToDataMode();
110 this->m_warnings.fileOpen(this->m_file.name);
111 this->goToStartMode();
118 this->m_packetsReceived.packetReceived();
119 if (this->m_receiveMode != DATA) {
124 this->checkSequenceIndex(sequenceIndex);
127 if (byteOffset + dataSize > this->m_file.size) {
128 this->m_warnings.packetOutOfBounds(sequenceIndex, this->m_file.name);
137 this->m_warnings.fileWrite(this->m_file.name);
144 this->m_packetsReceived.packetReceived();
145 if (this->m_receiveMode == DATA) {
146 this->m_filesReceived.fileReceived();
148 this->compareChecksums(endPacket);
154 this->goToStartMode();
160 this->m_packetsReceived.packetReceived();
162 this->goToStartMode();
166 checkSequenceIndex(
const U32 sequenceIndex)
168 if (sequenceIndex != this->m_lastSequenceIndex + 1) {
169 this->m_warnings.packetOutOfOrder(
171 this->m_lastSequenceIndex
174 this->m_lastSequenceIndex = sequenceIndex;
181 this->m_file.getChecksum(computed);
183 if (computed != stored) {
184 this->m_warnings.badChecksum(
194 this->m_file.osFile.close();
195 this->m_receiveMode = START;
196 this->m_lastSequenceIndex = 0;
202 this->m_receiveMode = DATA;
203 this->m_lastSequenceIndex = 0;
PlatformIntType NATIVE_INT_TYPE
C++-compatible configuration header for fprime configuration.
Class representing a 32-bit checksum as mandated by the CCSDS File Delivery Protocol.
U32 getValue() const
Get the checksum value.
The type of a data packet.
const FilePacket::Header & asHeader() const
Get this as a Header.
U32 getByteOffset() const
Get the byte offset.
const U8 * getData() const
Get the data.
U32 getDataSize() const
Get the data size.
The type of an end packet.
void getChecksum(CFDP::Checksum &checksum) const
Get the checksum.
const FilePacket::Header & asHeader() const
Get this as a Header.
@ OP_OK
Operation was successful.
Auto-generated base for FileUplink component.
void log_WARNING_HI_DecodeError(I32 status)
void log_ACTIVITY_HI_UplinkCanceled()
void pingOut_out(FwIndexType portNum, U32 key)
Invoke output port pingOut.
void log_WARNING_HI_FileWriteError_ThrottleClear()
Reset throttle value for FileWriteError.
void log_WARNING_HI_PacketOutOfOrder_ThrottleClear()
Reset throttle value for PacketOutOfOrder.
void log_WARNING_HI_PacketOutOfBounds_ThrottleClear()
Reset throttle value for PacketOutOfBounds.
void bufferSendOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port bufferSendOut.
void log_WARNING_HI_InvalidReceiveMode_ThrottleClear()
Reset throttle value for InvalidReceiveMode.
void log_ACTIVITY_HI_FileReceived(const Fw::StringBase &fileName)
FileUplink(const char *const name)
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.
The type of a start packet.
SerializeStatus fromBuffer(const Buffer &buffer)
const StartPacket & asStartPacket() const
const EndPacket & asEndPacket() const
const DataPacket & asDataPacket() const
const Header & asHeader() const