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

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?

UserRevisionLine numberNew contents of line
rebonatto 0:c64e1194230b 1 #include "TelnetServer.h"
rebonatto 0:c64e1194230b 2
rebonatto 0:c64e1194230b 3 char *header_msg_version = "Protegemed - version information:\r\n\r\n";
rebonatto 0:c64e1194230b 4 char *fwversion_msg = "FW Version: ";
rebonatto 0:c64e1194230b 5 char *builddate_msg = "\r\nBuild Date: ";
rebonatto 0:c64e1194230b 6 char *fwfile_msg = "\r\nFW Filename: ";
rebonatto 0:c64e1194230b 7 char *fwfile_not_available_msg = "Information not available";
rebonatto 0:c64e1194230b 8
rebonatto 0:c64e1194230b 9 #define VERSION_TEXT "2.0"
rebonatto 0:c64e1194230b 10 #define BUILD_TEXT __TIME__
rebonatto 0:c64e1194230b 11
rebonatto 0:c64e1194230b 12 int TelnetServer::VersionCommand(TCPSocketConnection *conn,char** argv,int argc)
rebonatto 0:c64e1194230b 13 {
rebonatto 0:c64e1194230b 14
rebonatto 0:c64e1194230b 15
rebonatto 0:c64e1194230b 16 conn->send(header_msg_version,strlen(header_msg_version));
rebonatto 0:c64e1194230b 17
rebonatto 0:c64e1194230b 18 conn->send(fwversion_msg,strlen(fwversion_msg));
rebonatto 0:c64e1194230b 19
rebonatto 0:c64e1194230b 20 conn->send(VERSION_TEXT,strlen(VERSION_TEXT));
rebonatto 0:c64e1194230b 21
rebonatto 0:c64e1194230b 22 conn->send(builddate_msg,strlen(builddate_msg));
rebonatto 0:c64e1194230b 23
rebonatto 0:c64e1194230b 24 conn->send(BUILD_TEXT,strlen(BUILD_TEXT));
rebonatto 0:c64e1194230b 25 //printf("Version\n");
rebonatto 0:c64e1194230b 26 conn->send(fwfile_msg,strlen(fwfile_msg));
rebonatto 0:c64e1194230b 27
rebonatto 0:c64e1194230b 28 FILE *f = fopen("/local/version.txt","r");
rebonatto 0:c64e1194230b 29 if(f != NULL)
rebonatto 0:c64e1194230b 30 {
rebonatto 0:c64e1194230b 31 char buf[20];
rebonatto 0:c64e1194230b 32 fread(buf,1,19,f);
rebonatto 0:c64e1194230b 33 buf[19]='\0';
rebonatto 0:c64e1194230b 34 conn->send(buf,strlen(buf));
rebonatto 0:c64e1194230b 35 fclose(f);
rebonatto 0:c64e1194230b 36 }
rebonatto 0:c64e1194230b 37 else
rebonatto 0:c64e1194230b 38 {
rebonatto 0:c64e1194230b 39 conn->send(fwfile_not_available_msg,strlen(fwfile_not_available_msg));
rebonatto 0:c64e1194230b 40 }
rebonatto 0:c64e1194230b 41
rebonatto 0:c64e1194230b 42 conn->send("\r\n\r\n",strlen("\r\n\r\n"));
rebonatto 0:c64e1194230b 43 return 0;
rebonatto 0:c64e1194230b 44 }