Versão sem FFT e aquisição por DMA. 256 amostras.

Dependencies:   EthernetInterface NTPClient mbed-rtos mbed

Codes/TelnetCommands/telnet_version.cpp

Committer:
rebonatto
Date:
2016-01-05
Revision:
0:e57bc370d339

File content as of revision 0:e57bc370d339:

#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;
}