Skip to content

Commit 441a30a

Browse files
committed
ARP table cleanup was not invoked
1 parent d043333 commit 441a30a

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/Ethernet.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ IPAddress UIPEthernetClass::_dnsServerAddress;
4040
DhcpClass* UIPEthernetClass::_dhcp(NULL);
4141

4242
unsigned long UIPEthernetClass::periodic_timer;
43+
unsigned long UIPEthernetClass::arp_timer;
4344

4445
// Because uIP isn't encapsulated within a class we have to use global
4546
// variables, so we can only have one TCP/IP stack per program.
@@ -178,6 +179,13 @@ UIPEthernetClass::tick()
178179
{
179180
if (!initialized)
180181
return;
182+
183+
// run ARP table cleanup every 10 seconds as required by a comment in uip_arp.h
184+
if (millis() - arp_timer > 10000) {
185+
arp_timer = millis();
186+
uip_arp_timer();
187+
}
188+
181189
if (in_packet == NOBLOCK)
182190
{
183191
in_packet = Enc28J60Network::receivePacket();
@@ -488,3 +496,9 @@ uip_udpchksum(void)
488496
#endif
489497

490498
UIPEthernetClass Ethernet;
499+
500+
extern "C" void serialPrint(int i);
501+
void serialPrint(int i) {
502+
Serial.println(i);
503+
Serial.flush();
504+
}

src/Ethernet.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ class UIPEthernetClass
109109
static DhcpClass* _dhcp;
110110

111111
static unsigned long periodic_timer;
112+
static unsigned long arp_timer;
112113

113114
static void init(const uint8_t* mac);
114115
static void configure(IPAddress ip, IPAddress dns, IPAddress gateway, IPAddress subnet);

0 commit comments

Comments
 (0)