Commit graph

196 commits

Author SHA1 Message Date
Martin Lund
c2ef2fced5 Add codefactor.io shield 2024-05-04 14:07:55 +02:00
Martin Lund
3a75b098d1 Add new build shields to README 2024-05-04 13:35:40 +02:00
Martin Lund
ce736c267a Update README 2024-05-03 18:25:17 +02:00
Martin Lund
59940b3311 Update README 2024-05-03 15:45:39 +02:00
Martin Lund
05785e82b3 Update README 2024-05-03 15:39:52 +02:00
Martin Lund
50253a6a77 Update README 2024-05-03 15:36:53 +02:00
Martin Lund
13f3bedb2f Update README 2024-05-03 15:31:05 +02:00
Martin Lund
eb087713a4 Update README 2024-05-03 15:26:11 +02:00
Martin Lund
5ec33f5d4d Update doc 2024-05-03 11:57:26 +02:00
Martin Lund
22b4f451ea Update pattern matching example 2024-05-02 20:42:10 +02:00
Martin Lund
65c5a068d8 Replace inih with glib key file parser
After including the use of glib we might as well replace inih
with the glib key file parser.

All configuraiton file parsing has been reworked and also the options
parsing has been cleaned up, resulting in better and stricter
configuration file and option value checks.

Compared to old, configuration files now requires any default
configurations to be put in a group/section named [default].

Configuration file keywords such as "enable", "disable", "on",
"off", "yes", "no", "0", "1" have been retired. Now only "true" and
"false" apply to boolean configuration options. This is done to simplify
things and avoid any confusion.

The pattern option feature has been reworked so now the user can now
access the full match string and any matching subexpression using the
%mN syntax.

For example:

[usb devices]
pattern = usb([0-9]*)
device = /dev/ttyUSB%m1

Then when using tio:
$ tio usb12

   %m0 = 'usb12'  // Full match string
   %m1 = 12       // First match subexpression

Which results in device = /dev/ttyUSB12
2024-05-02 18:35:37 +02:00
Martin Lund
d8fb141bc4 Update lua read() description 2024-04-29 16:47:00 +02:00
Martin Lund
c16a2a1f94 Update README 2024-04-29 16:05:14 +02:00
Martin Lund
e2960c3f82 Update README 2024-04-29 16:00:12 +02:00
Martin Lund
6d77201ba0 Simplify lua line manipulation API
Collapses lua high(), low(), toggle(), config_high(), config_low(),
config_apply() into one simple function:

set{<line>=<state>, ...}

Line can be any of DTR, RTS, CTS, DSR, CD, RI.

State is high, low, or toggle.

Example:
script = set{DTR=high, RTS=low}; msleep(100); set{DTR=low, RTS=high}; msleep(100); set{RTS=low}

Notice the use of {} instad of () when calling the set function. This is
required to pass parameters by name in lua.
2024-04-29 15:20:53 +02:00
Martin Lund
6895c05321 Update README 2024-04-28 18:23:08 +02:00
Martin Lund
c453728ab5 Update README 2024-04-28 17:26:10 +02:00
Martin Lund
273afb73f4 Update README 2024-04-28 17:22:26 +02:00
Martin Lund
84dd4c3685 Update README 2024-04-28 14:47:07 +02:00
Martin Lund
33eae0c30d Update script API 2024-04-28 14:46:41 +02:00
Martin Lund
76de9b890e Update README 2024-04-27 15:33:22 +02:00
Martin Lund
42ff234204 Add hexN output mode
Adds support for hexN mode where N is a number in the range 1 to 4096
which defines how many hex values will be printed before a line break.

In short, it defines the width of the hex output.

In this mode, if timestamps are enabled they will be added to each hex
line.
2024-04-27 15:25:34 +02:00
Martin Lund
232cbee697 Rename sub-config to profile
Because better naming.
2024-04-27 09:13:33 +02:00
Martin Lund
1b77ed783b Update README 2024-04-27 02:30:22 +02:00
Martin Lund
41b8e4f99c Update README 2024-04-27 02:03:12 +02:00
Martin Lund
d8fbd607d4 Update README 2024-04-26 22:58:24 +02:00
Martin Lund
01f3c391f0 Update README 2024-04-26 22:54:25 +02:00
Martin Lund
5bbdf3b9f8 Update README 2024-04-26 22:38:55 +02:00
Martin Lund
d19ba1c492 Add new ways to manage serial devices
* Rename --list-devices to --list

 * Rename --no-autoconnect to --no-reconnect

 * Switch -l and -L options

   * -l now lists available serial devices

   * -L enables log to file

 * Add option --auto-connect <strategy>

   * Supported strategies:

     * "new" - Waits to connect first new appearing serial device

     * "latest" - Connects to latest registered serial device

     * "direct" - Connect directly to specified serial device (default)

 * Add options to exclude serial devices from auto connect strategy by
   pattern

   * Supported exclude options:

     * --exclude-devices <pattern>

       Example: '--exclude-devices "/dev/ttyUSB2,/dev/ttyS?"'

     * --exclude-drivers <pattern>

       Example: '--exclude-drivers "cdc_acm"'

     * --exclude-tids <pattern>

       Example: '--exclude-tids "yW07,bCC2"'

     * Patterns support '*' and '?'

 * Connect to same port/device combination via unique topology ID (TID)

   * Topology ID is a 4 digit base62 encoded hash of a device topology
     string coming from the Linux kernel. This means that whenever you
     plug in the same e.g. USB serial port device to the same USB hub
     port connected via the exact same hub topology all the way to your
     computer, you will get the same unique TID.

   * Useful for stable reconnections when serial device has no serial
     device by ID

   * For now, only tested on Linux.

 * Reworked and improved listing of serial devices to show serial devices:

   * By device

     * Including TID, uptime, driver, and description.

     * Sorted by uptime (newest device listed last)

   * By unique topology ID

   * By ID

   * By path

 * Add script interface 'list = tty_search()' for searching for serial
   devices.
2024-04-26 22:19:22 +02:00
Martin Lund
fa4207ddfd Update description of mute option 2024-04-19 20:14:22 +02:00
Martin Lund
f257b7fba5 Update README 2024-04-18 16:23:41 +02:00
Martin Lund
6fff4939e4 Add timeout based timestamps in hex output mode
This change reintroduces timestamping in hex output mode but based on
timeout instead of new lines which made no sense. This means that
timestamps will only be printed when timeout time has elapsed with no
output activity from serial device.

Adds option --timestamp-timeout <ms> for setting the timeout value in
milliseconds.

Defaults to 200 ms.
2024-04-18 15:52:45 +02:00
Martin Lund
a1987b61b4 Organize examples directory 2024-04-17 18:24:33 +02:00
Davis C
1cefb7b6bc Revert "Added reset_buffer()"
This reverts commit ee56d1280d.
2024-04-17 18:13:00 +02:00
Davis C
794c5202f4 Added reset_buffer() 2024-04-17 18:13:00 +02:00
Martin Lund
4801816357 Introduce basic line input mode 2024-04-16 17:42:34 +02:00
Martin Lund
10eedd4ad2 Update README 2024-04-14 02:32:25 +02:00
Martin Lund
fa41771e65 Update README 2024-04-14 01:50:50 +02:00
Martin Lund
97537853a8 Remove options --response-wait, --response-timeout
Remove options and rework input handling so it is possible to do the
same thing but via script which is much more flexible.

These options were always a bit of a hardcoded solution. With the new
script expect feature we can wait for any type of response.

For example, pipe command to serial device and wait for line response within 1 second:

$ echo "*IDN?" | tio /dev/ttyACM0 --script "expect('\r\n', 1000)" --mute
2024-04-13 23:18:25 +02:00
Martin Lund
e1e3e298bf Add lua exit(code) 2024-04-13 16:46:00 +02:00
Martin Lund
c5dac4fd33 pdate README 2024-04-13 15:48:32 +02:00
Martin Lund
51300cc4f0 Add timeout feature to expect() 2024-04-13 15:30:14 +02:00
Martin Lund
3ad090caf7 Update README 2024-04-13 00:56:41 +02:00
Martin Lund
fba73f98db Update README 2024-04-13 00:11:44 +02:00
Martin Lund
2db87ede53 Update README 2024-04-12 22:21:35 +02:00
Martin Lund
7915c1a445 Update README 2024-04-12 18:51:17 +02:00
Martin Lund
6c75ec553d Update README 2024-04-12 18:36:31 +02:00
Martin Lund
0afae5d3ee Update text 2024-04-12 13:03:51 +02:00
Martin Lund
a208c9908a Update README 2024-04-10 15:05:29 +02:00
Martin Lund
2fff4d36d0 Add independent input and output mode
Replaces -x, --hexadecimal option with --intput-mode and --output-mode
so it is possible to select hex or normal mode for both input and output
independently.

To obtain same behaviour as -x, --hexadecimal use the following
configuration:

input-mode = hex
output-mode = hex
2024-04-10 14:40:18 +02:00