Marcelo Rebonatto / Mbed 2 deprecated PMED_Tempo

Dependencies:   EthernetInterface mbed-rtos mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers telnet_listparam.cpp Source File

telnet_listparam.cpp

00001 #include "TelnetServer.h"
00002 #define NUMBERPARAM 3
00003 
00004 char *msg_list_param[NUMBERPARAM] = { "bla", 
00005                                       "bla2", 
00006                                       "Bla23" };
00007 
00008 char *header_msg_listparam = "This is a list of available parameters:\r\n\r\n";
00009 
00010 
00011 int TelnetServer::ListParamCommand(TCPSocketConnection *conn, char ** argv,int argc)
00012 {
00013     printf("Entering list parameters command...\n");
00014     
00015     conn->send(header_msg_listparam,strlen(header_msg_listparam));
00016     
00017     int i;
00018     for(i=0;i < NUMBERPARAM ;i++)
00019     {
00020         
00021         Thread::wait(20);
00022         conn->send(msg_list_param[i],strlen(msg_list_param[i]));
00023         
00024         //printf("Parameter = %s\n",msg_list_param[i]);        
00025         conn->send("\r\n",2);
00026     }
00027 
00028     return 0;
00029 }