From 9fe17a8505eba1541b3a2b477690960bb7e59e58 Mon Sep 17 00:00:00 2001 From: cinoan Date: Sun, 12 Nov 2017 09:39:49 +0000 Subject: [PATCH 1/2] Reduce timeout on WS calls that don't get a reply --- html/script.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/html/script.js b/html/script.js index 2429b19a4..6671bdcba 100644 --- a/html/script.js +++ b/html/script.js @@ -348,10 +348,16 @@ function wsProcessQueue() { } else { //set wsBusy flag that we are waiting for a response wsBusy=true; - //set timeout to clear flag and try next message if response isn't recieved - wsTimerId=setTimeout(wsReadyToSend,2000); - //get next message from queue and send it. + //get next message from queue. message=wsQueue.shift(); + //set timeout to clear flag and try next message if response isn't recieved. Short timeout for message types that don't generate a response. + if(['T0','T1','T2','T3','X6'].indexOf(message.substr(0,2))) { + timeout=40; + } else { + timeout=2000; + } + wsTimerId=setTimeout(wsReadyToSend,timeout); + //send it. console.log('WS sending ' + message); ws.send(message); } From 295d2f898ac17130f6d72d1576e3451b9fb8c1ea Mon Sep 17 00:00:00 2001 From: cinoan Date: Sun, 12 Nov 2017 09:40:06 +0000 Subject: [PATCH 2/2] update documentaion of ws calls. --- wshandler.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wshandler.h b/wshandler.h index 6db4d5c4c..fcf1ce3bb 100644 --- a/wshandler.h +++ b/wshandler.h @@ -45,6 +45,9 @@ extern bool reboot; // Reboot flag T0 - Disable Testing T1 - Static Testing + T2 - Chase Test + T3 - Rainbow Test + T4 - View Stream S1 - Set Network Config S2 - Set Device Config @@ -52,6 +55,7 @@ extern bool reboot; // Reboot flag X1 - Get RSSI X2 - Get E131 Status Xh - Get Heap + XU - Get Uptime X6 - Reboot */