11-04-2020 10:17 PM
Hi,
I am working on Ethernet lwip echo server using zcu102 evaluation board. I am unable to identify write and read functions in this example. Can any one support where those functions available to send custom data using write function.
Best Regards,
Harinath.
11-09-2020 02:33 AM
Pls. check the following document. It explains the read and write calls used with different lwip applications.
https://www.xilinx.com/support/documentation/application_notes/xapp1026.pdf
/Nisha
11-09-2020 02:50 AM
Thank you for your response,
i already checked that application note, in echo server loop back example code i am not getting where it is reading and how it is sending same data. please support an provide any proven codes you are having.
11-09-2020 09:15 AM
As mentioned in the document, in tcp layer, when a packet is received recv callback function will be called. tcp_recved indcates that packet has been received. and the same data is written back using tcp_write function.
To know more about read and write at tcp layer, check tcp_in.c and tcp_out.c. the calls in these functions call/called by IP layer. Those can be found under ip4.c.
IP APIs in turn call/called by xemacpsif.c low level input and output calls. I hope this helps.
/Nisha
11-09-2020 08:14 PM
Thank you for your information,
I understood packet receive and send back functions, but inside structure i am unable to get.
tcp_recved(tpcb, p->len); this is for receiving packet, here in tpcb it is receiving or in p->len that i am not getting.
err = tcp_write(tpcb, p->payload, p->len, 1); this is for sending packet, here tpcb it is sending or p->payload it is sending that i am not getting.
I want to send my own data using tcp_write function, how i want to send that i am not getting.
Kindly help and provide solution.
Thank you.