0.8.3 • Published 7 years ago

finggal-thermometer v0.8.3

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Finggal Link Bluetooth Thermometer

This module provides a simple bluetooth API for Finggal bluetooth thermometers.

Current Support is only for the IRSTP3 model See bluetooth-serial-port for platform specific install dependencies. Testing has only been performed on Debian (Raspian), but it should work on all OS's that bluetooth-serial-port supports.

Useage

Install non-npm dependencies

apt-get install build-essential libbluetooth-dev

Install via npm

npm install --save finggal-thermometer

Next, import the package and instantiage an object.

const Thermometer = require('finggal-thermometer')
const thermometer = new Thermometer()

Register for events, and begin scanning.

thermometer.on('connect', () => {
  console.log('Connected!')
})

thermometer.on('disconnect', () => {
  console.log('Disconnected')
})

thermometer.on('finishedScan', () => {
  console.log('Completed scan')
})

thermometer.on('error', error => {
  console.log(error)
})

thermometer.on('data', temp => {
  console.log('Temp: ' + temp + '˚C')
})

// Don't forget this!
thermometer.scanAndConnect()