Closed Katheesh closed 2 years ago
Please post the code you used.
void setupTelnet() {
telnet.onConnect(onTelnetConnect);
telnet.onConnectionAttempt(onTelnetConnectionAttempt);
telnet.onReconnect(onTelnetReconnect);
telnet.onDisconnect(onTelnetDisconnect);
telnet.onInputReceived([](String str) {
if(!IS_LOGGED_IN){
if(TELNET_PSWD == str){
IS_LOGGED_IN = true;
telnet.print("DasKlug:> ");
return;
}
telnet.print("Invalid Password. Try again...");
telnet.print("Enter password to access telnet : ");
return;
}
if(str == "" || str == " "){
telnet.print("DasKlug:> ");
return;
}
toCommand(1, str);
});
if (!telnet.begin(TELNET_PORT)) {
Serial.println("Unable to start telnet...");
}
}
void onTelnetConnect(String ip) {
Serial.print("SMARTOMATION TELNET");
Serial.print(ip);
Serial.println(" connected");
if(IS_LOGGED_IN){
telnet.println("(Use Ctrl + ] to quit)");
telnet.println("\nWelcome " + telnet.getIP());
telnet.println();
telnet.print("DasKlug:> ");
return;
}
if(!IS_LOGGED_IN){
telnet.println("(Use Ctrl + ] to quit)");
telnet.print("Enter password to access telnet : ");
return;
}
}
Hey, I briefly looked into this and you want to look into ANSI escape sequences.
I have that on my list for telnet but didn't have the time yet.
Thanks, man...
Please help me to find the correct function to ask for hidden input. please reply as soon as possible. Thanks.