XPlaneConnectorCore 1.0.1

dotnet add package XPlaneConnectorCore --version 1.0.1
                    
NuGet\Install-Package XPlaneConnectorCore -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="XPlaneConnectorCore" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="XPlaneConnectorCore" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="XPlaneConnectorCore" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add XPlaneConnectorCore --version 1.0.1
                    
#r "nuget: XPlaneConnectorCore, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package XPlaneConnectorCore@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=XPlaneConnectorCore&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=XPlaneConnectorCore&version=1.0.1
                    
Install as a Cake Tool

✈️ XPlaneConnector

XPlaneConnector is a lightweight, fully asynchronous .NET library for interacting with X-Plane via UDP. It allows developers, simulation enthusiasts, and cockpit builders to automate flight operations, monitor datarefs, and trigger commands within the simulator in a reliable and scalable way.

🚀 Features

  • Full support for DataRef subscription and change notifications
  • Event-driven architecture for string-based datarefs
  • Command sending and continuous loop execution with cancellation support
  • Built-in support for frequency-based polling and timeout detection
  • Robust async/await architecture for modern .NET applications
  • Minimal dependencies, easy to integrate and extend

📦 Installation

dotnet add package XPlaneConnectorCore

Usage

1. Initialize and Start Connector

var connector = new XPlaneConnectorCore.XPlaneConnector();
connector.OnLog += Console.WriteLine;
connector.Start();

2. Subscribe to a float DataRef

var altitude = new DataRefElement("sim/cockpit2/gauges/indicators/altitude_ft_pilot", "ft", "Altitude");
await connector.SubscribeAsync(altitude, frequency: 5, onchange: (refElement, newValue) =>
{
    Console.WriteLine($"Altitude: {newValue} ft");
});

3. Subscribe to a String DataRef

var airportCode = new StringDataRefElement("sim/aircraft/view/acf_ICAO", 40);
await connector.SubscribeAsync(airportCode, frequency: 1, onchange: (refElement, value) =>
{
    Console.WriteLine($"ICAO Code: {value}");
});

4. Send a One-Time Command

var brakesCommand = new XPlaneCommand("sim/flight_controls/brakes_toggle", "Toggle brakes");
await connector.SendCommandAsync(brakesCommand);

5. Send a Repeating Command (with cancellation)

var gearCommand = new XPlaneCommand("sim/flight_controls/landing_gear_down", "Gear Down");
var commandTask = connector.StartCommand(gearCommand, frequencyHz: 10);

// Stop after 2 seconds
await Task.Delay(2000);
await connector.StopCommandAsync(commandTask);

6. Clean Shutdown

await connector.StopAsync();
connector.Dispose();

📚 Use Cases

  • Real-time monitoring of instruments and flight state
  • Custom-built cockpit hardware integration
  • Flight scenario scripting and automation
  • Development of training tools or ATC assistants

📄 License

MIT License © 2020–2025 Max Ferretti

🤝 Contributing

Pull requests are welcome! For feature requests, open an issue or get in touch.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 125 5/30/2025
1.0.0 110 5/30/2025