I see these lines from the IPAddress.h in Arduino are commented out in the Spark equivalent firmware file spark_wiring_ipaddress.h:
// Overloaded cast operator to allow IPAddress objects to be used where a pointer
// to a four-byte uint8_t array is expected
//operator uint32_t() { return *((uint32_t*)_address); };
**//bool operator==(const IPAddress& addr) { return (*((uint32_t*)_address)) == (*((uint32_t*)addr._address)); };**
bool operator==(const uint8_t* addr);
I need the bold line to be un-commented so that comparison code like the following works:
(withaddr == INADDR_NONE ? …
Anyone has some inside on the motivation to comment it out?
good find! but seriously I don’t remember as why that code was commented out. probably it was done during our early days when we had issues with C++ setup.
I uncommitted the code and they work just fine. I will issue a pull request within a short-while from now.
It works now nicely in the local build however, I tried to make the library available to the community in the WEB IDE and there I still see the problem. When do you think it will get pushed out to the cloud?