SatCat5
satcat5::ccsds_spp::Address Class Reference

Detailed Description

Implemention of "net::Address" API for CCSDS-SPP packets.

See also
ccsds_spp.h, ccsds_spp::Dispatch. This object automatically tracks required per-APID sequence counters.

Definition at line 169 of file ccsds_spp.h.

#include <ccsds_spp.h>

Inheritance diagram for satcat5::ccsds_spp::Address:
[legend]
Collaboration diagram for satcat5::ccsds_spp::Address:
[legend]

Public Member Functions

constexpr Address (satcat5::ccsds_spp::Dispatch *iface)
 Attach this address to a specified interface.
 
void connect (bool cmd, u16 apid)
 Set the packet type and APID. More...
 
satcat5::net::Dispatchiface () const override
 Fetch a pointer to the underlying interface. More...
 
satcat5::io::Writeableopen_write (unsigned len) override
 Open a new frame to the designated address and type. More...
 
void close () override
 Close any open connections and revert to idle. More...
 
bool ready () const override
 Is this address object ready for use? Child MUST override this method.
 
bool is_multicast () const override
 Is the destination a broadcast or multicast address? Child MUST override these method.
 
bool matches_reply_address () const override
 Does this Address object match the parent interface's current reply address? Multicast destinations should match any source address expected to receive the multicast message. More...
 
bool reply_is_multicast () const override
 Was the parent interface's incoming message sent to a multicast address? (i.e., Could that message have many other recipients?) Child MUST override this method.
 
void save_reply_address () override
 Bind this Address object to the parent interface's current reply address, as provided in net::Dispatch::open_reply(). More...
 
virtual void retry ()
 If this Address is not in the ready() state, reattempt any steps required to do so, such as MAC address resolution. More...
 
bool write_packet (unsigned nbytes, const void *data)
 All-in-one call that writes an entire packet. More...
 

Protected Attributes

satcat5::ccsds_spp::Dispatch *const m_iface
 
satcat5::ccsds_spp::Header m_dst
 

Member Function Documentation

◆ close()

void Address::close ( )
overridevirtual

Close any open connections and revert to idle.

Child MUST override this method.

Implements satcat5::net::Address.

Definition at line 111 of file ccsds_spp.cc.

◆ connect()

void satcat5::ccsds_spp::Address::connect ( bool  cmd,
u16  apid 
)
inline

Set the packet type and APID.

TODO: Do we need access to the full feature-set?

Definition at line 177 of file ccsds_spp.h.

◆ iface()

satcat5::net::Dispatch * Address::iface ( ) const
overridevirtual

Fetch a pointer to the underlying interface.

Child MUST override this method.

Implements satcat5::net::Address.

Definition at line 101 of file ccsds_spp.cc.

◆ matches_reply_address()

bool Address::matches_reply_address ( ) const
overridevirtual

Does this Address object match the parent interface's current reply address? Multicast destinations should match any source address expected to receive the multicast message.

Child MUST override this method.

Implements satcat5::net::Address.

Definition at line 119 of file ccsds_spp.cc.

◆ open_write()

Writeable * Address::open_write ( unsigned  len)
overridevirtual

Open a new frame to the designated address and type.

Child MUST override this method.

Returns
Zero if sending a frame is not currently possible.

Implements satcat5::net::Address.

Definition at line 105 of file ccsds_spp.cc.

◆ retry()

virtual void satcat5::net::Address::retry ( )
inlinevirtualinherited

If this Address is not in the ready() state, reattempt any steps required to do so, such as MAC address resolution.

Child SHOULD override this method if applicable.

Reimplemented in satcat5::udp::Address, and satcat5::ip::Address.

Definition at line 52 of file net_address.h.

◆ save_reply_address()

void Address::save_reply_address ( )
overridevirtual

Bind this Address object to the parent interface's current reply address, as provided in net::Dispatch::open_reply().

Child MUST override this method.

Implements satcat5::net::Address.

Definition at line 123 of file ccsds_spp.cc.

◆ write_packet()

bool Address::write_packet ( unsigned  nbytes,
const void *  data 
)
inherited

All-in-one call that writes an entire packet.

Equivalent to open_write(), io::Writeable::write_bytes(), io::Writeable::write_finalize().

Definition at line 11 of file net_address.cc.


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