3.3.1 • Published 4 years ago

insteon-packet-parser v3.3.1

Weekly downloads
8
License
MIT
Repository
github
Last release
4 years ago

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}`);
    }
  });
});
3.3.1

4 years ago

3.3.0

5 years ago

3.2.1

5 years ago

3.2.0

5 years ago

3.1.4

5 years ago

3.1.3

5 years ago

3.1.2

6 years ago

3.1.1

6 years ago

3.1.0

6 years ago

3.0.0

6 years ago

2.2.1

7 years ago

2.2.0

7 years ago

2.1.0

7 years ago

2.0.2

7 years ago

2.0.0

7 years ago

0.6.4

7 years ago

0.6.3

7 years ago

0.6.2

8 years ago

0.6.1

8 years ago

0.6.0

8 years ago

0.5.0

8 years ago

0.4.0

8 years ago

1.4.0

8 years ago

0.3.0

8 years ago

0.1.1

8 years ago

1.1.1

8 years ago

1.0.0

8 years ago