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
323 void bufferReturn_handler(
345 void SendFile_cmdHandler(
354 void Cancel_cmdHandler(
361 void SendPartial_cmdHandler(
379 const char* sourceFilename,
380 const char* destFilename,
387 void sendCancelPacket();
388 void sendEndPacket();
389 void sendStartPacket();
393 void exitFileTransfer();
394 void enterCooldown();
397 void getBuffer(
Fw::Buffer& buffer, PacketType type);
399 void downlinkPacket();
401 void finishHelper(
bool is_cancel);
405 void sendResponse(SendFileStatus resp);
429 FilesSent m_filesSent;
432 PacketsSent m_packetsSent;
471 struct FileEntry m_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.
Enum representing a command response.
void init()
Object initializer.
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.
SendFileRequestPortStrings::StringSize100 sourceFileNameString
SendFileRequestPortStrings::StringSize100 destFileNameString
static const U32 FILEDOWNLINK_INTERNAL_BUFFER_SIZE