The remote console NervesHub attaches to.
nerves_hub_link on Nerves answers the console channel with a real IEx
session over ExTTY, so an operator gets the language. AtomVM has no shell and
no ExTTY, so this is a debug terminal instead: a fixed set of commands that
answer the questions a console is usually opened to answer.
That difference is worth being plain about. This will not evaluate Erlang, and it is not a way in to a running system — it reports, and it reboots.
NervesHub drives it over the console topic:
dn %{"data" => Keystrokes} server -> device
window_size %{"height" =>, "width" =>} server -> device
restart server -> device
up %{"data" => Output} device -> server
Keystrokes arrive as they are typed, so this echoes them back: nothing else
is going to, and a terminal that shows nothing while you type reads as
broken. restart clears the session the way it restarts IEx on Nerves —
it does not restart the device, which is what reboot is for.
file-data/* exists to push a file onto a device
with a filesystem to put it in, and this one has partitions.
state() = #{line := binary(), mode := input | escape | escape_bracket}
| banner/0 | What to send when someone first attaches. |
| commands/0 | The commands and what each is for. |
| handle_input/2 | Feed keystrokes in, get terminal output back. |
| new/0 | A console session with nothing typed. |
| parse/1 | Split a line into a command and its arguments. |
| prompt/0 | |
| restart/1 | Reset the session, as restart does to IEx on Nerves. |
banner() -> binary()
What to send when someone first attaches.
A console that says nothing until you type looks like one that is not working, and the commands here are not guessable.commands() -> [{binary(), binary()}]
The commands and what each is for.
Feed keystrokes in, get terminal output back.
Returns everything to send in oneup, so a line that runs a command echoes
the newline, the output and the next prompt together.
new() -> state()
A console session with nothing typed.
parse(Line::binary()) -> {binary(), [binary()]} | empty
Split a line into a command and its arguments.
prompt() -> binary()
Reset the session, as restart does to IEx on Nerves.
Generated by EDoc