Jump to content
The simFlight Network Forums

nupp

new Members
  • Content count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

About nupp

  • Rank
    Newbie

Profile Information

  • Gender
    Male
  • Location
    Brazil
  1. Live FSX data for use with node.js

    I tried to implement this solution, exporting functions and compiling as DLL, but I can not connect to FSUIPC. I get the message: "Can not link to FSUIPC or WideClient", when a try to connect via FSUIPC_Open I compile as 32 bits. My node.js is also 32 bits. Tried 64, but I get the same error. This is my javascript code. var ffi = require('ffi'); var ref = require('ref'); const pszErrors = [ "Okay", "Attempt to Open when already Open", "Cannot link to FSUIPC or WideClient", "Failed to Register common message with Windows", "Failed to create Atom for mapping filename", "Failed to create a file mapping object", "Failed to open a view to the file map", "Incorrect version of FSUIPC, or not FSUIPC", "Sim is not version requested", "Call cannot execute, link not Open", "Call cannot execute: no requests accumulated", "IPC timed out all retries", "IPC sendmessage failed all retries", "IPC request contains bad data", "Maybe running on WideClient, but FS not running on Server, or wrong FSUIPC", "Read or Write request cannot be added, memory for Process is full", ]; // Creates a DWORD pointer const DWORDPTR = ref.refType('ulong'); const fsuipc = ffi.Library('fsuipc', { 'FSUIPC_Open': [ 'int', ['ulong', DWORDPTR]], 'FSUIPC_Read': ['int', ['ulong', 'ulong', 'pointer', DWORDPTR]], 'FSUIPC_Process': ['int', [DWORDPTR]] }); var dwResult = ref.alloc('ulong'); if (fsuipc.FSUIPC_Open(0, dwResult)) { var chTime = ref.alloc('ulong'); if (!fsuipc.FSUIPC_Read(0x238, 3, chTime, dwResult) || !fsuipc.FSUIPC_Process(dwResult)) { console.log(chTime.deref()); } } else { console.log(pszErrors[dwResult.deref()]); }
×