Why is this line in spark_wiring_ipaddress.h commented out?

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?

1 Like

This is a great question for @satishgn.

Normally when something is commented out like that, it is because there were problems.

1 Like

@kkaiser @bko

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.

Thanks

1 Like

Pull request for this over here: https://github.com/spark/core-firmware/pull/219

2 Likes

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?

Hi @kkaiser

The team seems to like to work in 2-week sprints, so around another week or so.

You can follow the pull request and see when it gets integrated to the compile-server2 branch used by the cloud.