Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: oldheating gps motorhome heating
Diff: tcp/tcpsend.c
- Revision:
- 78:9d8fc88df405
- Parent:
- 75:603b10404183
- Child:
- 79:f50e02fb5c94
--- a/tcp/tcpsend.c Wed Oct 31 20:22:01 2018 +0000 +++ b/tcp/tcpsend.c Mon Nov 05 19:27:19 2018 +0000 @@ -170,8 +170,18 @@ } int TcpPollForPacketToSend(int* pSize, void* pPacket, int ipType, int* pRemArIndex) { - struct tcb* pTcb = TcbGetNext(); //This loops around the TCBs + //This loops around the TCBs + //struct tcb* pTcb = TcbGetOld(); + static struct tcb* pTcb = NULL; //Passing a pointer containing NULL to TcbGetNext causes it to return the first TCB + TcbGetNext(&pTcb); + + //Ignore empty TCBs + if (!pTcb->state) return DO_NOTHING; + + //Ignore TCBs of a different IP type if (pTcb->ipType != ipType) return DO_NOTHING; + + //Return the remote AR index *pRemArIndex = pTcb->remArIndex; //Check if have unacknowledged bytes longer than a time out