Diecol, If I'm not mistaken you will need to leave both:
#define LWIP_DHCP 1 #define LWIP_UDP 1 This will allow you to make a runtime decision on what IP mode the user has enabled. Keep in mind, the underlying protocol for receiving DHCP packets is handled by the UDP portion of the lwIP stack (or at least that is the way I remember it). As for configuring your interface at runtime, look into lwiplib.h. It contains the structure, definitions and prototypes to configure your network interface for both modes. Once you have assigned the proper parameters to the structure, you can call lwIPLib_Init(lwIPLib_IPInfo_t *pInitParams). If you need to reconfigure call: lwIPLib_NetworkConfigChange( unsigned long ulIPAddr, // the new IP address to be used (static) unsigned long ulNetMask, // the new network mask to be used (static) unsigned long ulGWAddr, // the new Gateway address to be used (static) unsigned long ulIPMode) // the IP Address Mode Hope this helps, Andrew -----Original Message----- From: Diecol [mailto:[email protected]] Sent: Monday, December 20, 2010 13:11 To: [email protected] Subject: [lwip-users] Problem with use DHCP and IP fixed Hello there, I'm working with lwip on at91sam9260 board and I'm using Eclipse platform. well, When I set at lwipopts.h like this: #define LWIP_DHCP 1 #define LWIP_UDP 1 DHCP works fine.. And when I set like this: #define LWIP_DHCP 0 #define LWIP_UDP 0 My Ip fixed works fine too.. But in my code, users can changed from ip fixed to dhcp on and contrariwise! When I used uIP protocol, I just did like this: uip_ipaddr_t ipaddr; uip_ipaddr(ipaddr, 0, 0, 0, 0); uip_sethostaddr(ipaddr); uip_ipaddr(ipaddr, 0, 0, 0, 0); uip_setdraddr(ipaddr); uip_ipaddr(ipaddr, 0, 0, 0, 0); uip_setnetmask(ipaddr); uip_setethaddr(MacAddress); dhcpc_init(MacAddress.addr, 6); uip_restart(); And It worked.. But now, I needed to change to lwip and when I try to change the configuration It didnt work! Someone has any idea? Thanks Regards Oliveira, Diego -- View this message in context: http://old.nabble.com/Problem-with-use-DHCP-and-IP-fixed-tp30500330p30500330.html Sent from the lwip-users mailing list archive at Nabble.com. _______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users _______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
