SatCat5
satcat5::ptp::TlvHandler Class Reference

Detailed Description

Users should derive custom TLV objects from this base class.

The child class should override tlv_rcvd(), tlv_send(), or both.

Definition at line 111 of file ptp_tlv.h.

#include <ptp_tlv.h>

Inheritance diagram for satcat5::ptp::TlvHandler:
[legend]
Collaboration diagram for satcat5::ptp::TlvHandler:
[legend]

Public Member Functions

virtual bool tlv_rcvd (const satcat5::ptp::Header &hdr, const satcat5::ptp::TlvHeader &tlv, satcat5::io::LimitedRead &rd)
 Child class SHOULD override this method to read incoming TLV(s). More...
 
virtual unsigned tlv_send (const satcat5::ptp::Header &hdr, satcat5::io::Writeable *wr)
 Child class SHOULD override this method to append outgoing TLV(s). More...
 
virtual void tlv_meas (satcat5::ptp::Measurement &meas)
 Child class MAY override this method to read or modify each complete two-way handshake event. More...
 

Protected Member Functions

 TlvHandler (satcat5::ptp::Client *client)
 Only children should create or destroy the base class.
 

Protected Attributes

satcat5::ptp::Client *const m_client
 Pointer to the associated PTP client.
 

Private Attributes

satcat5::ptp::TlvHandlerm_next
 

Member Function Documentation

◆ tlv_meas()

void TlvHandler::tlv_meas ( satcat5::ptp::Measurement meas)
virtual

Child class MAY override this method to read or modify each complete two-way handshake event.

See discussion above. The default handler takes no action.

Reimplemented in satcat5::ptp::DopplerTlv.

Definition at line 95 of file ptp_tlv.cc.

◆ tlv_rcvd()

bool TlvHandler::tlv_rcvd ( const satcat5::ptp::Header hdr,
const satcat5::ptp::TlvHeader tlv,
satcat5::io::LimitedRead rd 
)
virtual

Child class SHOULD override this method to read incoming TLV(s).

See also
tlv_type.h. For matching type(s), the method should read the TLV contents and return true; otherwise return false. The default handler does not match any incoming TLV.

Reimplemented in satcat5::ptp::DopplerTlv.

Definition at line 78 of file ptp_tlv.cc.

◆ tlv_send()

unsigned TlvHandler::tlv_send ( const satcat5::ptp::Header hdr,
satcat5::io::Writeable wr 
)
virtual

Child class SHOULD override this method to append outgoing TLV(s).

The override method MUST predict its output length (input = null). See discussion above. Returns predicted or actual length in bytes. The default handler does not emit any outgoing TLVs.

Reimplemented in satcat5::ptp::DopplerTlv.

Definition at line 87 of file ptp_tlv.cc.


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