@jliuhtonen/nightvision
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

Nightvision

Nightvision CI

Lenbrook Service Discovery Protocol implementation for Node.js. See specification.

This library provides you with a client and server implementation for the protocol that allows you to send and receive messages to discover supported devices and their capabilities.

Currently, it cannot be used to advertise services as only queries can be sent. Contributions are welcome.

Example

import { createConnection } from "nightvision"
const conn = await createConnection()

conn.onData((err, result) => {
  if (err) {
    console.error(err)
    return
  }
  console.log(JSON.stringify(result, null, 2))
})

await conn.sendMessage({
  type: "query",
  messageType: "standard",
  classIds: ["0001"],
})

As mentioned in the specification, the guideline is to send startup messages 7 times within certain time interval and delays. This is considered out of scope for this library.

Package Sidebar

Install

npm i @jliuhtonen/nightvision

Weekly Downloads

16

Version

0.2.1

License

MIT

Unpacked Size

30.8 kB

Total Files

20

Last publish

Collaborators

  • jliuhtonen