Open lathoub opened 5 years ago
This could be addressed by including a comment noting that data sent to or received from the library must be in "network byte order", aka "Big-Endian", though in practice it doesn't seem necessary to worry much about it. For instance, you can declare a buffer like so:
const char page1[] = "<body><p><u><b><H1 style='margin-left: auto; margin-right: auto; text-align: center;'>Test Page</H1></b></u></p>";
and pass it to EthernetClient::write() and it sends just fine. Adding a note about Endianness would confuse many more than it would help.
This Ethernet library does not define the BYTE_ORDER of the chipset that is used, the wifi library does (as does the ESP32). I have made a suggestion here, so that the Ethernet library programmer doesn't have to reinvent it. (or should this be defined by the Arduino main library?)