Some small adjustments for ESP32
- bump version - remove compilation warnings - do not require SPIFFS
This commit is contained in:
parent
e4950444c4
commit
3e6690396a
|
@ -12,6 +12,8 @@
|
|||
"type": "git",
|
||||
"url": "https://github.com/me-no-dev/ESPAsyncWebServer.git"
|
||||
},
|
||||
"version": "1.1.0",
|
||||
"license": "LGPL-3.0",
|
||||
"frameworks": "arduino",
|
||||
"platforms":"espressif",
|
||||
"dependencies":
|
||||
|
|
|
@ -307,6 +307,7 @@ AsyncWebSocketBasicMessage::AsyncWebSocketBasicMessage(uint8_t opcode, bool mask
|
|||
,_sent(0)
|
||||
,_ack(0)
|
||||
,_acked(0)
|
||||
,_data(NULL)
|
||||
{
|
||||
_opcode = opcode & 0x07;
|
||||
_mask = mask;
|
||||
|
|
|
@ -94,11 +94,11 @@ class AsyncWebSocketMessage {
|
|||
|
||||
class AsyncWebSocketBasicMessage: public AsyncWebSocketMessage {
|
||||
private:
|
||||
uint8_t * _data;
|
||||
size_t _len;
|
||||
size_t _sent;
|
||||
size_t _ack;
|
||||
size_t _acked;
|
||||
uint8_t * _data;
|
||||
public:
|
||||
AsyncWebSocketBasicMessage(const char * data, size_t len, uint8_t opcode=WS_TEXT, bool mask=false);
|
||||
AsyncWebSocketBasicMessage(uint8_t opcode=WS_TEXT, bool mask=false);
|
||||
|
|
|
@ -334,7 +334,11 @@ static bool isExcluded(fs::FS _fs, const char *filename) {
|
|||
|
||||
// WEB HANDLER IMPLEMENTATION
|
||||
|
||||
#ifdef ESP32
|
||||
SPIFFSEditor::SPIFFSEditor(const fs::FS& fs, const String& username, const String& password)
|
||||
#else
|
||||
SPIFFSEditor::SPIFFSEditor(const String& username, const String& password, const fs::FS& fs)
|
||||
#endif
|
||||
:_fs(fs)
|
||||
,_username(username)
|
||||
,_password(password)
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
#define SPIFFSEditor_H_
|
||||
#include <ESPAsyncWebServer.h>
|
||||
|
||||
#ifdef ESP32
|
||||
#include "SPIFFS.h"
|
||||
#endif
|
||||
|
||||
#define EXCLUDELIST "/.exclude.files"
|
||||
|
||||
class SPIFFSEditor: public AsyncWebHandler {
|
||||
|
@ -16,7 +12,11 @@ class SPIFFSEditor: public AsyncWebHandler {
|
|||
bool _authenticated;
|
||||
uint32_t _startTime;
|
||||
public:
|
||||
#ifdef ESP32
|
||||
SPIFFSEditor(const fs::FS& fs, const String& username=String(), const String& password=String());
|
||||
#else
|
||||
SPIFFSEditor(const String& username=String(), const String& password=String(), const fs::FS& fs=SPIFFS);
|
||||
#endif
|
||||
virtual bool canHandle(AsyncWebServerRequest *request) override final;
|
||||
virtual void handleRequest(AsyncWebServerRequest *request) override final;
|
||||
virtual void handleUpload(AsyncWebServerRequest *request, const String& filename, size_t index, uint8_t *data, size_t len, bool final) override final;
|
||||
|
|
Loading…
Reference in New Issue