OK, so let me ask this in an different way: Currently I do have data to be sent available in main loop only. How can I enqueue these data into the lwIP-ISR-context correctly so that it can be transmitted without problems?
Currently I'm doing it as described at http://lwip.wikia.com/wiki/Raw/TCPin section "Sending TCP data" which seems to be wrong for my case... 2014-09-16 17:20 GMT+02:00 Bill Auerbach <[email protected]>: > Yeah, I should have kept reading. Sorry > > > > *From:* [email protected] [mailto: > [email protected]] *On Behalf Of *Simon > Goldschmidt > *Sent:* Tuesday, September 16, 2014 9:51 AM > *To:* Mailing list for lwIP users > *Subject:* Re: [lwip-users] How to check send state? > > > > Bill, I appreciate you trying to teach programming basics, but I think > this won't get Karl Karpfen further: sending from main-loop and receiving > in interrupt just won't work with lwIP. > > > > Simon > > > > *Gesendet:* Dienstag, 16. September 2014 um 15:43 Uhr > *Von:* "Bill Auerbach" <[email protected]> > *An:* "'Mailing list for lwIP users'" <[email protected]> > *Betreff:* Re: [lwip-users] How to check send state? > > Hi, > > > > Did you declare sentLength as volatile? You might also need to protect it > if it’s not loaded/stored in a single processor instruction (not likely to > be the case with a 32-bit architecture). > > > > Bill > > > > *From:* [email protected] [ > mailto:[email protected] > <[email protected]>] *On Behalf Of *Karl > Karpfen > *Sent:* Monday, September 15, 2014 3:00 PM > *To:* [email protected] > *Subject:* [lwip-users] How to check send state? > > > > Hi, > > within my lwIP application (TCP with permanent connection) I'm sending > some data out of main-loop (no interrupt context) and start submission by > calling > > tcp_output(currentPcb); > > Sending of data is done via tcp_write(). Within the send function itself > amount of data already sent is stored in a variable sentLength. Now to find > out if it is possible to send next bunch of data I check this variable. > When its size is equal to the length of the previous data buffer, sending > was completed and I start submission of next buffer. > > > > My problem here: sentLength is manipulated out of interrupt context while > checking it for completion is done out of main loop. It seems this > sometimes causes troubles, at receiver side I can see incomplete frames. > > So my question: what is the correct way to find out if currentPcb has > finished sending (or better has pushed all data to tcp_write()) and is > ready to accept next bunch of data? > > Thanks! > > _______________________________________________ lwip-users mailing list > [email protected] https://lists.nongnu.org/mailman/listinfo/lwip-users > > _______________________________________________ > lwip-users mailing list > [email protected] > https://lists.nongnu.org/mailman/listinfo/lwip-users >
_______________________________________________ lwip-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/lwip-users
