#!/usr/bin/env python3
#
# Script to emulate an instrument sending UDP packets to RIC.
#
# If you would like to test the complete path from the aircraft, but the
# instrument is unavailable, use this script.
#
# Change the ip and ports and message ID (they need to match what is in the
# <inst>.ini file). Change the content of the message to whatever is useful
# to you.
# Then run it to write a message to the specified port, which should be sent
# via ric_switch to the proxy on the ground.
#
# This script can also be a reference for instrument code in Python.
import socket
import time
def main():
udp_id = "INSTID" # Instrument ID
# To send from the aircraft to the ground
udp_send_port = 32106 # Get these ports from
udp_read_port = 32107 # http://wiki.eol.ucar.edu/sew/Aircraft/UDP-Data.
udp_ip = "192.168.84.2" # The IP address of the aircraft server
# To send from the ground to the aircraft
udp_send_port = 32107 # Note these are the reverse of above
udp_read_port = 32106
udp_ip = "127.0.0.1"