LennartHennigs / ESPTelnet

ESP library that allows you to setup a telnet server for debugging.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ESPTelnetStream private of Stream

hsaturn opened this issue · comments

Hello

ESPTelnetStream inherits privately from Stream.

I don't find any reason for this.

Is it possible to replace the inheritance with:

 class ESPTelnetStream : public ESPTelnetBase, public Stream 
                                               ^^^^^^

(note: tried on clone master from github since the 2.1.0 is not yeat deployed)


The reason for this is that I want to use

ESPTelnetStream telnet;
...
TinyConsole.begin(telnet)

in order to benefit the power of TinyConsole with a telnet connection instead of a Serial connection.
After making ESPTelnetStream public Stream, this works pretty well, except that I have to force TinyConsole to use escape sequences and this is a little slow (probably related to TinyConsole.

The TinyConsole example works very well (drawing a colored spiral on the telnet terminal) with very few changes.

Best regards

Hey, @hsaturn,
created a branch for this.
Does it work for you?

Works perfectly on this branch:

$ git status
On branch 45-esptelnetstream-private-of-stream
Your branch is up to date with 'origin/45-esptelnetstream-private-of-stream'.

nothing to commit, working tree clean

As you see the COM4 TinyConsole switched to telnet smoothly when onTelnetConnected message was sent by your lib!
Great !
The message "You are not using a real terminal" made TinyConsole to switch in basic mode (no ansi escapes). I had to force TinyConsole that telnet is a ansi term. This is probably because my telnet client does not sends what TinyConsole expects, and is not related to ESPTelnet (probably to TinyConsole).

image

image

ok, cool @hsaturn.
happy to hear.
merged the branch now and will release it as 2.1.1