88 #include <satcat5/eth_socket.h>
93 #include <satcat5/udp_socket.h>
96 #if SATCAT5_CBOR_ENABLE
136 QCBOREncodeContext m_cbor;
153 u32 tier_id,
unsigned nbytes,
const void* data) = 0;
165 friend satcat5::util::ListCore;
188 u32 tier_id,
unsigned interval_msec = 0);
195 void set_interval(
unsigned interval_msec);
212 unsigned m_time_interval;
213 unsigned m_time_count;
226 { m_tlm_concat = concat_tiers; }
240 void timer_event()
override;
271 u32 key,
const QCBORItem& item,
272 QCBORDecodeContext* cbor) = 0;
284 friend satcat5::util::ListCore;
312 u32 key,
const QCBORItem& item,
313 QCBORDecodeContext* cbor)
override;
324 { m_watchers.add(callback); }
326 { m_watchers.remove(callback); }
340 void telem_item(QCBORDecodeContext* cbor,
const QCBORItem& item);
358 u32 tier_id,
unsigned nbytes,
const void* data)
override;
378 bool concat_tiers =
true);
387 { m_addr.connect(addr, type, vtag); }
396 u32 tier_id,
unsigned nbytes,
const void* data)
override
397 { m_addr.write_packet(nbytes, data); }
434 bool concat_tiers =
true);
443 { m_addr.connect(dstaddr, dstport, satcat5::udp::PORT_NONE, vtag);}
452 u32 tier_id,
unsigned nbytes,
const void* data)
override
453 { m_addr.write_packet(nbytes, data); }
CborWriter(satcat5::io::Writeable *dst, QCBOREncodeContext *encode, u8 *buff, unsigned size, bool automap=false)
Constructor requires child class to provide a working buffer.
Write a series of key-value pairs to a CBOR Map.
Inheritable container for a eth::Address.
Implemention of "net::Dispatch" for Ethernet frames.
Thin wrapper for sending CBOR telemetry over raw-Ethernet.
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.
void telem_ready(u32 tier_id, unsigned nbytes, const void *data) override
This method is called for each outgoing telemetry message.
void close()
Close the connection and stop transmission.
Thin wrapper for receiving CBOR telemetry over raw-Ethernet.
Limited read of next N bytes.
A net::Protocol is the counterpart to net::Dispatch that handles a particular data stream,...
Protocol-agnostic handler for one or more TelemetryTier objects.
unsigned timer_interval() const
Query the polling interval for this aggregator.
void telem_concat(bool concat_tiers)
Change to concatenated or per-tier mode.
Legacy ephemeral wrapper class for the CBOR encoder.
TelemetryCbor()
Default constructor initializes both variants.
Example TelemetryWatcher that logs received key/value pairs.
Loopback adapter for telemetry messages.
Parse incoming CBOR telemetry and notify TelemetryWatcher callbacks.
satcat5::util::List< satcat5::net::TelemetryWatcher > m_watchers
Linked list of registered callback objects.
void remove_watcher(TelemetryWatcher *callback)
Manage the list of registered callback objects.
TelemetryRx()
Constructor is only accessible to the child object.
void add_watcher(TelemetryWatcher *callback)
Manage the list of registered callback objects.
User data sinks must inherit from the TelemetrySink class.
satcat5::net::TelemetryAggregator *const m_tlm
Pointer to the parent object.
TelemetrySink(satcat5::net::TelemetryAggregator *tlm)
Only children can safely access constructor/destructor.
virtual void telem_ready(u32 tier_id, unsigned nbytes, const void *data)=0
This method is called for each outgoing telemetry message.
User data sources must inherit from the TelemetrySource class.
virtual void telem_event(u32 tier_id, satcat5::net::TelemetryCbor &cbor)=0
User method for writing each telemetry message.
Rate control for a particular telemetry "tier".
const u32 m_tier_id
Tier-ID for this object.
Callback API for incoming telemetry items.
virtual void telem_rcvd(u32 key, const QCBORItem &item, QCBORDecodeContext *cbor)=0
Callback for each received key/value pair.
Timer objects are polled after a fixed delay or at a regular interval.
unsigned timer_interval() const
Accessor for recurring timer interval, if one is set.
Inheritable container for a udp::Address.
Dispatcher sorts incoming UDP messages by port index.
Thin wrapper for sending CBOR telemetry over UDP.
void connect(const satcat5::udp::Addr &dstaddr, const satcat5::udp::Port &dstport=satcat5::udp::PORT_CBOR_TLM, const satcat5::eth::VlanTag &vtag=satcat5::eth::VTAG_NONE)
Set the destination IP address and UDP port.
void close()
Close the connection and stop transmission.
void telem_ready(u32 tier_id, unsigned nbytes, const void *data) override
This method is called for each outgoing telemetry message.
Thin wrapper for receiving CBOR telemetry over UDP.
Helper functions for manipulating singly-linked lists.
CBOR (IETF RFC8949) Readable/Writeable interface.
#define SATCAT5_QCBOR_BUFFER
Set the default size for the QCBOR buffer.
Templated functions for manipulating singly-linked lists.
Core event-processing loop for SatCat5 software.
An Ethernet MAC address (with serializable interface).
EtherType field (uint16) is used a protocol-ID [1536..65535].
Header contents for an 802.1Q Virtual-LAN tag.
IPv4 address is a 32-bit unsigned integer.
UDP and TCP ports are both 16-bit unsigned integers.
String constant, plus the CRC32 hash of that string.
const u32 hash
CRC32 of that string.
const char * key
String key.
Basic type aliases and prototypes used throughout SatCat5.