1.0.10 • Published 7 years ago

axia-socket v1.0.10

Weekly downloads
-
License
ISC
Repository
-
Last release
7 years ago

Installation

npm install --save axia-socket

Basic Usage

const axiaSocket = require("axia-socket");

let newSocket = new axiaSocket({
	host : "127.0.0.1",
	port : "8000",
	reconnect : 5000,
	pollInterval : 200
});

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.

reconnect indicates the how long it will wait until it reconnects after a connection error. Default is 5000 milliseconds

pollInterval indicates how often this sends the list of polls 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.

run

On poll run.

halt

On poll stop.

log

Internal logged messages.

data.raw

On data receive, returning raw chunk of data.

error.raw

On error, returning raw error.

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago