Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Make the telnet example an Lua module #3133

Merged
merged 2 commits into from
Jun 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions docs/lua-modules/telnet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Telnet Module

| Since | Origin / Contributor | Maintainer | Source |
| :----- | :-------------------- | :---------- | :------ |
| 2018-05-24 | [Terry Ellison](https://github.com/TerryE) | [Terry Ellison](https://github.com/TerryE) | [telnet.lua](../../lua_modules/telnet/telnet.lua) |

The current version of this module exploits the stdin / stdout pipe functionality and
task integration that is now build into the NodeNMCU Lua core.

There are two nice advantages of this core implementation:

- Errors are now written to stdout in a separate task execution.
- The pipes pretty much eliminate UART and telnet overrun.

Both have the same interface if required into the variable `telnet`

## telnet:open()

Open a telnet server based on the provided parameters.

#### Syntax

`telnet:open(ssid, pwd, port)`

#### Parameters

`ssid` and `password`. Strings. SSID and Password for the Wifi network. If these are
`nil` then the wifi is assumed to be configured or auto-configured.

`port`. Integer TCP listening port for the Telnet service. The default is 2323

#### Returns

Nothing returned (this is evaluated as `nil` in a scalar context).

## telnet:close()

Close a telnet server and release all resources. Also set the variable `telnet` to nil to fully reference and GC the resources.

#### Syntax

`telnet:close()`

#### Parameters

None

#### Returns

Nothing returned (this is evaluated as `nil` in a scalar context).
56 changes: 0 additions & 56 deletions lua_examples/telnet/README.md

This file was deleted.

84 changes: 0 additions & 84 deletions lua_examples/telnet/telnet_fifosock.lua

This file was deleted.

Loading