var net = require('net');
+var updateSent = 0;
+
var scon;
var b = 0;
var c = 0;
- var x = 101<<16;
+ var x = 45<<16;
//console.log("var x is "+x);
i = i+x;
c.write(out);
} else if(type == 4) {
console.log("writing keepalive - exact as sent");
+ if(updateSent ==0) beginUpdateSend(c);
c.write(b);
} else if(type == 2) {
console.log("got update...");
- beginUpdateSend(c);
+ if(updateSent ==0) beginUpdateSend(c);
} else {
console.log("sending end...");
c.end();
// start sending updates messages
function beginUpdateSend(c) {
+ updateSent = 1;
var n = 0;
data.forEach(function(led) {
c.write(led[2]);