jcw/ethercard — pull request #80 by brianlah87 (2013-04-06 22:00:28+00:00)
Title: UDP Listener Server

I implemented a basic UDP Listener Server for a project I'm working on, and I thought you might want to see if it's of any use to you. I've kept all the code in a separate udpserver.cpp file. The only other changes I had to make was to add a hook to tcpip.cpp to call my code as part of packetLoop, and the relevant header info in EtherCard.h.

You can register callbacks from the Arduino sketch to UDP port numbers, and when the device gets a packet from those port numbers, your callback fires.

I've also included an example sketch based off one of the old examples.

If there are code or documentation conventions you would like me to follow or functionality you want added, do let me know. If it's a simple addition, I think I could spare the time to look into it.

Btw, thanks for working on the project. It saved me quite a bit of time working with non official shield devices.