Massive changes. Added a quite nice webinterface with live data using WebSockets. Removed the FTP server (wasn't that useful anyways). JSON creating using ArduinoJson instead of String concatenation. Ans, and, and.

This commit is contained in:
2019-11-16 23:03:13 +01:00
parent 0cddfaf0d9
commit 7c3eb2f605
22 changed files with 625 additions and 2809 deletions

View File

@ -1,29 +1,28 @@
/*
#pragma once
#include <ESP8266WebServer.h>
class HTTPServer;
#include "player.h"
#include "controller.h"
#include <SD.h>
#include <WiFiClient.h>
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <AsyncTCP.h>
#include <ESPAsyncWebServer.h>
class HTTPServer {
private:
ESP8266WebServer* _http_server;
void _handle_upload();
AsyncWebServer* _server;
Player* _player;
Controller* _controller;
void _handle_upload(AsyncWebServerRequest* request, String filename, size_t index, uint8_t* data, size_t len, bool final);
uint16_t _chunk_length;
uint8_t* _chunk;
uint32_t _file_size;
uint32_t _file_size_done;
bool _need_header;
uint32_t _upload_position;
void _handle_index();
void _handle_status();
Player* _player;
Controller* _controller;
void _onEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventType type, void * arg, uint8_t *data, size_t len);
void _handle_index(AsyncWebServerRequest* req);
public:
HTTPServer(Player* p, Controller* c);
void loop();
AsyncWebSocket* ws;
};
*/