SatCat5
satcat5::eth::Telemetry Class Referencefinal

Detailed Description

Thin wrapper for sending CBOR telemetry over raw-Ethernet.

See also
net_telemetry.h, net::Telemetry, eth::TelemetryRx.

Definition at line 368 of file net_telemetry.h.

#include <net_telemetry.h>

Inheritance diagram for satcat5::eth::Telemetry:
[legend]
Collaboration diagram for satcat5::eth::Telemetry:
[legend]

Public Member Functions

 Telemetry (satcat5::eth::Dispatch *eth, bool concat_tiers=true)
 Link this object to a network interface. More...
 
void connect (const satcat5::eth::MacAddr &addr, const satcat5::eth::MacType &type, const satcat5::eth::VlanTag &vtag=satcat5::eth::VTAG_NONE)
 Set the destination MAC address and EtherType. More...
 
void close ()
 Close the connection and stop transmission.
 
void telem_concat (bool concat_tiers)
 Change to concatenated or per-tier mode.
 
void telem_send (TelemetryCbor &cbor, u32 tier_id)
 Send data to all attached TelemetrySink objects. More...
 
unsigned timer_interval () const
 Query the polling interval for this aggregator. More...
 

Protected Member Functions

void telem_ready (u32 tier_id, unsigned nbytes, const void *data) override
 This method is called for each outgoing telemetry message. More...
 
void timer_event () override
 Child class MUST override this method.
 
void timer_once (unsigned msec)
 Configure a one-time notification after X milliseconds.
 
void timer_every (unsigned msec)
 Configure a repeating notification every X milliseconds.
 
void timer_stop ()
 Stop all future notifications.
 
unsigned timer_remaining () const
 Accessor for time to next event, if one is set.
 

Static Protected Member Functions

static unsigned count_timer ()
 Count all objects of this type, including idle timers.
 

Protected Attributes

satcat5::eth::Address m_addr
 
bool m_tlm_concat
 
satcat5::util::List< satcat5::net::TelemetrySinkm_sinks
 
satcat5::util::List< satcat5::net::TelemetryTierm_tiers
 
u8 m_buff [SATCAT5_QCBOR_BUFFER]
 
satcat5::net::TelemetryAggregator *const m_tlm
 Pointer to the parent object.
 

Private Member Functions

void query (unsigned elapsed_msec)
 

Private Attributes

satcat5::poll::Timerm_next
 
unsigned m_trem
 
unsigned m_tnext
 

Constructor & Destructor Documentation

◆ Telemetry()

satcat5::eth::Telemetry::Telemetry ( satcat5::eth::Dispatch eth,
bool  concat_tiers = true 
)

Link this object to a network interface.

User must call connect() to begin sending telemetry.

Definition at line 23 of file net_telemetry.cc.

Member Function Documentation

◆ connect()

void satcat5::eth::Telemetry::connect ( const satcat5::eth::MacAddr addr,
const satcat5::eth::MacType type,
const satcat5::eth::VlanTag vtag = satcat5::eth::VTAG_NONE 
)
inline

Set the destination MAC address and EtherType.

Recommended EtherType is satcat5::eth::ETYPE_CBOR_TLM.

Definition at line 383 of file net_telemetry.h.

◆ telem_ready()

void satcat5::eth::Telemetry::telem_ready ( u32  tier_id,
unsigned  nbytes,
const void *  data 
)
inlineoverrideprotectedvirtual

This method is called for each outgoing telemetry message.

  • If the aggregator is in concatenate mode (default), all tiers are added to a single dictionary and the method is called once. (Placeholder tier_id = 0.)
  • If the aggregator is in per-tier mode, the method is called for each telemetry tier and sets the appropriate tier_id. Child class MUST override this method.

Implements satcat5::net::TelemetrySink.

Definition at line 395 of file net_telemetry.h.

◆ telem_send()

void TelemetryAggregator::telem_send ( TelemetryCbor cbor,
u32  tier_id 
)
inherited

Send data to all attached TelemetrySink objects.

This is normally called automatically, but calling it directly may be used for unscheduled messages.

Definition at line 123 of file net_telemetry.cc.

◆ timer_interval()

unsigned satcat5::net::TelemetryAggregator::timer_interval ( ) const
inlineinherited

Query the polling interval for this aggregator.

Rate is adjusted automatically based on active sources.

Definition at line 235 of file net_telemetry.h.


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