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(
void) : 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)
135 void fileSent(
void) {
137 this->fileDownlink->tlmWrite_FilesSent(n);
157 n(0), fileDownlink(fileDownlink)
163 void packetSent(
void) {
165 this->fileDownlink->tlmWrite_PacketsSent(n);
185 n(0), fileDownlink(fileDownlink)
191 void fileOpenError(
void);
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 sourceFileNameString sourceFilename,
295 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(
void);
367 void sendEndPacket(
void);
368 void sendStartPacket(
void);
372 void exitFileTransfer(
void);
373 void enterCooldown(
void);
376 void getBuffer(
Fw::Buffer& buffer, PacketType type);
378 void downlinkPacket();
380 void finishHelper(
bool is_cancel);
382 Fw::CommandResponse statusToCmdResp(SendFileStatus status);
384 void sendResponse(SendFileStatus resp);
411 PacketsSent packetsSent;
450 struct FileEntry curEntry;