nodemcu-firmware/lua_examples/telnet/README.md

57 lines
1.8 KiB
Markdown
Raw Normal View History

2018-07-02 00:27:16 +02:00
# Telnet Module
| Since | Origin / Contributor | Maintainer | Source |
| :----- | :-------------------- | :---------- | :------ |
| 2014-12-22 | [Zeroday](https://github.com/funshine) | [Terry Ellison](https://github.com/TerryE) | [simple_telnet.lua](./simple_telnet.lua) |
| 2018-05-24 | [Terry Ellison](https://github.com/TerryE) | [Terry Ellison](https://github.com/TerryE) | [telnet.lua](./telnet.lua) |
2019-07-19 04:53:53 +02:00
This README discusses the packet marshalling versions of telnet. The first (fifosock)
version was written for SDK 2 implementations, with all of the marshalling imlemented
in Lua; the second (pipe) version uses the latest features added to the SDK 3 version
that have been added to prepare for the `lua53` implementation. These exploit 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 spearate task execution.
- The pipes pretty much eliminate uart and telnet overrun.
Both have the same interface if required into the variable `telnet`
2018-07-02 00:27:16 +02:00
## telnet:open()
Open a telnet server based on the provided parameters.
#### Syntax
`telnet:open(ssid, pwd, port)`
#### Parameters
2019-02-17 19:26:29 +01:00
`ssid` and `password`. Strings. SSID and Password for the Wifi network. If these are
2018-07-02 00:27:16 +02:00
`nil` then the wifi is assumed to be configured or autoconfigured.
`port`. Integer TCP listenting port for the Telnet service. The default is 2323
2019-02-17 19:26:29 +01:00
2018-07-02 00:27:16 +02:00
#### Returns
Nothing returned (this is evaluted as `nil` in a scalar context).
## telnet:close()
2019-07-19 04:53:53 +02:00
Close a telnet server and release all resources. Also set the variable `telnet` to nil to fully reference and GC the resources.
2018-07-02 00:27:16 +02:00
#### Syntax
`telnet:close()`
#### Parameters
None
#### Returns
Nothing returned (this is evaluted as `nil` in a scalar context).