i broke it
This commit is contained in:
@@ -251,7 +251,7 @@ uint8_t check_DHCP_timeout(void);
|
||||
void reset_DHCP_timeout(void);
|
||||
|
||||
/* Parse message as OFFER and ACK and NACK from DHCP server.*/
|
||||
int8_t parseDHCPCMSG(void);
|
||||
int8_t parseDHCPMSG(void);
|
||||
|
||||
/* The default handler of ip assign first */
|
||||
void default_ip_assign(void)
|
||||
@@ -749,6 +749,9 @@ uint8_t DHCP_run(void)
|
||||
if (check_DHCP_leasedIP()) {
|
||||
// Network info assignment from DHCP
|
||||
dhcp_ip_assign();
|
||||
#ifdef _DHCP_DEBUG_
|
||||
printf("> DHCP Success\r\n");
|
||||
#endif
|
||||
reset_DHCP_timeout();
|
||||
|
||||
dhcp_state = STATE_DHCP_LEASED;
|
||||
@@ -901,10 +904,17 @@ int8_t check_DHCP_leasedIP(void)
|
||||
tmp = getRCR();
|
||||
setRCR(0x03);
|
||||
|
||||
#ifdef _DHCP_DEBUG_
|
||||
printf("\r\n> Check leased IP - %d.%d.%d.%d\r\n", DHCP_allocated_ip[0], DHCP_allocated_ip[1], DHCP_allocated_ip[2], DHCP_allocated_ip[3]);
|
||||
#endif
|
||||
// IP conflict detection : ARP request - ARP reply
|
||||
// Broadcasting ARP Request for check the IP conflict using UDP sendto() function
|
||||
ret = sendto(DHCP_SOCKET, (uint8_t *)"CHECK_IP_CONFLICT", 17, DHCP_allocated_ip, 5000);
|
||||
|
||||
#ifdef _DHCP_DEBUG_
|
||||
printf("> sendto result : %ld\r\n", ret);
|
||||
#endif
|
||||
|
||||
// RCR value restore
|
||||
setRCR(tmp);
|
||||
|
||||
@@ -964,7 +974,10 @@ void DHCP_init(uint8_t s, uint8_t * buf)
|
||||
/* Reset the DHCP timeout count and retry count. */
|
||||
void reset_DHCP_timeout(void)
|
||||
{
|
||||
dhcp_tick_1s = 0;
|
||||
#ifdef _DHCP_DEBUG_
|
||||
printf("> reset_DHCP_timeout !!!\r\n");
|
||||
#endif
|
||||
// dhcp_tick_1s = 0;
|
||||
dhcp_tick_next = DHCP_WAIT_TIME;
|
||||
dhcp_retry_count = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user