Merge pull request #1138 from oliverschmidt/master
Fix DHCP client retries.
This commit is contained in:
commit
ac3b8b0955
|
@ -97,9 +97,9 @@ makestrings(void)
|
||||||
PROCESS_THREAD(dhcp_process, ev, data)
|
PROCESS_THREAD(dhcp_process, ev, data)
|
||||||
{
|
{
|
||||||
PROCESS_BEGIN();
|
PROCESS_BEGIN();
|
||||||
|
|
||||||
ctk_window_new(&window, 28, 7, "DHCP");
|
ctk_window_new(&window, 28, 7, "DHCP");
|
||||||
|
|
||||||
CTK_WIDGET_ADD(&window, &getbutton);
|
CTK_WIDGET_ADD(&window, &getbutton);
|
||||||
CTK_WIDGET_ADD(&window, &statuslabel);
|
CTK_WIDGET_ADD(&window, &statuslabel);
|
||||||
CTK_WIDGET_ADD(&window, &ipaddrlabel);
|
CTK_WIDGET_ADD(&window, &ipaddrlabel);
|
||||||
|
@ -110,22 +110,21 @@ PROCESS_THREAD(dhcp_process, ev, data)
|
||||||
CTK_WIDGET_ADD(&window, &gatewayentry);
|
CTK_WIDGET_ADD(&window, &gatewayentry);
|
||||||
CTK_WIDGET_ADD(&window, &dnsserverlabel);
|
CTK_WIDGET_ADD(&window, &dnsserverlabel);
|
||||||
CTK_WIDGET_ADD(&window, &dnsserverentry);
|
CTK_WIDGET_ADD(&window, &dnsserverentry);
|
||||||
|
|
||||||
CTK_WIDGET_FOCUS(&window, &getbutton);
|
CTK_WIDGET_FOCUS(&window, &getbutton);
|
||||||
|
|
||||||
ctk_window_open(&window);
|
ctk_window_open(&window);
|
||||||
dhcpc_init(uip_lladdr.addr, sizeof(uip_lladdr.addr));
|
dhcpc_init(uip_lladdr.addr, sizeof(uip_lladdr.addr));
|
||||||
|
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
PROCESS_WAIT_EVENT();
|
PROCESS_WAIT_EVENT();
|
||||||
|
|
||||||
if(ev == ctk_signal_widget_activate) {
|
if(ev == ctk_signal_widget_activate) {
|
||||||
if(data == (process_data_t)&getbutton) {
|
if(data == (process_data_t)&getbutton) {
|
||||||
dhcpc_request();
|
dhcpc_request();
|
||||||
set_statustext("Requesting...");
|
set_statustext("Requesting...");
|
||||||
}
|
}
|
||||||
} else if(ev == tcpip_event) {
|
} else if(ev == tcpip_event || ev == PROCESS_EVENT_TIMER) {
|
||||||
dhcpc_appcall(ev, data);
|
dhcpc_appcall(ev, data);
|
||||||
} else if(ev == PROCESS_EVENT_EXIT ||
|
} else if(ev == PROCESS_EVENT_EXIT ||
|
||||||
ev == ctk_signal_window_close) {
|
ev == ctk_signal_window_close) {
|
||||||
|
|
|
@ -177,9 +177,9 @@ app_quit(void)
|
||||||
PROCESS_THREAD(ipconfig_process, ev, data)
|
PROCESS_THREAD(ipconfig_process, ev, data)
|
||||||
{
|
{
|
||||||
PROCESS_BEGIN();
|
PROCESS_BEGIN();
|
||||||
|
|
||||||
ctk_window_new(&window, 29, 14, "IP config");
|
ctk_window_new(&window, 29, 14, "IP config");
|
||||||
|
|
||||||
CTK_WIDGET_ADD(&window, &requestbutton);
|
CTK_WIDGET_ADD(&window, &requestbutton);
|
||||||
CTK_WIDGET_ADD(&window, &statuslabel);
|
CTK_WIDGET_ADD(&window, &statuslabel);
|
||||||
CTK_WIDGET_ADD(&window, &ipaddrlabel);
|
CTK_WIDGET_ADD(&window, &ipaddrlabel);
|
||||||
|
@ -208,11 +208,11 @@ PROCESS_THREAD(ipconfig_process, ev, data)
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
PROCESS_WAIT_EVENT();
|
PROCESS_WAIT_EVENT();
|
||||||
|
|
||||||
if(ev == PROCESS_EVENT_MSG) {
|
if(ev == PROCESS_EVENT_MSG) {
|
||||||
makestrings();
|
makestrings();
|
||||||
ctk_window_redraw(&window);
|
ctk_window_redraw(&window);
|
||||||
} else if(ev == tcpip_event) {
|
} else if(ev == tcpip_event || ev == PROCESS_EVENT_TIMER) {
|
||||||
dhcpc_appcall(ev, data);
|
dhcpc_appcall(ev, data);
|
||||||
} else if(ev == ctk_signal_button_activate) {
|
} else if(ev == ctk_signal_button_activate) {
|
||||||
if(data == (process_data_t)&requestbutton) {
|
if(data == (process_data_t)&requestbutton) {
|
||||||
|
|
Loading…
Reference in a new issue