Variant of SimpleClient using a single outgoing SPP connection.
Definition at line 65 of file coap_client.h.
#include <coap_client.h>
|
|
| SimpleClientSpp (satcat5::ccsds_spp::Dispatch *iface, u16 apid) |
| |
|
u16 | msg_id () const |
| | Message-ID and token for the most recent request.
|
| |
|
void | set_callback (satcat5::io::EventListener *obj) |
| | Request notifications for incoming responses.
|
| |
|
satcat5::io::Readable * | response_all () |
| | Read full header and contents of the next CoAP response.
|
| |
|
satcat5::io::Readable * | response_data () |
| | Read the contents of the next CoAP response.
|
| |
|
bool | response_discard () |
| | Discard the contents of the next CoAP response.
|
| |
|
satcat5::net::Dispatch * | iface () const |
| | Fetch the associated network interface.
|
| |
|
satcat5::udp::Port | srcport () const |
| | For UDP only, query the local port number.
|
| |
| Connection * | find_token (u32 token) const |
| | Scan connections for a matching proxy-ID. More...
|
| |
|
satcat5::coap::Connection * | get_idle_connection () const |
| | Get the first idle connection, or null if all are busy.
|
| |
| void | set_connection (satcat5::coap::Connection *obj) |
| | Set the preferred connection for outgoing requests. More...
|
| |
| void | set_filter (const satcat5::net::Type &filter) |
| | Set network interface filter. More...
|
| |
|
satcat5::coap::ConnectionSpp * | connection () |
| | Accessor for the internal connection object.
|
| |
|
| bool | request (satcat5::coap::Code code, const char *uri, const char *data, u16 fmt=satcat5::coap::FORMAT_TEXT) |
| | Create and send a CoAP request, with optional data. More...
|
| |
| bool | request (satcat5::coap::Code code, const char *uri, satcat5::io::Readable *data=0, u16 fmt=satcat5::coap::FORMAT_BYTES) |
| | Create and send a CoAP request, with optional data. More...
|
| |
| bool | request (satcat5::coap::Code code, const char *uri, satcat5::cbor::CborWriter &cbor) |
| | Create and send a CoAP request, with optional data. More...
|
| |
◆ coap_error()
| virtual void satcat5::coap::Endpoint::coap_error |
( |
Connection * |
obj | ) |
|
|
inlineprotectedvirtualinherited |
The Child class overrides these event-handlers:
- coap_request = Received incoming request. The default implementation always responds with "5.01 Not
Implemented". The child class SHOULD override this method if it accepts incoming requests. Call open_response() or open_separate() to send the reply.
- See also
- coap::Connection.
- coap_response = Received the response to a pending request. The default implementation discards the incoming response. The child class SHOULD override this method if it issues requests.
- See also
- Connection::open_request. Multicast queries may result in multiple responses.
- coap_reqwait = Received duplicate request in "await" state. Child classes that require special event handling, such as reverse-proxies, MAY override this method as needed.
- coap_separate = Received separated-response notification. Child classes that require special event handling, such as reverse-proxies, MAY override this method as needed.
- coap_error = A pending request failed (i.e., reset or timeout). The child class SHOULD override this method if it issues requests, in order to process errors.
- coap_ping = Received response to a ping request. The child class MAY override this method if it issues ping requests.
- See also
- Connection::ping.
- coap_timeout = Benign timeout for a non-confirmable request. For unicast queries, this event indicates no response. For multicast queries, this event marks the end of the waiting period, whether or not request(s) were received.
Reimplemented in satcat5::coap::ProxyServer, and satcat5::coap::EndpointSppFwd.
Definition at line 106 of file coap_endpoint.h.
◆ coap_ping()
| virtual void satcat5::coap::Endpoint::coap_ping |
( |
const Reader * |
msg | ) |
|
|
inlineprotectedvirtualinherited |
The Child class overrides these event-handlers:
- coap_request = Received incoming request. The default implementation always responds with "5.01 Not
Implemented". The child class SHOULD override this method if it accepts incoming requests. Call open_response() or open_separate() to send the reply.
- See also
- coap::Connection.
- coap_response = Received the response to a pending request. The default implementation discards the incoming response. The child class SHOULD override this method if it issues requests.
- See also
- Connection::open_request. Multicast queries may result in multiple responses.
- coap_reqwait = Received duplicate request in "await" state. Child classes that require special event handling, such as reverse-proxies, MAY override this method as needed.
- coap_separate = Received separated-response notification. Child classes that require special event handling, such as reverse-proxies, MAY override this method as needed.
- coap_error = A pending request failed (i.e., reset or timeout). The child class SHOULD override this method if it issues requests, in order to process errors.
- coap_ping = Received response to a ping request. The child class MAY override this method if it issues ping requests.
- See also
- Connection::ping.
- coap_timeout = Benign timeout for a non-confirmable request. For unicast queries, this event indicates no response. For multicast queries, this event marks the end of the waiting period, whether or not request(s) were received.
Reimplemented in satcat5::coap::EndpointSppFwd.
Definition at line 107 of file coap_endpoint.h.
◆ coap_request()
| virtual void satcat5::coap::Endpoint::coap_request |
( |
Connection * |
obj, |
|
|
Reader * |
msg |
|
) |
| |
|
inlineprotectedvirtualinherited |
The Child class overrides these event-handlers:
- coap_request = Received incoming request. The default implementation always responds with "5.01 Not
Implemented". The child class SHOULD override this method if it accepts incoming requests. Call open_response() or open_separate() to send the reply.
- See also
- coap::Connection.
- coap_response = Received the response to a pending request. The default implementation discards the incoming response. The child class SHOULD override this method if it issues requests.
- See also
- Connection::open_request. Multicast queries may result in multiple responses.
- coap_reqwait = Received duplicate request in "await" state. Child classes that require special event handling, such as reverse-proxies, MAY override this method as needed.
- coap_separate = Received separated-response notification. Child classes that require special event handling, such as reverse-proxies, MAY override this method as needed.
- coap_error = A pending request failed (i.e., reset or timeout). The child class SHOULD override this method if it issues requests, in order to process errors.
- coap_ping = Received response to a ping request. The child class MAY override this method if it issues ping requests.
- See also
- Connection::ping.
- coap_timeout = Benign timeout for a non-confirmable request. For unicast queries, this event indicates no response. For multicast queries, this event marks the end of the waiting period, whether or not request(s) were received.
Reimplemented in satcat5::coap::ResourceServer, and satcat5::coap::EndpointSppFwd.
Definition at line 101 of file coap_endpoint.h.
◆ coap_reqwait()
| virtual void satcat5::coap::Endpoint::coap_reqwait |
( |
Connection * |
obj, |
|
|
Reader * |
msg |
|
) |
| |
|
inlineprotectedvirtualinherited |
The Child class overrides these event-handlers:
- coap_request = Received incoming request. The default implementation always responds with "5.01 Not
Implemented". The child class SHOULD override this method if it accepts incoming requests. Call open_response() or open_separate() to send the reply.
- See also
- coap::Connection.
- coap_response = Received the response to a pending request. The default implementation discards the incoming response. The child class SHOULD override this method if it issues requests.
- See also
- Connection::open_request. Multicast queries may result in multiple responses.
- coap_reqwait = Received duplicate request in "await" state. Child classes that require special event handling, such as reverse-proxies, MAY override this method as needed.
- coap_separate = Received separated-response notification. Child classes that require special event handling, such as reverse-proxies, MAY override this method as needed.
- coap_error = A pending request failed (i.e., reset or timeout). The child class SHOULD override this method if it issues requests, in order to process errors.
- coap_ping = Received response to a ping request. The child class MAY override this method if it issues ping requests.
- See also
- Connection::ping.
- coap_timeout = Benign timeout for a non-confirmable request. For unicast queries, this event indicates no response. For multicast queries, this event marks the end of the waiting period, whether or not request(s) were received.
Reimplemented in satcat5::coap::ProxyServer.
Definition at line 104 of file coap_endpoint.h.
◆ coap_separate()
| virtual void satcat5::coap::Endpoint::coap_separate |
( |
Connection * |
obj, |
|
|
Reader * |
msg |
|
) |
| |
|
inlineprotectedvirtualinherited |
The Child class overrides these event-handlers:
- coap_request = Received incoming request. The default implementation always responds with "5.01 Not
Implemented". The child class SHOULD override this method if it accepts incoming requests. Call open_response() or open_separate() to send the reply.
- See also
- coap::Connection.
- coap_response = Received the response to a pending request. The default implementation discards the incoming response. The child class SHOULD override this method if it issues requests.
- See also
- Connection::open_request. Multicast queries may result in multiple responses.
- coap_reqwait = Received duplicate request in "await" state. Child classes that require special event handling, such as reverse-proxies, MAY override this method as needed.
- coap_separate = Received separated-response notification. Child classes that require special event handling, such as reverse-proxies, MAY override this method as needed.
- coap_error = A pending request failed (i.e., reset or timeout). The child class SHOULD override this method if it issues requests, in order to process errors.
- coap_ping = Received response to a ping request. The child class MAY override this method if it issues ping requests.
- See also
- Connection::ping.
- coap_timeout = Benign timeout for a non-confirmable request. For unicast queries, this event indicates no response. For multicast queries, this event marks the end of the waiting period, whether or not request(s) were received.
Reimplemented in satcat5::coap::ProxyServer.
Definition at line 105 of file coap_endpoint.h.
◆ coap_timeout()
| virtual void satcat5::coap::Endpoint::coap_timeout |
( |
Connection * |
obj | ) |
|
|
inlineprotectedvirtualinherited |
The Child class overrides these event-handlers:
- coap_request = Received incoming request. The default implementation always responds with "5.01 Not
Implemented". The child class SHOULD override this method if it accepts incoming requests. Call open_response() or open_separate() to send the reply.
- See also
- coap::Connection.
- coap_response = Received the response to a pending request. The default implementation discards the incoming response. The child class SHOULD override this method if it issues requests.
- See also
- Connection::open_request. Multicast queries may result in multiple responses.
- coap_reqwait = Received duplicate request in "await" state. Child classes that require special event handling, such as reverse-proxies, MAY override this method as needed.
- coap_separate = Received separated-response notification. Child classes that require special event handling, such as reverse-proxies, MAY override this method as needed.
- coap_error = A pending request failed (i.e., reset or timeout). The child class SHOULD override this method if it issues requests, in order to process errors.
- coap_ping = Received response to a ping request. The child class MAY override this method if it issues ping requests.
- See also
- Connection::ping.
- coap_timeout = Benign timeout for a non-confirmable request. For unicast queries, this event indicates no response. For multicast queries, this event marks the end of the waiting period, whether or not request(s) were received.
Definition at line 108 of file coap_endpoint.h.
◆ find_token()
| Connection * Endpoint::find_token |
( |
u32 |
token | ) |
const |
|
inherited |
◆ frame_rcvd()
|
|
overrideprotectedvirtualinherited |
Dispatch calls frame_rcvd(...) for each incoming frame with with a matching net::Type value.
The child class SHOULD read the frame contents from the provided "src" object, which is only valid until the function returns.
To send a reply:
- Call m_iface->open_reply() to obtain a Writable object. (This also writes out any applicable frame headers.)
- Write frame contents, then call write_finalize().
The child class MUST override this method.
Implements satcat5::net::Protocol.
Definition at line 56 of file coap_endpoint.cc.
◆ request() [1/3]
| bool SimpleClient::request |
( |
satcat5::coap::Code |
code, |
|
|
const char * |
uri, |
|
|
const char * |
data, |
|
|
u16 |
fmt = satcat5::coap::FORMAT_TEXT |
|
) |
| |
|
inherited |
Create and send a CoAP request, with optional data.
Various options are provided for generating message contents.
Definition at line 45 of file coap_client.cc.
◆ request() [2/3]
Create and send a CoAP request, with optional data.
Various options are provided for generating message contents.
Definition at line 52 of file coap_client.cc.
◆ request() [3/3]
Create and send a CoAP request, with optional data.
Various options are provided for generating message contents.
Definition at line 22 of file coap_client.cc.
◆ set_connection()
◆ set_filter()
The documentation for this class was generated from the following files: