LWIP Raw API udp_send() Cube MX HAL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-08 6:24 AM
Hi,
LWIP: what is the difference between udp_send() and udp_sendto()?
What are the use cases for each?
The LWIP_RAW_CLIENT ECHO uses udp_send() but also uses udp_connect. Whereas udp_sendto() does not need to connect?
Does anyone have example?
Thanks
Solved! Go to Solution.
- Labels:
-
Ethernet
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-10 8:22 AM
In both my PTP sources and the UDP echo test I use udp_sendto.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-08 7:33 AM
https://lwip.fandom.com/wiki/Raw/UDP
err_t udp_connect(struct udp_pcb * pcb, struct ip_addr * ipaddr, u16_t port)
Sets the remote end of the pcb. This function does not generate any network traffic, but only set the remote address of the pcb. It binds the pcb to a local address if it is not already bound. It returns ERR_USE if no port is available, ERR_RTE if there is no route to the destination, or ERR_OK. Connecting is only needed when using udp_send(). For unconnected pcbs, udp_sendto() can be used to send to any specified remote address. Connected pcbs only receive data from the connected remote address, while unconnected pcbs receive datagrams from any remote address.
Sometimes google helps! ;)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-08 8:46 AM
Thanks. I'd read the documentation. I was really looking for some information explained differently from a different source.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-09 4:49 AM
Okay, it's basically all in there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-09 5:22 AM - edited ‎2023-08-09 5:22 AM
@LCE which function do you normally use?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-10 8:22 AM
In both my PTP sources and the UDP echo test I use udp_sendto.
