Hierarchy

  • Plugin

Constructors

Properties

onFrameEnd?: (() => void)

Type declaration

    • (): void
    • Callback function is called when Frame Information Received

      // Javascript Example
      obniz.plugin.onFrameEnd = length => {
      console.log(`frame ended`);
      };

      Returns void

onFrameStart?: ((frame_id, length) => void)

Type declaration

    • (frame_id, length): void
    • Callback function is called when Frame Information Received

      // Javascript Example
      obniz.plugin.onFrameStart = (frame_id, length) => {
      console.log(`${length} bytes will be start`);
      };

      Parameters

      • frame_id: number
      • length: number

      Returns void

onreceive?: PluginReceiveCallbackFunction

Callback function is called when Plugin is received.

// Javascript Example
obniz.plugin.onreceive = data => {
console.log(data);
};

Methods

  • Executing Lua on target device instantly. Lua script never be saved on a device.

    // Javascript Example
    obniz.plugin.execLua("duration = 60")

    Parameters

    • lua_script: string

    Returns void

  • Executing Lua on target device and save to it's flash memory.

    // Javascript Example
    obniz.storage.savePluginLua(`os.log("Hello World")`);
    obniz.plugin.reloadLua();

    Returns void

  • Scan WiFi

    // Javascript Example
    obniz.plugin.send("obniz.js send data")

    obniz.plugin.send([0x00, 0x01, 0x02])

    Parameters

    • data: string | number | number[] | Buffer

    Returns void

Generated using TypeDoc