mirror of
https://gitlab.silvrtree.co.uk/martind2000/bluetest.git
synced 2025-01-28 23:26:17 +00:00
process luxometer
This commit is contained in:
parent
7fbb8aac27
commit
4edeb690ad
@ -29,16 +29,16 @@ bluetest = module.exports = function(options) {
|
|||||||
core.processLuxData = function(data) {
|
core.processLuxData = function(data) {
|
||||||
console.log('+ processLuxData');
|
console.log('+ processLuxData');
|
||||||
var m, e, lux;
|
var m, e, lux;
|
||||||
var p = data.lastIndexOf(10);
|
var p = data.indexOf(10);
|
||||||
var l = data.length - (p + 1);
|
var l = data.length - (p + 1);
|
||||||
|
|
||||||
|
|
||||||
//var _data = data.toString('ascii',p + 1, l);
|
var _data = data.toString('ascii',0, p);
|
||||||
var _data = data.toString('ascii');
|
//var _data = data.toString('ascii');
|
||||||
//logger.debug('buffer:', data);
|
//logger.debug('buffer:', data);
|
||||||
//logger.warn('ascii:', _data);
|
//logger.warn('ascii:', _data);
|
||||||
|
|
||||||
logger.debug(_data);
|
logger.debug('>--',_data);
|
||||||
/* var wH = _data.slice(-5).split(' ');
|
/* var wH = _data.slice(-5).split(' ');
|
||||||
var wB = [];
|
var wB = [];
|
||||||
wB[0] = parseInt(wH[0], 16);
|
wB[0] = parseInt(wH[0], 16);
|
||||||
|
Loading…
Reference in New Issue
Block a user