I wonder if there is any way to get information about failed dhcp process? I need to start dhcp, and if it's not succeeded, disable dhcp and use a default local ip (case of a direct connect to a pc). I understand, that i can monitor local ip, but is there a better way? Also when dhcp is not succesful, the mcb2300_debug complains that retransmit timeout is too big.
Thanks, Gennady
DHCP client tries to obtain a valid IP. It uses exponential backoff retransmission on timeout. After 30 seconds, DHCP client is restarted. This process repeats indefinetly or until a valid IP is obtained. There is no such function to check if a DHCP has failed.
You can monitor the IP address as you have figured out. However I see no reason for doing this. For example a PC can be configured either to use a DHCP or a static IP, but not both at the same time.
Actually I have a similar requirement to "fall back" to a fixed IP address if DCHP negotiation fails. This is the scenario:
1. The device can be connected to a network with a dhcp server. It is expected to negotiate an address with no user intervention.
or...
2. The device is connected to a PC using an ethernet crossover cable. The PC has been configured with a static IP address. It expects to find the device at a well known IP address (say, 192.168.0.1). This is similar to the configuration scheme for many dsl routers.
Dave
View all questions in Keil forum