linq-discovery
TypeScript icon, indicating that this package has built-in type declarations

2.1.6 • Public • Published

linq-discovery

npm library to discover linq devices using UDP broadcast

Install

yarn add linq-discovery
or
npm i linq-discovery

How To Use

import {Discovery} from 'linq-discovery'

const UDP_PORT = 7123 // Default Port used

const disco = new Discovery(UDP_PORT)
  .on('new', (device) => {                    // New device discovered
    console.dir(device)
  })
  .on('message', (device) => {                // Un-filtered UDP message received
    console.log(`${JSON.stringify(device)}`)
  })

Console Output Example

Device {
  product: 'linq2',
  id: 'cCzyUmwbgItEvWvzIesdoF-7seAUjH79LGC5zfTyqfs=',
  ip: '192.168.1.57',
  http: 80,
  https: 443,
  mqtt: 1883,
  mqtts: 8883
}

To get a list of devices discovered since application started

let array_of_devices = disco.get_devices()

To clear the list of devices discovered

disco.clear()

Readme

Keywords

none

Package Sidebar

Install

npm i linq-discovery

Weekly Downloads

0

Version

2.1.6

License

MIT

Unpacked Size

6.26 kB

Total Files

7

Last publish

Collaborators

  • richardlevano