Skip to content

Lenbrook Service Discovery Protocol implementation for Node.js

License

Notifications You must be signed in to change notification settings

jliuhtonen/nightvision

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 as well as announce and delete services.

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.

Also note that many BluOS devices might send the same UDP broadcast every n seconds in addition to query responses.

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"],
})

About

Lenbrook Service Discovery Protocol implementation for Node.js

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published