Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ESPTelnetStream private of Stream #45

Closed
hsaturn opened this issue Mar 12, 2023 · 3 comments · Fixed by #46
Closed

ESPTelnetStream private of Stream #45

hsaturn opened this issue Mar 12, 2023 · 3 comments · Fixed by #46
Assignees
Labels
enhancement New feature or request

Comments

@hsaturn
Copy link

hsaturn commented Mar 12, 2023

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

@LennartHennigs LennartHennigs self-assigned this Mar 12, 2023
@LennartHennigs LennartHennigs added the enhancement New feature or request label Mar 12, 2023
@LennartHennigs
Copy link
Owner

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

@hsaturn
Copy link
Author

hsaturn commented Mar 13, 2023

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

@LennartHennigs
Copy link
Owner

LennartHennigs commented Mar 13, 2023

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants