1stsetup / node-lirc_client

NodeJS add-on to communicate with the lirc_client
GNU General Public License v2.0
2 stars 2 forks source link

NPM

Description

node-lirc_client provides a lirc_client object so your nodejs application can receive lirc command.

It is based on the lirc_client example

Installation

npm install lirc_client

Requirements

Example

var lirc_client = require('lirc_client');

try {
    lirc_client.connect("testone", true, "test1.lircrc",function(type, data, configFile){
        console.log("Type:", type);
        console.log("Data:", data);
        switch (type) {
            case "rawdata":
                console.log("Rawdata received:",data);
                break;
            case "data":
                console.log("Data received '%s' from configFile '%s'",data, configFile);
                break;
            case "closed":
                console.log("Lircd closed connection to us.");
                break;
        }
    });

    console.log("lirc_client.isConnected:", lirc_client.isConnected);
    console.log("lirc_client.mode:", lirc_client.mode);
    console.log("lirc_client.configFiles:", lirc_client.configFiles);

    console.close();
    console.log("lirc_client.isConnected:", lirc_client.isConnected);
}
catch (err) {
    console.log("Error on connect:",err);
}

See examples folder for more detailed example.

API Documentation

Module Functions


Module properties