https://github.com/jrascagneres/simconnect-go
GoLang SimConnect Library
https://github.com/jrascagneres/simconnect-go
api flight-simulator fs2020 golang microsoft-flight-simulator-2020 msfs2020 simconnect windows
Last synced: 4 months ago
JSON representation
GoLang SimConnect Library
- Host: GitHub
- URL: https://github.com/jrascagneres/simconnect-go
- Owner: JRascagneres
- License: mit
- Created: 2020-11-22T17:53:41.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-08-09T13:02:59.000Z (almost 2 years ago)
- Last Synced: 2025-03-16T21:35:27.779Z (4 months ago)
- Topics: api, flight-simulator, fs2020, golang, microsoft-flight-simulator-2020, msfs2020, simconnect, windows
- Language: Go
- Homepage:
- Size: 86.9 KB
- Stars: 23
- Watchers: 3
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simconnect-Go [](https://godoc.org/github.com/JRascagneres/Simconnect-Go) [](https://github.com/JRascagneres/Simconnect-Go/releases) [](https://github.com/JRascagneres/Simconnect-Go/blob/master/LICENSE)
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.
## Status
The current version is considered an early release and will therefore keep changing. Breaking changes will be avoided but may happen if required.
## Currently Implemented
- 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)## Install
`go get -u github.com/JRascagneres/Simconnect-Go`
and import with
`import (simconnect "github.com/JRascagneres/Simconnect-Go")`## Very Simple Usage
Very simple example which starts the connection, grabs the current user data and closes the connection.
```
package mainimport (
"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)
}
}
```## Documentation
All Documentation can be found through the [godoc](https://godoc.org/github.com/JRascagneres/Simconnect-Go)
## Contributing
Issues, feature requests or improvements welcome!
## License
This project is licensed under the [MIT License](LICENSE).