Advertisement
robgonsalves

send_airspeed_command.py

Aug 28th, 2015
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. import socket
  2. #set the address and port of the AirSpeed system
  3. HOST = '10.105.216.188'
  4. PORT = 59451
  5. #create and initializae the socket object
  6. s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  7. s.connect((HOST, PORT))
  8. #set the output buffer with the command for AirSpeed
  9. output_buffer = b"<?xml version=\"1.0\" encoding=\"UTF-8\"?><AMS><Configuration><GetConfigInfo/></Configuration></AMS>"
  10. #set the commnad
  11. s.send(out_buffer)
  12. #get amd print the result
  13. input_buffer = s.recv(2048)
  14. s.close()
  15. print (input_buffer.decode("utf-8"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement