Juerd / ESP-WiFiSettings

WiFi Manager for the ESP32 Arduino environment
Other
166 stars 34 forks source link

Fix ESP8266 hostname generation + compiler warnings #5

Closed Pwuts closed 4 years ago

Pwuts commented 4 years ago

ESP8266 hostname generation

Problem: the hostname for the ESP8266 is generated using ESP.getChipId() >> 8, but since the chip ID of the ESP8266 is the last 24 bits of its MAC address, this only leaves 16 bits (AKA the first two symbols of the ID part of the hostname is aways 00).

Solution: remove >> 8 truncation.

compiler warning

Problem: the compiler warned about a signed vs unsigned integer comparison. In the for-loop on line 50 of WiFiSettings.cpp, int i is used as an iterator but the limiter is raw.length() which has type size_t.

Solution: for (size_t i = 0; i < raw.length(); i++)

version

I think fixing these bugs justifies a v3.1.0 release, so I updated the version in the library manifests.

Juerd commented 4 years ago

For future reference: #5 is an update of #4.