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

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers echo6.c Source File

echo6.c

00001 #include  <stdint.h>
00002 #include <stdbool.h>
00003 #include <string.h>
00004 
00005 #include    "log.h"
00006 #include    "net.h"
00007 #include "action.h"
00008 
00009 bool Echo6Trace = false;
00010 
00011 int Echo6HandleRequest(void (*traceback)(void), uint8_t* pType, uint8_t* pCode, char* payloadRx, int sizeRx, char* payloadTx, int* pSizeTx)
00012 {
00013     if (Echo6Trace)
00014     {
00015         if (NetTraceNewLine) Log("\r\n");
00016         LogTime("Echo6\r\n");
00017         if (NetTraceStack) traceback();
00018     }
00019     *pType = 129;
00020     *pCode = 0;
00021     *pSizeTx = sizeRx;
00022     memcpy(payloadTx, payloadRx, *pSizeTx);
00023     return ActionMakeFromDestAndTrace(UNICAST, Echo6Trace && NetTraceStack);
00024 }