problemas de sincronismo

parent e9afb690
Showing with 3 additions and 4 deletions
......@@ -80,10 +80,6 @@ function abrirPuerta(socket){
}
}, 100);
setTimeout(function(){
cerrarPuerta(socket);
}, 15000);
}
// Cerrar puerta
......@@ -148,6 +144,9 @@ io.sockets.on('connection', function (socket) { // WebSocket Connection
if (estadoPuerta == 0 && ordenRecibida == 0) console.log("La puerta ya se encuentra cerrada");
if (estadoPuerta == 0 && ordenRecibida == 1) {
abrirPuerta(socket);
setTimeout(function(){
cerrarPuerta(socket);
}, 15000);
console.log("Abriendo puerta");
}
if (estadoPuerta == 1 && ordenRecibida == 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment