Versão sem FFT e aquisição por DMA. 256 amostras.

Dependencies:   EthernetInterface NTPClient mbed-rtos mbed

Committer:
rebonatto
Date:
Tue Jan 05 11:45:44 2016 +0000
Revision:
0:e57bc370d339
Vers?o est?vel sem calculo de FFT. Aquisi??o por DMA. Usa 256 amostras.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rebonatto 0:e57bc370d339 1 #include "TelnetServer.h"
rebonatto 0:e57bc370d339 2
rebonatto 0:e57bc370d339 3 char *header_msg_remove = "File removed successfully\r\n\r\n";
rebonatto 0:e57bc370d339 4 char *wrong_args_msg_remove = "Wrong number of arguments.\r\n\r\nUsage: remove <filename>\r\n";
rebonatto 0:e57bc370d339 5 char *file_not_found_msg_remove = "File not found.\r\n\r\n";
rebonatto 0:e57bc370d339 6
rebonatto 0:e57bc370d339 7 extern LocalFileSystem local;
rebonatto 0:e57bc370d339 8
rebonatto 0:e57bc370d339 9 int TelnetServer::RemoveCommand(TCPSocketConnection *conn,char** argv,int argc)
rebonatto 0:e57bc370d339 10 {
rebonatto 0:e57bc370d339 11
rebonatto 0:e57bc370d339 12 if(argc != 2)
rebonatto 0:e57bc370d339 13 {
rebonatto 0:e57bc370d339 14 conn->send(wrong_args_msg_remove,strlen(wrong_args_msg_remove));
rebonatto 0:e57bc370d339 15 return 0;
rebonatto 0:e57bc370d339 16 }
rebonatto 0:e57bc370d339 17
rebonatto 0:e57bc370d339 18 char fullpath[256];
rebonatto 0:e57bc370d339 19 strcpy(fullpath,"/local/");
rebonatto 0:e57bc370d339 20 strcat(fullpath,argv[1]);
rebonatto 0:e57bc370d339 21 printf("File = %s\n",fullpath);
rebonatto 0:e57bc370d339 22 FILE* f = fopen(fullpath,"r");
rebonatto 0:e57bc370d339 23 if(f == NULL)
rebonatto 0:e57bc370d339 24 {
rebonatto 0:e57bc370d339 25 conn->send(file_not_found_msg_remove,strlen(file_not_found_msg_remove));
rebonatto 0:e57bc370d339 26 return 0;
rebonatto 0:e57bc370d339 27 }
rebonatto 0:e57bc370d339 28
rebonatto 0:e57bc370d339 29 fclose(f);
rebonatto 0:e57bc370d339 30
rebonatto 0:e57bc370d339 31 local.remove(argv[1]);
rebonatto 0:e57bc370d339 32
rebonatto 0:e57bc370d339 33 conn->send(header_msg_remove,strlen(header_msg_remove));
rebonatto 0:e57bc370d339 34
rebonatto 0:e57bc370d339 35 return 0;
rebonatto 0:e57bc370d339 36 }