I would use udp_sendto since this does send immediately if lwIP has an ARP entry to know the MAC destination address and your Ethernet driver (low_level_output) sends immediately without some delay or wait for interrupt. You might make your call, delay a few mS for it to process and then disable system interrupts.
How to prove this? Start WireShark capturing on the PC (assuming the PC will get/see the UDP packet). Step in the debugger over lwip_sendto stopping after this line. Does WireShark contain the UDP packet(s)? If you can't stop in a debugger, simply test adding for(;;); after lwip_sendto. If you don't see anything, add a software delay after lwip_sendto. From: [email protected] [mailto:[email protected]] On Behalf Of Chen Sent: Tuesday, January 19, 2010 11:14 AM To: [email protected] Subject: [lwip-users] How do I check if a packet is sent out? Hi, all, In my project, I need to send out an UDP packet then stop the system interrupts for a few ms, but I need to confirm the UDP packet is sent out first (I don't need to confirm if it will reach the destination) I send out the UDP packet using lwip_sendto(lSocketUDP, myudpout.buffer, sizeof(myudpout), 0, (struct sockaddr *)&sSyncDestAddrUDP, sizeof(sSyncDestAddrUDP)); How can I confirm *THIS* packet is sent out? Can anyone be so kind to give me a pointer? Thanks Chen BTW, I also have an active TCP connection at the same time
_______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
