-
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
24 changed files
with
383 additions
and
138 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
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,3 @@ | ||
#!/bin/bash | ||
|
||
cloc --exclude-dir=.pio,.vscode,_release,.github . --by-file-by-lang |
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,10 @@ | ||
|
||
#ifdef ESP32 | ||
#include <WebServer.h> | ||
typedef WebServer HTTPWEBSERVER; | ||
#endif | ||
|
||
#ifdef ESP8266 | ||
#include <ESP8266WebServer.h> | ||
typedef ESP8266WebServer HTTPWEBSERVER; | ||
#endif |
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,3 @@ | ||
#include "network/http_api.h" | ||
|
||
void http_api_base_setup(); |
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 @@ | ||
#include <Arduino.h> | ||
|
||
String http_normal_not_found_html(); | ||
|
||
String http_normal_data_json(); | ||
|
||
String http_normal_ping_json(); |
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,3 @@ | ||
#include "network/http_api.h" | ||
|
||
void http_api_config_setup(); |
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,3 @@ | ||
#include "network/http_api.h" | ||
|
||
void http_api_display_setup(); |
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,3 @@ | ||
#include "network/http_api.h" | ||
|
||
void http_api_mhz_setup(); |
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,3 @@ | ||
#include <Arduino.h> | ||
|
||
bool parseBooleanString(const String value); |
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 |
---|---|---|
|
@@ -209,6 +209,6 @@ void loop_normal() { | |
http_loop_normal(); | ||
|
||
// mainlog("Wait for Next tick."); | ||
|
||
yield(); | ||
watchdog_feed(); | ||
} |
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,46 @@ | ||
#include <Arduino.h> | ||
|
||
#include "config.h" | ||
|
||
#include "global.h" | ||
#include "display/display.h" | ||
#include "network/http_api.h" | ||
#include "network/http_api_base_json.h" | ||
|
||
extern HTTPWEBSERVER server; | ||
|
||
void http_handle_data() { | ||
String message = http_normal_data_json(); | ||
server.send(200, MIME_JSON, message); | ||
} | ||
|
||
void http_handle_ping() { | ||
String message = http_normal_ping_json(); | ||
server.send(200, MIME_JSON, message); | ||
} | ||
|
||
void http_handle_stastics() { | ||
server.send(200, MIME_JSON, stasticsJSON); | ||
} | ||
|
||
void http_handle_goto_setup() { | ||
|
||
remove_configure_flag_file(); | ||
|
||
String message = "OK. Entering setup mode at next boot."; | ||
server.send( 200, MIME_TEXT, message ); | ||
} | ||
|
||
void http_handle_not_found() { | ||
String message = http_normal_not_found_html(); | ||
server.send(404, MIME_HTML, message); | ||
} | ||
|
||
void http_api_base_setup() { | ||
server.on ( "/ping", HTTP_GET, http_handle_ping); | ||
server.on ( "/", HTTP_GET, http_handle_data ); | ||
server.on ( "/stastics", HTTP_GET, http_handle_stastics ); | ||
server.on ( "/goto_setup", HTTP_POST, http_handle_goto_setup ); | ||
|
||
server.onNotFound ( http_handle_not_found ); | ||
} |
Oops, something went wrong.