sensortag

node.js lib for the TI SensorTag

node-sensortag

node.js lib for the TI SensorTag

npm install sensortag
var SensorTag = require('sensortag');
SensorTag.discover(callback(sensorTag)[, uuid]);

Optional SensorTag uuid to scan for, obtained from previous discover sensorTag.uuid. The uuid per SensorTag may not be the same across machines.

sensorTag.connect(callback);
sensorTag.disconnect(callback);
sensorTag.discoverServicesAndCharacteristics(callback);
sensorTag.readDeviceName(callback(deviceName)); // does not work on OS X 10.10 
 
sensorTag.readSystemId(callback(systemId));
 
sensorTag.readSerialNumber(callback(serialNumber));
 
sensorTag.readFirmwareRevision(callback(firmwareRevision));
 
sensorTag.readHardwareRevision(callback(hardwareRevision));
 
sensorTag.readSoftwareRevision(callback(softwareRevision));
 
sensorTag.readManufacturerName(callback(manufacturerName));
sensorTag.enableIrTemperature(callback);
 
sensorTag.disableIrTemperature(callback);
 
sensorTag.setIrTemperaturePeriod(period, callback); // period min 300ms, default period is 1000 ms 
sensorTag.readIrTemperature(callback(objectTemperature, ambientTemperature));
sensorTag.notifyIrTemperature(callback);
 
sensorTag.unnotifyIrTemperature(callback);
 
sensorTag.on('irTemperatureChange', callback(objectTemperature, ambientTemperature));
sensorTag.enableAccelerometer(callback);
 
sensorTag.disableAccelerometer(callback);
 
sensorTag.setAccelerometerPeriod(period, callback); // period 1 - 2550 ms, default period is 2000 ms 
sensorTag.readAccelerometer(callback(x, y, z));
sensorTag.notifyAccelerometer(callback);
 
sensorTag.unnotifyAccelerometer(callback);
 
sensorTag.on('accelerometerChange', callback(x, y, z));
sensorTag.enableHumidity(callback);
 
sensorTag.disableHumidity(callback);
sensorTag.readHumidity(callback(temperature, humidity));
sensorTag.notifyHumidity(callback);
 
sensorTag.unnotifyHumidity(callback);
 
sensorTag.on('humidityChange', callback(temperature, humidity));
sensorTag.enableMagnetometer(callback);
 
sensorTag.disableMagnetometer(callback);
 
sensorTag.setMagnetometerPeriod(period, callback); // period 1 - 2550 ms, default period is 2000 ms 
sensorTag.readMagnetometer(callback(x, y, z));
sensorTag.notifyMagnetometer(callback);
 
sensorTag.unnotifyMagnetometer(callback);
 
sensorTag.on('magnetometerChange', callback(x, y, z));
sensorTag.enableBarometricPressure(callback);
 
sensorTag.disableBarometricPressure(callback);
sensorTag.readBarometricPressure(callback(pressure));
sensorTag.notifyBarometricPressure(callback);
 
sensorTag.unnotifyBarometricPressure(callback);
 
sensorTag.on('barometricPressureChange', callback(pressure));
sensorTag.enableGyroscope(callback);
 
sensorTag.disableGyroscope(callback);
 
sensorTag.setGyroscopePeriod(period, callback); // period 100 - 2550 ms, default period is 1000 ms 
sensorTag.readGyroscope(callback(x, y, z));
sensorTag.notifyGyroscope(callback);
 
sensorTag.unnotifyGyroscope(callback);
 
sensorTag.on('gyroscopeChange', callback(x, y, z));
sensorTag.notifySimpleKey(callback);
 
sensorTag.unnotifySimpleKey(callback);
 
sensorTag.on('simpleKeyChange', callback(left, right));