12#ifndef Svc_FileDownlink_HPP
13#define Svc_FileDownlink_HPP
16#include <Svc/FileDownlink/FileDownlinkComponentAc.hpp>
26 public FileDownlinkComponentBase
41 typedef enum { IDLE, DOWNLINK, CANCEL, WAIT, COOLDOWN } Type;
46 Mode() : value(IDLE) { }
51 void set(
const Type value) {
60 const Type value = this->value;
105 const char *
const sourceFileName,
106 const char *
const destFileName
112 const U32 byteOffset,
118 checksum = this->checksum;
129 n(0), fileDownlink(fileDownlink)
137 this->fileDownlink->tlmWrite_FilesSent(n);
157 n(0), fileDownlink(fileDownlink)
165 this->fileDownlink->tlmWrite_PacketsSent(n);
185 n(0), fileDownlink(fileDownlink)
191 void fileOpenError();
201 this->fileDownlink->tlmWrite_Warnings(n);
215 enum CallerSource { COMMAND, PORT };
217 #define FILE_ENTRY_FILENAME_LEN 101
248 const char *
const compName
292 Svc::SendFileResponse SendFile_handler(
294 const sourceFileNameString& sourceFilename,
295 const destFileNameString& destFilename,
302 void bufferReturn_handler(
324 void SendFile_cmdHandler(
333 void Cancel_cmdHandler(
340 void SendPartial_cmdHandler(
358 const char* sourceFilename,
359 const char* destFilename,
366 void sendCancelPacket();
367 void sendEndPacket();
368 void sendStartPacket();
372 void exitFileTransfer();
373 void enterCooldown();
376 void getBuffer(
Fw::Buffer& buffer, PacketType type);
378 void downlinkPacket();
380 void finishHelper(
bool is_cancel);
382 Fw::CmdResponse statusToCmdResp(SendFileStatus status);
384 void sendResponse(SendFileStatus resp);
411 PacketsSent packetsSent;
450 struct FileEntry curEntry;
PlatformIntType NATIVE_INT_TYPE
uint8_t U8
8-bit unsigned integer
PlatformUIntType NATIVE_UINT_TYPE
#define FILE_ENTRY_FILENAME_LEN
Class representing a CFDP checksum.
FileDownlink(const char *const compName)
void init(const NATIVE_INT_TYPE queueDepth, const NATIVE_INT_TYPE instance)
void configure(U32 timeout, U32 cooldown, U32 cycleTime, U32 fileQueueDepth)
static const U32 FILEDOWNLINK_INTERNAL_BUFFER_SIZE