aboutsummaryrefslogtreecommitdiff
path: root/Projects/Webserver/Lib/TELNETServerApp.c
diff options
context:
space:
mode:
authorDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2010-03-10 12:48:20 +0000
committerDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2010-03-10 12:48:20 +0000
commit51e27aced8a4681ae22873360a8970ad1d60a249 (patch)
treecc807cb6af03604e0f019c181b96d31f39b08dcd /Projects/Webserver/Lib/TELNETServerApp.c
parentaa320b20c349f8c0888f47cc16c1b55862c93986 (diff)
Added ENABLE_TELNET_SERVER compile time option to the Webserver project to disable the TELNET server if desired.
Change over static strings in the Webserver project to use PROGMEM where possible. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1162 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'Projects/Webserver/Lib/TELNETServerApp.c')
-rw-r--r--Projects/Webserver/Lib/TELNETServerApp.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/Projects/Webserver/Lib/TELNETServerApp.c b/Projects/Webserver/Lib/TELNETServerApp.c
index d1f1d7f9..2855f8d7 100644
--- a/Projects/Webserver/Lib/TELNETServerApp.c
+++ b/Projects/Webserver/Lib/TELNETServerApp.c
@@ -28,6 +28,8 @@
this software.
*/
+#if defined(ENABLE_TELNET_SERVER) || defined(__DOXYGEN__)
+
/** \file
*
* TELNET Webserver Application. When connected to the uIP stack,
@@ -114,7 +116,7 @@ void TELNETServerApp_Callback(void)
TELNETServerApp_DisplayTCPConnections();
break;
default:
- strcpy(AppData, "Invalid Command.\r\n");
+ strcpy_P(AppData, PSTR("Invalid Command.\r\n"));
uip_send(AppData, strlen(AppData));
break;
}
@@ -144,14 +146,17 @@ static void TELNETServerApp_DisplayTCPConnections(void)
if (CurrConnection->tcpstateflags != UIP_CLOSED)
{
/* Add the current connection's details to the out buffer */
- ResponseLen += sprintf(&AppData[ResponseLen], "%u) %02d.%02d.%02d.%02d (Local %u, Remote %u)\r\n",
- ++ActiveConnCount, CurrConnection->ripaddr.u8[0],
- CurrConnection->ripaddr.u8[1],
- CurrConnection->ripaddr.u8[2],
- CurrConnection->ripaddr.u8[3],
- HTONS(CurrConnection->lport), HTONS(CurrConnection->rport));
+ ResponseLen += sprintf_P(&AppData[ResponseLen], PSTR("%u) %02d.%02d.%02d.%02d (Local %u, Remote %u)\r\n"),
+ ++ActiveConnCount,
+ CurrConnection->ripaddr.u8[0],
+ CurrConnection->ripaddr.u8[1],
+ CurrConnection->ripaddr.u8[2],
+ CurrConnection->ripaddr.u8[3],
+ HTONS(CurrConnection->lport), HTONS(CurrConnection->rport));
}
}
uip_send(AppData, ResponseLen);
-} \ No newline at end of file
+}
+
+#endif