Skip to content

Commit ca79f2c

Browse files
authored
use static_assert to check on fw structure changes over updates (#5939)
1 parent 68c0a1c commit ca79f2c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ static bool sta_config_equal(const station_config& lhs, const station_config& rh
6363
* @return equal
6464
*/
6565
static bool sta_config_equal(const station_config& lhs, const station_config& rhs) {
66+
67+
static_assert(sizeof(station_config) == 112, "struct station_config has changed, please update comparison function");
68+
6669
if(strncmp(reinterpret_cast<const char*>(lhs.ssid), reinterpret_cast<const char*>(rhs.ssid), sizeof(lhs.ssid)) != 0) {
6770
return false;
6871
}

0 commit comments

Comments
 (0)