![](/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
Codes/TelnetCommands/telnet_remove.cpp@2:86c3cb25577b, 2014-07-21 (annotated)
- Committer:
- rebonatto
- Date:
- Mon Jul 21 00:58:34 2014 +0000
- Revision:
- 2:86c3cb25577b
- Parent:
- 0:c64e1194230b
Problemas com objeto para aquisi??o da rfid (serial)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rebonatto | 0:c64e1194230b | 1 | #include "TelnetServer.h" |
rebonatto | 0:c64e1194230b | 2 | |
rebonatto | 0:c64e1194230b | 3 | char *header_msg_remove = "File removed successfully\r\n\r\n"; |
rebonatto | 0:c64e1194230b | 4 | char *wrong_args_msg_remove = "Wrong number of arguments.\r\n\r\nUsage: remove <filename>\r\n"; |
rebonatto | 0:c64e1194230b | 5 | char *file_not_found_msg_remove = "File not found.\r\n\r\n"; |
rebonatto | 0:c64e1194230b | 6 | |
rebonatto | 0:c64e1194230b | 7 | extern LocalFileSystem local; |
rebonatto | 0:c64e1194230b | 8 | |
rebonatto | 0:c64e1194230b | 9 | int TelnetServer::RemoveCommand(TCPSocketConnection *conn,char** argv,int argc) |
rebonatto | 0:c64e1194230b | 10 | { |
rebonatto | 0:c64e1194230b | 11 | |
rebonatto | 0:c64e1194230b | 12 | if(argc != 2) |
rebonatto | 0:c64e1194230b | 13 | { |
rebonatto | 0:c64e1194230b | 14 | conn->send(wrong_args_msg_remove,strlen(wrong_args_msg_remove)); |
rebonatto | 0:c64e1194230b | 15 | return 0; |
rebonatto | 0:c64e1194230b | 16 | } |
rebonatto | 0:c64e1194230b | 17 | |
rebonatto | 0:c64e1194230b | 18 | char fullpath[256]; |
rebonatto | 0:c64e1194230b | 19 | strcpy(fullpath,"/local/"); |
rebonatto | 0:c64e1194230b | 20 | strcat(fullpath,argv[1]); |
rebonatto | 0:c64e1194230b | 21 | printf("File = %s\n",fullpath); |
rebonatto | 0:c64e1194230b | 22 | FILE* f = fopen(fullpath,"r"); |
rebonatto | 0:c64e1194230b | 23 | if(f == NULL) |
rebonatto | 0:c64e1194230b | 24 | { |
rebonatto | 0:c64e1194230b | 25 | conn->send(file_not_found_msg_remove,strlen(file_not_found_msg_remove)); |
rebonatto | 0:c64e1194230b | 26 | return 0; |
rebonatto | 0:c64e1194230b | 27 | } |
rebonatto | 0:c64e1194230b | 28 | |
rebonatto | 0:c64e1194230b | 29 | fclose(f); |
rebonatto | 0:c64e1194230b | 30 | |
rebonatto | 0:c64e1194230b | 31 | local.remove(argv[1]); |
rebonatto | 0:c64e1194230b | 32 | |
rebonatto | 0:c64e1194230b | 33 | conn->send(header_msg_remove,strlen(header_msg_remove)); |
rebonatto | 0:c64e1194230b | 34 | |
rebonatto | 0:c64e1194230b | 35 | return 0; |
rebonatto | 0:c64e1194230b | 36 | } |