This Simconnect library is used to communicate with primary Microsoft Flight Simulator 2020 using Golang. However, given its use of the SimConnect API it should be able to communicate with other flight simulators whcih also support the SimConnect API.
This attempts to be a little more of a high-level library attempting to abstract much of the SimConnect complexity from the user.
The current version is considered an early release and will therefore keep changing. Breaking changes will be avoided but may happen if required.
- Request Data on User Aircraft (SimConnect_RequestDataOnSimObjectType)
- Request Data on Object (SimConnect_RequestDataOnSimObject)
- Load Flight Plan into Users Aircraft (SimConnect_FlightPlanLoad)
- Create parked ATC AI aircraft (SimConnect_AICreateParkedATCAircraft)
- Create Non ATC AI aircraft SimConnect_AICreateNonATCAircraft()
- Set Data on Object including user (SimConnect_SetDataOnSimObject)
- Create enroute ATC Aircraft (SimConnect_AICreateEnrouteATCAircraft)
- Set Flight Plan for AI ATC Aircraft (SimConnect_AISetAircraftFlightPlan)
- Remove Objects (SimConnect_AIRemoveObject)
go get -u github.com/JRascagneres/Simconnect-Go
and import with
import (simconnect "github.com/JRascagneres/Simconnect-Go")
Very simple example which starts the connection, grabs the current user data and closes the connection.
package main
import (
"fmt"
simconnect "github.com/JRascagneres/Simconnect-Go"
)
func main() {
instance, err := simconnect.NewSimConnect("Simconnect-Go")
if err != nil {
panic(err)
}
report, err := instance.GetReport()
if err != nil {
panic(err)
}
fmt.Printf("User Altitude: %f\n", report.Altitude)
if err := instance.Close(); err != nil {
panic(err)
}
}
All Documentation can be found through the godoc
Issues, feature requests or improvements welcome!
This project is licensed under the MIT License.