TReK Python
5.3.3
Telemetry/Command API
|
The Telemetry API extends telemetry capabilities to user developed applications.
The descriptions below of the functionality available in the Telemetry APIs use some terminology that requires explanation.
The full list of documented classes can be found in the Class List, but here is a high level summary of some of the most useful / common classes. Each of them can be saved to a file and loaded from a file. The format of the save file is XML.
The TelemetryApi provides methods to retrieve data from the associated data store. The data retrieved can be processed with the associated Packet class.
Methods to Retrieve Data*
TelemetryApi.get_this_packet() - retrieves the packet specified by the token.
Methods for Packet Arrival Notification*
TelemetryApi.unregister_packet_semaphore() - used to identify that packet arrival noticiation is no longer required.
General Methods*
The following examples are provided to show how to use Telemetry APIs:
Tutorial of the "process" - Telemetry
Newest Data
Shows how to get the last packet to arrive. The newest packet is typically used to show the most recent data in user applications such as displays. The code here could be used with a timer to update at the needed frequency.
Source File: ex_telem_get_newest.py
Next Data
Shows how to get all of the data that arrives. This code uses the TelemetryApi.wait_for_packet() function to know when a packet arrives. You can also use a timer to periodically check for data.
Source File: ex_telem_get_next.py