Updated Python client to support "switch" argument in SIMU command.

This commit is contained in:
Jason Watkins
2015-05-01 15:13:27 -07:00
parent dcdd63d0c3
commit 35abb41e8e
2 changed files with 14 additions and 4 deletions

View File

@@ -81,11 +81,11 @@ class XPlaneConnect(object):
Args:
pause: True to pause the simulation; False to resume.
'''
pause_val = 0
if pause:
pause_val = 1
pause = int(pause)
if pause < 0 or pause > 2:
raise ValueError("Invalid argument for pause command.")
buffer = struct.pack("<4sxB", "SIMU", pause_val)
buffer = struct.pack("<4sxB", "SIMU", pause)
self.sendUDP(buffer)
# X-Plane UDP Data