22 #include <hal_posix/file_io.h>
23 #include <satcat5/net_aeroftp.h>
44 const char* work_folder,
45 u32 file_id, u32 file_len,
51 u32 file_id, u32 file_len, u32 offset, u32 rxlen,
58 inline bool done()
const {
return m_pcount == 0; }
60 inline bool error()
const {
return m_pcount == UINT_MAX; }
64 void log(s8 level,
const char* msg);
66 const std::string m_name_data;
67 const std::string m_name_meta;
68 const std::string m_name_part;
87 bool done(u32 file_id)
const;
90 inline void resume(
bool allow) {m_resume = allow;}
99 const char* work_folder,
108 const std::string m_work_folder;
111 std::map<u32, satcat5::net::AeroFtpFile*> m_files;
121 const char* work_folder,
132 const char* work_folder,
Server for receiving file(s) using AeroFTP over Ethernet.
Implemention of "net::Dispatch" for Ethernet frames.
Ephemeral Readable interface for a simple array.
Limited read of next N bytes.
Abstract API for reading byte-streams and packets.
Helper class representing a saving data to a particular file.
bool error() const
Has there been an unrecoverable file-transfer error?
bool done() const
Has the complete file been received successfully?
void frame_rcvd(u32 file_id, u32 file_len, u32 offset, u32 rxlen, satcat5::io::LimitedRead &data)
Handler for each received packet relating to this file.
satcat5::io::Readable * missing_blocks()
Get a stream of missing blocks for this file.
AeroFtpFile(const char *work_folder, u32 file_id, u32 file_len, bool resume)
Create a new file object.
Server for receiving file(s) using AeroFTP.
void frame_rcvd(satcat5::io::LimitedRead &src) override
Callback for incoming packets.
satcat5::io::Readable * missing_blocks(u32 file_id)
Get a stream of missing blocks for the designated file-ID.
AeroFtpServer(const char *work_folder, satcat5::net::Dispatch *iface, const satcat5::net::Type &typ)
Constructor is only available to child classes.
void resume(bool allow)
Allow server to resume transfers in progress?
bool done(u32 file_id) const
Has the complete file been received successfully?
The "Dispatch" is a generic interface that knows how to read a designated protocol layer and sort inc...
A net::Protocol is the counterpart to net::Dispatch that handles a particular data stream,...
Server for receiving file(s) using AeroFTP over UDP.
Dispatcher sorts incoming UDP messages by port index.
EtherType field (uint16) is used a protocol-ID [1536..65535].
UDP and TCP ports are both 16-bit unsigned integers.
Multipurpose filter for matching fields in network packets.