Forum Discussion
5 Replies
- Altera_Forum
Honored Contributor
If you want to disable DHCP you have two options:
1 - Open the BSP editor for your project and disable the DHCP client for the InterNiche Stack. 2 - Edit the function "get_ip_addr" in the file "network_utilities.c" for the simple socket server example so that it doesn't set the variable "*use_dhcp" to 1 before returning. If you want to reduce the DHCP timeout, there is a function called "dhc_set_timeout" which you can call before initializing the InterNiche stack. What you would do is put the declaration:
at the top of your file. Then you simply call dhc_set_timeout with the timeout value in seconds before the call to "iniche_initialize". Jakeextern void dhc_set_timeout(int timeout_sec); - Altera_Forum
Honored Contributor
--- Quote Start --- If you want to disable DHCP you have two options: 1 - Open the BSP editor for your project and disable the DHCP client for the InterNiche Stack. 2 - Edit the function "get_ip_addr" in the file "network_utilities.c" for the simple socket server example so that it doesn't set the variable "*use_dhcp" to 1 before returning. If you want to reduce the DHCP timeout, there is a function called "dhc_set_timeout" which you can call before initializing the InterNiche stack. What you would do is put the declaration:
at the top of your file. Then you simply call dhc_set_timeout with the timeout value in seconds before the call to "iniche_initialize". Jake --- Quote End --- Sorry for the graveyard rez, but I am trying to set the timeout with a function like in this post, but there is no "dhc_set_timeout" in my workspace. Has the name of this function changed?extern void dhc_set_timeout(int timeout_sec); - Altera_Forum
Honored Contributor
--- Quote Start --- Sorry for the graveyard rez, but I am trying to set the timeout with a function like in this post, but there is no "dhc_set_timeout" in my workspace. Has the name of this function changed? --- Quote End --- Hi all it seems to me too. Is there any way to set the dhcp timeout in inche? memes - Altera_Forum
Honored Contributor
--- Quote Start --- Hi all it seems to me too. Is there any way to set the dhcp timeout in inche? memes --- Quote End --- I use the superloop setup and for me the file that needed to be changed was at this path: superloop_iniche_lib\iniche\src\misclib\dhcsetup.c Changed this code:
I think the "100" used to be some other value./* wait for DHCP activity to conclude */ /* * Altera Niche Stack Nios port modification: * Increase DHCP timeout to > 2 minutes */ while (((cticks - dhcp_started) < (100*TPS)) && (dhc_alldone() == FALSE)) { /* let other tasks spin. This is required, since some systems * increment cticks in tasks, or use a polling task to receive * packets. Without this activity this loop will never exit. */ tk_yield(); pktdemux();# ifdef SUPERLOOP dhc_second ();# endif } - Altera_Forum
Honored Contributor
Great It worked. Thanks a lot.