|
@ -30,7 +30,7 @@ io.on('connection', function (socket) { |
|
|
socket.on('newconnection', function (data,callback){ |
|
|
socket.on('newconnection', function (data,callback){ |
|
|
numconnections++; |
|
|
numconnections++; |
|
|
console.log("numconnections: " + numconnections); |
|
|
console.log("numconnections: " + numconnections); |
|
|
io.sockets.emit('numconnections',{numconnections}); //aqí envia la data
|
|
|
|
|
|
|
|
|
//io.sockets.emit('numconnections',{numconnections}); //aqí envia la data
|
|
|
}); |
|
|
}); |
|
|
socket.on('pinON', function (data,callback){ |
|
|
socket.on('pinON', function (data,callback){ |
|
|
console.log(data + "--> ON"); |
|
|
console.log(data + "--> ON"); |
|
@ -45,7 +45,7 @@ io.on('connection', function (socket) { |
|
|
gpio.close(data); // Close pin
|
|
|
gpio.close(data); // Close pin
|
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
io.sockets.emit('listPinsON',{listPinsON}); |
|
|
|
|
|
|
|
|
io.sockets.emit('listPinsON',listPinsON); |
|
|
}else{ |
|
|
}else{ |
|
|
//pin already encès
|
|
|
//pin already encès
|
|
|
io.sockets.emit("alreadyON", data); |
|
|
io.sockets.emit("alreadyON", data); |
|
@ -68,7 +68,7 @@ io.on('connection', function (socket) { |
|
|
gpio.close(data); // Close pin
|
|
|
gpio.close(data); // Close pin
|
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
io.sockets.emit('listPinsON',{listPinsON}); //aqí envia la data
|
|
|
|
|
|
|
|
|
io.sockets.emit('listPinsON',listPinsON); //aqí envia la data
|
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|