- Created a new HTML file for device setup with a form for API URL and registration code. - Implemented JavaScript for handling registration and displaying status messages. - Updated upgrade and WiFi pages to include navigation to the new setup page. - Refactored display functions to improve readability and consistency. - Replaced occurrences of `oledShowMessage` with `oledDisplayText` for uniformity. - Updated WebSocket handling in the upgrade and WiFi pages for better connection management. - Adjusted delays in various functions to use `pdMS_TO_TICKS` for better timing accuracy. - Removed unused routes and cleaned up the website code for improved maintainability.
31 lines
786 B
C
31 lines
786 B
C
#ifndef WEBSITE_H
|
|
#define WEBSITE_H
|
|
|
|
#include <Arduino.h>
|
|
#include <ESPAsyncWebServer.h>
|
|
#include "commonFS.h"
|
|
#include "api.h"
|
|
#include <ArduinoJson.h>
|
|
#include <Update.h>
|
|
#include <AsyncTCP.h>
|
|
#include "nfc.h"
|
|
#include "scale.h"
|
|
#include "esp_task_wdt.h"
|
|
|
|
extern String spoolmanUrl;
|
|
extern AsyncWebServer server;
|
|
extern AsyncWebSocket ws;
|
|
|
|
// Server-Initialisierung und Handler
|
|
void initWebServer();
|
|
void handleBody(AsyncWebServerRequest *request, uint8_t *data, size_t len, size_t index, size_t total);
|
|
void setupWebserver(AsyncWebServer &server);
|
|
|
|
// WebSocket-Funktionen
|
|
void sendAmsData(AsyncWebSocketClient *client);
|
|
void sendNfcData();
|
|
void foundNfcTag(AsyncWebSocketClient *client, uint8_t success);
|
|
void sendWriteResult(AsyncWebSocketClient *client, uint8_t success);
|
|
|
|
#endif
|