Fix Telnet welcome message refering to ESP3D-TFT

Add support of  #define DISABLE_TELNET_WELCOME_MESSAGE to disable welcome message
This commit is contained in:
Luc 2024-07-09 07:46:11 +08:00
parent 0bf8188570
commit 412aee442c
3 changed files with 9 additions and 3 deletions

View File

@ -169,6 +169,10 @@
*/
#define TELNET_FEATURE
/* Disable telnet welcome message
*/
#define DISABLE_TELNET_WELCOME_MESSAGE
/* Use Websocket server
* Enable websocket communications
*/

View File

@ -22,7 +22,7 @@
#define _VERSION_ESP3D_H
// version and sources location
#define FW_VERSION "3.0.0.a234"
#define FW_VERSION "3.0.0.a235"
#define REPOSITORY "https://github.com/luc-github/ESP3D/tree/3.0"
#endif //_VERSION_ESP3D_H

View File

@ -38,10 +38,10 @@ Telnet_Server telnet_server;
#if defined(AUTHENTICATION_FEATURE)
#define TELNET_WELCOME_MESSAGE \
";Welcome to ESP3D-TFT V" FW_VERSION \
";Welcome to ESP3D V" FW_VERSION \
", please enter a command with credentials.\r\n"
#else
#define TELNET_WELCOME_MESSAGE ";Welcome to ESP3D-TFT V" FW_VERSION ".\r\n"
#define TELNET_WELCOME_MESSAGE ";Welcome to ESP3D V" FW_VERSION ".\r\n"
#endif // AUTHENTICATION_FEATURE
void Telnet_Server::closeClient() {
@ -62,9 +62,11 @@ bool Telnet_Server::isConnected() {
_telnetClients.stop();
}
_telnetClients = _telnetserver->accept();
#ifndef DISABLE_TELNET_WELCOME_MESSAGE
// new client
writeBytes((uint8_t *)TELNET_WELCOME_MESSAGE,
strlen(TELNET_WELCOME_MESSAGE));
#endif // DISABLE_TELNET_WELCOME_MESSAGE
initAuthentication();
}
}