10 #include <satcat5/coap_connection.h>
11 #include <satcat5/udp_dispatch.h>
117 { m_list.
add(item); }
118 inline void remove_connection(Connection* item)
200 {
return ip()->iface(); }
202 {
return udp()->iface(); }
254 template <
unsigned SIZE>
CCSDS Space Packet Protocol.
Implemention of "net::Dispatch" API for CCSDS-SPP packets.
CoAP request/response handling for a single client-server connection.
Variant of coap::Connection for CCSDS-SPP connections.
Statically-allocated array of ConnectionUdp objects.
Variant of coap::Connection for UDP connections.
CoAP endpoint (i.e., client, server, or combined client+server).
satcat5::udp::Port srcport() const
For UDP only, query the local port number.
virtual void coap_reqwait(Connection *obj, Reader *msg)
The Child class overrides these event-handlers:
void set_connection(satcat5::coap::Connection *obj)
Set the preferred connection for outgoing requests.
virtual void coap_request(Connection *obj, Reader *msg)
The Child class overrides these event-handlers:
satcat5::coap::Connection * get_idle_connection() const
Get the first idle connection, or null if all are busy.
Endpoint(satcat5::net::Dispatch *iface)
Constructor is only accessible to the child object.
virtual void coap_separate(Connection *obj, Reader *msg)
The Child class overrides these event-handlers:
satcat5::net::Dispatch * iface() const
Fetch the associated network interface.
void frame_rcvd(satcat5::io::LimitedRead &src) override
Dispatch calls frame_rcvd(...) for each incoming frame with with a matching net::Type value.
virtual void coap_error(Connection *obj)
The Child class overrides these event-handlers:
virtual void coap_ping(const Reader *msg)
The Child class overrides these event-handlers:
Connection * find_token(u32 token) const
Scan connections for a matching proxy-ID.
void set_filter(const satcat5::net::Type &filter)
Set network interface filter.
virtual void coap_timeout(Connection *obj)
The Child class overrides these event-handlers:
virtual void coap_response(Connection *obj, Reader *msg)
The Child class overrides these event-handlers:
EndpointSpp variant that forwards all requests to another Endpoint.
void coap_ping(const Reader *msg) override
The Child class overrides these event-handlers:
void coap_request(Connection *obj, Reader *msg) override
The Child class overrides these event-handlers:
void coap_error(Connection *obj) override
The Child class overrides these event-handlers:
void coap_response(Connection *obj, Reader *msg) override
The Child class overrides these event-handlers:
Variant of coap::Endpoint for a CCSDS-SPP client or server.
EndpointSpp(satcat5::ccsds_spp::Dispatch *iface, u16 apid)
Constructor and destructor should only be called by the child.
Variant for a UDP client or server with multiple active connections.
EndpointUdp(satcat5::udp::Dispatch *iface, satcat5::udp::Port req_port=satcat5::udp::PORT_NONE)
Constructor and destructor should only be called by the child.
Variant of EndpointUdp with a single active connection.
satcat5::coap::ConnectionUdp m_connection
Connection to the remote server.
EndpointUdpSimple(satcat5::udp::Dispatch *iface, satcat5::udp::Port req_port=satcat5::udp::PORT_NONE)
Constructor and destructor should only be called by the child.
Variant of EndpointUdp with a static array of connections.
satcat5::coap::ConnectionUdpArray< SIZE > m_connections
Connections to remote server(s).
EndpointUdpStatic(satcat5::udp::Dispatch *iface, satcat5::udp::Port req_port=satcat5::udp::PORT_NONE)
Constructor and destructor should only be called by the child.
ConnectionUdp & connections(unsigned idx)
Access an internal connection object by index.
Connection manager for CoAP endpoints using CCSDS-SPP.
satcat5::coap::ConnectionSpp * connection()
Accessor for the internal connection object.
satcat5::coap::ConnectionSpp m_connection
Point-to-point link, only one Connection is required.
ManageSpp(satcat5::coap::Endpoint *coap, u16 apid)
Constructor and destructor should only be called by the child.
Connection manager for CoAP endpoints using UDP.
satcat5::coap::ConnectionUdp * connect(const satcat5::udp::Addr &dstaddr, const satcat5::udp::Port &dstport=satcat5::udp::PORT_COAP, const satcat5::udp::Port &srcport=satcat5::udp::PORT_NONE)
Open a connection to the designated remote UDP endpoint.
ManageUdp(satcat5::coap::Endpoint *coap, satcat5::udp::Port req_port=satcat5::udp::PORT_NONE)
Constructor and destructor should only be called by the child.
satcat5::eth::Dispatch * eth() const
Pointer to the parent's network interface.
satcat5::coap::Endpoint *const m_endpoint
Pointer to the associated Endpoint.
satcat5::ip::Dispatch * ip() const
Pointer to the parent's network interface.
satcat5::udp::Dispatch * udp() const
Pointer to the parent's network interface.
void bind(satcat5::udp::Port req_port=satcat5::udp::PORT_COAP)
Begin accepting incoming requests on the designated UDP port.
Base-class for parsing CoAP message headers and options.
Implemention of "net::Dispatch" for Ethernet frames.
Limited read of next N bytes.
Protocol handler and dispatch unit for Internet Protocol v4 (IPv4).
The "Dispatch" is a generic interface that knows how to read a designated protocol layer and sort inc...
A net::Protocol is the counterpart to net::Dispatch that handles a particular data stream,...
satcat5::net::Type m_filter
Incoming packet filter.
Dispatcher sorts incoming UDP messages by port index.
void add(T *item)
Add new item to front or back, whichever is simpler.
void remove(T *item)
Remove the designated item from the list.
constexpr Code CODE_NOT_IMPL(5, 1)
< 5.00 Internal Server Error
IPv4 address is a 32-bit unsigned integer.
UDP and TCP ports are both 16-bit unsigned integers.
Multipurpose filter for matching fields in network packets.
u16 as_u16() const
Accessors for m_value.
Miscellaneous mathematical utility functions.