diff options
author | Dean Camera <[email protected]> | 2010-03-10 12:48:20 +0000 |
---|---|---|
committer | Dean Camera <[email protected]> | 2010-03-10 12:48:20 +0000 |
commit | aca7863350509a1f390eda93ac0150378d8cd16c (patch) | |
tree | cc807cb6af03604e0f019c181b96d31f39b08dcd /Projects/Webserver/Lib/TELNETServerApp.c | |
parent | 92418433a505cdf1db0162cea2bdb22a99014ebb (diff) | |
download | qmk_firmware-aca7863350509a1f390eda93ac0150378d8cd16c.tar.gz qmk_firmware-aca7863350509a1f390eda93ac0150378d8cd16c.zip |
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.
Diffstat (limited to 'Projects/Webserver/Lib/TELNETServerApp.c')
-rw-r--r-- | Projects/Webserver/Lib/TELNETServerApp.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/Projects/Webserver/Lib/TELNETServerApp.c b/Projects/Webserver/Lib/TELNETServerApp.c index d1f1d7f971..2855f8d763 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
|