27 m_lastSequenceIndex(0),
28 m_lastPacketWriteStatus(
Os::File::MAX_STATUS),
29 m_filesReceived(this),
30 m_packetsReceived(this),
58 switch (header_type) {
69 this->handleCancelPacket();
101 this->m_packetsReceived.packetReceived();
102 if (this->m_receiveMode != START) {
103 this->m_file.osFile.close();
108 this->goToDataMode();
111 this->m_warnings.fileOpen(this->m_file.name);
112 this->goToStartMode();
119 this->m_packetsReceived.packetReceived();
120 if (this->m_receiveMode != DATA) {
129 this->checkDuplicatedPacket(sequenceIndex)) {
133 this->checkSequenceIndex(sequenceIndex);
136 if (byteOffset + dataSize > this->m_file.size) {
137 this->m_warnings.packetOutOfBounds(sequenceIndex, this->m_file.name);
146 this->m_warnings.fileWrite(this->m_file.name);
149 this->m_lastPacketWriteStatus = status;
155 this->m_packetsReceived.packetReceived();
156 if (this->m_receiveMode == DATA) {
157 this->m_filesReceived.fileReceived();
159 this->compareChecksums(endPacket);
165 this->goToStartMode();
171 this->m_packetsReceived.packetReceived();
173 this->goToStartMode();
177 checkSequenceIndex(
const U32 sequenceIndex)
179 if (sequenceIndex != this->m_lastSequenceIndex + 1) {
180 this->m_warnings.packetOutOfOrder(
182 this->m_lastSequenceIndex
185 this->m_lastSequenceIndex = sequenceIndex;
189 checkDuplicatedPacket(
const U32 sequenceIndex)
192 if (sequenceIndex == this->m_lastSequenceIndex) {
193 this->m_warnings.packetDuplicate(sequenceIndex);
204 this->m_file.getChecksum(computed);
206 if (computed != stored) {
207 this->m_warnings.badChecksum(
217 this->m_file.osFile.close();
218 this->m_receiveMode = START;
219 this->m_lastSequenceIndex = 0;
226 this->m_receiveMode = DATA;
227 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.
@ MAX_STATUS
Maximum value of status.
@ 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