Socket
Socket
Sign inDemoInstall

insteon-packet-parser

Package Overview
Dependencies
0
Maintainers
2
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    insteon-packet-parser

A simple Insteon packet parser to be used by Node Serialport and a PowerLinc Modem (PLM) library or program


Version published
Weekly downloads
2
increased by100%
Maintainers
2
Install size
88.6 kB
Created
Weekly downloads
 

Readme

Source

InsteonPacketParser

A simple Insteon packet parser to be used by Node Serialport and a PowerLinc Modem (PLM) library or program.

If you see any problems, have any advice, or want to help out please open an issue.

Examples

Send Command and read replies

const SerialPort = require('serialport');
const {InsteonParser} = require('../dist/main');

/* Open serial port */
const port = new SerialPort('/dev/tty.usbserial-A60336ZZ', {
  baudRate: 19200,
  dataBits: 8,
  stopBits: 1,
  parity: 'none'
});

/* Creating new parser */
const parser = new InsteonParser();

/* Porting serial port to parser */
port.pipe(parser);

/* On data */
parser.on('data', (data)=> console.info(data));

/* Result
  {
    id: 0x73,
    type: 'Get IM Configuration',
    autoLinking: true,
    monitorMode: true,
    autoLED: true,
    deadman: true,
    success: true
  }
*/

/* On serial port opened send command */
port.on('open', () => {
  const buf = Buffer.alloc(2);
        buf.writeUInt8(0x02, 0);
        buf.writeUInt8(0x73,1);

  port.write(buf, (error) => {
    if(error){
      console.error(`Error: ${error}`);
    }
  });
});

Keywords

FAQs

Last updated on 14 Nov 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc