1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-13 05:53:06 +01:00

allow to set the AP password if we can do hardware reset

This commit is contained in:
andreas
2021-11-06 18:55:05 +01:00
parent 5ec4dbcecf
commit 436dd3632b
5 changed files with 60 additions and 8 deletions

View File

@@ -62,7 +62,12 @@ typedef std::map<String,String> StringMap;
GwLog logger(GwLog::DEBUG,NULL);
GwConfigHandler config(&logger);
GwWifi gwWifi(&config,&logger);
#ifdef GWBUTTON_PIN
bool fixedApPass=false;
#else
bool fixedApPass=true;
#endif
GwWifi gwWifi(&config,&logger,fixedApPass);
GwSocketServer socketServer(&config,&logger,MIN_TCP_CHANNEL_ID);
GwBoatData boatData(&logger);
@@ -223,13 +228,16 @@ class CapabilitiesRequest : public GwRequestMessage{
CapabilitiesRequest() : GwRequestMessage(F("application/json"),F("capabilities")){};
protected:
virtual void processRequest(){
DynamicJsonDocument json(JSON_OBJECT_SIZE(2));
DynamicJsonDocument json(JSON_OBJECT_SIZE(6));
#ifdef GWSERIAL_MODE
String serial(F(GWSERIAL_MODE));
#else
String serial(F("NONE"));
#endif
json["serialmode"]=serial;
#ifdef GWBUTTON_PIN
json["hardwareReset"]="true";
#endif
serializeJson(json,result);
}
};