SatCat5
satcat5::ccsds_spp::Dispatch Class Referencefinal

Detailed Description

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

See also
ccsds_spp.h, ccsds_spp::Address, ccsds_spp::Packetizer.

Definition at line 197 of file ccsds_spp.h.

#include <ccsds_spp.h>

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

Public Member Functions

 Dispatch (satcat5::io::Readable *src, satcat5::io::Writeable *dst)
 Connect to any valid packetized I/O source and sink. More...
 
satcat5::io::Writeableopen_reply (const satcat5::net::Type &type, unsigned len) override
 Write CCSDS-SPP frame header and get Writeable object. More...
 
satcat5::io::Writeableopen_write (const satcat5::ccsds_spp::Header &hdr, unsigned len)
 Write CCSDS-SPP frame header and get Writeable object. More...
 
const satcat5::ccsds_spp::Headerrcvd_hdr () const
 Fetch the last received CCSDS-SPP header.
 
void add (satcat5::net::Protocol *proto)
 Register a Protocol object.
 
void remove (satcat5::net::Protocol *proto)
 Unregister a Protocol object.
 
bool bound (const satcat5::net::Type &type) const
 Check if a given net::Type has a matching Protocol.
 

Protected Member Functions

void data_rcvd (satcat5::io::Readable *src) override
 The data_rcvd() callback is polled whenever data is available. More...
 
void data_unlink (satcat5::io::Readable *src) override
 Unlink this EventListener from the designated source, because the designated Readable object is being destroyed. More...
 
bool deliver (const satcat5::net::Type &type, satcat5::io::Readable *src, unsigned len)
 Deliver current message by calling Protocol::frame_rcvd(...). More...
 

Protected Attributes

satcat5::io::Readablem_src
 
satcat5::io::Writeable *const m_dst
 
satcat5::ccsds_spp::Header m_rcvd_hdr
 
satcat5::util::List< satcat5::net::Protocolm_list
 Linked list of Protocol objects.
 

Constructor & Destructor Documentation

◆ Dispatch()

Dispatch::Dispatch ( satcat5::io::Readable src,
satcat5::io::Writeable dst 
)

Connect to any valid packetized I/O source and sink.

(e.g., satcat5::io::PacketBuffer or satcat5::port::MailMap.) For connection to a raw UART, use ccsds_spp::Packetizer, above. For unidirectional links, src or dst may be a null pointer.

Definition at line 128 of file ccsds_spp.cc.

Member Function Documentation

◆ data_rcvd()

void Dispatch::data_rcvd ( satcat5::io::Readable src)
overrideprotectedvirtual

The data_rcvd() callback is polled whenever data is available.

A pointer is provided to assist handlers with multiple sources. Child objects of io::EventListener MUST override this method.

Implements satcat5::io::EventListener.

Definition at line 167 of file ccsds_spp.cc.

◆ data_unlink()

void Dispatch::data_unlink ( satcat5::io::Readable src)
overrideprotectedvirtual

Unlink this EventListener from the designated source, because the designated Readable object is being destroyed.

Child objects of io::EventListener MAY override this method if action is required.

Reimplemented from satcat5::io::EventListener.

Definition at line 189 of file ccsds_spp.cc.

◆ deliver()

bool Dispatch::deliver ( const satcat5::net::Type type,
satcat5::io::Readable src,
unsigned  len 
)
protectedinherited

Deliver current message by calling Protocol::frame_rcvd(...).

Note: Caller is responsible for read_finalize(), if required.

Returns
True if a matching Protocol is found.

Definition at line 25 of file net_dispatch.cc.

◆ open_reply()

Writeable * Dispatch::open_reply ( const satcat5::net::Type type,
unsigned  len 
)
overridevirtual

Write CCSDS-SPP frame header and get Writeable object.

This variant replies with the last received APID.

Implements satcat5::net::Dispatch.

Definition at line 142 of file ccsds_spp.cc.

◆ open_write()

Writeable * Dispatch::open_write ( const satcat5::ccsds_spp::Header hdr,
unsigned  len 
)

Write CCSDS-SPP frame header and get Writeable object.

This variant sets all destination parameters.

Definition at line 150 of file ccsds_spp.cc.


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