![](/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_version.cpp
- Revision:
- 0:c64e1194230b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Codes/TelnetCommands/telnet_version.cpp Wed Jul 09 21:16:23 2014 +0000 @@ -0,0 +1,44 @@ +#include "TelnetServer.h" + +char *header_msg_version = "Protegemed - version information:\r\n\r\n"; +char *fwversion_msg = "FW Version: "; +char *builddate_msg = "\r\nBuild Date: "; +char *fwfile_msg = "\r\nFW Filename: "; +char *fwfile_not_available_msg = "Information not available"; + +#define VERSION_TEXT "2.0" +#define BUILD_TEXT __TIME__ + +int TelnetServer::VersionCommand(TCPSocketConnection *conn,char** argv,int argc) +{ + + + conn->send(header_msg_version,strlen(header_msg_version)); + + conn->send(fwversion_msg,strlen(fwversion_msg)); + + conn->send(VERSION_TEXT,strlen(VERSION_TEXT)); + + conn->send(builddate_msg,strlen(builddate_msg)); + + conn->send(BUILD_TEXT,strlen(BUILD_TEXT)); + //printf("Version\n"); + conn->send(fwfile_msg,strlen(fwfile_msg)); + + FILE *f = fopen("/local/version.txt","r"); + if(f != NULL) + { + char buf[20]; + fread(buf,1,19,f); + buf[19]='\0'; + conn->send(buf,strlen(buf)); + fclose(f); + } + else + { + conn->send(fwfile_not_available_msg,strlen(fwfile_not_available_msg)); + } + + conn->send("\r\n\r\n",strlen("\r\n\r\n")); + return 0; +} \ No newline at end of file