mirror of
https://github.com/lumapu/ahoy.git
synced 2025-06-12 15:41:38 +02:00
implemented #318 static IP support
This commit is contained in:
parent
ea991a7723
commit
ca8142e781
7 changed files with 96 additions and 2 deletions
|
@ -330,6 +330,28 @@ void web::showSave(AsyncWebServerRequest *request) {
|
|||
mProtected = (strlen(mConfig->password) > 0);
|
||||
}
|
||||
|
||||
|
||||
// static ip
|
||||
if(request->arg("ipAddr") != "") {
|
||||
request->arg("ipAddr").toCharArray(buf, SSID_LEN);
|
||||
ip2Arr(mConfig->staticIp.ip, buf);
|
||||
if(request->arg("ipMask") != "") {
|
||||
request->arg("ipMask").toCharArray(buf, SSID_LEN);
|
||||
ip2Arr(mConfig->staticIp.mask, buf);
|
||||
}
|
||||
if(request->arg("ipDns") != "") {
|
||||
request->arg("ipDns").toCharArray(buf, SSID_LEN);
|
||||
ip2Arr(mConfig->staticIp.dns, buf);
|
||||
}
|
||||
if(request->arg("ipGateway") != "") {
|
||||
request->arg("ipGateway").toCharArray(buf, SSID_LEN);
|
||||
ip2Arr(mConfig->staticIp.gateway, buf);
|
||||
}
|
||||
}
|
||||
else
|
||||
memset(&mConfig->staticIp, 0, sizeof(staticIp_t));
|
||||
|
||||
|
||||
// inverter
|
||||
Inverter<> *iv;
|
||||
for(uint8_t i = 0; i < MAX_NUM_INVERTERS; i ++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue