Skip to content

Instantly share code, notes, and snippets.

@iainiain32
iainiain32 / main.rb
Created February 14, 2012 04:56
Read X-Plane UDP packets with Ruby
require 'rubygems'
require 'socket'
class Xplane
XP_SENDING_PORT = 49001 # X-Plane sends packets on this port
# These define the structure of the UDP packet.
XP_PACKET_HEADER = 'CCCCC'
XP_PACKET_DATA = 'lffffffff'