A stack which works with or without an Mbed os library. Provides IPv4 or IPv6 with a full 1500 byte buffer.
Dependents: oldheating gps motorhome heating
Diff: tcp/tcpsend.c
- Revision:
- 80:4ef1500fca1d
- Parent:
- 79:f50e02fb5c94
- Child:
- 82:20781198d26d
--- a/tcp/tcpsend.c Sun Nov 11 15:44:23 2018 +0000 +++ b/tcp/tcpsend.c Thu Nov 15 16:55:29 2018 +0000 @@ -181,7 +181,7 @@ return preparePacket(pPacket, pTcb, dataLength, pSize); } -int TcpPollForPacketToSend(int* pSize, void* pPacket, int ipType, int* pRemArIndex) +int TcpPollForPacketToSend(int* pSize, void* pPacket, int ipType, int* pRemArIndex, int* pLocIpScope) { //This loops around the TCBs, moving on if empty but staying if not the right type static struct tcb* pTcb = NULL; //Passing a pointer containing NULL to TcbGetNext causes it to return the first TCB @@ -203,6 +203,9 @@ return DO_NOTHING; } *pRemArIndex = pTcb->remArIndex; + + //Return the local IP scope + if (pLocIpScope) *pLocIpScope = pTcb->locIpScope; //Close old ones if (TcbElapsed > pTcb->timeLastRcvd + TIMEOUT_KEEP_ALIVE)