mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-09-02 19:02:35 +02:00
Fixed reverse parsing of IP addresses from Yaml.
This commit is contained in:
@@ -73,8 +73,3 @@ comms:
|
|||||||
wifi_ap:
|
wifi_ap:
|
||||||
ssid: ScratchThat
|
ssid: ScratchThat
|
||||||
ip_address: "192.168.0.1"
|
ip_address: "192.168.0.1"
|
||||||
gateway: "192.168.0.1"
|
|
||||||
netmask: "255.255.255.0"
|
|
||||||
|
|
||||||
wifi_sta:
|
|
||||||
ssid: StefanMieke
|
|
||||||
|
@@ -240,6 +240,7 @@ public:
|
|||||||
if (ip.begin() != nullptr) {
|
if (ip.begin() != nullptr) {
|
||||||
uint32_t value = 0;
|
uint32_t value = 0;
|
||||||
uint32_t tmp = 0;
|
uint32_t tmp = 0;
|
||||||
|
int shift = 0;
|
||||||
int c = 0;
|
int c = 0;
|
||||||
for (auto ch : ip) {
|
for (auto ch : ip) {
|
||||||
if (ch >= '0' && ch <= '9') {
|
if (ch >= '0' && ch <= '9') {
|
||||||
@@ -252,7 +253,8 @@ public:
|
|||||||
if (tmp > 255) {
|
if (tmp > 255) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
value = (value << 8) + tmp;
|
value = value | (tmp << shift);
|
||||||
|
shift += 8;
|
||||||
tmp = 0;
|
tmp = 0;
|
||||||
} else if (ch != ' ') {
|
} else if (ch != ' ') {
|
||||||
// For convenience / layouting.
|
// For convenience / layouting.
|
||||||
@@ -262,7 +264,7 @@ public:
|
|||||||
if (tmp > 255) {
|
if (tmp > 255) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
value = (value << 8) + tmp;
|
value = value | (tmp << shift);
|
||||||
|
|
||||||
// Correct.
|
// Correct.
|
||||||
dst = value;
|
dst = value;
|
||||||
|
Reference in New Issue
Block a user