axia-lwrp v3.2.0
Installation
npm install axia-lwrp
Basic Usage
const Lwrp = require("axia-lwrp");
// Connect to an Axia device
let device = new Lwrp({
name: "xNode",
host: "127.0.0.1",
port: 93,
pass: "",
reconnect: 5000,
pollInterval: 1000,
});
// Do something when the device is ready
device.on("ready",deviceInfo=>{
console.log(deviceInfo);
});
// Set name of DST 1 to "Ch1"
device.write(`DST 1 NAME:"Ch1"`);
name is a friendly name assigned to the LiveWire device. This is optional. Default is device model.
host is the IP address of the LiveWire device you want to connect to. Default is localhost.
port is the LiveWire telnet port of the device. Default is port 93.
pass is the login password of the device. Default is blank.
reconnect indicates how long it will wait before reconnecting when there's a connection error. Default is 5000 milliseconds.
pollInterval indicates how often this sends the list of commands to the device. Default is 1000 milliseconds.
Methods
write(command)
Send a command to device.
run
Start polling. This gets called automatically after object is initialized.
stop
Stop polling. Emits halt event.
addCommand(command)
Adds a command to poll. Added commands will be sent to the device continuously on every interval set in runSpeed. This emits a log event.
removeCommand(command)
Removes a command from poll. This emits a log event.
Events
connected
On successful connection to device.
ready
Emitted when the version of the device has been retrieved.
log
Internal logged messages.
data
On data receive, returning parsed data.
data.*
Return parsed data of all supported indications.
data.INDI
Return parsed data of a specific supported indication. Replace INDI with the indication. See below.
Supported commands
VER
LOGIN password
PASSWD old password
SET key=value
SRC port
DST port
MTR ICH|OCH
LVL ICH|OCH CLIP.LEVEL=value LOW.LEVEL=value
ADD GPI ports
ADD GPO ports
DEL GPI ports
DEL GPO ports
GPO port
CFG GPO
IP
SAVE
Supported indications
VER
SET parameters
SRC port
DST port
MTR
GPO port
GPI port
CFG GPO
IP
ERROR code
To Do
Higher level functions for changing values. i.e., LVL, DST, SRC, VER, etc
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago