While writing my own IP stack, I have come across a small "issue" with htons, htonl, etc.
It seems that the routines don't do anything.
The Arduino is meant to be little-endian, yes? And network order is big-endian. Yet, the following code:
uint32_t t = 94737692; Serial.print("Host: "); Serial.print(t); Serial.print(" Network: "); Serial.println(htonl(t));
Host: 94737692 Network: 94737692
Whereas surely it should give:
Host: 94737692 Network: 479569157
Am I correct in my assumption that it's just plain broken in the library?