-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
64 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// HTTP ヘッダ (HTTP 1.1 〜) | ||
// を送信する | ||
void sendHttpHeader(); | ||
|
||
// HTMLヘッダ (<html>~<head/>まで)を送信する。 | ||
// <body>〜</body></html> は呼び出し元で送信する必要がある | ||
void sendHtmlHeader(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include "global.h" | ||
|
||
#include "network/webserver.h" | ||
#include "embed/style_css.h" | ||
|
||
void sendHttpHeader() { | ||
server.sendContent("HTTP/1.1 200 OK\r\n"); | ||
server.sendContent("Content-Type: text/html\r\n"); | ||
server.sendContent("Connection: close\r\n"); | ||
server.sendContent("\r\n"); | ||
} | ||
|
||
void sendHtmlHeader() { | ||
String html = ""; | ||
html += "<!DOCTYPE html>"; | ||
html += "<html>"; | ||
html += "<head>"; | ||
html += "<meta charset='UTF-8'>"; | ||
html += "<meta name='viewport' content='width=device-width'>"; | ||
html += "<meta name='format-detection' content='telephone=no' />\n"; | ||
html += "<title>" + product + " setting</title>\n"; | ||
|
||
server.sendContent(html); | ||
html = ""; | ||
|
||
server.sendContent("<style>\n"); | ||
server.sendContent(STYLE_CSS); // String(STYLE_CSS) は使えないので注意(空文字列しか生成されない) | ||
server.sendContent("\n</style>"); | ||
|
||
html += "</head>\n"; | ||
|
||
server.sendContent(html); | ||
} |