lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] TM4C1294 LWIP Usage


From: Noam weissman
Subject: Re: [lwip-users] TM4C1294 LWIP Usage
Date: Wed, 17 Dec 2014 17:37:22 +0200

Hi Lee,

 

LwIP has 3 flavers, meaning you can use it in 3 different modes:

1.       RAW mode

2.       NetCon

3.       BSD

 

I have only experience with RAW mode, were you use the callbacks J

BSD is similar to any other system like Linux etc..

 

NetCon is a socket based API but different from the BSD socket coding.

 

RAW:

In general when you define a server you bind your own IP with a server port and add an accept call-back

 

Every connection to this server will trigger the call-back. Inside the call-back you call your own initializing code

and assign your receive, poll and other call-back functions. This are bound to the accepted PCB or control block

for the new connection.

 

If your connection gets new packets the TCP stack will call the receive call-back for the new connection. If you a few

connections at the same time the PCB for every connection is different but the call-back is the same. All these call-back

functions should be reentrant with no static variables.

 

This is on one leg…

 

I suggest checking the contribution code and especially the echo server. This is very simple and will help you get the ide.

 

Read the rawapi.txt inside the doc directory. It will also give you some inside information on how to work in RAW mode.

 

 

Hope that helped.

 

BR,

Noam.

 

From: address@hidden [mailto:address@hidden On Behalf Of Lee Noack
Sent: Wednesday, December 17, 2014 12:20 PM
To: address@hidden
Subject: [lwip-users] TM4C1294 LWIP Usage

 

Hi,

 

 

My goal is to receive data from the GPIO ports continuously, store it in dual buffers and feed this out the ethernet port continuously. I was hoping to use the enet-lwip example as a starting point but this does leave me with many questions and a steep learning curve. partially because the examples are generally web servers.

 

Firstly I understand LWIP is driven by callback functions. One of which is declared as

 

err_t (* accept) (void * arg, struct tcp_pcb *newpcb, err_t) 

 

It is not well documented what one is meant to do in these callback function although I have scoured the web and plagarised heavily as in the attached code.

 

Secondly where do you write the code when it is meant to called by the ethernet interrupt. I placed my initial trial code in the lwIPHostTimerHandler as the code was jumping to there after the call to lwIPInit() however that is obviously not the spot to place it eventually if I am to achieve my aim.

 

Thirdly my current problem aside from these issues is that I can establish a connection to a client that a colleague wrote for me however I cannot seem to send anything.

 

Some help and guidance at this early stage would be much appreciated.

 

Regards,

Lee.




************************************************************************************
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer viruses.
************************************************************************************





************************************************************************************
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer viruses.
************************************************************************************


reply via email to

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