nsd-ble
v0.3.2
Published
This package is needed to communicate with the bluetooth standees. You can send to it what you want to be displayed on the screen. You can also give instructions on what the buttons need to do as well as upload graphics to them to be displayed. The stande
Readme
NotSoDoom standees bluetooth
This package is needed to communicate with the bluetooth standees. You can send to it what you want to be displayed on the screen. You can also give instructions on what the buttons need to do as well as upload graphics to them to be displayed. The standees communicate through a mesh they create on their own. You inly have to connect to one standee to be part of the mesh.
Mesh
The mesh lets you read and write to the standees.
useMesh()
connect()is the method to call when you want to search for a bluetooth device through the browser. This needs to be on a user action like a click.onConnectedis aSyncEvent<DataView<ArrayBufferLike>>event that you can attach your method to. This will be called when the mesh is connected.
let connected = false;
const mesh = useMesh();
mesh.onConnected.attach(() => (connected = true));onDisconnectedis aSyncEvent<DataView<ArrayBufferLike>>event that you can attach your method to. This will be called when the mesh is connected.
let connected = false;
const mesh = useMesh();
mesh.onDisconnected.attach(() => (connected = false));for more information on the events package check out https://github.com/rogierschouten/ts-events.
