Use one UDP PCB, bind it to IPADDR_ANY and port x.

Use udp_sendto() to send to any IP/port combination.
http://www.nongnu.org/lwip/2_0_0/group__udp__raw.html

You get the src address/port of any request in your receive callback:

void my_udp_recv_fn (void *arg, struct udp_pcb
<http://www.nongnu.org/lwip/2_0_0/structudp__pcb.html> *pcb, struct pbuf
<http://www.nongnu.org/lwip/2_0_0/structpbuf.html> *p, const ip_addr_t
<http://www.nongnu.org/lwip/2_0_0/group__ipaddr.html#ga44f9ada14c65d17aecf802d82eb273c5>
*addr, u16_t port)
{
   [create new pbuf with response]
   udp_sendto(pcb, response_pbuf, addr, port);
​}

​Dirk
​
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to