Skip to content

A high level abstraction to communitcate with the DreamScreen BLE stick

Notifications You must be signed in to change notification settings

smirea/DreamScreen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DreamScreen BLE Interface

Provides a convenient high level abstraction to the BLE interface of the DreamScreen

Uses the command set from the DIY Board

Uses noble as the interface layer

Install

It's on npm

npm install --save dreamscreen

Usage

const DreamScreen = require('dreamscreen');

DreamScreen.getInstance()
.then(ds =>
    ds.setMode('video')
    .then(() => ds.setBrightness(50))
)

Options

Current options that can be passed to getInstance():

option default description
discoverByName false The default operation is to try to directly connect to the device by its ID If this is set to true, it will instead discover all devices and stops when one of them matches options.localName
localName DreamScreen The default name of the device. Only relevant in conjunction with discoverByName = true
debug false Prints out relevant information

Events

The resulting instance extends the node EventEmitter class and follows the following events:

name arguments description
disconnect The peripheral has disconnected
read {data, isNotification} A read has occurred. These generally happen after sendRead operations
send code Any code gets written to the peripheral

Caveats

Noble does not play nice with multiple instances so this package hijacks it.

Things are probably not going to go well if this is used together with other noble packages.

Tested on OSX and on Raspberry PI 3

About

A high level abstraction to communitcate with the DreamScreen BLE stick

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published