BlakeFoster / Arduino-Ping

ICMP ping library for the Arduino
59 stars 44 forks source link

One major new feature (asynchronous ICMP) and a few minor mods #6

Closed psychogenic closed 8 years ago

psychogenic commented 8 years ago

One major new feature (asynchronous ICMP requests, and a little bit of re-working to support it) along with three minor modifications.

The async ICMP is used when you have time critical code to execute and/or don't like the idea of waiting around on network events. You first call asyncStart() to send an ICMP packet, then periodically poll to see whether results are in using asyncComplete(). The API is documented and an example is available in the examples/ directory.

Minor mods are:

The patch applied by this push leaves things mostly unchanged, as neither ICMPPING_ASYNCH_ENABLE nor ICMPPING_INSERT_YIELDS are defined. To enable these features, edit icmp_ping/ICMPPing.h and uncomment the defines as needed.

I've run both examples, Ping and AsyncPing, on an ESP8266 with async enabled and yields on, and also run the Ping example with those functions completly disabled.

Hope this is useful to others! Regards, Pat Deegan, http://psychogenic.com

BlakeFoster commented 8 years ago

Nice work, thanks!