26 #include <FlowScanner.h>
35 static const uint8_t
CS_PIN = 10;
46 static const uint8_t PING_PERIOD = NTICKS(1000);
52 printf_P(PSTR(
"Reply from %d.%d.%d.%d: bytes=%d time=%dms TTL=%d\n"),
53 packet.ip.sourceIP.b[0], packet.ip.sourceIP.b[1], packet.ip.sourceIP.b[2], packet.ip.sourceIP.b[3],
91 ACross::printf_serial_init();
94 printf_P(PSTR(
"ICMP Ping EtherDune sample\n"));
95 printf_P(PSTR(
"Free RAM: %d"),ACross::getFreeRam());
96 printf_P(PSTR(
"Press any key to start...\n"));
98 while (!Serial.available());
103 ACERROR(
"failed to start EtherDune");
105 ACINFO(
"waiting for link...");
109 ACINFO(
"link is up");
114 printf_P(PSTR(
"DHCP setup failed\n"));
118 printf_P(PSTR(
"DHCP setup OK\n"));
120 printf_P(PSTR(
"Local IP is %d.%d.%d.%d. Try pinging me!\n\n"),
125 pingTest.start(targetIP);
Implements an ICMP Echo reply service.
virtual void onPingReply(uint16_t roundtripTime)=0
static bool begin(uint8_t cspin)
Initializes EtherDune and the underlying hardware
represents an IP address in memory
static const uint8_t CS_PIN
void ping(const IPAddress &targetIP)
Send an ICMP Echo request (ping) to the specified target IP address.
#define IPADDR_P(b0, b1, b2, b3)
defines an IP address as stored in PROGMEM
bool dhcpSetup()
Attempts to configure the IP settings: local IP, subnet mask, gateway and DNS via DHCP...
virtual void tick()
This is a timer function that is called every NETWORK_TIMER_RESOLUTION milliseconds on every service...
static MACAddress_P mymac
static bool isLinkUp()
Determines whether the network link is ready
static MACAddress localMAC
Ethernet MAC address.
Base data structures for Internet communication.
static void loop()
Gives processing time to EtherDune so that it can check for incoming packets or send queued packets...
static IPAddress localIP
IP address of this application.
Implements an ICMP Echo request service.