沈斌
2016-12-15 a5fa0c2f86c64b271ddbeae7758bc27d2920dcf9
method.js
@@ -4,6 +4,7 @@
var moment = require('moment');
var config = require('./config');
var queue = require('./queue');
module.exports.toDec = function(hex) {
    if(typeof hex === 'number') {
@@ -166,6 +167,22 @@
    var ddv = this.toDec(fields[62]) * 256 + this.toDec(fields[63]);
    var mcu = this.toDec(fields[64]) + this.toDec(fields[65]) / 100;
    queue.pushToScreen({
        mac: mac,
        location: {
            lat: 31.430616,
            lng: 120.988327
        },
        data: {
            x1: x1,  //PM2.5
            x2: x9,  //甲醛
            x3: x11, //温度
            x4: x10, //湿度
            x5: x14, //光线强度
            x6: x12  //风速
        }
    });
    var current = moment();
    var rank = 0;