I am trying to use WiFi Shield to send some UDP packets to my devices(Ardrone), and the devices will return some UDP packets to Arduino. I need to the source port to get the response.
Is there any way to check Arduino UDP sending packet source port?
It should be the same as the ethernet shield's udp functions. Here is how you get the sender's ip and port so you can send a response packet. I think that is what you are asking.
I means that if Arduino sends UDP packet from port 32201 (assume), the sender will send response packet back to Arduino port 32201. I have to set Arduino listen from port 32201 to receive response.