13 #include <satcat5/udp_core.h>
54 bool send(u32 file_id,
62 void throttle(
unsigned msec_per_pkt);
102 { m_addr.
connect(addr, type); }
106 {
return m_addr.
ready(); }
130 { m_addr.
connect(addr, port, 0); }
134 {
return m_addr.
ready(); }
Inheritable container for a eth::Address.
bool ready() const override
Is this address object ready for use? Child MUST override this method.
void connect(const satcat5::eth::MacAddr &addr, const satcat5::eth::MacType &type, const satcat5::eth::VlanTag &vtag=satcat5::eth::VTAG_NONE)
Connect to the designated address.
Implement AeroFTP protocol over Ethernet.
AeroFtpClient(satcat5::eth::Dispatch *eth)
Constructor links to the Ethernet interface.
bool ready() const
Is the connection ready to transmit?
void connect(const satcat5::eth::MacAddr &addr, const satcat5::eth::MacType &type=satcat5::eth::ETYPE_AEROFTP)
Set the destination address before calling send().
Implemention of "net::Dispatch" for Ethernet frames.
Abstract API for reading byte-streams and packets.
Defines a generic API for sending data to a specific destination, such as a MAC address,...
AeroCube File Transfer Protocol (AeroFTP) transmitter.
u32 m_file_len
Length (bytes)
bool done() const
Is the current transfer completed?
u32 m_file_pos
Current read index (bytes)
satcat5::io::Readable * m_src
Source for file data.
bool send(u32 file_id, satcat5::io::Readable *src, satcat5::io::Readable *aux=0)
Begin transmission of the designated file.
void timer_event() override
Callback for timer events.
void skip_ahead()
Skip to next requested block.
void throttle(unsigned msec_per_pkt)
Set throttle (one packet every N msec).
satcat5::io::Readable * m_aux
Source for retransmit control.
AeroFtpClient(satcat5::net::Address *dst)
Constructor is only available to child classes.
void close()
Close connection and abort transfer in progress.
void end_of_file()
End-of-file cleanup.
unsigned m_throttle
Delay per packet (msec)
u32 m_file_id
ID for this file.
u32 m_bytes_sent
Count transmission length.
bool busy() const
Is there already a transfer in progress?
Timer objects are polled after a fixed delay or at a regular interval.
Inheritable container for a udp::Address.
bool ready() const override
Is this address object ready for use? Child MUST override this method.
void connect(const satcat5::udp::Addr &dstaddr, const satcat5::eth::MacAddr &dstmac, const satcat5::udp::Port &dstport, const satcat5::udp::Port &srcport=satcat5::udp::PORT_NONE, const satcat5::eth::VlanTag &vtag=satcat5::eth::VTAG_NONE)
Manual address resolution (user supplies IP + MAC).
Implement AeroFTP protocol over UDP.
AeroFtpClient(satcat5::udp::Dispatch *udp)
Constructor links to the UDP stack.
bool ready() const
Is the connection ready to transmit?
void connect(const satcat5::udp::Addr &addr, const satcat5::udp::Port &port=satcat5::udp::PORT_AEROFTP)
Set the destination address before calling send().
Dispatcher sorts incoming UDP messages by port index.
Generic network Address API.
Generic network Protocol API.
Core event-processing loop for SatCat5 software.
An Ethernet MAC address (with serializable interface).
EtherType field (uint16) is used a protocol-ID [1536..65535].
IPv4 address is a 32-bit unsigned integer.
UDP and TCP ports are both 16-bit unsigned integers.