12 #ifndef Svc_FileDownlink_HPP
13 #define Svc_FileDownlink_HPP
41 typedef enum {
IDLE, DOWNLINK, CANCEL, WAIT, COOLDOWN } Type;
46 Mode() : m_value(
IDLE) { }
51 void set(
const Type value) {
53 this->m_value = value;
54 this->m_mutex.unLock();
60 const Type value = this->m_value;
61 this->m_mutex.unLock();
80 File() : m_size(0) { }
103 const char *
const sourceFileName,
104 const char *
const destFileName
110 const U32 byteOffset,
116 checksum = this->m_checksum;
121 return this->m_sourceName;
126 return this->m_destName;
131 return this->m_osFile;
147 m_sent_file_count(0),
148 m_fileDownlink(fileDownlink)
155 ++this->m_sent_file_count;
156 this->m_fileDownlink->tlmWrite_FilesSent(m_sent_file_count);
162 U32 m_sent_file_count;
176 m_sent_packet_count(0),
177 m_fileDownlink(fileDownlink)
184 ++this->m_sent_packet_count;
185 this->m_fileDownlink->tlmWrite_PacketsSent(m_sent_packet_count);
191 U32 m_sent_packet_count;
206 m_fileDownlink(fileDownlink)
212 void fileOpenError();
221 ++this->m_warning_count;
222 this->m_fileDownlink->tlmWrite_Warnings(m_warning_count);
236 enum CallerSource { COMMAND, PORT };
238 #define FILE_ENTRY_FILENAME_LEN 101
269 const char *
const compName
316 void bufferReturn_handler(
338 void SendFile_cmdHandler(
347 void Cancel_cmdHandler(
354 void SendPartial_cmdHandler(
372 const char* sourceFilename,
373 const char* destFilename,
380 void sendCancelPacket();
381 void sendEndPacket();
382 void sendStartPacket();
386 void exitFileTransfer();
387 void enterCooldown();
390 void getBuffer(
Fw::Buffer& buffer, PacketType type);
392 void downlinkPacket();
394 void finishHelper(
bool is_cancel);
398 void sendResponse(SendFileStatus resp);
422 FilesSent m_filesSent;
425 PacketsSent m_packetsSent;
464 struct FileEntry m_curEntry;
PlatformIntType NATIVE_INT_TYPE
uint8_t U8
8-bit unsigned integer
#define FILE_ENTRY_FILENAME_LEN
Class representing a 32-bit checksum as mandated by the CCSDS File Delivery Protocol.
Enum representing a command response.
Auto-generated base for FileDownlink component.
FileDownlink(const char *const compName)
void configure(U32 timeout, U32 cooldown, U32 cycleTime, U32 fileQueueDepth)
Send file response struct.
static const U32 FILEDOWNLINK_INTERNAL_BUFFER_SIZE