0.7.0 • Published 5 years ago

tinkerforge-device-manager v0.7.0

Weekly downloads
5
License
ISC
Repository
github
Last release
5 years ago

Tinkerforge Device Manager

A node library to make connecting to and accessing Tinkerforge devices easier. Created at the University of Applied Sciences in Osnabrueck.

Supported Devices

Currently supported Tinkerforge devices:

Example

Consider you have a Humidity V2 Bricklet connected to a Master Brick. You can then use the device manager to get the Humidity V2 Bricklet via its UID or its device identifier. The process is as follows:

  1. Initialize the device manager (dm.initialize())
  2. Set a callback that is called for each connected device (e.g. dm.setConnectCallback(start);)
  3. In start(device) you'll have the current device as a wrapper object. Now you can check the type and register listeners (or do anything else)

Here is a full example (see also test.js):

var dm = require('./index.js');

// You can pass host and port, default is 'localhost' and 4223
dm.initialize();

// This will call start for each enumerated device
dm.setConnectCallback(start);

function start(device) {
    // Check the name of the current device
    console.log(device.getName());

    // Humidity V2 Bricklet
    if (device.getDeviceIdentifier() == 283) {
        device.registerListener(humidityChanged)
    }

    // Accelerometer Bricklet
    if (device.getDeviceIdentifier() == 250) {
        device.registerListener(accelerationChanged)
    }

    // And so on...
}

function humidityChanged(valObject) {
    console.log(valObject);
}

function accelerationChanged(valObject) {
    console.log(valObject);
}
0.7.0

5 years ago

0.6.0

5 years ago

0.5.8

5 years ago

0.5.7

5 years ago

0.5.6

5 years ago

0.5.5

5 years ago

0.5.4

5 years ago

0.5.3

5 years ago

0.5.2

5 years ago

0.5.1

5 years ago

0.5.0

6 years ago

0.4.0

6 years ago

0.3.0

6 years ago

0.2.5

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago