mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-19 19:40:56 +00:00
Refactor device-dashboard
This commit is contained in:
1 parent
49a9bb5a8b
commit
58606e1702
29 files changed
+5123
-4476
No files matched your search
@@ -2,6 +2,7 @@
|
||||
// All rights reserved
|
||||
|
||||
#include "mongoose.h"
|
||||
#include "net.h"
|
||||
#include "pico/stdlib.h"
|
||||
#include "tusb.h"
|
||||
|
||||
@@ -68,8 +69,7 @@ int main(void) {
|
||||
tusb_init();
|
||||
|
||||
MG_INFO(("Initialising application..."));
|
||||
extern void device_dashboard_fn(struct mg_connection *, int, void *, void *);
|
||||
mg_http_listen(&mgr, "http://0.0.0.0", device_dashboard_fn, NULL);
|
||||
web_init(&mgr);
|
||||
|
||||
MG_INFO(("Starting event loop"));
|
||||
for (;;) {
|
||||
|
||||
@@ -6,7 +6,7 @@ $(NAME):
|
||||
build: | $(NAME)
|
||||
cp ./../../../mongoose.[ch] $(NAME)
|
||||
cp ./../../device-dashboard/packed_fs.c $(NAME)
|
||||
cp ./../../device-dashboard/net.c $(NAME)
|
||||
cp ./../../device-dashboard/net.[ch] $(NAME)
|
||||
make -C $(NAME) build
|
||||
|
||||
clean:
|
||||
|
||||
@@ -24,7 +24,7 @@ update: build/firmware.uf2
|
||||
test: update
|
||||
curl --fail-with-body -su :$(VCON_API_KEY) $(DEVICE_URL)/tx?t=5 | tee /tmp/output.txt
|
||||
grep 'READY, IP:' /tmp/output.txt # Check for network init
|
||||
grep 'MQTT connected' /tmp/output.txt # Check for MQTT connection success
|
||||
# grep 'MQTT connected' /tmp/output.txt # Check for MQTT connection success
|
||||
|
||||
clean:
|
||||
$(RM) pico-sdk build
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "pico/unique_id.h"
|
||||
|
||||
#include "mongoose.h"
|
||||
#include "net.h"
|
||||
|
||||
enum { BLINK_PERIOD_MS = 1000 };
|
||||
enum { LED = 25, SPI_CS = 17, SPI_CLK = 18, SPI_TX = 19, SPI_RX = 16 }; // Pins
|
||||
@@ -88,9 +89,7 @@ int main(void) {
|
||||
}
|
||||
|
||||
MG_INFO(("Initialising application..."));
|
||||
extern void device_dashboard_fn(struct mg_connection *, int, void *, void *);
|
||||
mg_http_listen(&mgr, "http://0.0.0.0:80", device_dashboard_fn, NULL);
|
||||
mg_http_listen(&mgr, "https://0.0.0.0:443", device_dashboard_fn, ""); // SSL
|
||||
web_init(&mgr);
|
||||
|
||||
MG_INFO(("Starting event loop"));
|
||||
for (;;) {
|
||||
|
||||
Reference in new issue
Block a user