Hi,
I am trying to get started with using Arduino Ethernet and I am examining the library source code to get an understanding of how things are done.
I've looked through the file "...\Arduino\libraries\Ethernet\src\utilty\w5100.cpp" to see how to read/write the WizNet chip and many of the functions call routines named "writeMR" and "readMR" but I just can't see where those two routines are defined. I can guess that these are routines to write and read the MODE REGISTER but I would like to confirm the details of just how this is done...
Can anyone help point me in the right direction?
Many thanks
PhilipJ
Hi Juraj,
thanks, that's a great help
I've spent most of my life programming 'C' but there are features like this that I hardly ever use and so they catch me out when I do a global search for something and can't find it.
Hi, sorry to bother you again but you might know the answer to this question also:
I am following through the code of DhcpAddressPrinter.ino to try and understand how DHCP works. One of the first things it does is to call Ethernet.begin(mac) but when I look in the source for Ethernet.cpp there are a number of EthernetClass::begin() functions defined but none with only one parameter. I understand about overloaded functions and how the compiler chooses the correct one according to the passed parameters but how does it work in this case for only the one parameter? I can guess that somewhere there is a stub that adds a 2nd parameter (IP address) and calls the begin() function with two params but I'd like to see it.
Kind regards
PhilipJ
Thanks, I think I've got it (sorry but my knowledge of C++ is limited as I've always programmed embedded CPU is 'C').
The function is defined in the class with the two params "unsigned long timeout = 60000, unsigned long responseTimeout = 4000" given default values so I'm guessing they do not need to be included when the function is called? but can be overridden if different values are required.
Sorry to be a trouble!
Kind regards
PhilipJ