Skip to content

Galen-Titanium/xpl-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xpl-api

Objective

XPL layer for nodejs

Installation

$ npm install xpl-api

Usage

Waiting for XPL messages :

var Xpl=require("xpl-api");

var xpl=new Xpl();

xpl.on("message", function(message) {
	console.log("Receive message ", message);
	
});

xpl.on("close", function() {
	console.log("Receive close event");
});

xpl.bind(function(error) {
	console.log("Bind return ", error);
});

Sending XPL messages :

var Xpl=require("xpl-api");

var xpl=new Xpl({
	source: "nodejs-sample",
	broadcastAddress: "192.168.X.Y" // <<< you must specify a correct IP
});

xpl.sendXplTrig({
	device: "temp1 0x90",
	type: "temp",
	current: 20.4
});

xpl.sendXplCmnd({
	request: "on",
	device: "x10"
});

About

XPL layer for nodejs

Resources

Stars

Watchers

Forks

Packages

No packages published