Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
photon : Comparison between IPAddress objects does not always work #715
Ran into a bug where comparison between a resolved IPAddress is not equal to an IPAddress created using the constructors. Take a look at the test code below :
Test 1 above passes if
My temporary workaround is just comparing individual octets
Just wanted to bring this up since the documentation claims comparisons against IPAddress objects is possible.
You have some code shift from _a _b _c to _x _y _z but I think your idea is there.
You cannot run WiFi.resolve() to set a global variable outside of setup() or loop() since the network may or may not be running when you call it. You can call WiFi.resolve() in functions when the network is up and running of course.
Does that explain what you are seeing or is there some other problem?
oops, thanks edited the first comment to fix the variable names.
As I mentioned before. The comparison passes if you compare each byte individually but not if you compare IPAddress objects. So the actual values are being set properly, the comparison just doesn't work.