Skip to content

Commit f2a7162

Browse files
committed
webmenu data/1.5 with websocket re-connect
1 parent bc65f1a commit f2a7162

File tree

8 files changed

+17
-17
lines changed

8 files changed

+17
-17
lines changed

examples/esp8266/WebMenu/WebMenu/WebMenu.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ menuOut& operator<<(menuOut& o,endlObj) {
6868
}
6969

7070
//this version numbers MUST be the same as data/1.2
71-
#define CUR_VERSION "1.4"
71+
#define CUR_VERSION "1.5"
7272
#define APName "WebMenu"
7373

7474
int ledCtrl=LOW;

examples/esp8266/WebMenu/WebMenu/data/1.4/bootstrap.xslt renamed to examples/esp8266/WebMenu/WebMenu/data/1.5/bootstrap.xslt

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

examples/esp8266/WebMenu/WebMenu/data/1.4/r-site.js renamed to examples/esp8266/WebMenu/WebMenu/data/1.5/r-site.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -103,21 +103,21 @@ function mkPath(m) {
103103
}
104104

105105
function menu(o,cnt) {
106-
// if(connection.readyState!=1) {//not connected (yet)?
107-
// console.log("not connected yet...")
108-
// if (connection.readyState==3) {//disconnected?
109-
// console.log("connecting websocket");
110-
// connectWS();
111-
// }
112-
// setTimeout(function() {//check latter...
113-
// console.log("checking websocket connetion");
114-
// if (connection.readyState!=1&&cnt>5) {//give up?
115-
// alert("websocket disconnected, please refresh page");//TODO: put mutilang here
116-
// return;
117-
// } else menu(o,cnt?cnt+1:0);
118-
// },500);
119-
// return;
120-
// }
106+
if(connection.readyState!=1) {//not connected (yet)?
107+
console.log("not connected yet...")
108+
if (connection.readyState==3) {//disconnected?
109+
console.log("connecting websocket");
110+
connectWS();
111+
}
112+
setTimeout(function() {//check latter...
113+
console.log("checking websocket connetion");
114+
if (connection.readyState!=1&&cnt>5) {//give up?
115+
alert("websocket disconnected, please refresh page");//TODO: put mutilang here
116+
return;
117+
} else menu(o,cnt?cnt+1:0);
118+
},500);
119+
return;
120+
}
121121
console.log("send ws",o);
122122
return connection.send(o);
123123
}

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ArduinoMenu library
2-
version=4.17.6
2+
version=4.17.7
33
author=Rui Azevedo, [email protected]
44
maintainer=neu-rah, [email protected]
55
sentence=Generic menu/interactivity system

0 commit comments

Comments
 (0)