![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
protegemed, aquisição via A/D simples utilizando interrupção do timer
Dependencies: EthernetInterface NTPClient mbed-rtos mbed
Fork of ptgm_semDMA by
Diff: Codes/TelnetCommands/telnet_version.cpp
- Revision:
- 0:fac116e94d44
diff -r 000000000000 -r fac116e94d44 Codes/TelnetCommands/telnet_version.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Codes/TelnetCommands/telnet_version.cpp Tue Jan 05 11:47:35 2016 +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