Request callback

From Sim Innovations Wiki
Revision as of 15:30, 5 February 2019 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search



request_callback is used to force a callback on a given data subscription (X-plane, FSX, FS2, IIC or external sources)

Info The callback will only be called when there is a connection with the given flight simulator or data source.

Return value

This function won't return any value.


# Argument Type Description
1 function_callback String The callback function that should be updated


-- This function will be called when new data is available from X-plane
  function new_altitude_callback(altitude)
    print("New altitude: " .. altitude)

  -- subscribe X-plane datarefs on the AirBus
  xpl_dataref_subscribe("sim/cockpit2/gauges/indicators/altitude_ft_pilot", "FLOAT", new_altitude_callback)

  -- Force a callback. The 'new_altitude_callback' function will be called here with its current arguments.