Optional onOptional onCallback function is called when Frame Information Received
// Javascript Example
obniz.plugin.onError = error => {
console.log(`error occurred: ${error.message}`);
};
Optional onCallback function is called when Frame Information Received
// Javascript Example
obniz.plugin.onFrameEnd = length => {
console.log(`frame ended`);
};
Optional onCallback function is called when Frame Information Received
// Javascript Example
obniz.plugin.onFrameStart = (frame_id, length) => {
console.log(`${length} bytes will be start`);
};
Optional onreceiveCallback function is called when Plugin is received.
// Javascript Example
obniz.plugin.onreceive = data => {
console.log(data);
};
Executing Lua on target device and wait for its returned value.
The Lua script is run inside a coroutine on the device. Whatever the script
returns (as a string) is resolved here. If the script raises an error, the
returned Promise is rejected with that error message.
The Lua side may itself call cloud.transactionWait(...) while running,
which is delivered to onCloudTransaction.
// Javascript Example
const result = await obniz.plugin.callWait(`return "hello from lua"`);
console.log(result); // "hello from lua"
Lua script to be run on target device
timeout in milliseconds (default 30000)
Generated using TypeDoc
Handler called when Lua runs
cloud.transactionWait(data)on the device.