12 #ifndef Svc_FileDownlink_HPP 13 #define Svc_FileDownlink_HPP 15 #include <config/FileDownlinkCfg.hpp> 45 typedef enum {
IDLE, DOWNLINK, CANCEL, WAIT, COOLDOWN } Type;
50 Mode() : m_value(
IDLE) { }
55 void set(
const Type value) {
57 this->m_value = value;
58 this->m_mutex.unLock();
64 const Type value = this->m_value;
65 this->m_mutex.unLock();
86 File() : m_size(0) { }
109 const char *
const sourceFileName,
110 const char *
const destFileName
116 const U32 byteOffset,
122 checksum = this->m_checksum;
127 return this->m_sourceName;
132 return this->m_destName;
137 return this->m_osFile;
155 m_sent_file_count(0),
163 ++this->m_sent_file_count;
164 this->m_fileDownlink->tlmWrite_FilesSent(m_sent_file_count);
170 U32 m_sent_file_count;
186 m_sent_packet_count(0),
194 ++this->m_sent_packet_count;
195 this->m_fileDownlink->tlmWrite_PacketsSent(m_sent_packet_count);
201 U32 m_sent_packet_count;
224 void fileOpenError();
233 ++this->m_warning_count;
234 this->m_fileDownlink->tlmWrite_Warnings(m_warning_count);
248 enum CallerSource { COMMAND, PORT };
250 #define FILE_ENTRY_FILENAME_LEN 101 281 const char *
const compName
328 void bufferReturn_handler(
350 void SendFile_cmdHandler(
359 void Cancel_cmdHandler(
366 void SendPartial_cmdHandler(
384 const char* sourceFilename,
385 const char* destFilename,
392 void sendCancelPacket();
393 void sendEndPacket();
394 void sendStartPacket();
398 void exitFileTransfer();
399 void enterCooldown();
402 void getBuffer(
Fw::Buffer& buffer, PacketType type);
404 void downlinkPacket();
406 void finishHelper(
bool is_cancel);
410 void sendResponse(SendFileStatus resp);
434 FilesSent m_filesSent;
437 PacketsSent m_packetsSent;
476 struct FileEntry m_curEntry;
#define FILE_ENTRY_FILENAME_LEN
friend class FileDownlinkTester
FwIdType FwOpcodeType
The type of a command opcode.
Enum representing a command response.
FileDownlink(const char *const compName)
Class representing a 32-bit checksum as mandated by the CCSDS File Delivery Protocol.
Auto-generated base for FileDownlink component.
uint8_t U8
8-bit unsigned integer
void configure(U32 timeout, U32 cooldown, U32 cycleTime, U32 fileQueueDepth)
PlatformIndexType FwIndexType
Send file response struct.
RateGroupDivider component implementation.
static const U32 FILEDOWNLINK_INTERNAL_BUFFER_SIZE