fix some basic type issues:
use size_t for size as async web server uses this type internally use uint8_t for provision mode, we only have 3 values address warnings about ordering initializers
This commit is contained in:
parent
b197ee8a80
commit
167cfa283b
@ -37,7 +37,7 @@ class APSettingsService : public SettingsService {
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
// access point settings
|
// access point settings
|
||||||
int _provisionMode;
|
uint8_t _provisionMode;
|
||||||
String _ssid;
|
String _ssid;
|
||||||
String _password;
|
String _password;
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ class AsyncJsonCallbackResponse: public AsyncJsonResponse {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
AsyncJsonCallbackResponse(AsyncJsonCallback callback, bool isArray=false) : _callback{callback}, AsyncJsonResponse(isArray) {}
|
AsyncJsonCallbackResponse(AsyncJsonCallback callback, bool isArray=false) : AsyncJsonResponse(isArray), _callback{callback} {}
|
||||||
~AsyncJsonCallbackResponse() {
|
~AsyncJsonCallbackResponse() {
|
||||||
_callback();
|
_callback();
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ class AsyncJsonRequestWebHandler: public AsyncWebHandler {
|
|||||||
String _uri;
|
String _uri;
|
||||||
WebRequestMethodComposite _method;
|
WebRequestMethodComposite _method;
|
||||||
JsonRequestCallback _onRequest;
|
JsonRequestCallback _onRequest;
|
||||||
int _maxContentLength;
|
size_t _maxContentLength;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ class AsyncJsonRequestWebHandler: public AsyncWebHandler {
|
|||||||
|
|
||||||
void setUri(const String& uri) { _uri = uri; }
|
void setUri(const String& uri) { _uri = uri; }
|
||||||
void setMethod(WebRequestMethodComposite method) { _method = method; }
|
void setMethod(WebRequestMethodComposite method) { _method = method; }
|
||||||
void setMaxContentLength(int maxContentLength) { _maxContentLength = maxContentLength; }
|
void setMaxContentLength(size_t maxContentLength) { _maxContentLength = maxContentLength; }
|
||||||
void onRequest(JsonRequestCallback fn) { _onRequest = fn; }
|
void onRequest(JsonRequestCallback fn) { _onRequest = fn; }
|
||||||
|
|
||||||
virtual bool canHandle(AsyncWebServerRequest *request) override final {
|
virtual bool canHandle(AsyncWebServerRequest *request) override final {
|
||||||
|
@ -122,7 +122,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
SettingsService(AsyncWebServer* server, FS* fs, char const* servicePath, char const* filePath):
|
SettingsService(AsyncWebServer* server, FS* fs, char const* servicePath, char const* filePath):
|
||||||
_server(server), _fs(fs), _filePath(filePath) {
|
_filePath(filePath), _server(server), _fs(fs){
|
||||||
|
|
||||||
// configure fetch config handler
|
// configure fetch config handler
|
||||||
_server->on(servicePath, HTTP_GET, std::bind(&SettingsService::fetchConfig, this, std::placeholders::_1));
|
_server->on(servicePath, HTTP_GET, std::bind(&SettingsService::fetchConfig, this, std::placeholders::_1));
|
||||||
|
Loading…
Reference in New Issue
Block a user