Giter Club home page Giter Club logo

infiniteflight-api's Introduction

Infinite Flight Connect API Docs & Samples

Connection

  1. To enable Infinite Flight command server, check Enable Infinite Flight Connect in Settings > General

  2. Infinite Flight will broadcast UDP packets on port 15000 containing its own IP address and Port. Example message : { "Address" : "192.168.0.11", "Port" : 10111 }

  3. You must then establish a TCP connection on this given host and port

Get Airplane State

This special command will request the airplane state from Infinite Flight. Response will be received on the same socket : { "Command": "Airplane.GetState", "Parameters": []}

Command Messages

A command message is a object of the follwing form :

There are two types of command messages :

  • Commands : { "Command": "Commands.{CommandName}", "Parameters": []}
  • Axis : { "Command": "NetworkJoystick.{AxisCommandName}", "Parameters": []}

List of commands

Joystick

Joystick axis use the NetworkJoystick.SetAxisValue command with two params :

  • Axis Name : 0 for Roll, 1 for Pitch
  • Value : a value between -1024 and 1024

Example :

            "Command": "NetworkJoystick.SetAxisValue",
            "Parameters": [ { "Name": 0, "Value": -340 } ]
        }```
      

#### Plane Systems 

Commands to control various systems of the plane. Example, lower flaps down : 
`{ "Command": "Commands.FlapsDown", "Parameters": []}`

| Command  | Description  |
|---|---|
| `Brakes` | Toggle brakes on/off |
| `ParkingBrakes` | Toggle parking brakes |
| `FlapsDown` | Decrement flaps |
| `FlapsUp` | Increment flaps |
| `FlapsFullDown` | |
| `FlapsFullUp` | |
| `Aircraft.SetFlapState` | TODO : provide example |
| `Spoilers` | Switch between spoilers states (Off, Flight, Armed) |
| `LandingGear` | Toggle landing gear  |
| `Pushback` | Toggle Pushback (on/off) |
| `ReverseThrust` | Enable reverse (?) |
| `RollLeft` | |
| `RollRight` | |
| `PitchUp` | |
| `PitchDown` | |
| `ResetCommands` | |
| `ElevatorTrimUp` | |
| `ElevatorTrimDown` | |
| `ThrottleUpCommand` | |
| `ThrottleDownCommand` | |

#### Lights

Following commands toggle the state of a light. Example : 
`{ "Command": "Commands.LandingLights", "Parameters": []}`

| Command  | Description  |
|---|---|
| `LandingLights` | |
| `TaxiLights` | |
| `StrobeLights` | |
| `BeaconLights` | |
| `NavLights` |  |

#### Camera 
##### Camera Commands

Following commands can be used to control cameras. Example : 
`{ "Command": "Commands.NextCamera", "Parameters": []}`

*For camera moves, see Axis commands below*

| Command  | Description  |
|---|---|
| `ToggleHUD` | Switch between HUD states (Full, Without map, disabled) |
| `NextCamera`| Switch to next camera |
| `PrevCamera` | Switch to previous camera |
| `CameraMoveLeft` | | 
| `CameraMoveRight` | |
| `CameraMoveDown` | | 
| `CameraMoveUp` | | 
| `CameraMoveHorizontal` | |
| `CameraMoveVertical` | |
| `CameraZoomIn` | |
| `CameraZoomOut` | |
| `SetCockpitCamera` | |
| `SetVirtualCockpitCameraCommand` | |
| `SetFollowCameraCommand` | |
| `SetFlyByCamera` | |
| `SetOnboardCameraCommand` | |
| `SetTowerCameraCommand` | |

##### Camera Axis 

Camera POV movements can be controlled via the following command : 
```{  "Command": "NetworkJoystick.SetPOVState",  "Parameters": [ { "Name": "X", "Value": 0 },  { "Name": "Y", "Value": 0 }  ] }```

X and Y values can be either `-1`, `0` or `1`: they determine if the camera will move on each axis, either negatively or positively (or stay still on the given axis with the `0` value). For example, to move the POV to the left only horizontaly, use the following command :

```{  "Command": "NetworkJoystick.SetPOVState",  "Parameters": [ { "Name": "X", "Value": -1 },  { "Name": "Y", "Value": 0 }  ] }```

#### ATC 

**Live only**
Allows you to send messages to ATC according to the options available on the ATC window. Example, call the ATC command #3 (as shown on the ATC window) : 
`{ "Command": "Commands.ATCEntry3", "Parameters": []}`

| Command  | Description  |
|---|---|
| `ShowATCWindowCommand` | Show / Hide the ATC window |
| `ATCEntry1` | Choose the option #1 (or back)  |
| `ATCEntry2` | ... |
| `ATCEntry3` |  ...|
| `ATCEntry4` |  ...|
| `ATCEntry5` |  ...|
| `ATCEntry6` |  ...|
| `ATCEntry7` |  ...|
| `ATCEntry8` |  ...|
| `ATCEntry9` |  ...|
| `ATCEntry10` |  ...|
| `Live.SetCOMFrequencies` | TODO : describe this |

#### Autopilot and Flight Plan

Commands to set the value of an Autopilot param, or to toggle its state. 
Examples : 
Set HDG param to 270 : 
      ```{
        "Command": "Commands.Autopilot.SetHeading",
        "Parameters": [{"Value": 270 }]
      }```

Enable HDG :
```{
        "Command": "Commands.Autopilot.SetHeadingState",
        "Parameters": [{ "Value": true }]
      }```

Toggle Autopilot : 
```{
        "Command": "Commands.Autopilot.Toggle",
        "Parameters": []
      }```


| Command  | Description  |
|---|---|
| `Autopilot.Toggle` | Toggle autopilot |
| `Autopilot.SetState` | |
| `Autopilot.SetHeading` | Heading |
| `Autopilot.SetAltitude` | Altitude |
| `Autopilot.SetVS` | Vertical Speed |
| `Autopilot.SetSpeed` | Speed |
| `Autopilot.SetHeadingState` | |
| `Autopilot.SetAltitudeState` | |
| `Autopilot.SetVSState` | |
| `Autopilot.SetSpeedState` | |
| `Autopilot.SetApproachModeState` | |
| `FlightPlan.AddWaypoints` | Add waypoints to flightplan |
| `FlightPlan.Clear` | Clear flightplan |
| `FlightPlan.ActivateLeg` | |

### Simulator Commands 

Control on simulator. Example, toggle play/pause : 
```{
        "Command": "Commands.TogglePause",
        "Parameters": []
      }```

| Command  | Description  |
|---|---|
| `TogglePause` | |
| `TakeScreenshot` | |
| `ToggleUber` | |
| `ToggleTime` | |
| `ToggleShader` | |
| `ToggleNormal` | |
| `Start Recording` | |
| `Stop Recording` | |

infiniteflight-api's People

Contributors

prollin avatar 0x6e69636f avatar giacomolaw avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.