UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
134 Views
Registered: ‎10-06-2018

LWIP in UDP

Hi Everybody,

      I want to send data from Zedboard to PC via Ethernet, for this I am using LWIP in UDP protocol only.

  Echo function is working in UDP protocol. But now I want to send my own data ( single integer), to do this what changes is required in following code.The Echo function code attached, please find it and do help to me.

 

void udp_echo_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, struct
ip_addr *addr, u16_t port)
{
if (p != NULL) {
/* send received packet back to sender */
udp_sendto(pcb, p, addr, port);
/* free the pbuf */
pbuf_free(p);
}
}    

0 Kudos
1 Reply
Xilinx Employee
Xilinx Employee
77 Views
Registered: ‎10-30-2017

Re: LWIP in UDP

Hi narendrandesainath@gmail.com ,

 

Please change the variable P in udp_sendto() function with interger value. basically in the data that is recevied in recv handler will be sent back using udp_sendto() function and the received data stored in variable P. if you replace the variable P with your interger value then this function will send the integer data to PC when PC requested any packet.

 

Best Regards,
Srikanth
----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.

0 Kudos