Versão estável sem DMA e FFT. 128 amostras.
Dependencies: EthernetInterface NTPClient mbed-rtos mbed
Diff: Headers/tftpsrv.h
- Revision:
- 0:fac116e94d44
diff -r 000000000000 -r fac116e94d44 Headers/tftpsrv.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Headers/tftpsrv.h Tue Jan 05 11:47:35 2016 +0000 @@ -0,0 +1,47 @@ +#include "mbed.h" +#include "rtos.h" + +#include "EthernetInterface.h" + + + static UDPSocket server; + static Endpoint client; + + static int estado; + + static int blockcnt, dupcnt; // block counter, and DUP counter + static FILE* fp; // current file to read or write + static char sendbuff[516]; // current DATA block; + static int blocksize; // last DATA block size while sending + static char filename[256]; // current (or most recent) filename + +class tftpsrv +{ + +#define ESCUTANDO 0 +#define LENDO 1 +#define ESCREVENDO 2 +#define ERRO 3 + +protected: + + static void tftpInicia(); + static void tftpPara(); + static void tftpReinicia(); + static void tftpAck(int val); + static void tftpErr(char* msg); + static int tftpModo(char* buff); + static void tftpGetBlock(); + static void tftpSendBlock(); + static void tftpLer(char* buff); + static void tftpEscrever(char* buff); + static void tftpEscutando(char* buff); + static void tftpLendo(char *buff); + static void tftpEscrevendo(int tam, char *buff); + static void tftpVai(); + +public: + + static void tftpsrv_Thread(void const* arg); + +};