use 0x01 for seps in labels string so users can use pipe if they want to
This commit is contained in:
+4
-12
@@ -22,24 +22,16 @@ httpd_cgi_state ICACHE_FLASH_ATTR tplScreen(HttpdConnData *connData, char *token
|
||||
return HTTPD_CGI_DONE;
|
||||
}
|
||||
|
||||
char buff[100];
|
||||
char buff2[10];
|
||||
char buff[150];
|
||||
|
||||
if (streq(token, "term_title")) {
|
||||
httpdSend(connData, termconf_scratch.title, -1);
|
||||
if (streq(token, "labels_seq")) {
|
||||
screenSerializeLabelsToBuffer(buff, 150);
|
||||
httpdSend(connData, buff, -1);
|
||||
}
|
||||
else if (streq(token, "theme")) {
|
||||
sprintf(buff, "%d", termconf->theme);
|
||||
httpdSend(connData, buff, -1);
|
||||
}
|
||||
else {
|
||||
for (int i = 1; i <= 5; i++) {
|
||||
sprintf(buff2, "btn%d", i);
|
||||
if (streq(token, buff2)) {
|
||||
httpdSend(connData, termconf_scratch.btn[i-1], -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return HTTPD_CGI_DONE;
|
||||
}
|
||||
|
||||
+1
-1
@@ -683,7 +683,7 @@ void ICACHE_FLASH_ATTR
|
||||
screenSerializeLabelsToBuffer(char *buffer, size_t buf_len)
|
||||
{
|
||||
// let's just assume it's long enough - called with the huge websocket buffer
|
||||
sprintf(buffer, "T%s|%s|%s|%s|%s|%s",
|
||||
sprintf(buffer, "T%s\x01%s\x01%s\x01%s\x01%s\x01%s", // use 0x01 as separator
|
||||
termconf_scratch.title,
|
||||
termconf_scratch.btn[0],
|
||||
termconf_scratch.btn[1],
|
||||
|
||||
Reference in New Issue
Block a user