Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jliuhtonen/nightvision
Lenbrook Service Discovery Protocol implementation for Node.js
https://github.com/jliuhtonen/nightvision
bluesound bluos lsdp node-js udp
Last synced: about 1 month ago
JSON representation
Lenbrook Service Discovery Protocol implementation for Node.js
- Host: GitHub
- URL: https://github.com/jliuhtonen/nightvision
- Owner: jliuhtonen
- License: mit
- Created: 2023-09-11T20:23:31.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-30T10:00:30.000Z (about 2 months ago)
- Last Synced: 2024-11-30T11:17:59.702Z (about 2 months ago)
- Topics: bluesound, bluos, lsdp, node-js, udp
- Language: TypeScript
- Homepage:
- Size: 119 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Nightvision
[![Nightvision CI](https://github.com/jliuhtonen/nightvision/actions/workflows/workflow.yml/badge.svg)](https://github.com/jliuhtonen/nightvision/actions/workflows/workflow.yml)
Lenbrook Service [Discovery](https://youtu.be/xBTqRd09y3E) Protocol implementation for Node.js. See [specification](https://content-bluesound-com.s3.amazonaws.com/uploads/2022/07/BluOS-Custom-Integration-API-v1.5.pdf).
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
```javascript
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"],
})
```