mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
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.
This commit is contained in:
parent
ae76f8f58d
commit
d19ba1c492
22 changed files with 1468 additions and 150 deletions
23
src/tty.h
23
src/tty.h
|
|
@ -22,10 +22,31 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <glib.h>
|
||||
|
||||
#define LINE_HIGH true
|
||||
#define LINE_LOW false
|
||||
|
||||
#define TOPOLOGY_ID_SIZE 4
|
||||
|
||||
typedef enum
|
||||
{
|
||||
AUTO_CONNECT_DIRECT,
|
||||
AUTO_CONNECT_NEW,
|
||||
AUTO_CONNECT_LATEST,
|
||||
AUTO_CONNECT_END,
|
||||
} auto_connect_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *tid;
|
||||
double uptime;
|
||||
char *path;
|
||||
char *driver;
|
||||
char *description;
|
||||
} device_t;
|
||||
|
||||
extern const char *device_name;
|
||||
extern bool interactive_mode;
|
||||
extern bool map_i_nl_cr;
|
||||
extern bool map_i_cr_nl;
|
||||
|
|
@ -43,3 +64,5 @@ void tty_line_set(int fd, int mask, bool value);
|
|||
void tty_line_toggle(int fd, int mask);
|
||||
void tty_line_config(int mask, bool value);
|
||||
void tty_line_config_apply(void);
|
||||
void tty_search(void);
|
||||
GList *tty_search_for_serial_devices(void);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue