SatCat5
satcat5::udp::TelemetryRx Class Referencefinal

Detailed Description

Thin wrapper for receiving CBOR telemetry over UDP.

See also
net_telemetry.h, net::TelemetryWatcher, udp::Telemetry.

Definition at line 458 of file net_telemetry.h.

#include <net_telemetry.h>

Inheritance diagram for satcat5::udp::TelemetryRx:
[legend]
Collaboration diagram for satcat5::udp::TelemetryRx:
[legend]

Public Member Functions

 TelemetryRx (satcat5::udp::Dispatch *iface, const satcat5::udp::Port &port=satcat5::udp::PORT_CBOR_TLM)
 Constructor sets network interface and incoming UDP port.
 
void telem_packet (satcat5::io::LimitedRead &src)
 The child object MUST call this method for each received message. More...
 
void add_watcher (TelemetryWatcher *callback)
 Manage the list of registered callback objects.
 
void remove_watcher (TelemetryWatcher *callback)
 Manage the list of registered callback objects.
 

Protected Member Functions

void frame_rcvd (satcat5::io::LimitedRead &src)
 Dispatch calls frame_rcvd(...) for each incoming frame with with a matching net::Type value. More...
 

Protected Attributes

satcat5::udp::Dispatch *const m_iface
 
satcat5::net::Type m_filter
 Incoming packet filter.
 

Private Member Functions

void telem_item (QCBORDecodeContext *cbor, const QCBORItem &item)
 Internal callback delivers one item to each watcher.
 

Private Attributes

satcat5::net::Protocolm_next
 Linked list of Protocols.
 
satcat5::util::List< satcat5::net::TelemetryWatcherm_watchers
 Linked list of registered callback objects.
 

Member Function Documentation

◆ frame_rcvd()

void satcat5::udp::TelemetryRx::frame_rcvd ( satcat5::io::LimitedRead src)
protectedvirtual

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 79 of file net_telemetry.cc.

◆ telem_packet()

void TelemetryRx::telem_packet ( satcat5::io::LimitedRead src)
inherited

The child object MUST call this method for each received message.

This API is also used by net::TelemetryLoopback.

Definition at line 184 of file net_telemetry.cc.


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