mbed IP library over Ethernet
Dependencies: Socket lwip-eth lwip-sys lwip
Fork of EthernetInterface by
Revision 48:027a7530fed6, committed 2016-11-23
- Comitter:
- zain_mbed
- Date:
- Wed Nov 23 11:28:39 2016 +0000
- Parent:
- 47:65b0d840274c
- Commit message:
- made chnages
Changed in this revision
EthernetInterface.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 65b0d840274c -r 027a7530fed6 EthernetInterface.cpp --- a/EthernetInterface.cpp Mon Feb 16 19:21:39 2015 +0000 +++ b/EthernetInterface.cpp Wed Nov 23 11:28:39 2016 +0000 @@ -29,7 +29,7 @@ /* TCP/IP and Network Interface Initialisation */ static struct netif netif; - +int a=0; static char mac_addr[19]; static char ip_addr[17] = "\0"; static char gateway[17] = "\0"; @@ -60,9 +60,14 @@ } static void init_netif(ip_addr_t *ipaddr, ip_addr_t *netmask, ip_addr_t *gw) { + if (a>0){ + // a=0; + netif_set_addr(&netif,ipaddr, netmask,gw); + } + if (a==0){ tcpip_init(tcpip_init_done, NULL); tcpip_inited.wait(); - + a=a+1; memset((void*) &netif, 0, sizeof(netif)); netif_add(&netif, ipaddr, netmask, gw, NULL, eth_arch_enetif_init, tcpip_input); netif_set_default(&netif); @@ -70,6 +75,7 @@ netif_set_link_callback (&netif, netif_link_callback); netif_set_status_callback(&netif, netif_status_callback); } +} static void set_mac_address(void) { #if (MBED_MAC_ADDRESS_SUM != MBED_MAC_ADDR_INTERFACE)