-
Notifications
You must be signed in to change notification settings - Fork 0
/
TODO
91 lines (61 loc) · 3.38 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
* Support for interaction using simple autoresponse strings
Add support for simple autoresponse strings in the configuration file. For
example:
autoresponse = expect:'localhost login: ', send:'root\n',
expect:'Password: ', send:'abcd1234\n'
When expect line is matched tio will respond by writing the send string.
When parsing the autoresponse variable make sure matching expect/send pairs
else provide warning.
Maybe support regex matching in expect string to make feature more powerful.
This is mostly a convenience feature. For more powerful scripted interaction
users can continue use the socket feature in combination with the expect tool
as described in the man page.
Maybe provide a mechanism to disable autoresponse feature. Maybe by defining
maximum match count and/or in session key command to toggle feature.
* Support for running external command
Add key command e.g. 'ctrl-t r' which prompts user to run external command.
The command will be run in a process which stdin/stdout is redirected to the
serial port.
This is the first step towards maybe also adding automatic support for
x/y/zmodem data transfer protocols by calling external programs such as
rb/sb, rx/sx, rz/sz, etc.
* Allow tio to connect to socket
After some more consideration I think it makes sense to support connecting to a
socket as that will make tio be able to both serve a serial port via a socket
and connect to it - it will be an end to end solution. In short we will be able
to do the following:
Host serial port on socket (existing feature):
$ tio --socket unix:/tmp/tio-socket-0 /dev/ttyUSB0
Connect to same socket (new feature):
$ tio unix:/tmp/tio-socket-0
Besides a bit of refactoring the following required changes spring to mind:
* Socket mode and type of socket should be activated via device name prefix. For example:
* UNIX socket: tio unix:<filename>
* TCPv4 socket: tio inet:<ip>:<port>
* TCPv6 socket: tio inet6:<ip>:<port>
* If no port number defined default to 3333
* Mapping flags INLCR, IGNCR, ICRNL needs implementation for socket mode
* Error messages should just say "device" instead of "tty device" etc.
* Remove other tty'isms (tty_write() should be device_write() etc.)
* In session key commands that do not work in socket mode should either not be listed or print an error messages if used.
* All non-tty features should continue work (auto-connect etc.)
* Shell completion script update
* Man page update
* Split I/O feature
Allow to split input and output so that it is possible to manage these
independently.
The general idea is to redirect the output stream on the socket port number
specified but then redirect the input stream on the same port number + 1.
Example:
$ tio /dev/ttyUSB0 --socket inet:4444,split-io
Will result in output stream being hosted on port 4444 and input stream
hosted on port 4445.
For file sockets something similar can be arranged:
$ tio /dev/ttyUSB0 --socket unix:/tmp/tio-socket-0,split-io
Will result in output stream being hosted via /tmp/tio-socket-0 and input
stream hosted via /tmp/tio-socket-0_input
* Websocket support
Extend the socket feature to redirect serial I/O to websocket on e.g. port
1234 like so:
$ tio --socket ws:1234
Use libwesockets to implement feature.