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
events.pyΒΆ
from time import sleep
from yamcs.client import YamcsClient
def listen_to_event_updates():
"""Subscribe to events."""
def callback(event):
print("Event:", event)
client.create_event_subscription(instance="simulator", on_data=callback)
sleep(5) # Subscription is non-blocking
def send_event():
"""Post an event."""
client.send_event(instance="simulator", message="hello world")
if __name__ == "__main__":
client = YamcsClient("localhost:8090")
listen_to_event_updates()
print("Sending an event:")
send_event()
sleep(5)