Commit graph

554 commits

Author SHA1 Message Date
Martin Lund
b8135ea639 Rename git version to simply version 2024-11-30 11:37:27 +01:00
Martin Lund
c49faa7337 Clean up lua API
Rename modem_send() to send()
Rename send to write()
2024-11-30 11:09:43 +01:00
Keith Hill
afd82f7ac4 + Add system timestamps to lua read() and new lua read_line() per global options
+ Add missing timestamp-format epoch
+ Update send_ to use fsync and tcdrain like normal tty_sync does
+ Rework read_line to save partial line at timeout
+ Simplified read_line to reduce cyclomatic complexity

+ renamed example files read.lua and read_line.lua
+ moved #define READ_LINE_SIZE to top of file
+ renamed g_linebuf to linebuf, and moved it into read_line as a static variable
2024-11-07 21:45:06 +01:00
Martin Lund
db3f109c7d Zero initialize buffer in read_string() 2024-11-07 18:05:32 +01:00
Martin Lund
ab678e6c88 Use version from git 2024-10-25 19:35:13 +02:00
Martin Lund
330e99381e Fix memory leak in base62_encode() 2024-10-25 18:26:59 +02:00
Martin Lund
9fec689117 Fix name declaration conflict with socket send() 2024-09-15 05:57:31 +02:00
Martin Lund
2e7da862c8 Cleanup 2024-08-24 13:21:41 +02:00
Steve Marple
f47467271f Add "epoch" timestamp option
Add an option that prints the timestamp as the number of seconds since
the Unix epoch.
2024-08-24 12:35:30 +02:00
Tomka Gergely
a3b67d3eb6 The log-directory options is not read from the configuration file. 2024-08-19 20:37:18 +02:00
Martin Lund
ef12ed62df Remove unnecessary sync in line input mode
This caused a problem for some highly timing sensitive modem read-eval-print
loops because the input line and line termination characters (cr/nl) would be
shifted out on the UART with too big delay inbetween because of two
syncs.
2024-08-06 20:48:43 +02:00
Martin Lund
6163bc392b Fix socket send call on platforms without MSG_NOSIGNAL
To fix build issue encountered on MacOS Catalina but may apply to other
platforms.
2024-07-20 08:25:49 +02:00
Martin Lund
725423c50c Add configuration file include directive
To include the contents of another configuration file simply do e.g.:

[include raspberrypi.conf]

Also, included file can include other files which can include other
files etc.

This feature is useful for managing many configuration files and sharing
configuration files with others.
2024-07-19 08:49:49 +02:00
Martin Lund
e1fe232254 Fix shadow variable 2024-07-13 18:36:03 +02:00
Martin Lund
866b5bcb30 Mention how to list key commands in help output 2024-07-13 16:49:19 +02:00
Heinrich Schuchardt
68a64ac554 Print correct 'Done' timestamp for X- and Y-modem transfers
Closes: #268

Call tio_printf() after completing xymodem_send().

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-07-13 15:10:39 +02:00
Martin Lund
c3654486c7 Fix hex output mode when using normal input mode
In this combination of modes the input character was not forwarded to
the tty device. This fix makes sure it is forwarded.
2024-07-10 13:11:28 +02:00
Robert Lipe
fc0c6f61d2 Recompute listing_device_name_length_max for MacOS case, too. 2024-07-10 01:46:32 +02:00
Martin Lund
53bb2a6ad1 Fix uptime on MacOS
On MacOS the birth time is apparently not available so we use
modification time instead.
2024-07-09 22:12:42 +02:00
Martin Lund
da9f7a6540 Improve warning upon failing connect
Add device path to warning when connect fails.
2024-07-09 21:06:22 +02:00
Martin Lund
2a1dae6336 Fix crashy search_reset() on macOS 2024-07-09 16:44:10 +02:00
Martin Lund
ada2db0739 Clean up shadow variable 2024-07-02 19:20:59 +02:00
Martin Lund
14ee38a0d9 Clean up readline code 2024-07-02 19:13:14 +02:00
Martin Lund
2c700a90b0 Code cleanup 2024-07-02 19:11:40 +02:00
Martin Lund
da04c2c444 Improve listing of long device names 2024-07-02 17:41:49 +02:00
Martin Lund
5f70b75e90 Fix listing of serial devices on macOS 2024-07-01 23:11:58 +02:00
Martin Lund
d34fa1c1ad Rename mapping flag MSB2LSB to IMSB2LSB
This is the correct naming since we are changing the input bit order on
input from the serial device.
2024-06-29 12:14:34 +02:00
Martin Lund
4723cc3f4e Add OIGNCR mapping flag
Ignores CR on output to serial device.
2024-06-27 20:09:25 +02:00
Martin Lund
8c471105fe Fix line input mode ignoring characters ABCD 2024-06-27 18:54:19 +02:00
Martin Lund
b9902bbd78 Fix tainted print 2024-06-27 18:43:16 +02:00
Jakob Haufe
c5afd86b9a Fix typos 2024-06-15 17:16:23 +02:00
Martin Lund
053ae53f19 Update configuration output 2024-06-15 16:00:58 +02:00
Martin Lund
8f77ad5830 Clean up script run interaction text 2024-06-15 15:58:08 +02:00
Martin Lund
be4fc0908f Fix unbounded writes 2024-06-15 15:06:10 +02:00
Martin Lund
6ec2ac19d0 Add history and editing feature to line input mode
Use up and down arrow keys to navigate history.

Use left and right arrow keys to move cursor back and forth.

We try mimic the behaviour of GNU readline which we can not use because
we also need to react to key commands.
2024-06-15 14:31:23 +02:00
Martin Lund
bed34a0b9a Reuse socket address
To avoid having to wait for socket timeout when restarting server.
2024-06-11 15:18:38 +02:00
Martin Lund
134038c1ce Fix line input mode
Fix so that ABCD are no longer ignored.
2024-06-09 13:03:59 +02:00
Martin Lund
003b2e37d4 Make sure ICRNL, IGNCR, INLCR take effect 2024-06-02 23:35:36 +02:00
Martin Lund
8014ef68c0 Cleanup parsing of mapping flags 2024-06-02 14:26:39 +02:00
Vyacheslav Patkov
563c4fa6ea Show current mappings in the configuration printout 2024-06-02 13:22:33 +02:00
Vyacheslav Patkov
d1d6b45e8e Use "ctrl-t m" to change mappings interactively 2024-06-02 13:22:33 +02:00
Vyacheslav Patkov
f148a1413c Prompt for Lua script or shell command in interactive session 2024-06-01 16:23:51 +02:00
Martin Lund
133789517a Add group write permission to xymodem received file 2024-05-29 09:26:08 +02:00
Martin Lund
7e0bd980f2 Fix missing open() flags in xymodem_receive() 2024-05-29 01:41:14 +02:00
Eliot Alan Foss
d10e762a7d Added support to receive XMODEM-CRC files from the connected serial port. 2024-05-29 01:23:00 +02:00
Martin Lund
ccc01433b7 Include correct header for poll() 2024-05-16 19:16:17 +02:00
Martin Lund
5b5248929e Force destructive backspace when using local echo
Only takes effect in normal output mode.
2024-05-14 23:22:05 +02:00
Martin Lund
8f45d6f688 Fix local-echo in configuration file 2024-05-14 22:20:59 +02:00
Martin Lund
3f616a47c8 Fix includes 2024-05-13 11:04:09 +02:00
Martin Lund
747ac62733 Fix includes 2024-05-13 10:57:27 +02:00