lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Very basic query regarding udp_sendto


From: Patrick Klos
Subject: Re: [lwip-users] Very basic query regarding udp_sendto
Date: Tue, 7 Apr 2020 08:27:06 -0400
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.3

On 4/7/2020 8:15 AM, Hemant Kapoor wrote:
Hello,

I am a newbie to networking and managed to port lwip stack to LPC17xx
controller runninf freertos.
I have requirement to send UDP data to a static destination IP Address.

I have a task which tries to send a UDP Packet every one second.

When I send data via broadcast, it works.
udp_sendto(pcb, pb,IP_ADDR_BROADCAST,1235)

Also from my PC if I ping to my board it all works fine

But if I try to send data to a specific ip address (that of my PC) then it
doesn;t work
udp_sendto(pcb, pb,&destinationAddress,1235)

Also I niotice that ping stop working.

Not sure about the ping breaking after the bad send, but did you make sure your destination address byte order is correct?  For instance, if your target IP address is 192.168.1.1 (0xc0a80101), then you would set destinationAddress like this:

        destinationAddress.addr = htonl(0xc0a80101);

Just a thought...

Patrick




reply via email to

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