Skip to content

system.registerMultimoduleProtocol

since 1.3.0

Register a Multimodule Protocol.

system.registerMultimoduleProtocol(label, id, params)

Parameters

Name Type Required Description
label string yes protocol name
id int yes protocol ID
params table yes see the fields below

Fields of params:

  • variants (table, optional): protocol variants
  • minChannels (unsigned, optional): minimum channels count
  • maxChannels (unsigned, optional): maximum channels count
  • features (unsigned, optional): protocol features
  • options (table of options, optional): protocol options with elements:
    • name (string): option name
    • min (int): option min
    • max (int): option max
    • display (function, optional): display function for the option value

Returns

Nothing.

Examples

From the official Ethos documentation
local function init()
  system.registerMultimoduleProtocol("Hubsan", 2, {variants={"H107", "H301", "H501"}, minChannels=8, maxChannels=16})
end