1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-09-01 18:32:37 +02:00

Fixed reverse parsing of IP addresses from Yaml.

This commit is contained in:
Stefan de Bruijn
2021-06-02 22:12:15 +02:00
parent ca858d489b
commit 8738b4ea71
2 changed files with 4 additions and 7 deletions

View File

@@ -73,8 +73,3 @@ comms:
wifi_ap:
ssid: ScratchThat
ip_address: "192.168.0.1"
gateway: "192.168.0.1"
netmask: "255.255.255.0"
wifi_sta:
ssid: StefanMieke

View File

@@ -240,6 +240,7 @@ public:
if (ip.begin() != nullptr) {
uint32_t value = 0;
uint32_t tmp = 0;
int shift = 0;
int c = 0;
for (auto ch : ip) {
if (ch >= '0' && ch <= '9') {
@@ -252,7 +253,8 @@ public:
if (tmp > 255) {
return false;
}
value = (value << 8) + tmp;
value = value | (tmp << shift);
shift += 8;
tmp = 0;
} else if (ch != ' ') {
// For convenience / layouting.
@@ -262,7 +264,7 @@ public:
if (tmp > 255) {
return false;
}
value = (value << 8) + tmp;
value = value | (tmp << shift);
// Correct.
dst = value;