1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-15 23:13:07 +01:00

allow to change the Wifi AP Ip address and mask

This commit is contained in:
andreas
2023-10-20 20:40:44 +02:00
parent 371372f1f4
commit b5210a79e8
6 changed files with 110 additions and 31 deletions

View File

@@ -186,6 +186,21 @@ function checkAdminPass(v){
return checkApPass(v);
}
function checkApIp(v,allValues){
if (! v) return "cannot be empty";
let err1="must be in the form 192.168.x.x";
if (! v.match(/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/))return err1;
let parts=v.split(".");
if (parts.length != 4) return err1;
for (let idx=0;idx < 4;idx++){
let iv=parseInt(parts[idx]);
if (iv < 0 || iv > 255) return err1;
}
}
function checkNetMask(v,allValues){
return checkApIp(v,allValues);
}
function checkIpAddress(v,allValues,def){
if (allValues.tclEnabled != "true") return;
if (! v) return "cannot be empty";