mirror of
https://github.com/FreeRTOS/FreeRTOS.git
synced 2025-06-17 21:49:29 +08:00
FreeRTOS+TCP : renewing DHCP lease while network is down (#53)
Co-authored-by: Hein Tibosch <hein@htibosch.net> Co-authored-by: Gary Wicker <14828980+gkwicker@users.noreply.github.com>
This commit is contained in:
@ -488,6 +488,8 @@ BaseType_t xGivingUp = pdFALSE;
|
|||||||
|
|
||||||
case eLeasedAddress :
|
case eLeasedAddress :
|
||||||
|
|
||||||
|
if( FreeRTOS_IsNetworkUp() )
|
||||||
|
{
|
||||||
/* Resend the request at the appropriate time to renew the lease. */
|
/* Resend the request at the appropriate time to renew the lease. */
|
||||||
prvCreateDHCPSocket();
|
prvCreateDHCPSocket();
|
||||||
|
|
||||||
@ -495,12 +497,17 @@ BaseType_t xGivingUp = pdFALSE;
|
|||||||
{
|
{
|
||||||
xDHCPData.xDHCPTxTime = xTaskGetTickCount();
|
xDHCPData.xDHCPTxTime = xTaskGetTickCount();
|
||||||
xDHCPData.xDHCPTxPeriod = dhcpINITIAL_DHCP_TX_PERIOD;
|
xDHCPData.xDHCPTxPeriod = dhcpINITIAL_DHCP_TX_PERIOD;
|
||||||
prvSendDHCPRequest( );
|
prvSendDHCPRequest();
|
||||||
xDHCPData.eDHCPState = eWaitingAcknowledge;
|
xDHCPData.eDHCPState = eWaitingAcknowledge;
|
||||||
|
|
||||||
/* From now on, we should be called more often */
|
/* From now on, we should be called more often */
|
||||||
vIPReloadDHCPTimer( dhcpINITIAL_TIMER_PERIOD );
|
vIPReloadDHCPTimer( dhcpINITIAL_TIMER_PERIOD );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vIPReloadDHCPTimer( pdMS_TO_TICKS( dhcpINITIAL_DHCP_TX_PERIOD ) );
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case eNotUsingLeasedAddress:
|
case eNotUsingLeasedAddress:
|
||||||
|
Reference in New Issue
Block a user