IFC Evolved

INTENDED FOR DEVELOPERS

IFC Evolved

https://github.com/Sam-Neale/ifc-evolved/

What is this?


Infinite Flight Connect Evolved is a Javascript Client for the Infinite Flight Connect API. Infinite Flight Connect is a built-in API that allows you to send command to Infinite Flight. You must enable it in Infinite Flight Settings > General > "Enable Infinite Flight Connect".

Where can I get this?


Using NPM: ifc-evolved - npm

Code Docs


Initialization

init(successCallback, errorCallback)

  • successCallback is the function to be executed after the connection has been established with Infinite Flight
  • errorCallback is the function to be executed in case of Error (20 seconds with no IF found, or data lacking an address)

Example:

const IFC = require('ifc-evolved');

IFC.init(
  function() {
    console.log("IFC connected");
    IFC.sendCommand({ "Command": "Commands.FlapsDown", "Parameters": []});
  },
  function() {
    IFC.log("IFC connection error");
  }
)

Sending a Command

To send a command to Infinite Flight, you may use the shortcut function IFC.cmd() or the full function for complex commands. You’ll find a full list of commands on the API Docs repo

Examples:

  • Flaps Down : IFC.cmd("FlapsDown") will lower the flaps down. (Full Command equivalent is: IFC.sendCommand({ "Command": "Commands.FlapsDown", "Parameters": []});
  • Camera Move : this one require params, so let’s call the full command call : "Command": "NetworkJoystick.SetPOVState", "Parameters": [ { "Name": "X", "Value": 0 }, { "Name": "Y", "Value": 0 } ] }

Connection to ForeFlight Link API

Fore Flight Link broadcasts various data about the player’s plane and traffic planes around him. ForeFlight Link must be enabled from Infinite Flight Settings > General > Enable ForeFlight Link

You can use IFC to listen to ForeFlight Link messages :

initForeFlight(onForeFlightDataReceived)

Received Data is formatted according to the official documentation : ForeFlight - Simulator GPS, Traffic, Attitude Integration

Credits


Almost all of the code is from Nicolas BARTHE-DEJEAN. I was unable to locate him on the IFC or by other means. If anyone knows how to contact him, please, please let me know so I can request ownership of the original. I am now maintaining this service due to 5 years of inactivity on Nicolas Barthe Dejean's part.

Projects


Projects that use IFC-Evolved

  • IFFMC Reborn

Add yours by replying below

8 Likes

Nice! Are you looking at supporting the v2 Connect API in the future?

1 Like

Yea, priority is to fix the current one. Then I’ll work in V2

4 Likes

Fixed NPM, can get it now

1 Like

NEW RELEASE (1.1.4)


Rectifies deprecated buffers, which seems to be causing program hangs when using with electron.
2 Likes

Feeling cute, gonna make this work with the connect API v2 because I need it for IFFMC. Wish me luck 💀

3 Likes

@Sam_Neale … I’ve also been working on a Node module for Connect API v2 myself based on code I wrote for PanelNinja. I’m expecting to publish a first cut on Github in the next week or so and share it in the forums here.

How far along are you with your v2 support in ifc-evolved?

Haha, well you see… I may have been putting it off for the last week because the connect api V2 is a pain in the ass.

In all honesty its probably due to my incompetence but like

1 Like

So … I went through a lot of pain getting the v2 API to work the way I wanted but seem to have it working reliably via Node but specifically for GetState only which is all I’ve used so far in my PanelNinja Electron app.

What I’ve done is externalise that now into an external node module which can do the following:

  • Detect a host via UDP and connect (or connect to an explicit API)
  • Retrieve the manifest
  • Send GetState commands – responses emit an event back to the calling script which can handle the response event a it wants
  • Allow the creation of a polling queue – i.e. define a list of commands which simply poll IF repeatedly in a looping sequence – useful for the type of instrument panel app I had built but I’m sure it has other use cases. In PanelNinja basically every time I get a response back from a command I fire off the next in the queue and loop back to the start of the list endlessly. The node module I’m building does for me now.

I’m extending the model right now to support SetState and RunCommand commands and I’m hopeful to crack that this side of Christmas.

2 Likes

Sounds good, keep me posted

Will do. I’ll post a proper announcement in the forums once I publish the first cut of the module.

Also, separately, last year (April 2020), I forked Velocity23’s fork of Nicolas BARTHE-DEJEAN’s IFC node module for Connect v1 and made some changes in case you’re interested:

likeablegeek/ifc: A Javascript client for Infinite Flight Connect API (github.com)

Thats quite impressive

I hope it’s useful. I’ve not updated or worked on it since I started focussing on the v2 API this year.

1 Like