SatCat5
satcat5::coap::ManageUdp Class Reference

Detailed Description

Connection manager for CoAP endpoints using UDP.

This class adds a management API suitable for CoAP over UDP. User-classes should inherit from this class and coap::Endpoint.

Definition at line 183 of file coap_endpoint.h.

#include <coap_endpoint.h>

Inheritance diagram for satcat5::coap::ManageUdp:
[legend]
Collaboration diagram for satcat5::coap::ManageUdp:
[legend]

Public Member Functions

void bind (satcat5::udp::Port req_port=satcat5::udp::PORT_COAP)
 Begin accepting incoming requests on the designated UDP port.
 
satcat5::coap::ConnectionUdpconnect (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. More...
 
satcat5::eth::Dispatcheth () const
 Pointer to the parent's network interface.
 
satcat5::ip::Dispatchip () const
 Pointer to the parent's network interface.
 
satcat5::udp::Dispatchudp () const
 Pointer to the parent's network interface.
 

Protected Member Functions

 ManageUdp (satcat5::coap::Endpoint *coap, satcat5::udp::Port req_port=satcat5::udp::PORT_NONE)
 Constructor and destructor should only be called by the child. More...
 

Protected Attributes

satcat5::coap::Endpoint *const m_endpoint
 Pointer to the associated Endpoint.
 

Constructor & Destructor Documentation

◆ ManageUdp()

ManageUdp::ManageUdp ( satcat5::coap::Endpoint coap,
satcat5::udp::Port  req_port = satcat5::udp::PORT_NONE 
)
explicitprotected

Constructor and destructor should only be called by the child.

The default (req_port = PORT_NONE) allows outgoing connections but rejects incoming requests; to change this, provide a port number or call bind() at any time.

Definition at line 144 of file coap_endpoint.cc.

Member Function Documentation

◆ connect()

ConnectionUdp * ManageUdp::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.

In most cases, the source port should be left as PORT_NONE, which automatically chooses an unoccupied local port. (Use the returned coap::Connection object to issue requests.)

Definition at line 154 of file coap_endpoint.cc.


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