Telemetry Handling Package
CCSDS TM Listener Module
Contains the TmListener which can be used to listen to Telemetry in the background
- class tmtccmd.tmtc.ccsds_tm_listener.CcsdsTmListener(tm_handler: CcsdsTmHandler)
Bases:
objectSimple helper object which can be used for retrieving and routing CCSDS packets. It can be used to poll CCSDS packets from a provided
tmtccmd.com_if.ComInterfaceand then route them using a provided CCSDS TM handler.Initiate a TM listener.
- Parameters:
tm_handler – If valid CCSDS packets are found, they are dispatched to the passed handler
- operation(com_if: ComInterface) int
Core operation to route packet to the provided handler.
- Parameters:
com_if
- Raises:
PacketsTooSmallForCcsds – If any of the received packets are too small. The internal handler will still continue to process the remaining packet list retrieved from the COM interface.
- Returns:
TM Common Module
- class tmtccmd.tmtc.common.CcsdsTmHandler(generic_handler: GenericApidHandlerBase | None)
Bases:
TmHandlerBaseGeneric CCSDS handler class. The user can create an instance of this class to handle CCSDS packets by adding dedicated APID handlers or a generic handler for all APIDs with no dedicated handler
- add_apid_handler(handler: SpecificApidHandlerBase)
Add a TM handler for a certain APID. The handler is a callback function which will be called if telemetry with that APID arrives.
- Parameters:
handler – Handler class instance
- Returns:
- handle_packet(apid: int, packet: bytes) bool
Handle a packet with an APID. If a handler exists for the given APID, it is used to handle the packet. If not, a dedicated handler for unknown APIDs is called.
- Parameters:
apid
packet
- Returns:
True if the packet was passed to as dedicated APID handler, False otherwise
- class tmtccmd.tmtc.common.DefaultApidHandler(user_args: Any)
Bases:
GenericApidHandlerBase
- class tmtccmd.tmtc.common.GenericApidHandlerBase(user_args: Any)
Bases:
ABCThis class is similar to the
SpecificApidHandlerBasebut it is not specific for an APID and the found APID will be passed to the callback
- class tmtccmd.tmtc.common.SpecificApidHandlerBase(apid: int, user_args: Any)
Bases:
ABCAbstract base class for an CCSDS APID specific handler. The user can implement a TM handler by implementing this class and then adding it to the
CcsdsTmHandler. If a CCSDS space packet with a specific APID is received, it will be routed to this handler using thehandle_tm()callback function
TM Base Module (deprecated)
- class tmtccmd.tmtc.tm_base.PusTmBase(pus_tm: PusTm)
Bases:
PusTmInterface
- class tmtccmd.tmtc.tm_base.PusTmInfoBase(pus_tm: PusTm)
Bases:
PusTmInfoInterface- append_telemetry_column_headers(header_list: list)
Default implementation adds the PUS header content header (confusing, I know) to the list which can then be printed with a simple print() command. To add additional headers, override this method. Any child class should call this function as well if header information is required.
- Parameters:
header_list – Header content will be appended to this list
- Returns:
- append_telemetry_content(content_list: list)
Default implementation adds the PUS header content to the list which can then be printed with a simple print() command. To add additional content, override this method. Any child class should call this function as well if header information is required.
- Parameters:
content_list – Header content will be appended to this list
- Returns:
- get_source_data_string(print_format: PrintFormats = PrintFormats.HEX) str