Skip to content

Commit 8d091c4

Browse files
committed
Make the telnet example an Lua module (#3133)
Also update ftp server
1 parent f20591a commit 8d091c4

File tree

7 files changed

+247
-322
lines changed

7 files changed

+247
-322
lines changed

docs/lua-modules/telnet.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Telnet Module
2+
3+
| Since | Origin / Contributor | Maintainer | Source |
4+
| :----- | :-------------------- | :---------- | :------ |
5+
| 2018-05-24 | [Terry Ellison](https://github.com/TerryE) | [Terry Ellison](https://github.com/TerryE) | [telnet.lua](../../lua_modules/telnet/telnet.lua) |
6+
7+
The current version of this module exploits the stdin / stdout pipe functionality and
8+
task integration that is now build into the NodeNMCU Lua core.
9+
10+
There are two nice advantages of this core implementation:
11+
12+
- Errors are now written to stdout in a separate task execution.
13+
- The pipes pretty much eliminate UART and telnet overrun.
14+
15+
Both have the same interface if required into the variable `telnet`
16+
17+
## telnet:open()
18+
19+
Open a telnet server based on the provided parameters.
20+
21+
#### Syntax
22+
23+
`telnet:open(ssid, pwd, port)`
24+
25+
#### Parameters
26+
27+
`ssid` and `password`. Strings. SSID and Password for the Wifi network. If these are
28+
`nil` then the wifi is assumed to be configured or auto-configured.
29+
30+
`port`. Integer TCP listening port for the Telnet service. The default is 2323
31+
32+
#### Returns
33+
34+
Nothing returned (this is evaluated as `nil` in a scalar context).
35+
36+
## telnet:close()
37+
38+
Close a telnet server and release all resources. Also set the variable `telnet` to nil to fully reference and GC the resources.
39+
40+
#### Syntax
41+
42+
`telnet:close()`
43+
44+
#### Parameters
45+
46+
None
47+
48+
#### Returns
49+
50+
Nothing returned (this is evaluated as `nil` in a scalar context).

lua_examples/telnet/README.md

Lines changed: 0 additions & 56 deletions
This file was deleted.

lua_examples/telnet/telnet_fifosock.lua

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)