I need help regarding DHCP client . I Find it very hard to understand the flow of how to integrated DHCP. I have followed Many Github Repos for DHCP client but i am still not clear could anyone Help about this ?. Many Examples are Confusing.
What i Find difficult to Follow is as Follow,
- What Is prerequisite for DHCP_init() ? --I think , only MAC addr and the rest Subnet IP and Getway all set to Zero. Is it Correct ? I think SUbnet Mask will always be 255.255.255.0 is it correct ?
- Do i have to pass any functional handlers or create local variables etc. before or after DHCp_init() and before DHCP_run()?
- Timer 1 Second Set to DHCP handler that Understood
- I have not yet Understood What is PHY LINK …is physical or Software bit…never understood that
- In DHCP_run() (while polling) when is the Success? --only When DHCP_LEASED state is reached or with DHCP_CHANGED as well(assuming i have set default ip and that when network finds it conflicting it changes to appropriate one --that is also Success right?)
how state transition happens?.
- When DHCP Leased…do i have to call DHCP_stop(), or just let go? If Successful. Is the Network Configurations automatically Set or do i have to read into temporary Structure variable and the Set them in W5500 forcefully ?.
- what if router goes down After i have obtained proper credentials… and after some time power is back …does it re-initiate getting credentials or do i have re-initiate from DHCP_init().
- How do i check for is the Router is even Powered on ?
- My code Gets stuck at DHCP_DIscover…and stuck forever
I have W5500 integrated with 16bit Controller.
I am awaiting reply… I am Completely rookie in this