![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Versão do protegemed que calcula o tempo em ms da fuga, calcula o numero de onverflow (valores muito baixo) e underflow (valores muito altos). Além disso, calcula um valor médio a partir dos valores capturados e não apenas pela fft.
Dependencies: EthernetInterface mbed-rtos mbed
Diff: Codes/TelnetCommands/telnet_remove.cpp
- Revision:
- 0:c64e1194230b
diff -r 000000000000 -r c64e1194230b Codes/TelnetCommands/telnet_remove.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Codes/TelnetCommands/telnet_remove.cpp Wed Jul 09 21:16:23 2014 +0000 @@ -0,0 +1,36 @@ +#include "TelnetServer.h" + +char *header_msg_remove = "File removed successfully\r\n\r\n"; +char *wrong_args_msg_remove = "Wrong number of arguments.\r\n\r\nUsage: remove <filename>\r\n"; +char *file_not_found_msg_remove = "File not found.\r\n\r\n"; + +extern LocalFileSystem local; + +int TelnetServer::RemoveCommand(TCPSocketConnection *conn,char** argv,int argc) +{ + + if(argc != 2) + { + conn->send(wrong_args_msg_remove,strlen(wrong_args_msg_remove)); + return 0; + } + + char fullpath[256]; + strcpy(fullpath,"/local/"); + strcat(fullpath,argv[1]); + printf("File = %s\n",fullpath); + FILE* f = fopen(fullpath,"r"); + if(f == NULL) + { + conn->send(file_not_found_msg_remove,strlen(file_not_found_msg_remove)); + return 0; + } + + fclose(f); + + local.remove(argv[1]); + + conn->send(header_msg_remove,strlen(header_msg_remove)); + + return 0; +} \ No newline at end of file