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
297 Svc::SendFileResponse SendFile_handler(
299 sourceFileNameString sourceFilename,
300 destFileNameString destFilename,
307 void bufferReturn_handler(
329 void SendFile_cmdHandler(
338 void Cancel_cmdHandler(
345 void SendPartial_cmdHandler(
363 const char* sourceFilename,
364 const char* destFilename,
371 void sendCancelPacket(
void);
372 void sendEndPacket(
void);
373 void sendStartPacket(
void);
377 void exitFileTransfer(
void);
378 void enterCooldown(
void);
381 void getBuffer(
Fw::Buffer& buffer, PacketType type);
383 void downlinkPacket();
385 void finishHelper(
bool is_cancel);
387 Fw::CommandResponse statusToCmdResp(SendFileStatus status);
389 void sendResponse(SendFileStatus resp);
416 PacketsSent packetsSent;
455 struct FileEntry curEntry;