Some small adjustments for ESP32

- bump version
- remove compilation warnings
- do not require SPIFFS
This commit is contained in:
me-no-dev 2017-09-09 09:04:47 +03:00
parent e4950444c4
commit 3e6690396a
5 changed files with 12 additions and 5 deletions

View File

@ -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":

View File

@ -307,6 +307,7 @@ AsyncWebSocketBasicMessage::AsyncWebSocketBasicMessage(uint8_t opcode, bool mask
,_sent(0)
,_ack(0)
,_acked(0)
,_data(NULL)
{
_opcode = opcode & 0x07;
_mask = mask;

View File

@ -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);

View File

@ -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)

View File

@ -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;