Server on telnet port (23) now works with Linux client
A mini pandemic project: I sat down and figured out what was required to have the modem code work with the the telnet options that the Linux telnet client sent. It was always one of those "one day" things, and today turned out to be the day.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,3 +6,4 @@ kicad/*bak
|
|||||||
kicad/*.svg
|
kicad/*.svg
|
||||||
kicad/RetroWiFiModem_rotated.kicad_pcb
|
kicad/RetroWiFiModem_rotated.kicad_pcb
|
||||||
telnet.txt
|
telnet.txt
|
||||||
|
RetroWiFiModem/*.gch
|
||||||
|
|||||||
@@ -47,8 +47,10 @@
|
|||||||
#define TTYPE ((uint8_t)24)
|
#define TTYPE ((uint8_t)24)
|
||||||
#define NAWS ((uint8_t)31)
|
#define NAWS ((uint8_t)31)
|
||||||
#define TSPEED ((uint8_t)32)
|
#define TSPEED ((uint8_t)32)
|
||||||
|
#define LFLOW ((uint8_t)33)
|
||||||
#define LINEMODE ((uint8_t)34)
|
#define LINEMODE ((uint8_t)34)
|
||||||
#define XLOC ((uint8_t)35)
|
#define XDISPLOC ((uint8_t)35)
|
||||||
|
#define NEW_ENVIRON ((uint8_t)39)
|
||||||
#define BINARY ((uint8_t)0)
|
#define BINARY ((uint8_t)0)
|
||||||
#define ECHO ((uint8_t)1)
|
#define ECHO ((uint8_t)1)
|
||||||
#define SUP_GA ((uint8_t)3)
|
#define SUP_GA ((uint8_t)3)
|
||||||
|
|||||||
@@ -173,9 +173,20 @@ int receiveTcpData() {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WILL:
|
case WILL:
|
||||||
// Server wants to do any option, allow it
|
// Server wants to do option, allow most
|
||||||
bytesOut += tcpClient.write(IAC);
|
bytesOut += tcpClient.write(IAC);
|
||||||
bytesOut += tcpClient.write(DO);
|
switch( cmdByte2 ) {
|
||||||
|
case LINEMODE:
|
||||||
|
case NAWS:
|
||||||
|
case LFLOW:
|
||||||
|
case NEW_ENVIRON:
|
||||||
|
case XDISPLOC:
|
||||||
|
bytesOut += tcpClient.write(DONT);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
bytesOut += tcpClient.write(DO);
|
||||||
|
break;
|
||||||
|
}
|
||||||
bytesOut += tcpClient.write(cmdByte2);
|
bytesOut += tcpClient.write(cmdByte2);
|
||||||
break;
|
break;
|
||||||
case SB:
|
case SB:
|
||||||
@@ -306,7 +317,7 @@ void sendResult(int resultCode) {
|
|||||||
} else if( resultCode == R_ERROR ) {
|
} else if( resultCode == R_ERROR ) {
|
||||||
lastCmd[0] = NUL;
|
lastCmd[0] = NUL;
|
||||||
memset(atCmd, 0, sizeof atCmd);
|
memset(atCmd, 0, sizeof atCmd);
|
||||||
}
|
}
|
||||||
if( resultCode == R_NO_CARRIER || resultCode == R_NO_ANSWER ) {
|
if( resultCode == R_NO_CARRIER || resultCode == R_NO_ANSWER ) {
|
||||||
sessionTelnetType = settings.telnet;
|
sessionTelnetType = settings.telnet;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user