extracted default config values

This commit is contained in:
RaffaelW 2024-12-15 18:45:15 +01:00
parent 1e52c401e4
commit c3fab50ccc
3 changed files with 44 additions and 38 deletions

View file

@ -1,11 +1,9 @@
#pragma once
#include <AsyncWebServer_ESP32_W5500.h>
#include <ESPDMX.h>
#include <Preferences.h>
// #ifndef CONFIG_h
// #define CONFIG_h
#ifndef CONFIG_h
#define CONFIG_h
extern Preferences config;
@ -31,10 +29,25 @@ enum Direction
};
const uint8_t DIRECTION_SIZE = 2;
const Connection DEFAULT_CONNECTION = WiFiAP;
const IpMethod DEFAULT_IP_METHOD = DHCP;
extern String DEFAULT_SSID; // initialized in setup because it depends on the mac address
const String DEFAULT_PASSWORD = "mbgmbgmbg";
const IPAddress DEFAULT_IP(192, 168, 4, 1);
const IPAddress DEFAULT_SUBNET(255, 0, 0, 0);
const IPAddress DEFAULT_GATEWAY(2, 0, 0, 1);
const Direction DEFAULT_DIRECTION1 = Output;
const Direction DEFAULT_DIRECTION2 = Input;
const uint8_t DEFAULT_UNIVERSE1 = 1;
const uint8_t DEFAULT_UNIVERSE2 = 2;
const uint8_t DEFAULT_LED_BRIGHTNESS = 25;
void onGetConfig(AsyncWebServerRequest *request);
void onPutConfig(AsyncWebServerRequest *request, uint8_t *data, size_t len, size_t index, size_t total);
void onGetNetworks(AsyncWebServerRequest *request);
// #endif
#endif