requested changes

This commit is contained in:
Christoph Kottke 2021-07-23 10:37:58 +02:00
parent c06efb910a
commit 3485426843
4 changed files with 8 additions and 6 deletions

View file

@ -100,8 +100,9 @@ bool EthTask::setup(System &system) {
delay(200);
digitalWrite(ETH_NRST, 1);
if (system.getUserConfig()->network.DHCP == false)
if (!system.getUserConfig()->network.DHCP) {
ETH.config(system.getUserConfig()->network.staticIP, system.getUserConfig()->network.gateway, system.getUserConfig()->network.subnet, system.getUserConfig()->network.dns1, system.getUserConfig()->network.dns2);
}
ETH.begin(ETH_ADDR, ETH_POWER_PIN, ETH_MDC_PIN, ETH_MDIO_PIN, ETH_TYPE, ETH_CLK);
return true;

View file

@ -22,8 +22,9 @@ bool WifiTask::setup(System &system) {
WiFi.onEvent(WiFiEvent);
WiFi.setHostname(system.getUserConfig()->callsign.c_str());
if (system.getUserConfig()->network.DHCP == false)
if (!system.getUserConfig()->network.DHCP) {
WiFi.config(system.getUserConfig()->network.staticIP, system.getUserConfig()->network.gateway, system.getUserConfig()->network.subnet, system.getUserConfig()->network.dns1, system.getUserConfig()->network.dns2);
}
for (Configuration::Wifi::AP ap : system.getUserConfig()->wifi.APs) {
logPrintD("Looking for AP: ");

View file

@ -73,7 +73,7 @@ void ProjectConfigurationManagement::readProjectConfiguration(DynamicJsonDocumen
void ProjectConfigurationManagement::writeProjectConfiguration(Configuration &conf, DynamicJsonDocument &data) {
data["callsign"] = conf.callsign;
if (conf.network.DHCP == false) {
if (!conf.network.DHCP) {
data["network"]["DHCP"] = conf.network.DHCP;
data["network"]["staticIP"] = conf.network.staticIP.toString();
data["network"]["subnet"] = conf.network.subnet.toString();

View file

@ -6,9 +6,9 @@
class Configuration {
public:
class NETWORK {
class Network {
public:
NETWORK() : DHCP(true) {
Network() : DHCP(true) {
}
bool DHCP;
@ -106,7 +106,7 @@ public:
Configuration() : callsign("NOCALL-10"), board(""), ntpServer("pool.ntp.org"){};
String callsign;
NETWORK network;
Network network;
Wifi wifi;
Beacon beacon;
APRS_IS aprs_is;