mirror of
https://github.com/UzixLS/picocom.git
synced 2025-07-19 07:21:18 +03:00
Only support toggle RTS command in Linux; fix a few spelling errors and typos in man page.
This commit is contained in:
13
picocom.1.md
13
picocom.1.md
@ -62,7 +62,7 @@ here.
|
||||
|
||||
**C-q**
|
||||
|
||||
: Quit the program _without_ reseting the serial port, regardless of
|
||||
: Quit the program _without_ resetting the serial port, regardless of
|
||||
the **--noreset** option.
|
||||
|
||||
**C-p**
|
||||
@ -78,6 +78,7 @@ here.
|
||||
|
||||
: Toggle the RTS line. If RTS is up, then lower it. If it is down,
|
||||
then raise it. Not supported if the flow control mode is RTS/CTS.
|
||||
Only supported in Linux.
|
||||
|
||||
**C-backslash**
|
||||
|
||||
@ -300,7 +301,7 @@ the same, only a single value is shown. Example:
|
||||
|
||||
*** baud: 9600
|
||||
|
||||
This behavioir was intriduced in picocom 2.0. Older releases displayed
|
||||
This behavior was introduced in picocom 2.0. Older releases displayed
|
||||
only the option values, not the actual serial-port settings
|
||||
corresponding to them.
|
||||
|
||||
@ -321,7 +322,7 @@ programs for this purpose are:
|
||||
|
||||
The name of, and the command-line options to, the program to be used
|
||||
for transmitting files are given by the **--send-cmd**
|
||||
option. Similarly the program to receive files, and its argumets, are
|
||||
option. Similarly the program to receive files, and its arguments, are
|
||||
given by the **--receive-cmd** option. For example, in order to start
|
||||
a picocom session that uses **sz(1)** to transmit files, and **rz(1)**
|
||||
to receive files, you have to say something like this:
|
||||
@ -348,7 +349,7 @@ with support for the linenoise library. Pressing **C-c** at this
|
||||
prompt will cancel the file transfer command and return to normal
|
||||
picocom operation. After entering a filename (and / or additional
|
||||
transmission or reception program arguments) and assuming you have not
|
||||
canceled the operation by pressing **C-c**, picocom will start the the
|
||||
canceled the operation by pressing **C-c**, picocom will start the
|
||||
external program as specified by the **--send-cmd**, or
|
||||
**--receive-cmd** option, and with any filenames and additional
|
||||
arguments you may have supplied. The standard input and output of the
|
||||
@ -365,7 +366,7 @@ the serial port.
|
||||
# INPUT, OUTPUT, AND ECHO MAPPING
|
||||
|
||||
Using the **--imap**, **--omap**, and **--emap** options you can make
|
||||
picocom map (tranlate, replace) certain special characters after being
|
||||
picocom map (translate, replace) certain special characters after being
|
||||
read from the serial port (with **--imap**), before being written to
|
||||
the serial port (with **--omap**), and before being locally echoed to
|
||||
the terminal (standard output) if local echo is enabled (with
|
||||
@ -387,7 +388,7 @@ For example the command:
|
||||
|
||||
will:
|
||||
|
||||
- Replace every CR (carriage return, 0x0d) caracter with LF (line
|
||||
- Replace every CR (carriage return, 0x0d) character with LF (line
|
||||
feed, 0x0a) and every DEL (delete, 0x7f) character with BS
|
||||
(backspace, 0x08) before writing it to the serial port.
|
||||
|
||||
|
38
term.c
38
term.c
@ -1446,7 +1446,7 @@ term_lower_dtr(int fd)
|
||||
int
|
||||
term_raise_rts(int fd)
|
||||
{
|
||||
int rval, r, i;
|
||||
int rval, i;
|
||||
|
||||
rval = 0;
|
||||
|
||||
@ -1460,6 +1460,7 @@ term_raise_rts(int fd)
|
||||
|
||||
#ifdef __linux__
|
||||
{
|
||||
int r;
|
||||
int opins = TIOCM_RTS;
|
||||
|
||||
r = ioctl(fd, TIOCMBIS, &opins);
|
||||
@ -1470,13 +1471,8 @@ term_raise_rts(int fd)
|
||||
}
|
||||
}
|
||||
#else
|
||||
r = tcsetattr(fd, TCSANOW, &term.currtermios[i]);
|
||||
if ( r < 0 ) {
|
||||
/* FIXME: perhaps try to update currtermios */
|
||||
term_errno = TERM_ESETATTR;
|
||||
rval = -1;
|
||||
break;
|
||||
}
|
||||
term_errno = TERM_ERTSUP;
|
||||
rval = -1;
|
||||
#endif /* of __linux__ */
|
||||
} while (0);
|
||||
|
||||
@ -1488,7 +1484,7 @@ term_raise_rts(int fd)
|
||||
int
|
||||
term_lower_rts(int fd)
|
||||
{
|
||||
int rval, r, i;
|
||||
int rval, i;
|
||||
|
||||
rval = 0;
|
||||
|
||||
@ -1502,6 +1498,7 @@ term_lower_rts(int fd)
|
||||
|
||||
#ifdef __linux__
|
||||
{
|
||||
int r;
|
||||
int opins = TIOCM_RTS;
|
||||
|
||||
r = ioctl(fd, TIOCMBIC, &opins);
|
||||
@ -1512,27 +1509,8 @@ term_lower_rts(int fd)
|
||||
}
|
||||
}
|
||||
#else
|
||||
{
|
||||
struct termios tio;
|
||||
|
||||
r = tcgetattr(fd, &tio);
|
||||
if ( r < 0 ) {
|
||||
term_errno = TERM_EGETATTR;
|
||||
rval = -1;
|
||||
break;
|
||||
}
|
||||
term.currtermios[i] = tio;
|
||||
|
||||
cfsetospeed(&tio, B0);
|
||||
cfsetispeed(&tio, B0);
|
||||
|
||||
r = tcsetattr(fd, TCSANOW, &tio);
|
||||
if ( r < 0 ) {
|
||||
term_errno = TERM_ESETATTR;
|
||||
rval = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
term_errno = TERM_ERTSDOWN;
|
||||
rval = -1;
|
||||
#endif /* of __linux__ */
|
||||
} while (0);
|
||||
|
||||
|
Reference in New Issue
Block a user