-
Notifications
You must be signed in to change notification settings - Fork 287
XPC Developer Information
Quick Links: Plugin | Network | Client | Troubleshooting
#Plugin Information
A Note on binaries: We keep the binaries for the plugin in version control
to keep track of all of them across platforms. However, it is very hard to keep
all of the binaries in sync all of the time. Therefore, develoepers working on
any branch other than master
are advised to always build the plugin before use
to ensure that the binary includes all of the latest changes.
##Components The following components make up the X-Plane Connect plugin. All components are written in C++. In general, there is a one-to-one correspondence between the components described below and a header file bearing the same name.
###Data Manager
The Data Manager component provides a wrapper around the XPLM data interface.
This component provides two basic data interface mechanisms. The primary
mechanism is the DREF
scoped enumeration that names commonly used X-Plane
datarefs. The DataManager
class provides methods to get and set the value of
these datarefs in a strongly typed manner. Secondly, the DataManager
class
provides weakly typed methods to set arbitrary datarefs by name using floating
point values.
###Drawing The Drawing component provides functionality for rendering graphics in the X-Plane environment. Currently, this includes writing a single text string on the screen, and rendering a sequence of waypoints in the X-Plane world.
###Log
The Log component facilitates the logging of information about what the XPC
plugin is doing while it is running. Logging is accomplished through two methods.
Other components can write to the XPC log either by calling Log::WriteLine
to
write a string to the log directly, or Log::FormatLine
to write a formatted
string to the log.
###Message & Message Handlers
The messaging component handles commands sent to the plugin. The Message
class
is primarily a data object containing the message data. The MessageHandlers
class contains the core functionality of the plugin. It contains methods to
operate on commands, and logic to dispatch incoming messages to the appropriate
handler.
###UDPSocket The UDPScocket component is a thin wrapper around the platform networking API. Its primary purpose is to abstract cross-platform differences.
#Network Information
#Client Information
#Troubleshooting The following topics have been identified as frequent obstacles to correct operation of the XPC plugin. If you are having an issue that is not covered here, or if the troubleshooting steps listed here do not resolve your issue, please let us know by opening an issue.
###Failing to read data By default, the XPC clients all set a read timeout of 100ms. This timeout should work well for systems where the client and plugin are running on the same machine, but it may be too aggressive for systems where the client is running on another machine, or in situations where X-Plane is running at a low frame-rate.
Troubleshooting steps:
- Increase the read timeout. This can be accomplished by calling the
appropriate version of the client constructor or openUDP for all versions
except the C client. For the C client, you can manually set the timeouts in
in the
aopenUDP
function. For Windows users, you may also want to adjust the timeout forselect
in thereadUDP
function. - Lower X-Plane graphics settings. X-Plane Connect is structured to run once per iterations of the X-Plane flight simulation loop. If X-Plane is running at a low frame-rate, it will increase the time it takes X-Plane Connect to respond to requests. You can view the current frame-rate by following the steps described here.