soef / wm-bus

wm-bus
MIT License
15 stars 4 forks source link

Error while reading data #4

Closed B1ON1C closed 6 years ago

B1ON1C commented 6 years ago

Hello! I got this code from you:

` var WMBUS = require('wm-bus').WMBUS;

var wmb = new WMBUS( { log: { debug: function () {}, //console.log, error: console.log } });

wmb.crcRemoved = true; //wmb.addAESKey( '00051713', '0000000000000000'); wmb.decrypted = 1; var data = '2B44A9151100577325077211005773A9152507A70000052F2F0314110000426C3F2C431411000002FD1700005119000000210000F075'; wmb.parseHex(data);

wmb.datablocks.forEach(function (data) { console.log(JSON.stringify(data)); }); `

But returns an error like TypeError: wmb.datablocks.forEach is not a function

B1ON1C commented 6 years ago

Ok, i commented this line:

//this.meter_manufacturer = uc(manId2ascii(this.meter_man));

and all goes OK. What is exactly uc()?

B1ON1C commented 6 years ago

Issue closed, the problem was that UC does not exit on the project... So comment this line... Thanks!

this.meter_manufacturer = uc(manId2ascii(this.meter_man));