Hi,
Our application has been developed with MQX 3.8. Our application has a dhcp client and it works properly..
We are porting our application to MQX 4.2 and now the dhcp client is not renewing the lease time before the lease time finishes. For example, our dhcp server is offering a lease time =60s and the DHCPclient is renewing the IP addres very 400s.
I heve been debugging and I see this in tcpip.c (MQX 4.2)
void TCPIP_task
(
void *dummy,
void *creator
)
{
..................
.....................
timeafter = RTCS_time_get();
/* If head changed set time delta to zero to prevent immidiate event */
if (queue == TCPIP_Event_head)
{
timedelta = RTCS_timer_get_interval(timebefore, timeafter);
}
else
{
timedelta = 0;
}
timebefore = timeafter;
timedelta = TCPIP_Event_time(timedelta);
...............................
...............................
}
Comparing MQX 3.8 and MQX 4.2 I suggest doing this change:
void TCPIP_task
(
void *dummy,
void *creator
)
{
..................
.....................
timeafter = RTCS_time_get();
/* If head changed set time delta to zero to prevent immidiate event */
if (queue == TCPIP_Event_head)
{
timedelta = RTCS_timer_get_interval(timebefore, timeafter);
timebefore = timeafter;
}
else
{
timedelta = 0;
}
timedelta = TCPIP_Event_time(timedelta);
...............................
...............................
}
I have tested and now the DHCP client works properly like in MQX 3.8.
Is this change correct? Is there an event timing error in MQX 4.2?
Regards,