How can my application know at run time what IP address was assigned to it by the DHCP server?
Thanks.
Err ... isn't that the whole point of DHCP?!
The 'D' is for Dynamic!
en.wikipedia.org/.../Dynamic_Host_Configuration_Protocol
Sorry - missed the "How..."
This will be part of your IP stack - so you will have to study the documentation for whatever IP stack you're using to find out what facilities it provides to retrieve such information.
You didn't say what IP stack you're using...
I'm using an ARM 9 processor and the Keil TCP/IP stack. I haven't found it in the documentation.
Check out:
http://www.keil.com/support/man/docs/rlarm/rlarm_tn_runtimecfg.htm
In particular look into localm and localm[NETIF_ETH]
This route certainly worked back in MDK-ARM 4.53
Yes, I've been printing out localm[NETIF_ETH]. Just found the problem, I was printing out localm[NETIF_ETH] too soon. I had to wait a couple of seconds until the DHCP process completed then localm[NETIF_ETH] holds the IP address. Thanks for the suggestion.