ICMP Ping on Teensy Ethernet Library

i read Ethernet.h on Ethernet Library 2.0.0

/ Sending UDP packets

// Start building up a packet to send to the remote host specific in ip and port
// Returns 1 if successful, 0 if there was a problem with the supplied IP address or port
virtual int beginPacket(IPAddress ip, uint16_t port);
// Start building up a packet to send to the remote host specific in host and port
// Returns 1 if successful, 0 if there was a problem resolving the hostname or port
virtual int beginPacket(const char *host, uint16_t port);
// Finish off this packet and send it
// Returns 1 if the packet was sent successfully, 0 if there was an error
virtual int endPacket();

i wonder if i can check target ip with begin packet?

if return is 0 then there was problem with ip or port → is right this code checking for target ip?

Thankyou so much
 
I briefly looked into adding this to QNEthernet a little while ago and it shouldn't be too difficult. You could either adapt/wrap lwIP's pre-made ping "app", or add some ICMP layer to the library API. I might or might not add this in the future; it's just a matter of having the time and gumption.
 
Back
Top