|
SatCat5
|
Implemention of "net::Dispatch" API for CCSDS-SPP packets.
Definition at line 197 of file ccsds_spp.h.
#include <ccsds_spp.h>
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::Writeable * | open_reply (const satcat5::net::Type &type, unsigned len) override |
| Write CCSDS-SPP frame header and get Writeable object. More... | |
| satcat5::io::Writeable * | open_write (const satcat5::ccsds_spp::Header &hdr, unsigned len) |
| Write CCSDS-SPP frame header and get Writeable object. More... | |
| const satcat5::ccsds_spp::Header & | rcvd_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::Readable * | m_src |
| satcat5::io::Writeable *const | m_dst |
| satcat5::ccsds_spp::Header | m_rcvd_hdr |
| satcat5::util::List< satcat5::net::Protocol > | m_list |
| Linked list of Protocol objects. | |
| 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.
|
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.
|
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.
|
protectedinherited |
Deliver current message by calling Protocol::frame_rcvd(...).
Note: Caller is responsible for read_finalize(), if required.
Definition at line 25 of file net_dispatch.cc.
|
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.
| 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.