lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Basic UDP send not working.


From: Luciano Moretti
Subject: Re: [lwip-users] Basic UDP send not working.
Date: Wed, 3 Mar 2021 08:28:30 -0600

Thanks,
I don't know what I changed but it started working. Great but bad feeling when stuff you've been struggling with starts working and you don't know why.

On Wed, Mar 3, 2021 at 6:41 AM Sidnei Silva <sidneisss1971@gmail.com> wrote:
Have you checked that there is no firewal on your machine blocking the udp port?

Sidnei


Em ter., 2 de mar. de 2021 às 18:28, Luciano Moretti <luciano.moretti@gmail.com> escreveu:
Hello:
I'm trying to send a generic UDP packet on a STM32F407 chip.
The HTTP server works, so the hardware is working. I can load the default page on my workstation no issue.

I'm trying to just send a UDP packet to a specific IP & Port. LwIP doesn't give an error but the packet doesn't show up in Wireshark. 

Code:

bool sendUDP(ip4_addr_t DestinationIP, uint16_t port, uint8_t *data, uint16_t length)
{
err_t err;
pbuf *p;

udp_pcb *upcb = udp_new();

// TODO: Clean up error handling here.
err = udp_connect( upcb, &DestinationIP, port );
p = pbuf_alloc( PBUF_TRANSPORT, length, PBUF_RAM );
memcpy(p->payload, data, length);
err = udp_send( upcb, p );
udp_disconnect( upcb );
pbuf_free(p);
udp_remove(upcb);
return (ERR_OK == err);
}
_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users
_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

reply via email to

[Prev in Thread] Current Thread [Next in Thread]