projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move DHCP negotiation timer into the DHCP connection application state structure...
[pub/USBasp.git]
/
Projects
/
Webserver
/
Lib
/
TELNETServerApp.c
diff --git
a/Projects/Webserver/Lib/TELNETServerApp.c
b/Projects/Webserver/Lib/TELNETServerApp.c
index
cabf527
..
7d8c907
100644
(file)
--- a/
Projects/Webserver/Lib/TELNETServerApp.c
+++ b/
Projects/Webserver/Lib/TELNETServerApp.c
@@
-38,15
+38,15
@@
#include "TELNETServerApp.h"
\r
\r
/** Welcome message to send to a TELNET client when a connection is first made. */
\r
#include "TELNETServerApp.h"
\r
\r
/** Welcome message to send to a TELNET client when a connection is first made. */
\r
-char PROGMEM WelcomeHeader[] = "********************************************\r\n"
\r
- "* LUFA uIP Webserver (TELNET) *\r\n"
\r
- "********************************************\r\n";
\r
+c
onst c
har PROGMEM WelcomeHeader[] = "********************************************\r\n"
\r
+
"* LUFA uIP Webserver (TELNET) *\r\n"
\r
+
"********************************************\r\n";
\r
\r
/** Main TELNET menu, giving the user the list of available commands they may issue */
\r
\r
/** Main TELNET menu, giving the user the list of available commands they may issue */
\r
-char PROGMEM TELNETMenu[] = "\r\n"
\r
- " Available Commands:\r\n"
\r
- " c) List Active TCP Connections\r\n"
\r
- "\r\nCommand>";
\r
+c
onst c
har PROGMEM TELNETMenu[] = "\r\n"
\r
+
" Available Commands:\r\n"
\r
+
" c) List Active TCP Connections\r\n"
\r
+
"\r\nCommand>";
\r
\r
/** Initialization function for the simple HTTP webserver. */
\r
void TELNETServerApp_Init(void)
\r
\r
/** Initialization function for the simple HTTP webserver. */
\r
void TELNETServerApp_Init(void)
\r
@@
-79,15
+79,15
@@
void TELNETServerApp_Callback(void)
{
\r
case TELNET_STATE_SendHeader:
\r
/* Copy over and send the TELNET welcome message upon first connection */
\r
{
\r
case TELNET_STATE_SendHeader:
\r
/* Copy over and send the TELNET welcome message upon first connection */
\r
- str
ncpy_P(AppData, WelcomeHeader, strlen_P(WelcomeHeader)
);
\r
- uip_send(AppData, strlen
_P(WelcomeHeader
));
\r
+ str
cpy_P(AppData, WelcomeHeader
);
\r
+ uip_send(AppData, strlen
(AppData
));
\r
\r
AppState->TELNETServer.NextState = TELNET_STATE_SendMenu;
\r
break;
\r
case TELNET_STATE_SendMenu:
\r
/* Copy over and send the TELNET menu to the client */
\r
\r
AppState->TELNETServer.NextState = TELNET_STATE_SendMenu;
\r
break;
\r
case TELNET_STATE_SendMenu:
\r
/* Copy over and send the TELNET menu to the client */
\r
- str
ncpy_P(AppData, TELNETMenu, strlen_P(TELNETMenu)
);
\r
- uip_send(AppData, strlen
_P(TELNETMenu
));
\r
+ str
cpy_P(AppData, TELNETMenu
);
\r
+ uip_send(AppData, strlen
(AppData
));
\r
\r
AppState->TELNETServer.NextState = TELNET_STATE_GetCommand;
\r
break;
\r
\r
AppState->TELNETServer.NextState = TELNET_STATE_GetCommand;
\r
break;
\r
@@
-106,7
+106,11
@@
void TELNETServerApp_Callback(void)
{
\r
case 'c':
\r
TELNETServerApp_DisplayTCPConnections();
\r
{
\r
case 'c':
\r
TELNETServerApp_DisplayTCPConnections();
\r
- break;
\r
+ break;
\r
+ default:
\r
+ strcpy(AppData, "Invalid Command.\r\n");
\r
+ uip_send(AppData, strlen(AppData));
\r
+ break;
\r
}
\r
\r
AppState->TELNETServer.NextState = TELNET_STATE_SendMenu;
\r
}
\r
\r
AppState->TELNETServer.NextState = TELNET_STATE_SendMenu;
\r