SatCat5
satcat5::net::TelemetryLogger Class Reference

Detailed Description

Example TelemetryWatcher that logs received key/value pairs.

If a specific key-string is specified, it only responds to that key.

Definition at line 301 of file net_telemetry.h.

#include <net_telemetry.h>

Inheritance diagram for satcat5::net::TelemetryLogger:
[legend]
Collaboration diagram for satcat5::net::TelemetryLogger:
[legend]

Public Member Functions

 TelemetryLogger (satcat5::net::TelemetryRx *rx, const char *kstr=nullptr)
 Constructor for string keys, or default null = no filter.
 
 TelemetryLogger (satcat5::net::TelemetryRx *rx, u32 key)
 Constructor for integer keys.
 

Protected Member Functions

void telem_rcvd (u32 key, const QCBORItem &item, QCBORDecodeContext *cbor) override
 Callback for each received key/value pair. More...
 

Protected Attributes

satcat5::util::optional< u32 > m_filter
 
satcat5::net::TelemetryRx *const m_rx
 Pointer to the receive-and-decode object.
 

Private Attributes

satcat5::net::TelemetryWatcherm_next
 

Member Function Documentation

◆ telem_rcvd()

void TelemetryLogger::telem_rcvd ( u32  key,
const QCBORItem &  item,
QCBORDecodeContext *  cbor 
)
overrideprotectedvirtual

Callback for each received key/value pair.

The child object MUST override this callback method. Users with string keys should compare against the hash first, to ensure the matching process can iterate quickly.

Parameters
keyInteger key, or CRC32 hash of a string key.
itemValue associated with this key.
cborQCBOR decoder for reading complex data structures. This pointer is provided for maps and arrays, not for simple items. The callback MUST NOT call ExitArray or ExitMap.

Implements satcat5::net::TelemetryWatcher.

Definition at line 159 of file net_telemetry.cc.


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