process luxometer

This commit is contained in:
Martin Donnelly 2016-07-07 15:51:38 +01:00
parent 7fbb8aac27
commit 4edeb690ad

View File

@ -29,16 +29,16 @@ bluetest = module.exports = function(options) {
core.processLuxData = function(data) {
console.log('+ processLuxData');
var m, e, lux;
var p = data.lastIndexOf(10);
var p = data.indexOf(10);
var l = data.length - (p + 1);
//var _data = data.toString('ascii',p + 1, l);
var _data = data.toString('ascii');
var _data = data.toString('ascii',0, p);
//var _data = data.toString('ascii');
//logger.debug('buffer:', data);
//logger.warn('ascii:', _data);
logger.debug(_data);
logger.debug('>--',_data);
/* var wH = _data.slice(-5).split(' ');
var wB = [];
wB[0] = parseInt(wH[0], 16);