Skip to content

system.registerSource

since 1.1.0

Register a Lua Source.

system.registerSource(params)

Parameters

Name Type Required Description
params table yes see the fields below

Fields of params:

  • key (string, 7 chars max): source key
  • name (string or function): source name
  • init (function, optional): handler called on source init
  • done (function, optional): handler called on source stop
  • wakeup (function, optional): handler called at each loop
  • read (function, optional): optional read handler
  • write (function, optional): optional write handler
  • configure (function, optional): handler called on source configuration

Returns

Nothing.

Examples

From the official Ethos documentation
local function init()
  system.registerSource({key="LuaSrc", name="My source", init=init, wakeup=wakeup})
end

Used in