Andrew Boyson / net

Dependents:   oldheating gps motorhome heating

Committer:
andrewboyson
Date:
Thu Dec 14 20:55:40 2017 +0000
Revision:
59:e0e556c8bd46
Parent:
43:bc028d5a6424
Added buffer length to help avoid over runs

Who changed what in which revision?

UserRevisionLine numberNew contents of line
andrewboyson 43:bc028d5a6424 1 #include "mbed.h"
andrewboyson 43:bc028d5a6424 2 #include "log.h"
andrewboyson 43:bc028d5a6424 3 #include "net.h"
andrewboyson 43:bc028d5a6424 4 #include "action.h"
andrewboyson 43:bc028d5a6424 5
andrewboyson 43:bc028d5a6424 6 bool Echo6Trace = false;
andrewboyson 43:bc028d5a6424 7
andrewboyson 59:e0e556c8bd46 8 int Echo6HandleRequest(void (*traceback)(void), uint8_t* pType, uint8_t* pCode, char* payloadRx, int sizeRx, char* payloadTx, int* pSizeTx)
andrewboyson 43:bc028d5a6424 9 {
andrewboyson 43:bc028d5a6424 10 if (Echo6Trace)
andrewboyson 43:bc028d5a6424 11 {
andrewboyson 43:bc028d5a6424 12 if (NetTraceNewLine) Log("\r\n");
andrewboyson 43:bc028d5a6424 13 LogTime("Echo6\r\n");
andrewboyson 43:bc028d5a6424 14 if (NetTraceStack) traceback();
andrewboyson 43:bc028d5a6424 15 }
andrewboyson 43:bc028d5a6424 16 *pType = 129;
andrewboyson 43:bc028d5a6424 17 *pCode = 0;
andrewboyson 59:e0e556c8bd46 18 *pSizeTx = sizeRx;
andrewboyson 59:e0e556c8bd46 19 memcpy(payloadTx, payloadRx, *pSizeTx);
andrewboyson 43:bc028d5a6424 20 return ActionMakeFromDestAndTrace(UNICAST, Echo6Trace && NetTraceStack);
andrewboyson 43:bc028d5a6424 21 }