29 packetsReceived(this),
66 switch (header_type) {
77 this->handleCancelPacket();
109 this->packetsReceived.packetReceived();
110 if (this->receiveMode != START) {
111 this->file.osFile.close();
116 this->goToDataMode();
119 this->warnings.fileOpen(this->file.name);
120 this->goToStartMode();
127 this->packetsReceived.packetReceived();
128 if (this->receiveMode != DATA) {
133 this->checkSequenceIndex(sequenceIndex);
136 if (byteOffset + dataSize > this->file.size) {
137 this->warnings.packetOutOfBounds(sequenceIndex, this->file.name);
146 this->warnings.fileWrite(this->file.name);
153 this->packetsReceived.packetReceived();
154 if (this->receiveMode == DATA) {
155 this->filesReceived.fileReceived();
157 this->compareChecksums(endPacket);
163 this->goToStartMode();
169 this->packetsReceived.packetReceived();
171 this->goToStartMode();
175 checkSequenceIndex(
const U32 sequenceIndex)
177 if (sequenceIndex != this->lastSequenceIndex + 1) {
178 this->warnings.packetOutOfOrder(
180 this->lastSequenceIndex
183 this->lastSequenceIndex = sequenceIndex;
190 this->file.getChecksum(computed);
192 if (computed != stored) {
193 this->warnings.badChecksum(
203 this->file.osFile.close();
204 this->receiveMode = START;
205 this->lastSequenceIndex = 0;
211 this->receiveMode = DATA;
212 this->lastSequenceIndex = 0;
PlatformIntType NATIVE_INT_TYPE
C++-compatible configuration header for fprime configuration.
Class representing a CFDP checksum.
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.
void init()
Object initializer.
@ OP_OK
Operation was successful.
Auto-generated base for FileUplink component.
void bufferSendOut_out(NATIVE_INT_TYPE portNum, Fw::Buffer &fwBuffer)
Invoke output port bufferSendOut.
void pingOut_out(NATIVE_INT_TYPE portNum, U32 key)
Invoke output port pingOut.
void log_WARNING_HI_DecodeError(I32 status)
void log_ACTIVITY_HI_UplinkCanceled()
void log_ACTIVITY_HI_FileReceived(const Fw::LogStringArg &fileName)
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 log_WARNING_HI_InvalidReceiveMode_ThrottleClear()
Reset throttle value for InvalidReceiveMode.
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