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: ip4/udptcp4.c
- Revision:
- 86:55bc5ddac16c
- Parent:
- 80:4ef1500fca1d
- Child:
- 88:1ba13e6062a3
--- a/ip4/udptcp4.c Sat Nov 17 18:50:48 2018 +0000 +++ b/ip4/udptcp4.c Sun Nov 18 12:13:15 2018 +0000 @@ -12,7 +12,8 @@ #include "tcpsend.h" #include "tcphdr.h" #include "udp.h" -#include "ar4.h" +#include "ar4.h" +#include "led.h" static uint16_t calculateChecksum(uint8_t pro, uint32_t srcIp, uint32_t dstIp, int size, void* pPacket) { @@ -94,6 +95,7 @@ int Udp4HandleReceivedPacket(void (*traceback)(void), void* pPacketRx, int sizeRx, void* pPacketTx, int* pSizeTx, uint32_t* pSrcIp, uint32_t* pDstIp) { + Led3Set(true); pTraceBack = traceback; tracePacketProtocol = UDP; calculatedChecksum = calculateChecksum(UDP, *pSrcIp, *pDstIp, sizeRx, pPacketRx); @@ -103,7 +105,8 @@ *pDstIp = *pSrcIp; finalisePacket(UDP, action, pPacketTx, *pSizeTx, pSrcIp, pDstIp); //Note that the ports are reversed here - + + Led3Set(false); return action; } int Tcp4PollForPacketToSend(void* pPacket, int* pSize, uint32_t* pSrcIp, uint32_t* pDstIp)