Browse Source

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
master
Rick Watson 6 years ago
parent
commit
167cfa283b
  1. 2
      src/APSettingsService.h
  2. 2
      src/AsyncJsonCallbackResponse.h
  3. 4
      src/AsyncJsonRequestWebHandler.h
  4. 2
      src/SettingsService.h

2
src/APSettingsService.h

@ -37,7 +37,7 @@ class APSettingsService : public SettingsService {
private:
// access point settings
int _provisionMode;
uint8_t _provisionMode;
String _ssid;
String _password;

2
src/AsyncJsonCallbackResponse.h

@ -21,7 +21,7 @@ class AsyncJsonCallbackResponse: public AsyncJsonResponse {
public:
AsyncJsonCallbackResponse(AsyncJsonCallback callback, bool isArray=false) : _callback{callback}, AsyncJsonResponse(isArray) {}
AsyncJsonCallbackResponse(AsyncJsonCallback callback, bool isArray=false) : AsyncJsonResponse(isArray), _callback{callback} {}
~AsyncJsonCallbackResponse() {
_callback();
}

4
src/AsyncJsonRequestWebHandler.h

@ -22,7 +22,7 @@ class AsyncJsonRequestWebHandler: public AsyncWebHandler {
String _uri;
WebRequestMethodComposite _method;
JsonRequestCallback _onRequest;
int _maxContentLength;
size_t _maxContentLength;
public:
@ -36,7 +36,7 @@ class AsyncJsonRequestWebHandler: public AsyncWebHandler {
void setUri(const String& uri) { _uri = uri; }
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; }
virtual bool canHandle(AsyncWebServerRequest *request) override final {

2
src/SettingsService.h

@ -122,7 +122,7 @@ private:
public:
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
_server->on(servicePath, HTTP_GET, std::bind(&SettingsService::fetchConfig, this, std::placeholders::_1));

Loading…
Cancel
Save