Python Yamcs Client
- General Client
- Mission Database
- TM/TC Processing
- Archive
- Link Management
- Object Storage
- File Transfer
- Time Correlation (TCO)
- Timeline
- Examples
- alarms.py
- archive_breakdown.py
- archive_retrieval.py
- authenticate.py
- ccsds_completeness.py
- commanding.py
- cop1.py
- file_transfer.py
- links.py
- events.py
- mission_time.py
- packet_subscription.py
- parameter_subscription.py
- plot_with_matplotlib.py
- query_mdb.py
- read_write_parameters.py
- reconnection.py
- timeline.py
- write_mdb.py
Related
Download this Document
packet_subscription.pyΒΆ
from binascii import hexlify
from time import sleep
from yamcs.client import YamcsClient
def receive_callbacks():
"""Shows how to receive callbacks on packet updates."""
def print_data(packet):
hexpacket = hexlify(packet.binary).decode("ascii")
print(packet.generation_time, ":", hexpacket)
processor.create_container_subscription(
containers=["/YSS/SIMULATOR/FlightData", "/YSS/SIMULATOR/Power"],
on_data=print_data,
)
if __name__ == "__main__":
client = YamcsClient("localhost:8090")
processor = client.get_processor("simulator", "realtime")
print("\nReceive callbacks")
receive_callbacks()
sleep(5) # Subscription is non-blocking