
struct confDataSecrets
{
  char WiFiPW1[64];
  char WiFiPW2[64];
  char WiFiAPModePassword[64];
  char http_token[31];
  char http_user[31];
  char http_pass[31];
  char http_user1[31];
  char http_pass1[31];
  char http_user2[31];
  char http_pass2[31];
  char mqtt_user[31];
  char mqtt_pass[31];
  // --- 471 bytes
  char spare[23];
  // --- 494 bytes + 2 bytes size information 
  // in EEPROM before the actual data => 512 bytes
} confSecrets;
bool confSecrets_wasChanged = false;
// if this struct is changed, encrypt/decrypt functions also have to be modified!

// confDevWiFi
struct confDataDevWiFi
{
  char deviceName[33]; // device name - for web interface and AP-Mode SSID
  char hostName[33];   // announced hostname on WiFi connection
  char WiFiSSID1[33];
  //char WiFiPW1[64];
  char WiFiSSID2[33];
  //char WiFiPW2[64];
  char WiFiAPModeSSID[33]; // generated, not set via config
  //char WiFiAPModePassword[64];
  uint16_t WiFiAPModeTimeout;
  uint16_t WiFiRetryInterval;
  uint16_t WiFiConnCheckInterval;
  uint16_t WiFiRebootOnNoConnect;
  bool enableArduinoOTA = false;
} confDevWiFi;
bool confDevWiFi_wasChanged = false;

// confWeb
struct confDataWeb
{
  //char http_token[31];
  //char http_user[31];
  //char http_pass[31];
  bool http_user_auth;
  //char http_user1[31];
  //char http_pass1[31];
  //char http_user2[31];
  //char http_pass2[31];
  bool wConsole;
  bool wsConsole;
  bool enableOTA = false;
  bool FSbrowser = false;
} confWeb;
bool confWeb_wasChanged = false;

// confMqtt
struct confDataMqtt
{
  bool mqtt_enable;
  char mqtt_server[41];
  uint16_t mqtt_port;
  //char mqtt_user[31];
  //char mqtt_pass[31];
  char mqtt_topic_in[51];  // MQTT in topic for commands
  char mqtt_topic_out[51]; // MQTT out base topic, will be extended by various value names
  char mqtt_willTopic[51]; // MQTT Last Will topic
  uint8_t mqtt_willQos;    // MQTT Last Will topic QOS
  bool mqtt_willRetain;    // MQTT Last Will retain
  char mqtt_willMsg[31];   // MQTT Last Will payload
  char mqtt_connMsg[31];
  bool mqtt_outRetain;         // send MQTT out with retain flag
  bool mqtt_outRetain_sensors; // send MQTT out with retain flag
  uint8_t mqtt_outPubInterval;
  uint8_t mqtt_outPubInterval_sensors;
  bool mqtt_enable_heartbeat;
  unsigned int mqtt_heartbeat_maxage_reconnect;
  unsigned int mqtt_heartbeat_maxage_reboot;
  bool mqtt_reconnect_silent = false;
} confMqtt;
bool confMqtt_wasChanged = false;



// confAdd
struct confDataAdd
{
  char mqtt_topic_pir[51];
  char mqtt_payload_pir_on[10];
  char mqtt_payload_pir_off[10];
  char outTemp_topic_in[51];
  char outHum_topic_in[51];
} confAdd;
bool confAdd_wasChanged;


#ifdef ENABLE_FEATURE_NTP_TIME
// confTime
struct confDataTime
{
  bool ntpEnable;
  char timeZoneStr[50];
  char ntpServer1[31];
  char ntpServer2[31];
  unsigned long ntpSyncInterval;
} confTime;
bool confTime_wasChanged;
#endif

// confLog
struct confDataLog
{
  uint8_t logLevelSerial;
  uint8_t logLevelWeb;
  uint8_t logLevelMqtt;
  uint8_t logLevelSyslog;
  bool logWebRequests;
} confLog;
bool confLog_wasChanged;



// confDisplay
struct confDataDisplay
{
  uint16_t displayInterval; // interval for display updates (if out-temp is
                            // active, display will toggle in this interval)
  uint16_t displayTimeout;  // display timeout after keypress (illumination)
  bool PIRenablesDisplay = false;
} confDisplay;
bool confDisplay_wasChanged;


// confSens
struct confDataSens
{
  uint16_t measureInterval; // interval for temp/hum measurement

  uint8_t oneWireDevAddress[4][8]; // reserve space for up to 4 onewire addresses

  float DHT_tempCorrVal;          // correction value for
                              // temperature sensor reading
  int DHT_humCorrVal;             // correction value for humidity sensor reading
  
} confSens;
bool confSens_wasChanged = false;
