From f7848f7f0430a893c943f992363b12f6c4cde77e Mon Sep 17 00:00:00 2001 From: Bluepr1nt Date: Wed, 29 Mar 2017 11:57:00 +0200 Subject: [PATCH] testing --- mean-app/server/routes/thingapi.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/mean-app/server/routes/thingapi.js b/mean-app/server/routes/thingapi.js index 99b45b1..7a50a58 100644 --- a/mean-app/server/routes/thingapi.js +++ b/mean-app/server/routes/thingapi.js @@ -25,8 +25,9 @@ var parseTelegram = function(data, callback){ found = str.match(regx); console.log("\n\nPARSING\n"); + console.log(str); console.log(found); - + if(found.length > 0) toe1 = found[0]; @@ -34,7 +35,7 @@ var parseTelegram = function(data, callback){ //TOE2 regx = /1-0:1\.8\.2\((\d{6}\.\d{3})\*kWh\)/g; found = str.match(regx); - + if(found.length > 0) toe2 = found[0]; @@ -42,7 +43,7 @@ var parseTelegram = function(data, callback){ //TTE1 regx = /1-0:2\.8\.1\((\d{6}\.\d{3})\*kWh\)/g; found = str.match(regx); - + if(found.length > 0) tte1 = found[0]; @@ -50,7 +51,7 @@ var parseTelegram = function(data, callback){ //TTE2 regx = /1-0:2\.8\.2\((\d{6}\.\d{3})\*kWh\)/g; found = str.match(regx); - + if(found.length > 0) tte2 = found[0]; @@ -58,7 +59,7 @@ var parseTelegram = function(data, callback){ //HT regx = /0-0:96\.14\.0\((\d{4})\)/g; found = str.match(regx); - + if(found.length > 0) ht = found[0]; @@ -66,7 +67,7 @@ var parseTelegram = function(data, callback){ //HOV regx = /1-0:1\.7\.0\((\d{2}\.\d{3})\*kW\)/g; found = str.match(regx); - + if(found.length > 0) hov = found[0]; @@ -74,7 +75,7 @@ var parseTelegram = function(data, callback){ //HTV regx = /1-0:2\.7\.0\((\d{2}\.\d{3})\*kW\)/g; found = str.match(regx); - + if(found.length > 0) htv = found[0]; @@ -106,7 +107,7 @@ router.post('/telegram', function(req, res){ res.status(200); res.send("{\"success\":\"true\"}"); }) - + }); /* GET api listing. */