cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
550 Views
Registered: ‎08-11-2019

How can I find the read (receive) and write (transmit) functions in lwip echo server project

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.

Tags (1)
0 Kudos
4 Replies
nishak
Moderator
Moderator
475 Views
Registered: ‎03-10-2020

harinatha.reddy@eldaas.com,

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

0 Kudos
469 Views
Registered: ‎08-11-2019

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. 

0 Kudos
nishak
Moderator
Moderator
445 Views
Registered: ‎03-10-2020

harinatha.reddy@eldaas.com,

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

0 Kudos
424 Views
Registered: ‎08-11-2019

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.

0 Kudos