SatCat5
satcat5::net::AeroFtpFile Class Reference

Detailed Description

Helper class representing a saving data to a particular file.

See also
net::AeroFtpServer, eth::AeroFtpServer, udp::AeroFtpServer

Definition at line 33 of file file_aeroftp.h.

#include <file_aeroftp.h>

Collaboration diagram for satcat5::net::AeroFtpFile:
[legend]

Public Member Functions

 AeroFtpFile (const char *work_folder, u32 file_id, u32 file_len, bool resume)
 Create a new file object. More...
 
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::Readablemissing_blocks ()
 Get a stream of missing blocks for this file.
 
bool done () const
 Has the complete file been received successfully?
 
bool error () const
 Has there been an unrecoverable file-transfer error?
 

Protected Member Functions

void cleanup ()
 
void log (s8 level, const char *msg)
 

Protected Attributes

const std::string m_name_data
 
const std::string m_name_meta
 
const std::string m_name_part
 
const u32 m_file_id
 
const u32 m_file_len
 
const u32 m_bcount
 
unsigned m_pcount
 
FILE * m_data
 
FILE * m_meta
 
u8 * m_pending
 
satcat5::io::ArrayRead m_status
 

Constructor & Destructor Documentation

◆ AeroFtpFile()

AeroFtpFile::AeroFtpFile ( const char *  work_folder,
u32  file_id,
u32  file_len,
bool  resume 
)

Create a new file object.

  • If the complete file already exists, no action is taken.
  • If the partial file already exists, download is resumed.
  • Otherwise, this creates a new partial file.
    Parameters
    work_folderPath to working folder.
    file_idNumeric ID for the new file.
    file_lenof the new file, measured in 32-bit words.
    resumeAllow resume of a previous partial file?

Definition at line 56 of file file_aeroftp.cc.


The documentation for this class was generated from the following files: