mirror of
https://github.com/UzixLS/picocom.git
synced 2025-07-19 07:21:18 +03:00
- Added support for the linenoise library, which allows line-editing
and path completion when entering filenames for receive- and send- file operations. Support can be compiled-out if you wish. See Makefile. - When entering a filename for receive- or send- file operations, pressing C-c cancels the operation. This works regardless of whether linenoise support (see above) has been compiled in or not - Use debian's xmltoman to convert manual page form xml to man.
This commit is contained in:
11
CONTRIBUTORS
11
CONTRIBUTORS
@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
The following people contributed suggestions, comments, and fixes:
|
The following people contributed improvements, fixes, suggestions, and
|
||||||
|
comments:
|
||||||
|
|
||||||
- Oliver Kurth (oku@debian.org) contributed bug fixes and the manual
|
- Oliver Kurth (oku@debian.org) contributed bug fixes and the manual
|
||||||
page for picocm.
|
page for picocm.
|
||||||
@ -25,3 +26,11 @@ The following people contributed suggestions, comments, and fixes:
|
|||||||
|
|
||||||
- Scott Tsai (scott.tw@gmail.com) suggested better UUCP_LOCK_DIR definition
|
- Scott Tsai (scott.tw@gmail.com) suggested better UUCP_LOCK_DIR definition
|
||||||
|
|
||||||
|
- Josh Handley (https://github.com/jhandley) added support for
|
||||||
|
line-editing, autocompletion and history when entering "send" and
|
||||||
|
"receive" file names. Editing support uses the "linenoise"
|
||||||
|
library. See: https://github.com/jhandley/picocom
|
||||||
|
|
||||||
|
- Salvatore Sanfilippo (https://github.com/antirez) is the author of
|
||||||
|
the linenoise line-editing library. See:
|
||||||
|
https://github.com/antirez/linenoise
|
||||||
|
30
Makefile
30
Makefile
@ -1,40 +1,52 @@
|
|||||||
|
|
||||||
VERSION=1.8
|
VERSION=1.8
|
||||||
|
|
||||||
UUCP_LOCK_DIR=/var/lock
|
|
||||||
|
|
||||||
# CC = gcc
|
# CC = gcc
|
||||||
CPPFLAGS=-DVERSION_STR=\"$(VERSION)\" \
|
CPPFLAGS=-DVERSION_STR=\"$(VERSION)\"
|
||||||
-DUUCP_LOCK_DIR=\"$(UUCP_LOCK_DIR)\" \
|
|
||||||
-DHIGH_BAUD
|
|
||||||
CFLAGS = -Wall -g
|
CFLAGS = -Wall -g
|
||||||
|
|
||||||
# LD = gcc
|
# LD = gcc
|
||||||
LDFLAGS = -g
|
LDFLAGS = -g
|
||||||
LDLIBS =
|
LDLIBS =
|
||||||
|
|
||||||
|
## Comment this out to disable high-baudrate support
|
||||||
|
CPPFLAGS += -DHIGH_BAUD
|
||||||
|
|
||||||
|
## Comment these out to disable UUCP-style lockdirs
|
||||||
|
UUCP_LOCK_DIR=/var/lock
|
||||||
|
CPPFLAGS += -DUUCP_LOCK_DIR=\"$(UUCP_LOCK_DIR)\"
|
||||||
|
|
||||||
|
## Comment these out to disable "linenoise"-library support
|
||||||
|
SEND_RECEIVE_HISTFILE = .picocom_send_receive
|
||||||
|
CPPFLAGS += -DSEND_RECEIVE_HISTFILE=\"$(SEND_RECEIVE_HISTFILE)\" \
|
||||||
|
-DLINENOISE
|
||||||
|
picocom : linenoise-1.0/linenoise.o
|
||||||
|
linenoise-1.0/linenoise.o : linenoise-1.0/linenoise.c linenoise-1.0/linenoise.h
|
||||||
|
|
||||||
|
|
||||||
picocom : picocom.o term.o
|
picocom : picocom.o term.o
|
||||||
# $(LD) $(LDFLAGS) -o $@ $+ $(LDLIBS)
|
# $(LD) $(LDFLAGS) -o $@ $+ $(LDLIBS)
|
||||||
|
|
||||||
picocom.o : picocom.c term.h
|
picocom.o : picocom.c term.h
|
||||||
term.o : term.c term.h
|
term.o : term.c term.h
|
||||||
|
|
||||||
|
|
||||||
doc : picocom.8 picocom.8.html picocom.8.ps
|
doc : picocom.8 picocom.8.html picocom.8.ps
|
||||||
|
|
||||||
changes :
|
changes :
|
||||||
svn log -v . > CHANGES
|
svn log -v . > CHANGES
|
||||||
|
|
||||||
picocom.8 : picocom.8.xml
|
picocom.8 : picocom.8.xml
|
||||||
xmlmp2man < $< > $@
|
xmltoman $< > $@
|
||||||
|
|
||||||
picocom.8.html : picocom.8.xml
|
picocom.8.html : picocom.8.xml
|
||||||
xmlmp2html < $< > $@
|
xmlmantohtml $< > $@
|
||||||
|
|
||||||
picocom.8.ps : picocom.8
|
picocom.8.ps : picocom.8
|
||||||
groff -mandoc -Tps $< > $@
|
groff -mandoc -Tps $< > $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f picocom.o term.o
|
rm -f picocom.o term.o linenoise-1.0/linenoise.o
|
||||||
rm -f *~
|
rm -f *~
|
||||||
rm -f \#*\#
|
rm -f \#*\#
|
||||||
|
|
||||||
|
3
linenoise-1.0/.gitignore
vendored
Normal file
3
linenoise-1.0/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
linenoise_example
|
||||||
|
*.dSYM
|
||||||
|
history.txt
|
25
linenoise-1.0/LICENSE
Normal file
25
linenoise-1.0/LICENSE
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
Copyright (c) 2010-2014, Salvatore Sanfilippo <antirez at gmail dot com>
|
||||||
|
Copyright (c) 2010-2013, Pieter Noordhuis <pcnoordhuis at gmail dot com>
|
||||||
|
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer in the documentation
|
||||||
|
and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
|
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||||
|
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
7
linenoise-1.0/Makefile
Normal file
7
linenoise-1.0/Makefile
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
linenoise_example: linenoise.h linenoise.c
|
||||||
|
|
||||||
|
linenoise_example: linenoise.c example.c
|
||||||
|
$(CC) -Wall -W -Os -g -o linenoise_example linenoise.c example.c
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f linenoise_example
|
52
linenoise-1.0/README.markdown
Normal file
52
linenoise-1.0/README.markdown
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
# Linenoise
|
||||||
|
|
||||||
|
A minimal, zero-config, BSD licensed, readline replacement used in Redis,
|
||||||
|
MongoDB, and Android.
|
||||||
|
|
||||||
|
* Single and multi line editing mode with the usual key bindings implemented.
|
||||||
|
* History handling.
|
||||||
|
* Completion.
|
||||||
|
* About 1,100 lines of BSD license source code.
|
||||||
|
* Only uses a subset of VT100 escapes (ANSI.SYS compatible).
|
||||||
|
|
||||||
|
## Can a line editing library be 20k lines of code?
|
||||||
|
|
||||||
|
Line editing with some support for history is a really important feature for command line utilities. Instead of retyping almost the same stuff again and again it's just much better to hit the up arrow and edit on syntax errors, or in order to try a slightly different command. But apparently code dealing with terminals is some sort of Black Magic: readline is 30k lines of code, libedit 20k. Is it reasonable to link small utilities to huge libraries just to get a minimal support for line editing?
|
||||||
|
|
||||||
|
So what usually happens is either:
|
||||||
|
|
||||||
|
* Large programs with configure scripts disabling line editing if readline is not present in the system, or not supporting it at all since readline is GPL licensed and libedit (the BSD clone) is not as known and available as readline is (Real world example of this problem: Tclsh).
|
||||||
|
* Smaller programs not using a configure script not supporting line editing at all (A problem we had with Redis-cli for instance).
|
||||||
|
|
||||||
|
The result is a pollution of binaries without line editing support.
|
||||||
|
|
||||||
|
So I spent more or less two hours doing a reality check resulting in this little library: is it *really* needed for a line editing library to be 20k lines of code? Apparently not, it is possibe to get a very small, zero configuration, trivial to embed library, that solves the problem. Smaller programs will just include this, supporing line editing out of the box. Larger programs may use this little library or just checking with configure if readline/libedit is available and resorting to linenoise if not.
|
||||||
|
|
||||||
|
## Terminals, in 2010.
|
||||||
|
|
||||||
|
Apparently almost every terminal you can happen to use today has some kind of support for basic VT100 escape sequences. So I tried to write a lib using just very basic VT100 features. The resulting library appears to work everywhere I tried to use it, and now can work even on ANSI.SYS compatible terminals, since no
|
||||||
|
VT220 specific sequences are used anymore.
|
||||||
|
|
||||||
|
The library is currently about 1100 lines of code. In order to use it in your project just look at the *example.c* file in the source distribution, it is trivial. Linenoise is BSD code, so you can use both in free software and commercial software.
|
||||||
|
|
||||||
|
## Tested with...
|
||||||
|
|
||||||
|
* Linux text only console ($TERM = linux)
|
||||||
|
* Linux KDE terminal application ($TERM = xterm)
|
||||||
|
* Linux xterm ($TERM = xterm)
|
||||||
|
* Linux Buildroot ($TERM = vt100)
|
||||||
|
* Mac OS X iTerm ($TERM = xterm)
|
||||||
|
* Mac OS X default Terminal.app ($TERM = xterm)
|
||||||
|
* OpenBSD 4.5 through an OSX Terminal.app ($TERM = screen)
|
||||||
|
* IBM AIX 6.1
|
||||||
|
* FreeBSD xterm ($TERM = xterm)
|
||||||
|
* ANSI.SYS
|
||||||
|
|
||||||
|
Please test it everywhere you can and report back!
|
||||||
|
|
||||||
|
## Let's push this forward!
|
||||||
|
|
||||||
|
Patches should be provided in the respect of linenoise sensibility for small
|
||||||
|
easy to understand code.
|
||||||
|
|
||||||
|
Send feedbacks to antirez at gmail
|
64
linenoise-1.0/example.c
Normal file
64
linenoise-1.0/example.c
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "linenoise.h"
|
||||||
|
|
||||||
|
|
||||||
|
void completion(const char *buf, linenoiseCompletions *lc) {
|
||||||
|
if (buf[0] == 'h') {
|
||||||
|
linenoiseAddCompletion(lc,"hello");
|
||||||
|
linenoiseAddCompletion(lc,"hello there");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char **argv) {
|
||||||
|
char *line;
|
||||||
|
char *prgname = argv[0];
|
||||||
|
|
||||||
|
/* Parse options, with --multiline we enable multi line editing. */
|
||||||
|
while(argc > 1) {
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
if (!strcmp(*argv,"--multiline")) {
|
||||||
|
linenoiseSetMultiLine(1);
|
||||||
|
printf("Multi-line mode enabled.\n");
|
||||||
|
} else if (!strcmp(*argv,"--keycodes")) {
|
||||||
|
linenoisePrintKeyCodes();
|
||||||
|
exit(0);
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "Usage: %s [--multiline] [--keycodes]\n", prgname);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Set the completion callback. This will be called every time the
|
||||||
|
* user uses the <tab> key. */
|
||||||
|
linenoiseSetCompletionCallback(completion);
|
||||||
|
|
||||||
|
/* Load history from file. The history file is just a plain text file
|
||||||
|
* where entries are separated by newlines. */
|
||||||
|
linenoiseHistoryLoad("history.txt"); /* Load the history at startup */
|
||||||
|
|
||||||
|
/* Now this is the main loop of the typical linenoise-based application.
|
||||||
|
* The call to linenoise() will block as long as the user types something
|
||||||
|
* and presses enter.
|
||||||
|
*
|
||||||
|
* The typed string is returned as a malloc() allocated string by
|
||||||
|
* linenoise, so the user needs to free() it. */
|
||||||
|
while((line = linenoise("hello> ")) != NULL) {
|
||||||
|
/* Do something with the string. */
|
||||||
|
if (line[0] != '\0' && line[0] != '/') {
|
||||||
|
printf("echo: '%s'\n", line);
|
||||||
|
linenoiseHistoryAdd(line); /* Add to the history. */
|
||||||
|
linenoiseHistorySave("history.txt"); /* Save the history on disk. */
|
||||||
|
} else if (!strncmp(line,"/historylen",11)) {
|
||||||
|
/* The "/historylen" command will change the history len. */
|
||||||
|
int len = atoi(line+11);
|
||||||
|
linenoiseHistorySetMaxLen(len);
|
||||||
|
} else if (line[0] == '/') {
|
||||||
|
printf("Unreconized command: %s\n", line);
|
||||||
|
}
|
||||||
|
free(line);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
1107
linenoise-1.0/linenoise.c
Normal file
1107
linenoise-1.0/linenoise.c
Normal file
File diff suppressed because it is too large
Load Diff
68
linenoise-1.0/linenoise.h
Normal file
68
linenoise-1.0/linenoise.h
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
/* linenoise.h -- VERSION 1.0
|
||||||
|
*
|
||||||
|
* Guerrilla line editing library against the idea that a line editing lib
|
||||||
|
* needs to be 20,000 lines of C code.
|
||||||
|
*
|
||||||
|
* See linenoise.c for more information.
|
||||||
|
*
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*
|
||||||
|
* Copyright (c) 2010-2014, Salvatore Sanfilippo <antirez at gmail dot com>
|
||||||
|
* Copyright (c) 2010-2013, Pieter Noordhuis <pcnoordhuis at gmail dot com>
|
||||||
|
*
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are
|
||||||
|
* met:
|
||||||
|
*
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __LINENOISE_H
|
||||||
|
#define __LINENOISE_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef struct linenoiseCompletions {
|
||||||
|
size_t len;
|
||||||
|
char **cvec;
|
||||||
|
} linenoiseCompletions;
|
||||||
|
|
||||||
|
typedef void(linenoiseCompletionCallback)(const char *, linenoiseCompletions *);
|
||||||
|
void linenoiseSetCompletionCallback(linenoiseCompletionCallback *);
|
||||||
|
void linenoiseAddCompletion(linenoiseCompletions *, const char *);
|
||||||
|
|
||||||
|
char *linenoise(const char *prompt);
|
||||||
|
int linenoiseHistoryAdd(const char *line);
|
||||||
|
int linenoiseHistorySetMaxLen(int len);
|
||||||
|
int linenoiseHistorySave(const char *filename);
|
||||||
|
int linenoiseHistoryLoad(const char *filename);
|
||||||
|
void linenoiseClearScreen(void);
|
||||||
|
void linenoiseSetMultiLine(int ml);
|
||||||
|
void linenoisePrintKeyCodes(void);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __LINENOISE_H */
|
386
picocom.8
386
picocom.8
@ -1,279 +1,129 @@
|
|||||||
.TH "picocom" "8" "" "" ""
|
.TH picocom 8 User Manuals
|
||||||
.SH NAME
|
.SH NAME
|
||||||
picocom \- minimal dumb-terminal emulation program
|
picocom \- minimal dumb-terminal emulation program
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B picocom [
|
\fBpicocom [ \fIoptions\fB ] \fIdevice\fB
|
||||||
.I options
|
\f1
|
||||||
.B ]
|
|
||||||
.I device
|
|
||||||
.br
|
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
As its name suggests,
|
As its name suggests, picocom is a minimal dumb-terminal emulation program. It is, in principle, very much like \fBminicom(1)\f1, only it's "pico" instead of "mini"! It was designed to serve as a simple, manual, modem configuration, testing, and debugging tool. It has also served (quite well) as a low-tech "terminal-window" to allow operator intervention in PPP connection scripts (something like the ms-windows "open terminal window before / after dialing" feature). It could also prove useful in many other similar tasks.
|
||||||
.B picocom
|
|
||||||
is a minimal dumb-terminal emulation program. It is, in principle, very much like
|
When picocom starts it opens the terminal (serial device) given as its non-option argument. Unless the \fI--noinit\f1 option is given, it configures the device to the settings specified by the option-arguments (or to some default settings), and sets it to "raw" mode. If \fI--noinit\f1 is given, the initialization and configuration is skipped; the device is just opened. Following this, picocom sets the standard-input and standard-output to raw mode. Having done so, it goes in a loop where it listens for input from stdin, or from the serial port. Input from the serial port is copied to the standard output while input from the standard input is copied to the serial port. picocom also scans its input stream for a user-specified control character, called the "escape character" (being by default "C-a"). If the escape character is seen, then instead of sending it to the serial-device, the program enters "command mode" and waits for the next character (which is called the "function character"). Depending on the value of the function character, picocom performs one of the operations described in the "Commands" section below.
|
||||||
.B minicom(1)
|
|
||||||
, only it's "pico" instead of "mini"! It was designed to serve as a simple, manual, modem configuration, testing, and debugging tool. It has also served (quite well) as a low-tech "terminal-window" to allow operator intervention in PPP connection scripts (something like the ms-windows "open terminal window before / after dialing" feature). It could also prove useful in many other similar tasks.
|
|
||||||
.br
|
|
||||||
.sp 0.6v
|
|
||||||
When
|
|
||||||
.B picocom
|
|
||||||
starts it opens the terminal (serial device) given as its non-option argument. Unless the
|
|
||||||
.I --noinit
|
|
||||||
option is given, it configures the device to the settings specified by the option-arguments (or to some default settings), and sets it to "raw" mode. If
|
|
||||||
.I --noinit
|
|
||||||
is given, the initialization and configuration is skipped; the device is just opened. Following this,
|
|
||||||
.B picocom
|
|
||||||
sets the standard-input and standard-output to raw mode. Having done so, it goes in a loop where it listens for input from stdin, or from the serial port. Input from the serial port is copied to the standard output while input from the standard input is copied to the serial port.
|
|
||||||
.B picocom
|
|
||||||
also scans its input stream for a user-specified control character, called the "escape character" (being by default "C-a"). If the escape character is seen, then instead of sending it to the serial-device, the program enters "command mode" and waits for the next character (which is called the "function character"). Depending on the value of the function character,
|
|
||||||
.B picocom
|
|
||||||
performs one of the operations described in the "Commands" section below.
|
|
||||||
.br
|
|
||||||
.sp 0.6v
|
|
||||||
.SH COMMANDS
|
.SH COMMANDS
|
||||||
Commands are given to
|
Commands are given to picocom by first keying the "espace character" which by default is "C-a" (see "Options" below on how to change it), and then keying one for the function (command) characters shown here.
|
||||||
.B picocom
|
|
||||||
by first keying the "espace character" which by default is "C-a" (see "Options" below on how to change it), and then keying one for the function (command) characters shown here.
|
[escape character]: Send the escape character to the serial port and return to "transparent" mode. This means that if the escape character ("C-a", by default) is typed twice, the program sends the escape character to the serial port, and remains in transparent mode. This is a new behavior implemented in v1.4. Previously picocom used to ignore the escape-character when it was entered as a function character.
|
||||||
.TP 3
|
|
||||||
.B [escape character]
|
[C-x]: Exit the program: if the \fI--noreset\f1 option was not given then the serial port is reset to its original settings before exiting; if it was given the serial port is not reset.
|
||||||
Send the escape character to the serial port and return to "transparent" mode. This means that if the escape character ("C-a", by default) is typed twice, the program sends the escape character to the serial port, and remains in transparent mode. This is a new behavior implemented in v1.4. Previously picocom used to ignore the escape-character when it was entered as a function character.
|
|
||||||
.TP 3
|
[C-q]: Quit the program *without* reseting the serial port, regardless of the \fI--noreset\f1 option.
|
||||||
.B C-x
|
|
||||||
Exit the program: if the "--noreset" option was not given then the serial port is reset to its original settings before exiting; if it was given the serial port is not reset.
|
[C-p]: Pulse the DTR line. Lower it for 1 sec, and then raise it again.
|
||||||
.TP 3
|
|
||||||
.B C-q
|
[C-t]: Toggle the DTR line. If DTR is up, then lower it. If it is down, then raise it.
|
||||||
Quit the program *without* reseting the serial port, regardless of the "--noreset" option.
|
|
||||||
.TP 3
|
[C-backslash]: Generate a break sequence on the serial line. A break sequence is usually generated by marking (driving to logical one) the serial Tx line for an amount of time coresponding to several character durations.
|
||||||
.B C-p
|
|
||||||
Pulse the DTR line. Lower it for 1 sec, and then raise it again.
|
[C-u]: Baud up. Increase the baud-rate. The list of baud-rates stepped-through by this command is: 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200.
|
||||||
.TP 3
|
|
||||||
.B C-t
|
[C-d]: Baud down. Decrease the baud-rate. The list of baud-rates stepped-through by this command is the same as for the "baud-up" command.
|
||||||
Toggle the DTR line. If DTR is up, then lower it. If it is down, then raise it.
|
|
||||||
.TP 3
|
[C-f]: Cycle through flow-control settings (RTS/CTS, XON/XOFF, none).
|
||||||
.B C-backslash
|
|
||||||
Generate a break sequence on the serial line. A break sequence is usually generated by marking (driving to logical one) the serial Tx line for an amount of time coresponding to several character durations.
|
[C-y]: Cycle through parity settings (even, odd, none).
|
||||||
.TP 3
|
|
||||||
.B C-u
|
[C-b]: Cycle through databits-number settings (5, 6, 7, 8).
|
||||||
Baud up. Increase the baud-rate. The list of baud-rates stepped-through by this command is: 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200.
|
|
||||||
.TP 3
|
[C-c]: Toggle local-echo mode.
|
||||||
.B C-d
|
|
||||||
Baud down. Decrease the baud-rate. The list of baud-rates stepped-through by this command is the same as for the "baud-up" command.
|
[C-v]: Show program options (like baud rate, data bits, etc). Only the options that can be modified online (through commands) are shown, not those that can only be set at the command-line.
|
||||||
.TP 3
|
|
||||||
.B C-f
|
[C-s]: Send (upload) a file (see "Sending and Receiving Files" below)
|
||||||
Cycle through flow-control settings (RTS/CTS, XON/XOFF, none).
|
|
||||||
.TP 3
|
[C-r]: Receive (download) a file (see "Sending and Receiving Files" below)
|
||||||
.B C-y
|
|
||||||
Cycle through parity settings (even, odd, none).
|
After performing one of the above operations the program leaves the command mode and enters transparent mode. Example: To increase the baud-rate by two steps, you have to type:
|
||||||
.TP 3
|
|
||||||
.B C-b
|
C-a, C-u, C-a, C-u
|
||||||
Cycle through databits-number settings (5, 6, 7, 8).
|
|
||||||
.TP 3
|
assuming of-course that "C-a" is the escape character.
|
||||||
.B C-c
|
|
||||||
Toggle local-echo mode.
|
|
||||||
.TP 3
|
|
||||||
.B C-v
|
|
||||||
Show program options (like baud rate, data bits, etc). Only the options that can be modified online (through commands) are shown, not those that can only be set at the command-line.
|
|
||||||
.TP 3
|
|
||||||
.B C-s
|
|
||||||
Send (upload) a file (see "Sending and Receiving Files" below)
|
|
||||||
.TP 3
|
|
||||||
.B C-r
|
|
||||||
Receive (download) a file (see "Sending and Receiving Files" below)
|
|
||||||
.PP
|
|
||||||
After performing one of the above operations the program leaves the command mode and enters transparent mode. Example: To increase the baud-rate by two steps, you have to type:
|
|
||||||
.br
|
|
||||||
.sp 0.6v
|
|
||||||
C-a, C-u, C-a, C-u
|
|
||||||
.br
|
|
||||||
.sp 0.6v
|
|
||||||
assuming of-course that "C-a" is the escape character.
|
|
||||||
.br
|
|
||||||
.sp 0.6v
|
|
||||||
.SH SENDING AND RECEIVING FILES
|
.SH SENDING AND RECEIVING FILES
|
||||||
.B picocom
|
picocom can send and receive files over the serial port using external programs that implement the respective protocols. In Linux typical programs for this purpose are:
|
||||||
can send and receive files over the serial port using external programs that implement the respective protocols. In Linux typical programs for this purpose are:
|
|
||||||
.IP \(em 3
|
\fBrx(1)\f1 - receive using the X-MODEM protocol
|
||||||
.B rx(1)
|
|
||||||
- receive using the X-MODEM protocol
|
\fBrb(1)\f1 - receive using the Y-MODEM protocol
|
||||||
.IP \(em 3
|
|
||||||
.B rb(1)
|
\fBrz(1)\f1 - receive using the Z-MODEM protocol
|
||||||
- receive using the Y-MODEM protocol
|
|
||||||
.IP \(em 3
|
\fBsx(1)\f1 - send using the X-MODEM protocol
|
||||||
.B rz(1)
|
|
||||||
- receive using the Z-MODEM protocol
|
\fBsb(1)\f1 - send using the Y-MODEM protocol
|
||||||
.IP \(em 3
|
|
||||||
.B sx(1)
|
\fBsz(1)\f1 - send using the Z-MODEM protocol
|
||||||
- send using the X-MODEM protocol
|
|
||||||
.IP \(em 3
|
\fBascii-xfr(1)\f1 - receive or transmit ASCII files
|
||||||
.B sb(1)
|
|
||||||
- send using the Y-MODEM protocol
|
The name of, and the command-line options to, the program to be used for transmitting files are given by the \fI--send-cmd\f1 option. Similarly the program to receive files, and its argumets, are given by the \fI--receive-cmd\f1 option. For example, in order to start a picocom session that uses "sz" to transmit files, and "rz" to receive, you have to say something like this:
|
||||||
.IP \(em 3
|
|
||||||
.B sz(1)
|
picocom --send-cmd "sz -vv" --receive-cmd "rz -vv"
|
||||||
- send using the Z-MODEM protocol
|
|
||||||
.IP \(em 3
|
During the picocom session, if you key the "send" or "receive" commands (e.g. by pressing C-a, C-s, or C-a, C-r) you will be prompted for a filename. At this prompt you can enter one or more file-names, and any additional arguments to the transmission or reception program. Command-line editing and pathname completion are available at this prompt, if you have compiled picocom 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 external program as specified by the \fI--send-cmd\f1, or \fI--receive-cmd\f1 option, and with any filenames and additional arguments you may have supplied. The standard input and output of the external program will be connected to the serial port. The standard error of the external program will be connected to the terminal which---while the program is running---will revert to canonical mode. Pressing 'C-c' while the external program is running will prematurely terminate it, and return control to picocom. Pressing 'C-c' at any other time, has no special effect; the character is normally passed to the serial port.
|
||||||
.B ascii-xfr(1)
|
|
||||||
- receive or transmit ASCII files
|
|
||||||
.PP
|
|
||||||
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 given by the "--receive-cmd" option. For example, in order to start a
|
|
||||||
.B picocom
|
|
||||||
session that uses "sz" to transmit files, and "rz" to receive, you have to say something like this:
|
|
||||||
.br
|
|
||||||
.sp 0.6v
|
|
||||||
picocom --send-cmd "sz -vv" --receive-cmd "rz -vv"
|
|
||||||
.br
|
|
||||||
.sp 0.6v
|
|
||||||
During the picocom session, if you key the "send" or "receive" commands (e.g. by pressing C-a, C-s, or C-a, C-r) you will be prompted for a filename. At this prompt you can enter one or more file-names, and any additional arguments to the transmission or reception program. After that, picocom will start the 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 external program will be connected to the serial port. The standard error of the external program will be connected to the terminal which---while the program is running---will revert to canonical mode. Pressing 'C-c' while the external program is running will prematurely terminate it, and return control to
|
|
||||||
.B picocom
|
|
||||||
. Pressing 'C-c' at any other time, has no special effect; the character is normally passed to the serial port.
|
|
||||||
.br
|
|
||||||
.sp 0.6v
|
|
||||||
.SH INPUT, OUTPUT, AND ECHO MAPPING
|
.SH INPUT, OUTPUT, AND ECHO MAPPING
|
||||||
Using the "--imap", "--omap", and "--emap" options you can make
|
Using the \fI--imap\f1, \fI--omap\f1, and \fI--emap\f1 options you can make picocom map (tranlate, replace) certain special characters after being read from the serial port (with \fI--imap\f1), before being written to the serial port (with \fI--omap\f1), and before being locally echoed to the terminal (standard output) if local echo is enabled (with \fI--emap\f1). These mapping options take, each, a single argument which is a comma-separated list of one or more of the following identifiers: "crlf" (map CR to LF), "crcrlf" (map CR to CR + LF), "igncr" (ignore CR), "lfcr" (map LF to CR), "lfcrlf" (map LF to CR + LF), "ignlf" (ignore LF), "bsdel" (map BS --> DEL), "delbs" (map DEL --> BS)
|
||||||
.B picocom
|
|
||||||
map (tranlate, replace) certain special characters after being read from the serial port (with
|
For example the command:
|
||||||
.I --imap
|
|
||||||
), before being written to the serial port (with
|
picocom --omap crlf,delbs --imap inglf,bsdel --emap crcrlf ...
|
||||||
.I --omap
|
|
||||||
), and before being locally echoed to the terminal (standard output) if local echo is enabled (with
|
will: Replace every CR (carriage return, 0x0d) caracter with LF (line feed, 0x0a) and every DEL (delete, 0x7f) character with BS (backspace, 0x08) before writing it to the serial port. Ignore (not write to the terminal) every LF character read from the serial port and replace every BS character read from the serial port with DEL. Replace every CR character with CR and LF when echoing to the terminal (if local-echo is enabled).
|
||||||
.I --emap
|
|
||||||
). These mapping options take, each, a single argument which is a comma-separated list of one or more of the following identifiers:
|
|
||||||
.IP \(em 3
|
|
||||||
crlf: map CR to LF
|
|
||||||
.IP \(em 3
|
|
||||||
crcrlf: map CR to CR + LF
|
|
||||||
.IP \(em 3
|
|
||||||
igncr: ignore CR
|
|
||||||
.IP \(em 3
|
|
||||||
lfcr: map LF to CR
|
|
||||||
.IP \(em 3
|
|
||||||
lfcrlf: map LF to CR + LF
|
|
||||||
.IP \(em 3
|
|
||||||
ignlf: ignore LF
|
|
||||||
.IP \(em 3
|
|
||||||
bsdel: map BS --> DEL
|
|
||||||
.IP \(em 3
|
|
||||||
delbs: map DEL --> BS
|
|
||||||
.PP
|
|
||||||
For example the command:
|
|
||||||
.br
|
|
||||||
.sp 0.6v
|
|
||||||
picocom --omap crlf,delbs --imap inglf,bsdel --emap crcrlf ...
|
|
||||||
.br
|
|
||||||
.sp 0.6v
|
|
||||||
will: Replace every CR (carriage return, 0x0d) caracter with LF (line feed, 0x0a) and every DEL (delete, 0x7f) character with BS (backspace, 0x08) before writing it to the serial port. Ignore (not write to the terminal) every LF character read from the serial port and replace every BS character read from the serial port with DEL. Replace every CR character with CR and LF when echoing to the terminal (if local-echo is enabled).
|
|
||||||
.br
|
|
||||||
.sp 0.6v
|
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.B picocom
|
picocom accepts the following command-line options
|
||||||
accepts the following command-line options
|
.TP
|
||||||
.TP 3
|
\fB--baud | -b
|
||||||
.B --baud | -b
|
\f1Defines the baud-rate to set the serial-port (terminal) to.
|
||||||
Defines the baud-rate to set the serial-port (terminal) to.
|
.TP
|
||||||
.TP 3
|
\fB--flow | -f
|
||||||
.B --flow | -f
|
\f1Defines the flow-control mode to set the serial-port to. Must be one of: 'x' for xon/xoff (software) mode, 'h' for hardware flow control (RTS/CTS), 'n' for no flow control. (Default: 'n')
|
||||||
Defines the flow-control mode to set the serial-port to. Must be one of:
|
.TP
|
||||||
.RS 3
|
\fB--parity | -p
|
||||||
.IP \(em 3
|
\f1Defines the parity mode to set the serial-port to. Must be one of: 'o' for odd parity mode, 'e' for even parity mode, 'n' for no parity mode. (Default: 'n')
|
||||||
\'x' for xon/xoff (software) mode
|
.TP
|
||||||
.IP \(em 3
|
\fB--databits | -d
|
||||||
\'h' for hardware flow control (RTS/CTS)
|
\f1Defines the number of data bits in every character. Must be one of: 5, 6, 7, 8. (Default: 8)
|
||||||
.IP \(em 3
|
.TP
|
||||||
\'n' for no flow control
|
\fB--esacpe | -e
|
||||||
.PP
|
\f1Defines the character that will make picocom enter command-mode (see description above). If 'x' is given, then C-x will make picocom enter command mode. (Default: 'a')
|
||||||
(Default: 'n')
|
.TP
|
||||||
.RE
|
\fB--echo | -c
|
||||||
.TP 3
|
\f1Enable local echo. Every character being read from the terminal (standard input) is echoed to the terminal (standard output) subject to the echo-mapping configuration (see \fI--emap\f1 option. (Default: Disabled)
|
||||||
.B --parity | -p
|
.TP
|
||||||
Defines the parity mode to set the serial-port to. Must be one of:
|
\fB--noinit | -i
|
||||||
.RS 3
|
\f1If given, picocom will not initialize, reset, or otherwise meddle with the serial port at start-up. It will just open it. This is useful, for example, for connecting picocom to already-connected modems, or already configured ports without terminating the connection, or altering the settings. If required serial port parameters can then be adjusted at run-time by commands.
|
||||||
.IP \(em 3
|
.TP
|
||||||
\'o' for odd parity mode.
|
\fB--noreset | -r
|
||||||
.IP \(em 3
|
\f1If given, picocom will not *reset* the serial port when exiting. It will just close the filedes and do nothing more. This is useful, for example, for leaving modems connected when exiting picocom. Regardless whether the \fI--noreset\f1 option is given the user can exit picocom using the "Quit" command (instead of "Exit"), which never resets the serial port. If \fI--noreset\f1 is given then "Quit" and "Exit" behave essentially the same.
|
||||||
\'e' for even parity mode.
|
.TP
|
||||||
.IP \(em 3
|
\fB--nolock | -l
|
||||||
\'n' for no parity, mode.
|
\f1If given, picocom will *not* attempt to lock the serial port before opening it. Normally picocom attempts to get a UUCP-style lock-file (e.g. "/var/lock/LCK..ttyS0") before opening the port. Failing to do so, results in the program exiting after emitting an error-message. It is possible that your picocom binary is compiled without this option.
|
||||||
.PP
|
.TP
|
||||||
(Default: 'n')
|
\fB--send-cmd | -s
|
||||||
.RE
|
\f1Specifies the external program (and any arguments to it) that will be used for transmitting files. (Default: "sz -vv")
|
||||||
.TP 3
|
.TP
|
||||||
.B --databits | -d
|
\fB--receive-cmd | -v
|
||||||
Defines the number of data bits in every character. Must be one of: 5, 6, 7, 8
|
\f1Specifies the external program (and any arguments to it) that will be used for receiving files. (Default: "rz -vv")
|
||||||
.br
|
.TP
|
||||||
.sp 0.6v
|
\fB--imap
|
||||||
(Default: 8)
|
\f1Specifies the input character map (i.e. special characters to be replaced when read from the serial port). Example: "--imap crlf,delbs". (Defaul: Empty)
|
||||||
.TP 3
|
.TP
|
||||||
.B --esacpe | -e
|
\fB--omap
|
||||||
Defines the character that will make picocom enter command-mode (see description above). If 'x' is given, then C-x will make picocom enter command mode.
|
\f1Specifies the output character map (i.e. special characters to be replaced before being written to serial port). Example: "--omap crcrlf,bsdel". (Defaul: Empty)
|
||||||
.br
|
.TP
|
||||||
.sp 0.6v
|
\fB--emap
|
||||||
(Default: 'a')
|
\f1Specifies the local-echo character map (i.e. special characters to be replaced before being echoed-back to the terminal, if local-echo is enabled). Example: "--emap crcrlf,bsdel". (Defaul: delbs,crcrlf)
|
||||||
.TP 3
|
.TP
|
||||||
.B --echo | -c
|
\fB--help | -h
|
||||||
Enable local echo. Every character being read from the terminal (standard input) is echoed to the terminal (standard output) subject to the echo-mapping configuration (see
|
\f1Print a short help message describing the command-line options.
|
||||||
.I --emap
|
|
||||||
option.
|
|
||||||
.br
|
|
||||||
.sp 0.6v
|
|
||||||
(Default: Disabled)
|
|
||||||
.TP 3
|
|
||||||
.B --noinit | -i
|
|
||||||
If given,
|
|
||||||
.B picocom
|
|
||||||
will not initialize, reset, or otherwise meddle with the serial port at start-up. It will just open it. This is useful, for example, for connecting
|
|
||||||
.B picocom
|
|
||||||
to already-connected modems, or already configured ports without terminating the connection, or altering the settings. If required serial port parameters can then be adjusted at run-time by commands.
|
|
||||||
.TP 3
|
|
||||||
.B --noreset | -r
|
|
||||||
If given,
|
|
||||||
.B picocom
|
|
||||||
will not *reset* the serial port when exiting. It will just close the filedes and do nothing more. This is useful, for example, for leaving modems connected when exiting
|
|
||||||
.B picocom
|
|
||||||
. Regardless whether the "--noreset" option is given the user can exit
|
|
||||||
.B picocom
|
|
||||||
using the "Quit" command (instead of "Exit"), which never resets the serial port. If "--noreset" is given then "Quit" and "Exit" behave essentially the same.
|
|
||||||
.TP 3
|
|
||||||
.B --nolock | -l
|
|
||||||
If given,
|
|
||||||
.B picocom
|
|
||||||
will *not* attempt to lock the serial port before opening it. Normally picocom attempts to get a UUCP-style lock-file (e.g. "/var/lock/LCK..ttyS0") before opening the port. Failing to do so, results in the program exiting after emitting an error-message. It is possible that your picocom binary is compiled without this option.
|
|
||||||
.TP 3
|
|
||||||
.B --send-cmd | -s
|
|
||||||
Specifies the external program (and any arguments to it) that will be used for transmitting files.
|
|
||||||
.br
|
|
||||||
.sp 0.6v
|
|
||||||
Default: "sz -vv"
|
|
||||||
.TP 3
|
|
||||||
.B --receive-cmd | -v
|
|
||||||
Specifies the external program (and any arguments to it) that will be used for receiving files.
|
|
||||||
.br
|
|
||||||
.sp 0.6v
|
|
||||||
(Default: "rz -vv")
|
|
||||||
.TP 3
|
|
||||||
.B --imap
|
|
||||||
Specifies the input character map (i.e. special characters to be replaced when read from the serial port). Example: "--imap crlf,delbs"
|
|
||||||
.br
|
|
||||||
.sp 0.6v
|
|
||||||
(Defaul: Empty)
|
|
||||||
.TP 3
|
|
||||||
.B --omap
|
|
||||||
Specifies the output character map (i.e. special characters to be replaced before being written to serial port). Example: "--omap crcrlf,bsdel"
|
|
||||||
.br
|
|
||||||
.sp 0.6v
|
|
||||||
(Defaul: Empty)
|
|
||||||
.TP 3
|
|
||||||
.B --emap
|
|
||||||
Specifies the local-echo character map (i.e. special characters to be replaced before being echoed-back to the terminal, if local-echo is enabled). Example: "--emap crcrlf,bsdel"
|
|
||||||
.br
|
|
||||||
.sp 0.6v
|
|
||||||
(Defaul: delbs,crcrlf)
|
|
||||||
.TP 3
|
|
||||||
.B --help | -h
|
|
||||||
Print a short help message describing the command-line options.
|
|
||||||
.PP
|
|
||||||
.SH AUTHOR
|
.SH AUTHOR
|
||||||
picocom was written by Nick Patavalis (npat@efault.net)
|
picocom was written by Nick Patavalis (npat@efault.net)
|
||||||
.br
|
|
||||||
.sp 0.6v
|
|
||||||
.SH AVAILABILITY
|
.SH AVAILABILITY
|
||||||
The latest version of "picocom" can be downloaded from:
|
The latest version of "picocom" can be downloaded from: \fBhttp://code.google.com/p/picocom/\f1
|
||||||
.B http://code.google.com/p/picocom/
|
|
||||||
|
1063
picocom.8.html
1063
picocom.8.html
File diff suppressed because it is too large
Load Diff
533
picocom.8.ps
533
picocom.8.ps
@ -1,10 +1,10 @@
|
|||||||
%!PS-Adobe-3.0
|
%!PS-Adobe-3.0
|
||||||
%%Creator: groff version 1.21
|
%%Creator: groff version 1.22.2
|
||||||
%%CreationDate: Tue Feb 21 10:04:53 2012
|
%%CreationDate: Thu Aug 6 22:53:21 2015
|
||||||
%%DocumentNeededResources: font Times-Roman
|
%%DocumentNeededResources: font Times-Roman
|
||||||
%%+ font Times-Bold
|
%%+ font Times-Bold
|
||||||
%%+ font Times-Italic
|
%%+ font Times-Italic
|
||||||
%%DocumentSuppliedResources: procset grops 1.21 0
|
%%DocumentSuppliedResources: procset grops 1.22 2
|
||||||
%%Pages: 4
|
%%Pages: 4
|
||||||
%%PageOrder: Ascend
|
%%PageOrder: Ascend
|
||||||
%%DocumentMedia: Default 612 792 0 () ()
|
%%DocumentMedia: Default 612 792 0 () ()
|
||||||
@ -14,7 +14,7 @@
|
|||||||
%%PageMedia: Default
|
%%PageMedia: Default
|
||||||
%%EndDefaults
|
%%EndDefaults
|
||||||
%%BeginProlog
|
%%BeginProlog
|
||||||
%%BeginResource: procset grops 1.21 0
|
%%BeginResource: procset grops 1.22 2
|
||||||
%!PS-Adobe-3.0 Resource-ProcSet
|
%!PS-Adobe-3.0 Resource-ProcSet
|
||||||
/setpacking where{
|
/setpacking where{
|
||||||
pop
|
pop
|
||||||
@ -235,18 +235,18 @@ def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
|
|||||||
%%BeginPageSetup
|
%%BeginPageSetup
|
||||||
BP
|
BP
|
||||||
%%EndPageSetup
|
%%EndPageSetup
|
||||||
/F0 10/Times-Roman@0 SF 373.3(picocom\(8\) picocom\(8\))72 48 R/F1 10.95
|
/F0 10/Times-Roman@0 SF 131.795(picocom\(8\) System)72 48 R(Manager')2.5
|
||||||
/Times-Bold@0 SF -.219(NA)72 84 S(ME).219 E F0
|
E 2.5(sM)-.55 G 131.795(anual picocom\(8\))-2.5 F/F1 10.95/Times-Bold@0
|
||||||
|
SF -.219(NA)72 84 S(ME).219 E F0
|
||||||
(picocom \255 minimal dumb-terminal emulation program)108 96 Q F1
|
(picocom \255 minimal dumb-terminal emulation program)108 96 Q F1
|
||||||
(SYNOPSIS)72 112.8 Q/F2 10/Times-Bold@0 SF(picocom [)108 124.8 Q/F3 10
|
(SYNOPSIS)72 112.8 Q/F2 10/Times-Bold@0 SF(picocom [)108 124.8 Q/F3 10
|
||||||
/Times-Italic@0 SF(options)2.73 E F2(])2.77 E F3(de)2.85 E(vice)-.15 E
|
/Times-Italic@0 SF(options)2.5 E F2(])2.5 E F3(de)2.5 E(vice)-.15 E F1
|
||||||
F1(DESCRIPTION)72 141.6 Q F0 1.423(As its name suggests,)108 153.6 R F2
|
(DESCRIPTION)72 141.6 Q F0 1.497(As its name suggests, picocom is a min\
|
||||||
(picocom)3.923 E F0 1.423
|
imal dumb-terminal emulation program. It is, in principle, v)108 153.6 R
|
||||||
(is a minimal dumb-terminal emulation program. It is, in principle, v)
|
(ery)-.15 E 1.141(much lik)108 165.6 R(e)-.1 E F2(minicom\(1\))3.641 E
|
||||||
3.923 F(ery)-.15 E .938(much lik)108 165.6 R(e)-.1 E F2(minicom\(1\))
|
F0 3.641(,o)C 1.141(nly it')-3.641 F 3.641(s")-.55 G 1.141
|
||||||
3.438 E F0 3.439(,o)3.439 G .939(nly it')-3.439 F 3.439(s")-.55 G .939
|
(pico" instead of "mini"! It w)-3.641 F 1.141(as designed to serv)-.1 F
|
||||||
(pico" instead of "mini"! It w)-3.439 F .939(as designed to serv)-.1 F
|
3.641(ea)-.15 G 3.642(sas)-3.641 G 1.142(imple, manual,)-3.642 F .757
|
||||||
3.439(ea)-.15 G 3.439(sas)-3.439 G .939(imple, manual,)-3.439 F .757
|
|
||||||
(modem con\214guration, testing, and deb)108 177.6 R .757
|
(modem con\214guration, testing, and deb)108 177.6 R .757
|
||||||
(ugging tool. It has also serv)-.2 F .756(ed \(quite well\) as a lo)-.15
|
(ugging tool. It has also serv)-.2 F .756(ed \(quite well\) as a lo)-.15
|
||||||
F .756(w-tech "terminal-)-.25 F(windo)108 189.6 Q .865(w" to allo)-.25 F
|
F .756(w-tech "terminal-)-.25 F(windo)108 189.6 Q .865(w" to allo)-.25 F
|
||||||
@ -255,280 +255,287 @@ F .756(w-tech "terminal-)-.25 F(windo)108 189.6 Q .865(w" to allo)-.25 F
|
|||||||
.866(he ms-windo)-3.366 F .866(ws "open)-.25 F(terminal windo)108 201.6
|
.866(he ms-windo)-3.366 F .866(ws "open)-.25 F(terminal windo)108 201.6
|
||||||
Q 2.5(wb)-.25 G(efore / after dialing" feature\). It could also pro)-2.5
|
Q 2.5(wb)-.25 G(efore / after dialing" feature\). It could also pro)-2.5
|
||||||
E .3 -.15(ve u)-.15 H(seful in man).15 E 2.5(yo)-.15 G
|
E .3 -.15(ve u)-.15 H(seful in man).15 E 2.5(yo)-.15 G
|
||||||
(ther similar tasks.)-2.5 E(When)108 220.8 Q F2(picocom)3.989 E F0 1.489
|
(ther similar tasks.)-2.5 E 1.563
|
||||||
(starts it opens the terminal \(serial de)3.989 F 1.489(vice\) gi)-.25 F
|
(When picocom starts it opens the terminal \(serial de)108 225.6 R 1.563
|
||||||
-.15(ve)-.25 G 3.989(na).15 G 3.988(si)-3.989 G 1.488(ts non-option ar)
|
(vice\) gi)-.25 F -.15(ve)-.25 G 4.063(na).15 G 4.062(si)-4.063 G 1.562
|
||||||
-3.988 F 1.488(gument. Unless the)-.18 F F3(--noinit)108.01 232.8 Q F0
|
(ts non-option ar)-4.062 F 1.562(gument. Unless the)-.18 F F3(--noinit)
|
||||||
1.333(option is gi)4.513 F -.15(ve)-.25 G 1.333
|
108 237.6 Q F0 1.376(option is gi)3.876 F -.15(ve)-.25 G 1.376
|
||||||
(n, it con\214gures the de).15 F 1.333
|
(n, it con\214gures the de).15 F 1.376
|
||||||
(vice to the settings speci\214ed by the option-ar)-.25 F 1.334
|
(vice to the settings speci\214ed by the option-ar)-.25 F 1.377
|
||||||
(guments \(or to)-.18 F .487(some def)108 244.8 R .487
|
(guments \(or to)-.18 F .528(some def)108 249.6 R .527
|
||||||
(ault settings\), and sets it to "ra)-.1 F .487(w" mode. If)-.15 F F3
|
(ault settings\), and sets it to "ra)-.1 F .527(w" mode. If)-.15 F F3
|
||||||
(--noinit)2.996 E F0 .486(is gi)3.666 F -.15(ve)-.25 G .486
|
(--noinit)3.027 E F0 .527(is gi)3.027 F -.15(ve)-.25 G .527
|
||||||
(n, the initialization and con\214guration is).15 F .667
|
(n, the initialization and con\214guration is).15 F .746
|
||||||
(skipped; the de)108 256.8 R .667(vice is just opened. F)-.25 F(ollo)
|
(skipped; the de)108 261.6 R .746(vice is just opened. F)-.25 F(ollo)
|
||||||
-.15 E .667(wing this,)-.25 F F2(picocom)3.167 E F0 .667
|
-.15 E .747
|
||||||
(sets the standard-input and standard-output to)3.167 F(ra)108 268.8 Q
|
(wing this, picocom sets the standard-input and standard-output to)-.25
|
||||||
3.289(wm)-.15 G .789(ode. Ha)-3.289 F .789(ving done so, it goes in a l\
|
F(ra)108 273.6 Q 3.289(wm)-.15 G .789(ode. Ha)-3.289 F .789(ving done s\
|
||||||
oop where it listens for input from stdin, or from the serial port.)-.2
|
o, it goes in a loop where it listens for input from stdin, or from the\
|
||||||
F .589(Input from the serial port is copied to the standard output whil\
|
serial port.)-.2 F .589(Input from the serial port is copied to the st\
|
||||||
e input from the standard input is copied to)108 280.8 R .105
|
andard output while input from the standard input is copied to)108 285.6
|
||||||
(the serial port.)108 292.8 R F2(picocom)5.105 E F0 .105
|
R .331(the serial port. picocom also scans its input stream for a user)
|
||||||
(also scans its input stream for a user)2.605 F .105
|
108 297.6 R .33(-speci\214ed control character)-.2 F 2.83(,c)-.4 G .33
|
||||||
(-speci\214ed control character)-.2 F 2.605(,c)-.4 G .105
|
(alled the "escape)-2.83 F .554(character" \(being by def)108 309.6 R
|
||||||
(alled the "escape)-2.605 F .554(character" \(being by def)108 304.8 R
|
|
||||||
.555(ault "C-a"\). If the escape character is seen, then instead of sen\
|
.555(ault "C-a"\). If the escape character is seen, then instead of sen\
|
||||||
ding it to the serial-)-.1 F(de)108 316.8 Q .179
|
ding it to the serial-)-.1 F(de)108 321.6 Q .179
|
||||||
(vice, the program enters "command mode" and w)-.25 F .179
|
(vice, the program enters "command mode" and w)-.25 F .179
|
||||||
(aits for the ne)-.1 F .178
|
(aits for the ne)-.1 F .178
|
||||||
(xt character \(which is called the "function)-.15 F 1.572
|
(xt character \(which is called the "function)-.15 F 1.652
|
||||||
(character"\). Depending on the v)108 328.8 R 1.573
|
(character"\). Depending on the v)108 333.6 R 1.652
|
||||||
(alue of the function character)-.25 F(,)-.4 E F2(picocom)4.073 E F0
|
(alue of the function character)-.25 F 4.152(,p)-.4 G 1.652
|
||||||
1.573(performs one of the operations)4.073 F
|
(icocom performs one of the operations)-4.152 F
|
||||||
(described in the "Commands" section belo)108 340.8 Q -.65(w.)-.25 G F1
|
(described in the "Commands" section belo)108 345.6 Q -.65(w.)-.25 G F1
|
||||||
(COMMANDS)72 364.8 Q F0 1.588(Commands are gi)108 376.8 R -.15(ve)-.25 G
|
(COMMANDS)72 362.4 Q F0 1.657(Commands are gi)108 374.4 R -.15(ve)-.25 G
|
||||||
4.088(nt).15 G(o)-4.088 E F2(picocom)4.088 E F0 1.588(by \214rst k)4.088
|
4.157(nt).15 G 4.157(op)-4.157 G 1.657(icocom by \214rst k)-4.157 F -.15
|
||||||
F -.15(ey)-.1 G 1.587(ing the "espace character" which by def).15 F
|
(ey)-.1 G 1.657(ing the "espace character" which by def).15 F 1.656
|
||||||
1.587(ault is "C-a" \(see)-.1 F .671("Options" belo)108 388.8 R 3.171
|
(ault is "C-a" \(see)-.1 F .671("Options" belo)108 386.4 R 3.171(wo)-.25
|
||||||
(wo)-.25 G 3.172(nh)-3.171 G 1.172 -.25(ow t)-3.172 H 3.172(oc).25 G
|
G 3.172(nh)-3.171 G 1.172 -.25(ow t)-3.172 H 3.172(oc).25 G .672
|
||||||
.672(hange it\), and then k)-3.172 F -.15(ey)-.1 G .672
|
(hange it\), and then k)-3.172 F -.15(ey)-.1 G .672
|
||||||
(ing one for the function \(command\) characters sho).15 F(wn)-.25 E
|
(ing one for the function \(command\) characters sho).15 F(wn)-.25 E
|
||||||
(here.)108 400.8 Q F2([escape character])108 417.6 Q F0 1.244(Send the \
|
(here.)108 398.4 Q 1.82([escape character]: Send the escape character t\
|
||||||
escape character to the serial port and return to "transparent" mode. T\
|
o the serial port and return to "transparent" mode. This)108 422.4 R .06
|
||||||
his means that if the)123 429.6 R .358(escape character \("C-a", by def)
|
(means that if the escape character \("C-a", by def)108 434.4 R .06
|
||||||
123 441.6 R .359(ault\) is typed twice, the program sends the escape ch\
|
(ault\) is typed twice, the program sends the escape character)-.1 F
|
||||||
aracter to the serial)-.1 F .054
|
.211(to the serial port, and remains in transparent mode. This is a ne)
|
||||||
(port, and remains in transparent mode. This is a ne)123 453.6 R 2.553
|
108 446.4 R 2.71(wb)-.25 G(eha)-2.71 E .21
|
||||||
(wb)-.25 G(eha)-2.553 E .053(vior implemented in v1.4. Pre)-.2 F .053
|
(vior implemented in v1.4. Pre)-.2 F(viously)-.25 E
|
||||||
(viously picocom)-.25 F(used to ignore the escape-character when it w)
|
(picocom used to ignore the escape-character when it w)108 458.4 Q
|
||||||
123 465.6 Q(as entered as a function character)-.1 E(.)-.55 E F2(C-x)108
|
(as entered as a function character)-.1 E(.)-.55 E .34
|
||||||
482.4 Q F0 .567(Exit the program: if the "--noreset" option w)123 494.4
|
([C-x]: Exit the program: if the)108 482.4 R F3(--nor)2.84 E(eset)-.37 E
|
||||||
R .567(as not gi)-.1 F -.15(ve)-.25 G 3.067(nt).15 G .567
|
F0 .34(option w)2.84 F .34(as not gi)-.1 F -.15(ve)-.25 G 2.84(nt).15 G
|
||||||
(hen the serial port is reset to its original set-)-3.067 F
|
.34(hen the serial port is reset to its original set-)-2.84 F
|
||||||
(tings before e)123 506.4 Q(xiting; if it w)-.15 E(as gi)-.1 E -.15(ve)
|
(tings before e)108 494.4 Q(xiting; if it w)-.15 E(as gi)-.1 E -.15(ve)
|
||||||
-.25 G 2.5(nt).15 G(he serial port is not reset.)-2.5 E F2(C-q)108 523.2
|
-.25 G 2.5(nt).15 G(he serial port is not reset.)-2.5 E
|
||||||
Q F0(Quit the program *without* reseting the serial port, re)123 535.2 Q
|
([C-q]: Quit the program *without* reseting the serial port, re)108
|
||||||
-.05(ga)-.15 G(rdless of the "--noreset" option.).05 E F2(C-p)108 552 Q
|
518.4 Q -.05(ga)-.15 G(rdless of the).05 E F3(--nor)2.5 E(eset)-.37 E F0
|
||||||
F0(Pulse the DTR line. Lo)123 564 Q
|
(option.)2.5 E([C-p]: Pulse the DTR line. Lo)108 542.4 Q
|
||||||
(wer it for 1 sec, and then raise it ag)-.25 E(ain.)-.05 E F2(C-t)108
|
(wer it for 1 sec, and then raise it ag)-.25 E(ain.)-.05 E([C-t]: T)108
|
||||||
580.8 Q F0 -.8(To)123 592.8 S(ggle the DTR line. If DTR is up, then lo)
|
566.4 Q(oggle the DTR line. If DTR is up, then lo)-.8 E
|
||||||
.8 E(wer it. If it is do)-.25 E(wn, then raise it.)-.25 E F2
|
(wer it. If it is do)-.25 E(wn, then raise it.)-.25 E 1.66([C-backslash\
|
||||||
(C-backslash)108 609.6 Q F0 .026(Generate a break sequence on the seria\
|
]: Generate a break sequence on the serial line. A break sequence is us\
|
||||||
l line. A break sequence is usually generated by marking \(dri)123 621.6
|
ually generated by)108 590.4 R .471(marking \(dri)108 602.4 R .471(ving\
|
||||||
R(ving)-.25 E(to logical one\) the serial Tx line for an amount of time\
|
to logical one\) the serial Tx line for an amount of time coresponding\
|
||||||
coresponding to se)123 633.6 Q -.15(ve)-.25 G(ral character durations.)
|
to se)-.25 F -.15(ve)-.25 G .472(ral character).15 F(durations.)108
|
||||||
.15 E F2(C-u)108 650.4 Q F0 .601(Baud up. Increase the baud-rate. The l\
|
614.4 Q 1.138([C-u]: Baud up. Increase the baud-rate. The list of baud-\
|
||||||
ist of baud-rates stepped-through by this command is: 300, 600,)123
|
rates stepped-through by this command is: 300,)108 638.4 R
|
||||||
662.4 R(1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200.)123 674.4 Q
|
(600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200.)108 650.4 Q
|
||||||
F2(C-d)108 691.2 Q F0 1.555(Baud do)123 703.2 R 1.555(wn. Decrease the \
|
.655([C-d]: Baud do)108 674.4 R .655(wn. Decrease the baud-rate. The li\
|
||||||
baud-rate. The list of baud-rates stepped-through by this command is th\
|
st of baud-rates stepped-through by this command is the)-.25 F
|
||||||
e)-.25 F(same as for the "baud-up" command.)123 715.2 Q(1)535 768 Q 0 Cg
|
(same as for the "baud-up" command.)108 686.4 Q
|
||||||
EP
|
([C-f]: Cycle through \215o)108 710.4 Q(w-control settings \(R)-.25 E
|
||||||
|
(TS/CTS, XON/XOFF)-.6 E 2.5(,n)-.8 G(one\).)-2.5 E 187.62(Manuals User)
|
||||||
|
72 768 R(1)219.56 E 0 Cg EP
|
||||||
%%Page: 2 2
|
%%Page: 2 2
|
||||||
%%BeginPageSetup
|
%%BeginPageSetup
|
||||||
BP
|
BP
|
||||||
%%EndPageSetup
|
%%EndPageSetup
|
||||||
/F0 10/Times-Roman@0 SF 373.3(picocom\(8\) picocom\(8\))72 48 R/F1 10
|
/F0 10/Times-Roman@0 SF 131.795(picocom\(8\) System)72 48 R(Manager')2.5
|
||||||
/Times-Bold@0 SF(C-f)108 84 Q F0(Cycle through \215o)123 96 Q
|
E 2.5(sM)-.55 G 131.795(anual picocom\(8\))-2.5 F
|
||||||
(w-control settings \(R)-.25 E(TS/CTS, XON/XOFF)-.6 E 2.5(,n)-.8 G
|
([C-y]: Cycle through parity settings \(e)108 84 Q -.15(ve)-.25 G
|
||||||
(one\).)-2.5 E F1(C-y)108 112.8 Q F0(Cycle through parity settings \(e)
|
(n, odd, none\).).15 E
|
||||||
123 124.8 Q -.15(ve)-.25 G(n, odd, none\).).15 E F1(C-b)108 141.6 Q F0
|
([C-b]: Cycle through databits-number settings \(5, 6, 7, 8\).)108 108 Q
|
||||||
(Cycle through databits-number settings \(5, 6, 7, 8\).)123 153.6 Q F1
|
([C-c]: T)108 132 Q(oggle local-echo mode.)-.8 E .729([C-v]: Sho)108 156
|
||||||
(C-c)108 170.4 Q F0 -.8(To)123 182.4 S(ggle local-echo mode.).8 E F1
|
R 3.229(wp)-.25 G .729(rogram options \(lik)-3.229 F 3.229(eb)-.1 G .729
|
||||||
(C-v)108 199.2 Q F0(Sho)123 211.2 Q 4.02(wp)-.25 G 1.52
|
(aud rate, data bits, etc\). Only the options that can be modi\214ed on\
|
||||||
(rogram options \(lik)-4.02 F 4.02(eb)-.1 G 1.521(aud rate, data bits, \
|
line)-3.229 F(\(through commands\) are sho)108 168 Q
|
||||||
etc\). Only the options that can be modi\214ed online)-4.02 F
|
(wn, not those that can only be set at the command-line.)-.25 E
|
||||||
(\(through commands\) are sho)123 223.2 Q
|
([C-s]: Send \(upload\) a \214le \(see "Sending and Recei)108 192 Q
|
||||||
(wn, not those that can only be set at the command-line.)-.25 E F1(C-s)
|
(ving Files" belo)-.25 E(w\))-.25 E([C-r]: Recei)108 216 Q .3 -.15
|
||||||
108 240 Q F0(Send \(upload\) a \214le \(see "Sending and Recei)123 252 Q
|
(ve \()-.25 H(do).15 E(wnload\) a \214le \(see "Sending and Recei)-.25 E
|
||||||
(ving Files" belo)-.25 E(w\))-.25 E F1(C-r)108 268.8 Q F0(Recei)123
|
(ving Files" belo)-.25 E(w\))-.25 E .054
|
||||||
280.8 Q .3 -.15(ve \()-.25 H(do).15 E
|
(After performing one of the abo)108 240 R .354 -.15(ve o)-.15 H .054
|
||||||
(wnload\) a \214le \(see "Sending and Recei)-.25 E(ving Files" belo)-.25
|
(perations the program lea).15 F -.15(ve)-.2 G 2.554(st).15 G .054
|
||||||
E(w\))-.25 E .054(After performing one of the abo)108 297.6 R .354 -.15
|
(he command mode and enters transparent)-2.554 F(mode. Example: T)108
|
||||||
(ve o)-.15 H .054(perations the program lea).15 F -.15(ve)-.2 G 2.554
|
252 Q 2.5(oi)-.8 G(ncrease the baud-rate by tw)-2.5 E 2.5(os)-.1 G
|
||||||
(st).15 G .054(he command mode and enters transparent)-2.554 F
|
(teps, you ha)-2.5 E .3 -.15(ve t)-.2 H 2.5(ot).15 G(ype:)-2.5 E
|
||||||
(mode. Example: T)108 309.6 Q 2.5(oi)-.8 G(ncrease the baud-rate by tw)
|
(C-a, C-u, C-a, C-u)108 276 Q
|
||||||
-2.5 E 2.5(os)-.1 G(teps, you ha)-2.5 E .3 -.15(ve t)-.2 H 2.5(ot).15 G
|
(assuming of-course that "C-a" is the escape character)108 300 Q(.)-.55
|
||||||
(ype:)-2.5 E(C-a, C-u, C-a, C-u)108 328.8 Q
|
E/F1 10.95/Times-Bold@0 SF(SENDING AND RECEIVING FILES)72 316.8 Q F0
|
||||||
(assuming of-course that "C-a" is the escape character)108 348 Q(.)-.55
|
.497(picocom can send and recei)108 328.8 R .796 -.15(ve \214)-.25 H
|
||||||
E/F2 10.95/Times-Bold@0 SF(SENDING AND RECEIVING FILES)72 372 Q F1
|
.496(les o).15 F -.15(ve)-.15 G 2.996(rt).15 G .496
|
||||||
(picocom)108 384 Q F0 .427(can send and recei)2.926 F .727 -.15(ve \214)
|
(he serial port using e)-2.996 F .496
|
||||||
-.25 H .427(les o).15 F -.15(ve)-.15 G 2.927(rt).15 G .427
|
(xternal programs that implement the respec-)-.15 F(ti)108 340.8 Q .3
|
||||||
(he serial port using e)-2.927 F .427
|
-.15(ve p)-.25 H
|
||||||
(xternal programs that implement the respec-)-.15 F(ti)108 396 Q .3 -.15
|
(rotocols. In Linux typical programs for this purpose are:).15 E/F2 10
|
||||||
(ve p)-.25 H(rotocols. In Linux typical programs for this purpose are:)
|
/Times-Bold@0 SF(rx\(1\))108 364.8 Q F0 2.5(-r)2.5 G(ecei)-2.5 E .3 -.15
|
||||||
.15 E<8a>108 412.8 Q F1(rx\(1\))123 412.8 Q F0 2.5(-r)2.5 G(ecei)-2.5 E
|
(ve u)-.25 H(sing the X-MODEM protocol).15 E F2(rb\(1\))108 388.8 Q F0
|
||||||
.3 -.15(ve u)-.25 H(sing the X-MODEM protocol).15 E<8a>108 429.6 Q F1
|
2.5(-r)2.5 G(ecei)-2.5 E .3 -.15(ve u)-.25 H(sing the Y).15 E
|
||||||
(rb\(1\))123 429.6 Q F0 2.5(-r)2.5 G(ecei)-2.5 E .3 -.15(ve u)-.25 H
|
(-MODEM protocol)-1.11 E F2(rz\(1\))108 412.8 Q F0 2.5(-r)2.5 G(ecei)
|
||||||
(sing the Y).15 E(-MODEM protocol)-1.11 E<8a>108 446.4 Q F1(rz\(1\))123
|
-2.5 E .3 -.15(ve u)-.25 H(sing the Z-MODEM protocol).15 E F2(sx\(1\))
|
||||||
446.4 Q F0 2.5(-r)2.5 G(ecei)-2.5 E .3 -.15(ve u)-.25 H
|
108 436.8 Q F0 2.5(-s)2.5 G(end using the X-MODEM protocol)-2.5 E F2
|
||||||
(sing the Z-MODEM protocol).15 E<8a>108 463.2 Q F1(sx\(1\))123 463.2 Q
|
(sb\(1\))108 460.8 Q F0 2.5(-s)2.5 G(end using the Y)-2.5 E
|
||||||
F0 2.5(-s)2.5 G(end using the X-MODEM protocol)-2.5 E<8a>108 480 Q F1
|
(-MODEM protocol)-1.11 E F2(sz\(1\))108 484.8 Q F0 2.5(-s)2.5 G
|
||||||
(sb\(1\))123 480 Q F0 2.5(-s)2.5 G(end using the Y)-2.5 E
|
(end using the Z-MODEM protocol)-2.5 E F2(ascii-xfr\(1\))108 508.8 Q F0
|
||||||
(-MODEM protocol)-1.11 E<8a>108 496.8 Q F1(sz\(1\))123 496.8 Q F0 2.5
|
2.5(-r)2.5 G(ecei)-2.5 E .3 -.15(ve o)-.25 H 2.5(rt).15 G
|
||||||
(-s)2.5 G(end using the Z-MODEM protocol)-2.5 E<8a>108 513.6 Q F1
|
(ransmit ASCII \214les)-2.5 E .692(The name of, and the command-line op\
|
||||||
(ascii-xfr\(1\))123 513.6 Q F0 2.5(-r)2.5 G(ecei)-2.5 E .3 -.15(ve o)
|
tions to, the program to be used for transmitting \214les are gi)108
|
||||||
-.25 H 2.5(rt).15 G(ransmit ASCII \214les)-2.5 E .692(The name of, and \
|
532.8 R -.15(ve)-.25 G 3.192(nb).15 G(y)-3.192 E(the)108 544.8 Q/F3 10
|
||||||
the command-line options to, the program to be used for transmitting \
|
/Times-Italic@0 SF(--send-cmd)3.149 E F0 .649
|
||||||
\214les are gi)108 530.4 R -.15(ve)-.25 G 3.191(nb).15 G(y)-3.191 E
|
(option. Similarly the program to recei)3.149 F .949 -.15(ve \214)-.25 H
|
||||||
2.843(the "--send-cmd" option. Similarly the program to recei)108 542.4
|
.649(les, and its ar).15 F .649(gumets, are gi)-.18 F -.15(ve)-.25 G
|
||||||
R 3.143 -.15(ve \214)-.25 H 2.843(les, and its ar).15 F 2.844
|
3.148(nb).15 G 3.148(yt)-3.148 G(he)-3.148 E F3(--r)3.148 E(eceive-)-.37
|
||||||
(gumets, are gi)-.18 F -.15(ve)-.25 G 5.344(nb).15 G 5.344(yt)-5.344 G
|
E(cmd)108 556.8 Q F0 1.135(option. F)3.635 F 1.135(or e)-.15 F 1.135(xa\
|
||||||
(he)-5.344 E("--recei)108 554.4 Q -.15(ve)-.25 G .118(-cmd" option. F)
|
mple, in order to start a picocom session that uses "sz" to transmit \
|
||||||
.15 F .117(or e)-.15 F .117(xample, in order to start a)-.15 F F1
|
\214les, and "rz" to)-.15 F(recei)108 568.8 Q -.15(ve)-.25 G 2.5(,y).15
|
||||||
(picocom)2.617 E F0 .117
|
G(ou ha)-2.5 E .3 -.15(ve t)-.2 H 2.5(os).15 G(ay something lik)-2.5 E
|
||||||
(session that uses "sz" to transmit \214les, and)2.617 F("rz" to recei)
|
2.5(et)-.1 G(his:)-2.5 E(picocom --send-cmd "sz -vv" --recei)108 592.8 Q
|
||||||
108 566.4 Q -.15(ve)-.25 G 2.5(,y).15 G(ou ha)-2.5 E .3 -.15(ve t)-.2 H
|
-.15(ve)-.25 G(-cmd "rz -vv").15 E .309
|
||||||
2.5(os).15 G(ay something lik)-2.5 E 2.5(et)-.1 G(his:)-2.5 E
|
(During the picocom session, if you k)108 616.8 R .609 -.15(ey t)-.1 H
|
||||||
(picocom --send-cmd "sz -vv" --recei)108 585.6 Q -.15(ve)-.25 G
|
.309(he "send" or "recei).15 F -.15(ve)-.25 G 2.809("c).15 G .309
|
||||||
(-cmd "rz -vv").15 E .309(During the picocom session, if you k)108 604.8
|
(ommands \(e.g. by pressing C-a, C-s, or C-)-2.809 F .43(a, C-r\) you w\
|
||||||
R .609 -.15(ey t)-.1 H .309(he "send" or "recei).15 F -.15(ve)-.25 G
|
ill be prompted for a \214lename. At this prompt you can enter one or m\
|
||||||
2.809("c).15 G .309(ommands \(e.g. by pressing C-a, C-s, or C-)-2.809 F
|
ore \214le-names, and an)108 628.8 R(y)-.15 E .533(additional ar)108
|
||||||
.431(a, C-r\) you will be prompted for a \214lename. At this prompt you\
|
640.8 R .532(guments to the transmission or reception program. Command-\
|
||||||
can enter one or more \214le-names, and an)108 616.8 R(y)-.15 E .487
|
line editing and pathname com-)-.18 F .982(pletion are a)108 652.8 R
|
||||||
(additional ar)108 628.8 R .487(guments to the transmission or receptio\
|
-.25(va)-.2 G .982(ilable at this prompt, if you ha).25 F 1.283 -.15
|
||||||
n program. After that, picocom will start the the e)-.18 F(xter)-.15 E
|
(ve c)-.2 H .983(ompiled picocom with support for the linenoise library)
|
||||||
(-)-.2 E .403
|
.15 F(.)-.65 E .077(Pressing 'C-c' at this prompt will cancel the \214l\
|
||||||
(nal program as speci\214ed by the "--send-cmd", or "--recei)108 640.8 R
|
e transfer command and return to normal picocom operation.)108 664.8 R
|
||||||
-.15(ve)-.25 G .403(-cmd" option, and with an).15 F 2.902<798c>-.15 G
|
.597(After entering a \214lename \(and / or additional transmission or \
|
||||||
.402(lenames and addi-)-2.902 F 1.195(tional ar)108 652.8 R 1.195
|
reception program ar)108 676.8 R .598(guments\) and assuming)-.18 F .479
|
||||||
(guments you may ha)-.18 F 1.495 -.15(ve s)-.2 H 1.195
|
(you ha)108 688.8 R .779 -.15(ve n)-.2 H .479(ot canceled the operation\
|
||||||
(upplied. The standard input and output of the e).15 F 1.195
|
by pressing C-c, picocom will start the the e).15 F .478
|
||||||
(xternal program will be)-.15 F .851
|
(xternal program as speci-)-.15 F .352(\214ed by the)108 700.8 R F3
|
||||||
(connected to the serial port. The standard error of the e)108 664.8 R
|
(--send-cmd)2.852 E F0 2.852(,o)C(r)-2.852 E F3(--r)2.852 E(eceive-cmd)
|
||||||
.851(xternal program will be connected to the terminal)-.15 F 1.399
|
-.37 E F0 .352(option, and with an)2.852 F 2.852<798c>-.15 G .352
|
||||||
(which---while the program is running---will re)108 676.8 R -.15(ve)-.25
|
(lenames and additional ar)-2.852 F .352(guments you may)-.18 F(ha)108
|
||||||
G 1.399(rt to canonical mode. Pressing 'C-c' while the e).15 F(xternal)
|
712.8 Q 1.023 -.15(ve s)-.2 H .723
|
||||||
-.15 E(program is running will prematurely terminate it, and return con\
|
(upplied. The standard input and output of the e).15 F .723
|
||||||
trol to)108 688.8 Q F1(picocom)2.5 E F0(2)535 768 Q 0 Cg EP
|
(xternal program will be connected to the serial port.)-.15 F .522
|
||||||
|
(The standard error of the e)108 724.8 R .523(xternal program will be c\
|
||||||
|
onnected to the terminal which---while the program is)-.15 F 187.62
|
||||||
|
(Manuals User)72 768 R(2)219.56 E 0 Cg EP
|
||||||
%%Page: 3 3
|
%%Page: 3 3
|
||||||
%%BeginPageSetup
|
%%BeginPageSetup
|
||||||
BP
|
BP
|
||||||
%%EndPageSetup
|
%%EndPageSetup
|
||||||
/F0 10/Times-Roman@0 SF 373.3(picocom\(8\) picocom\(8\))72 48 R/F1 10.95
|
/F0 10/Times-Roman@0 SF 131.795(picocom\(8\) System)72 48 R(Manager')2.5
|
||||||
/Times-Bold@0 SF(INPUT)72 84 Q 2.738(,O)-.81 G(UTPUT)-2.738 E 2.738(,A)
|
E 2.5(sM)-.55 G 131.795(anual picocom\(8\))-2.5 F .684
|
||||||
-.81 G(ND ECHO MAPPING)-2.738 E F0 .373
|
(running---will re)108 84 R -.15(ve)-.25 G .684
|
||||||
(Using the "--imap", "--omap", and "--emap" options you can mak)108 96 R
|
(rt to canonical mode. Pressing 'C-c' while the e).15 F .683
|
||||||
(e)-.1 E/F2 10/Times-Bold@0 SF(picocom)2.873 E F0 .372
|
(xternal program is running will prema-)-.15 F .029(turely terminate it\
|
||||||
(map \(tranlate, replace\) certain)2.873 F .214
|
, and return control to picocom. Pressing 'C-c' at an)108 96 R 2.53(yo)
|
||||||
(special characters after being read from the serial port \(with)108 108
|
-.15 G .03(ther time, has no special ef)-2.53 F .03(fect; the)-.25 F
|
||||||
R/F3 10/Times-Italic@0 SF(--imap)2.724 E F0 .215
|
(character is normally passed to the serial port.)108 108 Q/F1 10.95
|
||||||
(\), before being written to the serial port)2.905 F(\(with)108 120 Q F3
|
/Times-Bold@0 SF(INPUT)72 124.8 Q 2.738(,O)-.81 G(UTPUT)-2.738 E 2.738
|
||||||
(--omap)3.34 E F0 .83(\), and before being locally echoed to the termin\
|
(,A)-.81 G(ND ECHO MAPPING)-2.738 E F0 .036(Using the)108 136.8 R/F2 10
|
||||||
al \(standard output\) if local echo is enabled)3.52 F(\(with)108 132 Q
|
/Times-Italic@0 SF(--imap)2.536 E F0(,)A F2(--omap)2.536 E F0 2.536(,a)C
|
||||||
F3(--emap)3.495 E F0 .985(\). These mapping options tak)3.675 F .986
|
(nd)-2.536 E F2(--emap)2.536 E F0 .036(options you can mak)2.536 F 2.536
|
||||||
(e, each, a single ar)-.1 F .986
|
(ep)-.1 G .036(icocom map \(tranlate, replace\) certain special)-2.536 F
|
||||||
(gument which is a comma-separated list of)-.18 F
|
.777(characters after being read from the serial port \(with)108 148.8 R
|
||||||
(one or more of the follo)108 144 Q(wing identi\214ers:)-.25 E<8a>108
|
F2(--imap)3.278 E F0 .778
|
||||||
160.8 Q(crlf: map CR to LF)123 160.8 Q<8a>108 177.6 Q
|
(\), before being written to the serial port \(with)B F2(--omap)108
|
||||||
(crcrlf: map CR to CR + LF)123 177.6 Q<8a>108 194.4 Q(igncr: ignore CR)
|
160.8 Q F0 1.051(\), and before being locally echoed to the terminal \(\
|
||||||
123 194.4 Q<8a>108 211.2 Q(lfcr: map LF to CR)123 211.2 Q<8a>108 228 Q
|
standard output\) if local echo is enabled \(with)B F2(--emap)108 172.8
|
||||||
(lfcrlf: map LF to CR + LF)123 228 Q<8a>108 244.8 Q(ignlf: ignore LF)123
|
Q F0 .894(\). These mapping options tak)B .894(e, each, a single ar)-.1
|
||||||
244.8 Q<8a>108 261.6 Q(bsdel: map BS --> DEL)123 261.6 Q<8a>108 278.4 Q
|
F .895(gument which is a comma-separated list of one or)-.18 F .985
|
||||||
(delbs: map DEL --> BS)123 278.4 Q -.15(Fo)108 295.2 S 2.5(re).15 G
|
(more of the follo)108 184.8 R .984(wing identi\214ers: "crlf" \(map CR\
|
||||||
|
to LF\), "crcrlf" \(map CR to CR + LF\), "igncr" \(ignore)-.25 F .197(\
|
||||||
|
CR\), "lfcr" \(map LF to CR\), "lfcrlf" \(map LF to CR + LF\), "ignlf" \
|
||||||
|
\(ignore LF\), "bsdel" \(map BS --> DEL\),)108 196.8 R
|
||||||
|
("delbs" \(map DEL --> BS\))108 208.8 Q -.15(Fo)108 232.8 S 2.5(re).15 G
|
||||||
(xample the command:)-2.65 E
|
(xample the command:)-2.65 E
|
||||||
(picocom --omap crlf,delbs --imap inglf,bsdel --emap crcrlf ...)108
|
(picocom --omap crlf,delbs --imap inglf,bsdel --emap crcrlf ...)108
|
||||||
314.4 Q .86(will: Replace e)108 333.6 R -.15(ve)-.25 G .86(ry CR \(carr\
|
256.8 Q .86(will: Replace e)108 280.8 R -.15(ve)-.25 G .86(ry CR \(carr\
|
||||||
iage return, 0x0d\) caracter with LF \(line feed, 0x0a\) and e).15 F
|
iage return, 0x0d\) caracter with LF \(line feed, 0x0a\) and e).15 F
|
||||||
-.15(ve)-.25 G .86(ry DEL \(delete,).15 F .054(0x7f\) character with BS\
|
-.15(ve)-.25 G .86(ry DEL \(delete,).15 F .054(0x7f\) character with BS\
|
||||||
\(backspace, 0x08\) before writing it to the serial port. Ignore \(not\
|
\(backspace, 0x08\) before writing it to the serial port. Ignore \(not\
|
||||||
write to the termi-)108 345.6 R .782(nal\) e)108 357.6 R -.15(ve)-.25 G
|
write to the termi-)108 292.8 R .782(nal\) e)108 304.8 R -.15(ve)-.25 G
|
||||||
.781(ry LF character read from the serial port and replace e).15 F -.15
|
.781(ry LF character read from the serial port and replace e).15 F -.15
|
||||||
(ve)-.25 G .781(ry BS character read from the serial port).15 F 1.42
|
(ve)-.25 G .781(ry BS character read from the serial port).15 F 1.42
|
||||||
(with DEL. Replace e)108 369.6 R -.15(ve)-.25 G 1.42(ry CR character wi\
|
(with DEL. Replace e)108 316.8 R -.15(ve)-.25 G 1.42(ry CR character wi\
|
||||||
th CR and LF when echoing to the terminal \(if local-echo is).15 F
|
th CR and LF when echoing to the terminal \(if local-echo is).15 F
|
||||||
(enabled\).)108 381.6 Q F1(OPTIONS)72 405.6 Q F2(picocom)108 417.6 Q F0
|
(enabled\).)108 328.8 Q F1(OPTIONS)72 345.6 Q F0
|
||||||
(accepts the follo)2.5 E(wing command-line options)-.25 E F2
|
(picocom accepts the follo)108 357.6 Q(wing command-line options)-.25 E
|
||||||
(--baud | -b)108 434.4 Q F0
|
/F3 10/Times-Bold@0 SF(--baud | -b)108 374.4 Q F0
|
||||||
(De\214nes the baud-rate to set the serial-port \(terminal\) to.)123
|
(De\214nes the baud-rate to set the serial-port \(terminal\) to.)144
|
||||||
446.4 Q F2(--\215o)108 463.2 Q 2.5(w|-)-.1 G(f)-2.5 E F0
|
386.4 Q F3(--\215o)108 403.2 Q 2.5(w|-)-.1 G(f)-2.5 E F0 .33
|
||||||
(De\214nes the \215o)123 475.2 Q
|
(De\214nes the \215o)144 415.2 R .33(w-control mode to set the serial-p\
|
||||||
(w-control mode to set the serial-port to. Must be one of:)-.25 E<8a>123
|
ort to. Must be one of: 'x' for xon/xof)-.25 F 2.83(f\()-.25 G(softw)
|
||||||
492 Q(\264x' for xon/xof)138 492 Q 2.5(f\()-.25 G(softw)-2.5 E
|
-2.83 E(are\))-.1 E(mode, 'h' for hardw)144 427.2 Q(are \215o)-.1 E 2.5
|
||||||
(are\) mode)-.1 E<8a>123 508.8 Q(\264h' for hardw)138 508.8 Q(are \215o)
|
(wc)-.25 G(ontrol \(R)-2.5 E(TS/CTS\), 'n' for no \215o)-.6 E 2.5(wc)
|
||||||
-.1 E 2.5(wc)-.25 G(ontrol \(R)-2.5 E(TS/CTS\))-.6 E<8a>123 525.6 Q
|
-.25 G(ontrol. \(Def)-2.5 E(ault: 'n'\))-.1 E F3(--parity | -p)108 444 Q
|
||||||
(\264n' for no \215o)138 525.6 Q 2.5(wc)-.25 G(ontrol)-2.5 E(\(Def)123
|
F0 .685(De\214nes the parity mode to set the serial-port to. Must be on\
|
||||||
542.4 Q(ault: 'n'\))-.1 E F2(--parity | -p)108 559.2 Q F0
|
e of: 'o' for odd parity mode, 'e' for)144 456 R -2.15 -.25(ev e)144 468
|
||||||
(De\214nes the parity mode to set the serial-port to. Must be one of:)
|
T 2.5(np).25 G(arity mode, 'n' for no parity mode. \(Def)-2.5 E
|
||||||
123 571.2 Q<8a>123 588 Q(\264o' for odd parity mode.)138 588 Q<8a>123
|
(ault: 'n'\))-.1 E F3(--databits | -d)108 484.8 Q F0
|
||||||
604.8 Q(\264e' for e)138 604.8 Q -.15(ve)-.25 G 2.5(np).15 G
|
(De\214nes the number of data bits in e)144 496.8 Q -.15(ve)-.25 G
|
||||||
(arity mode.)-2.5 E<8a>123 621.6 Q(\264n' for no parity)138 621.6 Q 2.5
|
(ry character).15 E 2.5(.M)-.55 G(ust be one of: 5, 6, 7, 8. \(Def)-2.5
|
||||||
(,m)-.65 G(ode.)-2.5 E(\(Def)123 638.4 Q(ault: 'n'\))-.1 E F2
|
E(ault: 8\))-.1 E F3(--esacpe | -e)108 513.6 Q F0 .33
|
||||||
(--databits | -d)108 655.2 Q F0(De\214nes the number of data bits in e)
|
(De\214nes the character that will mak)144 525.6 R 2.829(ep)-.1 G .329
|
||||||
123 667.2 Q -.15(ve)-.25 G(ry character).15 E 2.5(.M)-.55 G
|
(icocom enter command-mode \(see description abo)-2.829 F -.15(ve)-.15 G
|
||||||
(ust be one of: 5, 6, 7, 8)-2.5 E(\(Def)123 686.4 Q(ault: 8\))-.1 E F2
|
.329(\). If 'x').15 F(is gi)144 537.6 Q -.15(ve)-.25 G
|
||||||
(--esacpe | -e)108 703.2 Q F0 1.151
|
(n, then C-x will mak).15 E 2.5(ep)-.1 G
|
||||||
(De\214nes the character that will mak)123 715.2 R 3.651(ep)-.1 G 1.151
|
(icocom enter command mode. \(Def)-2.5 E(ault: 'a'\))-.1 E F3
|
||||||
(icocom enter command-mode \(see description abo)-3.651 F -.15(ve)-.15 G
|
(--echo | -c)108 554.4 Q F0 .602(Enable local echo. Ev)144 566.4 R .602
|
||||||
1.15(\). If 'x' is).15 F(gi)123 727.2 Q -.15(ve)-.25 G
|
(ery character being read from the terminal \(standard input\) is echoe\
|
||||||
(n, then C-x will mak).15 E 2.5(ep)-.1 G(icocom enter command mode.)-2.5
|
d to the)-.15 F .157(terminal \(standard output\) subject to the echo-m\
|
||||||
E(3)535 768 Q 0 Cg EP
|
apping con\214guration \(see)144 578.4 R F2(--emap)2.656 E F0 .156
|
||||||
|
(option. \(Def)2.656 F(ault:)-.1 E(Disabled\))144 590.4 Q F3
|
||||||
|
(--noinit | -i)108 607.2 Q F0 .785(If gi)144 619.2 R -.15(ve)-.25 G .785
|
||||||
|
(n, picocom will not initialize, reset, or otherwise meddle with the se\
|
||||||
|
rial port at start-up. It).15 F 2.743
|
||||||
|
(will just open it. This is useful, for e)144 631.2 R 2.742
|
||||||
|
(xample, for connecting picocom to already-connected)-.15 F .038(modems\
|
||||||
|
, or already con\214gured ports without terminating the connection, or \
|
||||||
|
altering the settings. If)144 643.2 R(required serial port parameters c\
|
||||||
|
an then be adjusted at run-time by commands.)144 655.2 Q F3(--nor)108
|
||||||
|
672 Q(eset | -r)-.18 E F0 .397(If gi)144 684 R -.15(ve)-.25 G .397
|
||||||
|
(n, picocom will not *reset* the serial port when e).15 F .396
|
||||||
|
(xiting. It will just close the \214ledes and do)-.15 F .696
|
||||||
|
(nothing more. This is useful, for e)144 696 R .696(xample, for lea)-.15
|
||||||
|
F .696(ving modems connected when e)-.2 F .697(xiting picocom.)-.15 F
|
||||||
|
(Re)144 708 Q -.05(ga)-.15 G .546(rdless whether the).05 F F2(--nor)
|
||||||
|
3.046 E(eset)-.37 E F0 .546(option is gi)3.046 F -.15(ve)-.25 G 3.045
|
||||||
|
(nt).15 G .545(he user can e)-3.045 F .545
|
||||||
|
(xit picocom using the "Quit" com-)-.15 F .821
|
||||||
|
(mand \(instead of "Exit"\), which ne)144 720 R -.15(ve)-.25 G 3.321(rr)
|
||||||
|
.15 G .821(esets the serial port. If)-3.321 F F2(--nor)3.321 E(eset)-.37
|
||||||
|
E F0 .822(is gi)3.321 F -.15(ve)-.25 G 3.322(nt).15 G .822
|
||||||
|
(hen "Quit" and)-3.322 F 187.62(Manuals User)72 768 R(3)219.56 E 0 Cg EP
|
||||||
%%Page: 4 4
|
%%Page: 4 4
|
||||||
%%BeginPageSetup
|
%%BeginPageSetup
|
||||||
BP
|
BP
|
||||||
%%EndPageSetup
|
%%EndPageSetup
|
||||||
/F0 10/Times-Roman@0 SF 373.3(picocom\(8\) picocom\(8\))72 48 R(\(Def)
|
/F0 10/Times-Roman@0 SF 131.795(picocom\(8\) System)72 48 R(Manager')2.5
|
||||||
123 84 Q(ault: 'a'\))-.1 E/F1 10/Times-Bold@0 SF(--echo | -c)108 100.8 Q
|
E 2.5(sM)-.55 G 131.795(anual picocom\(8\))-2.5 F("Exit" beha)144 84 Q
|
||||||
F0 .193(Enable local echo. Ev)123 112.8 R .193(ery character being read\
|
.3 -.15(ve e)-.2 H(ssentially the same.).15 E/F1 10/Times-Bold@0 SF
|
||||||
from the terminal \(standard input\) is echoed to the termi-)-.15 F(na\
|
(--nolock | -l)108 100.8 Q F0 .744(If gi)144 112.8 R -.15(ve)-.25 G .744
|
||||||
l \(standard output\) subject to the echo-mapping con\214guration \(see)
|
(n, picocom will *not* attempt to lock the serial port before opening i\
|
||||||
123 124.8 Q/F2 10/Times-Italic@0 SF(--emap)2.51 E F0(option.)2.69 E
|
t. Normally picocom).15 F .388
|
||||||
(\(Def)123 144 Q(ault: Disabled\))-.1 E F1(--noinit | -i)108 160.8 Q F0
|
(attempts to get a UUCP-style lock-\214le \(e.g. "/v)144 124.8 R .389
|
||||||
.847(If gi)123 172.8 R -.15(ve)-.25 G(n,).15 E F1(picocom)3.347 E F0
|
(ar/lock/LCK..ttyS0"\) before opening the port. F)-.25 F(ail-)-.15 E
|
||||||
.846(will not initialize, reset, or otherwise meddle with the serial po\
|
.294(ing to do so, results in the program e)144 136.8 R .294
|
||||||
rt at start-up. It will)3.347 F 1.705
|
(xiting after emitting an error)-.15 F .294
|
||||||
(just open it. This is useful, for e)123 184.8 R 1.706
|
(-message. It is possible that your)-.2 F
|
||||||
(xample, for connecting)-.15 F F1(picocom)4.206 E F0 1.706
|
(picocom binary is compiled without this option.)144 148.8 Q F1
|
||||||
(to already-connected modems, or)4.206 F .864(already con\214gured port\
|
(--send-cmd | -s)108 165.6 Q F0 1.101(Speci\214es the e)144 177.6 R
|
||||||
s without terminating the connection, or altering the settings. If requ\
|
1.101(xternal program \(and an)-.15 F 3.601(ya)-.15 G -.18(rg)-3.601 G
|
||||||
ired serial)123 196.8 R
|
1.102(uments to it\) that will be used for transmitting \214les.).18 F
|
||||||
(port parameters can then be adjusted at run-time by commands.)123 208.8
|
(\(Def)144 189.6 Q(ault: "sz -vv"\))-.1 E F1(--r)108 206.4 Q(ecei)-.18 E
|
||||||
Q F1(--nor)108 225.6 Q(eset | -r)-.18 E F0 .18(If gi)123 237.6 R -.15
|
-.1(ve)-.1 G(-cmd | -v).1 E F0 1.86(Speci\214es the e)144 218.4 R 1.86
|
||||||
(ve)-.25 G(n,).15 E F1(picocom)2.68 E F0 .18
|
(xternal program \(and an)-.15 F 4.36(ya)-.15 G -.18(rg)-4.36 G 1.86
|
||||||
(will not *reset* the serial port when e)2.68 F .18
|
(uments to it\) that will be used for recei).18 F 1.86(ving \214les.)
|
||||||
(xiting. It will just close the \214ledes and do noth-)-.15 F .798
|
-.25 F(\(Def)144 230.4 Q(ault: "rz -vv"\))-.1 E F1(--imap)108 247.2 Q F0
|
||||||
(ing more. This is useful, for e)123 249.6 R .798(xample, for lea)-.15 F
|
.575(Speci\214es the input character map \(i.e. special characters to b\
|
||||||
.798(ving modems connected when e)-.2 F(xiting)-.15 E F1 .797
|
e replaced when read from the serial)144 247.2 R
|
||||||
(picocom picocom)3.297 F F0 .42
|
(port\). Example: "--imap crlf,delbs". \(Def)144 259.2 Q(aul: Empty\))
|
||||||
(using the "Quit" command \(instead of "Exit"\), which ne)123 261.6 R
|
-.1 E F1(--omap)108 276 Q F0 1.031(Speci\214es the output character map\
|
||||||
-.15(ve)-.25 G 2.92(rr).15 G .42
|
\(i.e. special characters to be replaced before being written to)144
|
||||||
(esets the serial port. If "--noreset" is gi)-2.92 F -.15(ve)-.25 G(n)
|
276 R(serial port\). Example: "--omap crcrlf,bsdel". \(Def)144 288 Q
|
||||||
.15 E(then "Quit" and "Exit" beha)123 273.6 Q .3 -.15(ve e)-.2 H
|
(aul: Empty\))-.1 E F1(--emap)108 304.8 Q F0 .408(Speci\214es the local\
|
||||||
(ssentially the same.).15 E F1(--nolock | -l)108 290.4 Q F0 2.07(If gi)
|
-echo character map \(i.e. special characters to be replaced before bei\
|
||||||
123 302.4 R -.15(ve)-.25 G(n,).15 E F1(picocom)4.57 E F0 2.07(will *not\
|
ng echoed-)144 304.8 R 4.24(back to the terminal, if local-echo is enab\
|
||||||
* attempt to lock the serial port before opening it. Normally picocom)
|
led\). Example: "--emap crcrlf,bsdel". \(Def)144 316.8 R(aul:)-.1 E
|
||||||
4.57 F .456(attempts to get a UUCP-style lock-\214le \(e.g. "/v)123
|
(delbs,crcrlf\))144 328.8 Q F1(--help | -h)108 345.6 Q F0
|
||||||
314.4 R .456(ar/lock/LCK..ttyS0"\) before opening the port. F)-.25 F
|
(Print a short help message describing the command-line options.)144
|
||||||
.457(ailing to)-.15 F .914(do so, results in the program e)123 326.4 R
|
357.6 Q/F2 10.95/Times-Bold@0 SF -.548(AU)72 374.4 S(THOR).548 E F0
|
||||||
.914(xiting after emitting an error)-.15 F .913
|
(picocom w)108 386.4 Q(as written by Nick P)-.1 E(ata)-.15 E -.25(va)-.2
|
||||||
(-message. It is possible that your picocom)-.2 F
|
G(lis \(npat@ef).25 E(ault.net\))-.1 E F2 -1.04 -1.588(AV A)72 403.2 T
|
||||||
(binary is compiled without this option.)123 338.4 Q F1(--send-cmd | -s)
|
(ILABILITY)1.588 E F0(The latest v)108 415.2 Q
|
||||||
108 355.2 Q F0(Speci\214es the e)123 367.2 Q(xternal program \(and an)
|
|
||||||
-.15 E 2.5(ya)-.15 G -.18(rg)-2.5 G
|
|
||||||
(uments to it\) that will be used for transmitting \214les.).18 E(Def)
|
|
||||||
123 386.4 Q(ault: "sz -vv")-.1 E F1(--r)108 403.2 Q(ecei)-.18 E -.1(ve)
|
|
||||||
-.1 G(-cmd | -v).1 E F0(Speci\214es the e)123 415.2 Q
|
|
||||||
(xternal program \(and an)-.15 E 2.5(ya)-.15 G -.18(rg)-2.5 G
|
|
||||||
(uments to it\) that will be used for recei).18 E(ving \214les.)-.25 E
|
|
||||||
(\(Def)123 434.4 Q(ault: "rz -vv"\))-.1 E F1(--imap)108 451.2 Q F0 .324
|
|
||||||
(Speci\214es the input character map \(i.e. special characters to be re\
|
|
||||||
placed when read from the serial port\).)123 463.2 R
|
|
||||||
(Example: "--imap crlf,delbs")123 475.2 Q(\(Def)123 494.4 Q
|
|
||||||
(aul: Empty\))-.1 E F1(--omap)108 511.2 Q F0 .752(Speci\214es the outpu\
|
|
||||||
t character map \(i.e. special characters to be replaced before being w\
|
|
||||||
ritten to serial)123 523.2 R(port\). Example: "--omap crcrlf,bsdel")123
|
|
||||||
535.2 Q(\(Def)123 554.4 Q(aul: Empty\))-.1 E F1(--emap)108 571.2 Q F0
|
|
||||||
.572(Speci\214es the local-echo character map \(i.e. special characters\
|
|
||||||
to be replaced before being echoed-back)123 583.2 R(to the terminal, i\
|
|
||||||
f local-echo is enabled\). Example: "--emap crcrlf,bsdel")123 595.2 Q
|
|
||||||
(\(Def)123 614.4 Q(aul: delbs,crcrlf\))-.1 E F1(--help | -h)108 631.2 Q
|
|
||||||
F0(Print a short help message describing the command-line options.)123
|
|
||||||
643.2 Q/F3 10.95/Times-Bold@0 SF -.548(AU)72 660 S(THOR).548 E F0
|
|
||||||
(picocom w)108 672 Q(as written by Nick P)-.1 E(ata)-.15 E -.25(va)-.2 G
|
|
||||||
(lis \(npat@ef).25 E(ault.net\))-.1 E F3 -1.04 -1.588(AV A)72 696 T
|
|
||||||
(ILABILITY)1.588 E F0(The latest v)108 708 Q
|
|
||||||
(ersion of "picocom" can be do)-.15 E(wnloaded from:)-.25 E F1
|
(ersion of "picocom" can be do)-.15 E(wnloaded from:)-.25 E F1
|
||||||
(http://code.google.com/p/picocom/)2.5 E F0(4)535 768 Q 0 Cg EP
|
(http://code.google.com/p/picocom/)2.5 E F0 187.62(Manuals User)72 768 R
|
||||||
|
(4)219.56 E 0 Cg EP
|
||||||
%%Trailer
|
%%Trailer
|
||||||
end
|
end
|
||||||
%%EOF
|
%%EOF
|
||||||
|
585
picocom.8.xml
585
picocom.8.xml
@ -1,21 +1,19 @@
|
|||||||
<?xml version="1.0" standalone='no'?>
|
<?xml version="1.0" standalone='no'?>
|
||||||
<!DOCTYPE manpage SYSTEM "xmlmp-1.1.dtd">
|
<!DOCTYPE manpage SYSTEM "xmltoman.dtd">
|
||||||
|
|
||||||
<manpage
|
<manpage
|
||||||
title="picocom"
|
name="picocom"
|
||||||
section="8"
|
section="8"
|
||||||
desc="minimal dumb-terminal emulation program">
|
desc="minimal dumb-terminal emulation program">
|
||||||
|
|
||||||
<synopsis>
|
<synopsis>
|
||||||
<synel>
|
<cmd>picocom [ <arg>options</arg> ] <arg>device</arg></cmd>
|
||||||
picocom [ <arg>options</arg> ] <arg>device</arg>
|
|
||||||
</synel>
|
|
||||||
</synopsis>
|
</synopsis>
|
||||||
|
|
||||||
<description>
|
<description>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
As its name suggests, <cmd>picocom</cmd> is a minimal
|
As its name suggests, <b>picocom</b> is a minimal
|
||||||
dumb-terminal emulation program. It is, in principle, very much
|
dumb-terminal emulation program. It is, in principle, very much
|
||||||
like <manref name="minicom" section="1"/>, only it's "pico"
|
like <manref name="minicom" section="1"/>, only it's "pico"
|
||||||
instead of "mini"! It was designed to serve as a simple, manual,
|
instead of "mini"! It was designed to serve as a simple, manual,
|
||||||
@ -28,25 +26,25 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
When <cmd>picocom</cmd> starts it opens the terminal (serial
|
When <b>picocom</b> starts it opens the terminal (serial
|
||||||
device) given as its non-option argument. Unless the
|
device) given as its non-option argument. Unless the
|
||||||
<arg>--noinit</arg> option is given, it configures the device to
|
<arg>--noinit</arg> option is given, it configures the device to
|
||||||
the settings specified by the option-arguments (or to some
|
the settings specified by the option-arguments (or to some
|
||||||
default settings), and sets it to "raw" mode. If
|
default settings), and sets it to "raw" mode. If
|
||||||
<arg>--noinit</arg> is given, the initialization and
|
<arg>--noinit</arg> is given, the initialization and
|
||||||
configuration is skipped; the device is just opened. Following
|
configuration is skipped; the device is just opened. Following
|
||||||
this, <cmd>picocom</cmd> sets the standard-input and
|
this, <b>picocom</b> sets the standard-input and
|
||||||
standard-output to raw mode. Having done so, it goes in a loop
|
standard-output to raw mode. Having done so, it goes in a loop
|
||||||
where it listens for input from stdin, or from the serial
|
where it listens for input from stdin, or from the serial
|
||||||
port. Input from the serial port is copied to the standard
|
port. Input from the serial port is copied to the standard
|
||||||
output while input from the standard input is copied to the
|
output while input from the standard input is copied to the
|
||||||
serial port. <cmd>picocom</cmd> also scans its input stream for
|
serial port. <b>picocom</b> also scans its input stream for
|
||||||
a user-specified control character, called the "escape
|
a user-specified control character, called the "escape
|
||||||
character" (being by default "C-a"). If the escape character is
|
character" (being by default "C-a"). If the escape character is
|
||||||
seen, then instead of sending it to the serial-device, the
|
seen, then instead of sending it to the serial-device, the
|
||||||
program enters "command mode" and waits for the next character
|
program enters "command mode" and waits for the next character
|
||||||
(which is called the "function character"). Depending on the
|
(which is called the "function character"). Depending on the
|
||||||
value of the function character, <cmd>picocom</cmd> performs one
|
value of the function character, <b>picocom</b> performs one
|
||||||
of the operations described in the "Commands" section below.
|
of the operations described in the "Commands" section below.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
@ -54,142 +52,95 @@
|
|||||||
<section name="COMMANDS">
|
<section name="COMMANDS">
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Commands are given to <cmd>picocom</cmd> by first keying the
|
Commands are given to <b>picocom</b> by first keying the "espace
|
||||||
"espace character" which by default is "C-a" (see "Options"
|
character" which by default is "C-a" (see "Options" below on how
|
||||||
below on how to change it), and then keying one for the function
|
to change it), and then keying one for the function (command)
|
||||||
(command) characters shown here.
|
characters shown here.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<dl>
|
<p>
|
||||||
<dt>[escape character]</dt>
|
[escape character]: Send the escape character to the serial port
|
||||||
<dd>
|
and return to "transparent" mode. This means that if the escape
|
||||||
<p>
|
character ("C-a", by default) is typed twice, the program sends
|
||||||
Send the escape character to the serial port and return to
|
the escape character to the serial port, and remains in
|
||||||
"transparent" mode. This means that if the escape character
|
transparent mode. This is a new behavior implemented in
|
||||||
("C-a", by default) is typed twice, the program sends the
|
v1.4. Previously picocom used to ignore the escape-character
|
||||||
escape character to the serial port, and remains in
|
when it was entered as a function character.
|
||||||
transparent mode. This is a new behavior implemented in
|
</p>
|
||||||
v1.4. Previously picocom used to ignore the escape-character
|
|
||||||
when it was entered as a function character.
|
|
||||||
</p>
|
|
||||||
</dd>
|
|
||||||
|
|
||||||
<dt>C-x</dt>
|
<p>
|
||||||
<dd>
|
[C-x]: Exit the program: if the <arg>--noreset</arg> option was
|
||||||
<p>
|
not given then the serial port is reset to its original settings
|
||||||
Exit the program: if the "--noreset" option was not given
|
before exiting; if it was given the serial port is not reset.
|
||||||
then the serial port is reset to its original settings
|
</p>
|
||||||
before exiting; if it was given the serial port is not
|
|
||||||
reset.
|
|
||||||
</p>
|
|
||||||
</dd>
|
|
||||||
|
|
||||||
<dt>C-q</dt>
|
<p>
|
||||||
<dd>
|
[C-q]: Quit the program *without* reseting the serial port,
|
||||||
<p>
|
regardless of the <arg>--noreset</arg> option.
|
||||||
Quit the program *without* reseting the serial port,
|
</p>
|
||||||
regardless of the "--noreset" option.
|
|
||||||
</p>
|
<p>
|
||||||
</dd>
|
[C-p]: Pulse the DTR line. Lower it for 1 sec, and then raise it
|
||||||
|
again.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
[C-t]: Toggle the DTR line. If DTR is up, then lower it. If it
|
||||||
|
is down, then raise it.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
[C-backslash]: Generate a break sequence on the serial line. A
|
||||||
|
break sequence is usually generated by marking (driving to
|
||||||
|
logical one) the serial Tx line for an amount of time
|
||||||
|
coresponding to several character durations.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
[C-u]: Baud up. Increase the baud-rate. The list of baud-rates
|
||||||
|
stepped-through by this command is: 300, 600, 1200, 2400, 4800,
|
||||||
|
9600, 19200, 38400, 57600, 115200.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
[C-d]: Baud down. Decrease the baud-rate. The list of baud-rates
|
||||||
|
stepped-through by this command is the same as for the "baud-up"
|
||||||
|
command.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
[C-f]: Cycle through flow-control settings (RTS/CTS, XON/XOFF,
|
||||||
|
none).
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
[C-y]: Cycle through parity settings (even, odd, none).
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
[C-b]: Cycle through databits-number settings (5, 6, 7, 8).
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
[C-c]: Toggle local-echo mode.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
[C-v]: Show program options (like baud rate, data bits,
|
||||||
|
etc). Only the options that can be modified online (through
|
||||||
|
commands) are shown, not those that can only be set at the
|
||||||
|
command-line.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
[C-s]: Send (upload) a file (see "Sending and Receiving Files"
|
||||||
|
below)
|
||||||
|
</p>
|
||||||
|
|
||||||
<dt>C-p</dt>
|
<p>
|
||||||
<dd>
|
[C-r]: Receive (download) a file (see "Sending and Receiving
|
||||||
<p>
|
Files" below)
|
||||||
Pulse the DTR line. Lower it for 1 sec, and then raise it
|
</p>
|
||||||
again.
|
|
||||||
</p>
|
|
||||||
</dd>
|
|
||||||
|
|
||||||
<dt>C-t</dt>
|
|
||||||
<dd>
|
|
||||||
<p>
|
|
||||||
Toggle the DTR line. If DTR is up, then lower it. If it is
|
|
||||||
down, then raise it.
|
|
||||||
</p>
|
|
||||||
</dd>
|
|
||||||
|
|
||||||
<dt>C-backslash</dt>
|
|
||||||
<dd>
|
|
||||||
<p>
|
|
||||||
Generate a break sequence on the serial line. A break
|
|
||||||
sequence is usually generated by marking (driving to logical
|
|
||||||
one) the serial Tx line for an amount of time coresponding
|
|
||||||
to several character durations.
|
|
||||||
</p>
|
|
||||||
</dd>
|
|
||||||
|
|
||||||
<dt>C-u</dt>
|
|
||||||
<dd>
|
|
||||||
<p>
|
|
||||||
Baud up. Increase the baud-rate. The list of baud-rates
|
|
||||||
stepped-through by this command is: 300, 600, 1200, 2400,
|
|
||||||
4800, 9600, 19200, 38400, 57600, 115200.
|
|
||||||
</p>
|
|
||||||
</dd>
|
|
||||||
|
|
||||||
<dt>C-d</dt>
|
|
||||||
<dd>
|
|
||||||
<p>
|
|
||||||
Baud down. Decrease the baud-rate. The list of baud-rates
|
|
||||||
stepped-through by this command is the same as for the
|
|
||||||
"baud-up" command.
|
|
||||||
</p>
|
|
||||||
</dd>
|
|
||||||
|
|
||||||
<dt>C-f</dt>
|
|
||||||
<dd>
|
|
||||||
<p>
|
|
||||||
Cycle through flow-control settings (RTS/CTS, XON/XOFF, none).
|
|
||||||
</p>
|
|
||||||
</dd>
|
|
||||||
|
|
||||||
<dt>C-y</dt>
|
|
||||||
<dd>
|
|
||||||
<p>
|
|
||||||
Cycle through parity settings (even, odd, none).
|
|
||||||
</p>
|
|
||||||
</dd>
|
|
||||||
|
|
||||||
<dt>C-b</dt>
|
|
||||||
<dd>
|
|
||||||
<p>
|
|
||||||
Cycle through databits-number settings (5, 6, 7, 8).
|
|
||||||
</p>
|
|
||||||
</dd>
|
|
||||||
|
|
||||||
<dt>C-c</dt>
|
|
||||||
<dd>
|
|
||||||
<p>
|
|
||||||
Toggle local-echo mode.
|
|
||||||
</p>
|
|
||||||
</dd>
|
|
||||||
|
|
||||||
<dt>C-v</dt>
|
|
||||||
<dd>
|
|
||||||
<p>
|
|
||||||
Show program options (like baud rate, data bits, etc). Only
|
|
||||||
the options that can be modified online (through commands)
|
|
||||||
are shown, not those that can only be set at the
|
|
||||||
command-line.
|
|
||||||
</p>
|
|
||||||
</dd>
|
|
||||||
|
|
||||||
<dt>C-s</dt>
|
|
||||||
<dd>
|
|
||||||
<p>
|
|
||||||
Send (upload) a file (see "Sending and Receiving Files"
|
|
||||||
below)
|
|
||||||
</p>
|
|
||||||
</dd>
|
|
||||||
|
|
||||||
<dt>C-r</dt>
|
|
||||||
<dd>
|
|
||||||
<p>
|
|
||||||
Receive (download) a file (see "Sending and Receiving Files"
|
|
||||||
below)
|
|
||||||
</p>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
After performing one of the above operations the program leaves
|
After performing one of the above operations the program leaves
|
||||||
@ -206,36 +157,34 @@
|
|||||||
|
|
||||||
<section name = "SENDING AND RECEIVING FILES">
|
<section name = "SENDING AND RECEIVING FILES">
|
||||||
<p>
|
<p>
|
||||||
<cmd>picocom</cmd> can send and receive files over the serial
|
<b>picocom</b> can send and receive files over the serial port
|
||||||
port using external programs that implement the respective
|
using external programs that implement the respective
|
||||||
protocols. In Linux typical programs for this purpose are:
|
protocols. In Linux typical programs for this purpose are:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<ul>
|
<p><manref name="rx" section="1"/>
|
||||||
<li><p><manref name="rx" section="1"/>
|
- receive using the X-MODEM protocol</p>
|
||||||
- receive using the X-MODEM protocol</p></li>
|
<p><manref name="rb" section="1"/>
|
||||||
<li><p><manref name="rb" section="1"/>
|
- receive using the Y-MODEM protocol</p>
|
||||||
- receive using the Y-MODEM protocol</p></li>
|
<p><manref name="rz" section="1"/>
|
||||||
<li><p><manref name="rz" section="1"/>
|
- receive using the Z-MODEM protocol</p>
|
||||||
- receive using the Z-MODEM protocol</p></li>
|
<p><manref name="sx" section="1"/>
|
||||||
<li><p><manref name="sx" section="1"/>
|
- send using the X-MODEM protocol</p>
|
||||||
- send using the X-MODEM protocol</p></li>
|
<p><manref name="sb" section="1"/>
|
||||||
<li><p><manref name="sb" section="1"/>
|
- send using the Y-MODEM protocol</p>
|
||||||
- send using the Y-MODEM protocol</p></li>
|
<p><manref name="sz" section="1"/>
|
||||||
<li><p><manref name="sz" section="1"/>
|
- send using the Z-MODEM protocol</p>
|
||||||
- send using the Z-MODEM protocol</p></li>
|
<p><manref name="ascii-xfr" section="1"/>
|
||||||
<li><p><manref name="ascii-xfr" section="1"/>
|
- receive or transmit ASCII files</p>
|
||||||
- receive or transmit ASCII files</p></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The name of, and the command-line options to, the program to be
|
The name of, and the command-line options to, the program to be
|
||||||
used for transmitting files are given by the "--send-cmd"
|
used for transmitting files are given by the
|
||||||
option. Similarly the program to receive files, and its
|
<arg>--send-cmd</arg> option. Similarly the program to receive
|
||||||
argumets, are given by the "--receive-cmd" option. For example,
|
files, and its argumets, are given by the
|
||||||
in order to start a <cmd>picocom</cmd> session that uses "sz" to
|
<arg>--receive-cmd</arg> option. For example, in order to start
|
||||||
transmit files, and "rz" to receive, you have to say something
|
a <b>picocom</b> session that uses "sz" to transmit files, and
|
||||||
like this:
|
"rz" to receive, you have to say something like this:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
@ -247,45 +196,44 @@
|
|||||||
commands (e.g. by pressing C-a, C-s, or C-a, C-r) you will be
|
commands (e.g. by pressing C-a, C-s, or C-a, C-r) you will be
|
||||||
prompted for a filename. At this prompt you can enter one or
|
prompted for a filename. At this prompt you can enter one or
|
||||||
more file-names, and any additional arguments to the
|
more file-names, and any additional arguments to the
|
||||||
transmission or reception program. After that, picocom will
|
transmission or reception program. Command-line editing and
|
||||||
start the the external program as specified by the "--send-cmd",
|
pathname completion are available at this prompt, if you have
|
||||||
or "--receive-cmd" option, and with any filenames and additional
|
compiled picocom with support for the linenoise
|
||||||
arguments you may have supplied. The standard input and output
|
library. Pressing 'C-c' at this prompt will cancel the file
|
||||||
of the external program will be connected to the serial
|
transfer command and return to normal <b>picocom</b>
|
||||||
port. The standard error of the external program will be
|
operation. After entering a filename (and / or additional
|
||||||
connected to the terminal which---while the program is
|
transmission or reception program arguments) and assuming you
|
||||||
running---will revert to canonical mode. Pressing 'C-c' while
|
have not canceled the operation by pressing C-c, picocom will
|
||||||
the external program is running will prematurely terminate it,
|
start the the external program as specified by the
|
||||||
and return control to <cmd>picocom</cmd>. Pressing 'C-c' at any other
|
<arg>--send-cmd</arg>, or <arg>--receive-cmd</arg> option, and
|
||||||
time, has no special effect; the character is normally passed to
|
with any filenames and additional arguments you may have
|
||||||
the serial port.
|
supplied. The standard input and output of the external program
|
||||||
|
will be connected to the serial port. The standard error of the
|
||||||
|
external program will be connected to the terminal which---while
|
||||||
|
the program is running---will revert to canonical mode. Pressing
|
||||||
|
'C-c' while the external program is running will prematurely
|
||||||
|
terminate it, and return control to <b>picocom</b>. Pressing
|
||||||
|
'C-c' at any other time, has no special effect; the character is
|
||||||
|
normally passed to the serial port.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section name = "INPUT, OUTPUT, AND ECHO MAPPING">
|
<section name = "INPUT, OUTPUT, AND ECHO MAPPING">
|
||||||
<p>
|
<p>
|
||||||
Using the "--imap", "--omap", and "--emap" options you can make
|
Using the <arg>--imap</arg>, <arg>--omap</arg>, and
|
||||||
<cmd>picocom</cmd> map (tranlate, replace) certain special
|
<arg>--emap</arg> options you can make <b>picocom</b> map
|
||||||
characters after being read from the serial port (with
|
(tranlate, replace) certain special characters after being read
|
||||||
<arg>--imap</arg>), before being written to the serial port
|
from the serial port (with <arg>--imap</arg>), before being
|
||||||
(with <arg>--omap</arg>), and before being locally echoed to the
|
written to the serial port (with <arg>--omap</arg>), and before
|
||||||
terminal (standard output) if local echo is enabled (with
|
being locally echoed to the terminal (standard output) if local
|
||||||
<arg>--emap</arg>). These mapping options take, each, a single
|
echo is enabled (with <arg>--emap</arg>). These mapping options
|
||||||
argument which is a comma-separated list of one or more of the
|
take, each, a single argument which is a comma-separated list of
|
||||||
following identifiers:
|
one or more of the following identifiers: "crlf" (map CR to LF),
|
||||||
|
"crcrlf" (map CR to CR + LF), "igncr" (ignore CR), "lfcr" (map
|
||||||
|
LF to CR), "lfcrlf" (map LF to CR + LF), "ignlf" (ignore LF),
|
||||||
|
"bsdel" (map BS --> DEL), "delbs" (map DEL --> BS)
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>crlf: map CR to LF</li>
|
|
||||||
<li>crcrlf: map CR to CR + LF</li>
|
|
||||||
<li>igncr: ignore CR</li>
|
|
||||||
<li>lfcr: map LF to CR</li>
|
|
||||||
<li>lfcrlf: map LF to CR + LF</li>
|
|
||||||
<li>ignlf: ignore LF</li>
|
|
||||||
<li>bsdel: map BS --> DEL</li>
|
|
||||||
<li>delbs: map DEL --> BS</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
For example the command:
|
For example the command:
|
||||||
@ -304,112 +252,112 @@
|
|||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section name = "OPTIONS">
|
<options>
|
||||||
<p>
|
<p>
|
||||||
<cmd>picocom</cmd> accepts the following command-line options
|
<b>picocom</b> accepts the following command-line options
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<dl>
|
<option>
|
||||||
<dt>--baud | -b</dt>
|
<opt><p>--baud | -b</p></opt>
|
||||||
<dd>
|
<optdesc>
|
||||||
<p>
|
<p>
|
||||||
Defines the baud-rate to set the serial-port (terminal) to.
|
Defines the baud-rate to set the serial-port (terminal) to.
|
||||||
</p>
|
</p>
|
||||||
</dd>
|
</optdesc>
|
||||||
|
</option>
|
||||||
|
|
||||||
<dt>--flow | -f</dt>
|
<option>
|
||||||
<dd>
|
<opt><p>--flow | -f</p></opt>
|
||||||
|
<optdesc>
|
||||||
<p>
|
<p>
|
||||||
Defines the flow-control mode to set the serial-port to. Must be
|
Defines the flow-control mode to set the serial-port
|
||||||
one of:
|
to. Must be one of: 'x' for xon/xoff (software) mode, 'h'
|
||||||
|
for hardware flow control (RTS/CTS), 'n' for no flow
|
||||||
|
control. (Default: 'n')
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
</optdesc>
|
||||||
<li><p>\'x' for xon/xoff (software) mode</p></li>
|
</option>
|
||||||
<li><p>\'h' for hardware flow control (RTS/CTS)</p></li>
|
|
||||||
<li><p>\'n' for no flow control</p></li>
|
|
||||||
</ul>
|
|
||||||
<p>(Default: 'n')</p>
|
|
||||||
</dd>
|
|
||||||
|
|
||||||
<dt>--parity | -p</dt>
|
|
||||||
<dd>
|
|
||||||
<p>
|
|
||||||
Defines the parity mode to set the serial-port to.
|
|
||||||
Must be one of:
|
|
||||||
</p>
|
|
||||||
<ul>
|
|
||||||
<li><p>\'o' for odd parity mode.</p></li>
|
|
||||||
<li><p>\'e' for even parity mode.</p></li>
|
|
||||||
<li><p>\'n' for no parity, mode.</p></li>
|
|
||||||
</ul>
|
|
||||||
<p>(Default: 'n')</p>
|
|
||||||
</dd>
|
|
||||||
|
|
||||||
<dt>--databits | -d</dt>
|
<option>
|
||||||
<dd>
|
<opt><p>--parity | -p</p></opt>
|
||||||
|
<optdesc>
|
||||||
<p>
|
<p>
|
||||||
Defines the number of data bits in every character. Must be one of:
|
Defines the parity mode to set the serial-port to. Must be
|
||||||
5, 6, 7, 8
|
one of: 'o' for odd parity mode, 'e' for even parity mode,
|
||||||
|
'n' for no parity mode. (Default: 'n')
|
||||||
</p>
|
</p>
|
||||||
<p>(Default: 8)</p>
|
</optdesc>
|
||||||
</dd>
|
</option>
|
||||||
|
|
||||||
<dt>--esacpe | -e</dt>
|
<option>
|
||||||
<dd>
|
<opt><p>--databits | -d</p></opt>
|
||||||
|
<optdesc>
|
||||||
<p>
|
<p>
|
||||||
Defines the character that will make picocom enter command-mode
|
Defines the number of data bits in every character. Must be
|
||||||
(see description above). If 'x' is given, then C-x will
|
one of: 5, 6, 7, 8. (Default: 8)
|
||||||
make picocom enter command mode.
|
|
||||||
</p>
|
</p>
|
||||||
|
</optdesc>
|
||||||
|
</option>
|
||||||
|
|
||||||
|
<option>
|
||||||
|
<opt><p>--esacpe | -e</p></opt>
|
||||||
|
<optdesc>
|
||||||
<p>
|
<p>
|
||||||
(Default: 'a')
|
Defines the character that will make picocom enter
|
||||||
|
command-mode (see description above). If 'x' is given, then
|
||||||
|
C-x will make picocom enter command mode. (Default: 'a')
|
||||||
</p>
|
</p>
|
||||||
</dd>
|
</optdesc>
|
||||||
|
</option>
|
||||||
<dt>--echo | -c</dt>
|
|
||||||
<dd>
|
<option>
|
||||||
|
<opt><p>--echo | -c</p></opt>
|
||||||
|
<optdesc>
|
||||||
<p>
|
<p>
|
||||||
Enable local echo. Every character being read from the
|
Enable local echo. Every character being read from the
|
||||||
terminal (standard input) is echoed to the terminal
|
terminal (standard input) is echoed to the terminal
|
||||||
(standard output) subject to the echo-mapping configuration
|
(standard output) subject to the echo-mapping configuration
|
||||||
(see <arg>--emap</arg> option.
|
(see <arg>--emap</arg> option. (Default: Disabled)
|
||||||
</p>
|
</p>
|
||||||
|
</optdesc>
|
||||||
|
</option>
|
||||||
|
|
||||||
|
<option>
|
||||||
|
<opt><p>--noinit | -i</p></opt>
|
||||||
|
<optdesc>
|
||||||
<p>
|
<p>
|
||||||
(Default: Disabled)
|
If given, <b>picocom</b> will not initialize, reset, or
|
||||||
</p>
|
|
||||||
</dd>
|
|
||||||
|
|
||||||
<dt>--noinit | -i</dt>
|
|
||||||
<dd>
|
|
||||||
<p>
|
|
||||||
If given, <cmd>picocom</cmd> will not initialize, reset, or
|
|
||||||
otherwise meddle with the serial port at start-up. It will
|
otherwise meddle with the serial port at start-up. It will
|
||||||
just open it. This is useful, for example, for connecting
|
just open it. This is useful, for example, for connecting
|
||||||
<cmd>picocom</cmd> to already-connected modems, or already
|
<b>picocom</b> to already-connected modems, or already
|
||||||
configured ports without terminating the connection, or
|
configured ports without terminating the connection, or
|
||||||
altering the settings. If required serial port parameters
|
altering the settings. If required serial port parameters
|
||||||
can then be adjusted at run-time by commands.
|
can then be adjusted at run-time by commands.
|
||||||
</p>
|
</p>
|
||||||
</dd>
|
</optdesc>
|
||||||
|
</option>
|
||||||
<dt>--noreset | -r</dt>
|
|
||||||
<dd>
|
<option>
|
||||||
|
<opt><p>--noreset | -r</p></opt>
|
||||||
|
<optdesc>
|
||||||
<p>
|
<p>
|
||||||
If given, <cmd>picocom</cmd> will not *reset* the serial
|
If given, <b>picocom</b> will not *reset* the serial port
|
||||||
port when exiting. It will just close the filedes and do
|
when exiting. It will just close the filedes and do nothing
|
||||||
nothing more. This is useful, for example, for leaving
|
more. This is useful, for example, for leaving modems
|
||||||
modems connected when exiting <cmd>picocom</cmd>. Regardless
|
connected when exiting <b>picocom</b>. Regardless whether
|
||||||
whether the "--noreset" option is given the user can exit
|
the <arg>--noreset</arg> option is given the user can exit
|
||||||
<cmd>picocom</cmd> using the "Quit" command (instead of
|
<b>picocom</b> using the "Quit" command (instead of "Exit"),
|
||||||
"Exit"), which never resets the serial port. If "--noreset"
|
which never resets the serial port. If <arg>--noreset</arg>
|
||||||
is given then "Quit" and "Exit" behave essentially the same.
|
is given then "Quit" and "Exit" behave essentially the same.
|
||||||
</p>
|
</p>
|
||||||
</dd>
|
</optdesc>
|
||||||
|
</option>
|
||||||
<dt>--nolock | -l</dt>
|
|
||||||
<dd>
|
<option>
|
||||||
|
<opt><p>--nolock | -l</p></opt>
|
||||||
|
<optdesc>
|
||||||
<p>
|
<p>
|
||||||
If given, <cmd>picocom</cmd> will *not* attempt to lock the
|
If given, <b>picocom</b> will *not* attempt to lock the
|
||||||
serial port before opening it. Normally picocom attempts to
|
serial port before opening it. Normally picocom attempts to
|
||||||
get a UUCP-style lock-file (e.g. "/var/lock/LCK..ttyS0")
|
get a UUCP-style lock-file (e.g. "/var/lock/LCK..ttyS0")
|
||||||
before opening the port. Failing to do so, results in the
|
before opening the port. Failing to do so, results in the
|
||||||
@ -417,77 +365,76 @@
|
|||||||
possible that your picocom binary is compiled without this
|
possible that your picocom binary is compiled without this
|
||||||
option.
|
option.
|
||||||
</p>
|
</p>
|
||||||
</dd>
|
</optdesc>
|
||||||
|
</option>
|
||||||
<dt>--send-cmd | -s</dt>
|
|
||||||
<dd>
|
<option>
|
||||||
|
<opt><p>--send-cmd | -s</p></opt>
|
||||||
|
<optdesc>
|
||||||
<p>
|
<p>
|
||||||
Specifies the external program (and any arguments to it)
|
Specifies the external program (and any arguments to it)
|
||||||
that will be used for transmitting files.
|
that will be used for transmitting files. (Default: "sz
|
||||||
|
-vv")
|
||||||
</p>
|
</p>
|
||||||
<p>
|
</optdesc>
|
||||||
Default: "sz -vv"
|
</option>
|
||||||
</p>
|
|
||||||
</dd>
|
<option>
|
||||||
|
<opt><p>--receive-cmd | -v</p></opt>
|
||||||
<dt>--receive-cmd | -v</dt>
|
<optdesc>
|
||||||
<dd>
|
|
||||||
<p>
|
<p>
|
||||||
Specifies the external program (and any arguments to it)
|
Specifies the external program (and any arguments to it)
|
||||||
that will be used for receiving files.
|
that will be used for receiving files. (Default: "rz -vv")
|
||||||
</p>
|
</p>
|
||||||
<p>
|
</optdesc>
|
||||||
(Default: "rz -vv")
|
</option>
|
||||||
</p>
|
|
||||||
</dd>
|
<option>
|
||||||
|
<opt><p>--imap</p></opt>
|
||||||
<dt>--imap</dt>
|
<optdesc>
|
||||||
<dd>
|
|
||||||
<p>
|
<p>
|
||||||
Specifies the input character map (i.e. special characters
|
Specifies the input character map (i.e. special characters
|
||||||
to be replaced when read from the serial port). Example:
|
to be replaced when read from the serial port). Example:
|
||||||
"--imap crlf,delbs"
|
"--imap crlf,delbs". (Defaul: Empty)
|
||||||
</p>
|
</p>
|
||||||
<p>
|
</optdesc>
|
||||||
(Defaul: Empty)
|
</option>
|
||||||
</p>
|
|
||||||
</dd>
|
<option>
|
||||||
|
<opt><p>--omap</p></opt>
|
||||||
<dt>--omap</dt>
|
<optdesc>
|
||||||
<dd>
|
|
||||||
<p>
|
<p>
|
||||||
Specifies the output character map (i.e. special characters
|
Specifies the output character map (i.e. special characters
|
||||||
to be replaced before being written to serial
|
to be replaced before being written to serial
|
||||||
port). Example: "--omap crcrlf,bsdel"
|
port). Example: "--omap crcrlf,bsdel". (Defaul: Empty)
|
||||||
</p>
|
</p>
|
||||||
<p>
|
</optdesc>
|
||||||
(Defaul: Empty)
|
</option>
|
||||||
</p>
|
|
||||||
</dd>
|
<option>
|
||||||
|
<opt><p>--emap</p></opt>
|
||||||
<dt>--emap</dt>
|
<optdesc>
|
||||||
<dd>
|
|
||||||
<p>
|
<p>
|
||||||
Specifies the local-echo character map (i.e. special
|
Specifies the local-echo character map (i.e. special
|
||||||
characters to be replaced before being echoed-back to the
|
characters to be replaced before being echoed-back to the
|
||||||
terminal, if local-echo is enabled). Example: "--emap
|
terminal, if local-echo is enabled). Example: "--emap
|
||||||
crcrlf,bsdel"
|
crcrlf,bsdel". (Defaul: delbs,crcrlf)
|
||||||
</p>
|
</p>
|
||||||
<p>
|
</optdesc>
|
||||||
(Defaul: delbs,crcrlf)
|
</option>
|
||||||
</p>
|
|
||||||
</dd>
|
<option>
|
||||||
|
<opt><p>--help | -h</p></opt>
|
||||||
<dt>--help | -h</dt>
|
<optdesc>
|
||||||
<dd>
|
|
||||||
<p>
|
<p>
|
||||||
Print a short help message describing the command-line
|
Print a short help message describing the command-line
|
||||||
options.
|
options.
|
||||||
</p>
|
</p>
|
||||||
</dd>
|
</optdesc>
|
||||||
</dl>
|
</option>
|
||||||
</section>
|
</options>
|
||||||
|
|
||||||
|
|
||||||
<section name="AUTHOR">
|
<section name="AUTHOR">
|
||||||
<p>picocom was written by Nick Patavalis (npat@efault.net)</p>
|
<p>picocom was written by Nick Patavalis (npat@efault.net)</p>
|
||||||
</section>
|
</section>
|
||||||
|
179
picocom.c
179
picocom.c
@ -37,11 +37,18 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
#ifdef LINENOISE
|
||||||
|
#include <dirent.h>
|
||||||
|
#include <libgen.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
|
|
||||||
#include "term.h"
|
#include "term.h"
|
||||||
|
#ifdef LINENOISE
|
||||||
|
#include "linenoise-1.0/linenoise.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
|
|
||||||
@ -328,6 +335,8 @@ fatal (const char *format, ...)
|
|||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef LINENOISE
|
||||||
|
|
||||||
#define cput(fd, c) do { int cl = c; write((fd), &(cl), 1); } while(0)
|
#define cput(fd, c) do { int cl = c; write((fd), &(cl), 1); } while(0)
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -353,6 +362,10 @@ fd_readline (int fdi, int fdo, char *b, int bsz)
|
|||||||
cput(fdo, '\x07');
|
cput(fdo, '\x07');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case '\x03': /* CTRL-c */
|
||||||
|
r = -1;
|
||||||
|
errno = EINTR;
|
||||||
|
goto out;
|
||||||
case '\r':
|
case '\r':
|
||||||
*bp = '\0';
|
*bp = '\0';
|
||||||
r = bp - (unsigned char *)b;
|
r = bp - (unsigned char *)b;
|
||||||
@ -370,6 +383,114 @@ out:
|
|||||||
|
|
||||||
#undef cput
|
#undef cput
|
||||||
|
|
||||||
|
#else /* LINENOISE defined */
|
||||||
|
|
||||||
|
void
|
||||||
|
send_file_completion (const char *buf, linenoiseCompletions *lc)
|
||||||
|
{
|
||||||
|
DIR *dirp;
|
||||||
|
struct dirent *dp;
|
||||||
|
char *basec, *basen, *dirc, *dirn;
|
||||||
|
int baselen, dirlen;
|
||||||
|
char *fullpath;
|
||||||
|
struct stat filestat;
|
||||||
|
|
||||||
|
basec = strdup(buf);
|
||||||
|
dirc = strdup(buf);
|
||||||
|
dirn = dirname(dirc);
|
||||||
|
dirlen = strlen(dirn);
|
||||||
|
basen = basename(basec);
|
||||||
|
baselen = strlen(basen);
|
||||||
|
dirp = opendir(dirn);
|
||||||
|
|
||||||
|
if (dirp) {
|
||||||
|
while ((dp = readdir(dirp)) != NULL) {
|
||||||
|
if (strncmp(basen, dp->d_name, baselen) == 0) {
|
||||||
|
/* add 2 extra bytes for possible / in middle & at end */
|
||||||
|
fullpath = (char *) malloc(strlen(dp->d_name) + dirlen + 3);
|
||||||
|
strcpy(fullpath, dirn);
|
||||||
|
if (fullpath[dirlen-1] != '/')
|
||||||
|
strcat(fullpath, "/");
|
||||||
|
strcat(fullpath, dp->d_name);
|
||||||
|
if (stat(fullpath, &filestat) == 0) {
|
||||||
|
if (S_ISDIR(filestat.st_mode)) {
|
||||||
|
strcat(fullpath, "/");
|
||||||
|
}
|
||||||
|
linenoiseAddCompletion(lc,fullpath);
|
||||||
|
}
|
||||||
|
free(fullpath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
closedir(dirp);
|
||||||
|
}
|
||||||
|
free(basec);
|
||||||
|
free(dirc);
|
||||||
|
}
|
||||||
|
|
||||||
|
static char *send_receive_history_file_path = NULL;
|
||||||
|
|
||||||
|
void
|
||||||
|
init_send_receive_history (void)
|
||||||
|
{
|
||||||
|
char *home_directory;
|
||||||
|
|
||||||
|
home_directory = getenv("HOME");
|
||||||
|
if (home_directory) {
|
||||||
|
send_receive_history_file_path =
|
||||||
|
malloc(strlen(home_directory) + 2 +
|
||||||
|
strlen(SEND_RECEIVE_HISTFILE));
|
||||||
|
strcpy(send_receive_history_file_path, home_directory);
|
||||||
|
if (home_directory[strlen(home_directory)-1] != '/') {
|
||||||
|
strcat(send_receive_history_file_path, "/");
|
||||||
|
}
|
||||||
|
strcat(send_receive_history_file_path, SEND_RECEIVE_HISTFILE);
|
||||||
|
linenoiseHistoryLoad(send_receive_history_file_path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
cleanup_send_receive_history (void)
|
||||||
|
{
|
||||||
|
if (send_receive_history_file_path)
|
||||||
|
free(send_receive_history_file_path);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
add_send_receive_history (char *fname)
|
||||||
|
{
|
||||||
|
linenoiseHistoryAdd(fname);
|
||||||
|
if (send_receive_history_file_path)
|
||||||
|
linenoiseHistorySave(send_receive_history_file_path);
|
||||||
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
read_send_filename (void)
|
||||||
|
{
|
||||||
|
char *fname;
|
||||||
|
linenoiseSetCompletionCallback(send_file_completion);
|
||||||
|
printf("\r\n");
|
||||||
|
fname = linenoise("*** file: ");
|
||||||
|
printf("\r\n");
|
||||||
|
linenoiseSetCompletionCallback(NULL);
|
||||||
|
if (fname != NULL)
|
||||||
|
add_send_receive_history(fname);
|
||||||
|
return fname;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
read_receive_filename (void)
|
||||||
|
{
|
||||||
|
printf("\r\n");
|
||||||
|
char *fname = linenoise("*** file: ");
|
||||||
|
printf("\r\n");
|
||||||
|
if (fname != NULL)
|
||||||
|
add_send_receive_history(fname);
|
||||||
|
return fname;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* of ifndef LINENOISE */
|
||||||
|
|
||||||
/* maximum number of chars that can replace a single characted
|
/* maximum number of chars that can replace a single characted
|
||||||
due to mapping */
|
due to mapping */
|
||||||
#define M_MAXMAP 4
|
#define M_MAXMAP 4
|
||||||
@ -668,7 +789,11 @@ loop(void)
|
|||||||
fd_set rdset, wrset;
|
fd_set rdset, wrset;
|
||||||
int newbaud, newflow, newparity, newbits;
|
int newbaud, newflow, newparity, newbits;
|
||||||
char *newflow_str, *newparity_str;
|
char *newflow_str, *newparity_str;
|
||||||
|
#ifndef LINENOISE
|
||||||
char fname[128];
|
char fname[128];
|
||||||
|
#else
|
||||||
|
char *fname;
|
||||||
|
#endif
|
||||||
int r, n;
|
int r, n;
|
||||||
unsigned char c;
|
unsigned char c;
|
||||||
|
|
||||||
@ -801,25 +926,59 @@ loop(void)
|
|||||||
opts.lecho ? "yes" : "no");
|
opts.lecho ? "yes" : "no");
|
||||||
break;
|
break;
|
||||||
case KEY_SEND:
|
case KEY_SEND:
|
||||||
|
#ifndef LINENOISE
|
||||||
fd_printf(STO, "\r\n*** file: ");
|
fd_printf(STO, "\r\n*** file: ");
|
||||||
r = fd_readline(STI, STO, fname, sizeof(fname));
|
r = fd_readline(STI, STO, fname, sizeof(fname));
|
||||||
fd_printf(STO, "\r\n");
|
fd_printf(STO, "\r\n");
|
||||||
if ( r < -1 && errno == EINTR ) break;
|
if ( r <= -1 ) {
|
||||||
if ( r <= -1 )
|
if ( errno == EINTR ) {
|
||||||
fatal("cannot read filename: %s", strerror(errno));
|
fd_printf(STO, "Cannot read filename!\r\n");
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
fatal("cannot read filename: %s", strerror(errno));
|
||||||
|
}
|
||||||
|
}
|
||||||
run_cmd(tty_fd, opts.send_cmd, fname, NULL);
|
run_cmd(tty_fd, opts.send_cmd, fname, NULL);
|
||||||
|
#else
|
||||||
|
fname = read_send_filename();
|
||||||
|
if (fname == NULL) {
|
||||||
|
fd_printf(STO, "Cannot read filename!\r\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
run_cmd(tty_fd, opts.send_cmd, fname, NULL);
|
||||||
|
free(fname);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case KEY_RECEIVE:
|
case KEY_RECEIVE:
|
||||||
|
#ifndef LINENOISE
|
||||||
fd_printf(STO, "*** file: ");
|
fd_printf(STO, "*** file: ");
|
||||||
r = fd_readline(STI, STO, fname, sizeof(fname));
|
r = fd_readline(STI, STO, fname, sizeof(fname));
|
||||||
fd_printf(STO, "\r\n");
|
fd_printf(STO, "\r\n");
|
||||||
if ( r < -1 && errno == EINTR ) break;
|
|
||||||
if ( r <= -1 )
|
if ( r <= -1 ) {
|
||||||
fatal("cannot read filename: %s", strerror(errno));
|
if ( errno == EINTR ) {
|
||||||
|
fd_printf(STO, "Cannot read filename!\r\n");
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
fatal("cannot read filename: %s", strerror(errno));
|
||||||
|
}
|
||||||
|
}
|
||||||
if ( fname[0] )
|
if ( fname[0] )
|
||||||
run_cmd(tty_fd, opts.receive_cmd, fname, NULL);
|
run_cmd(tty_fd, opts.receive_cmd, fname, NULL);
|
||||||
else
|
else
|
||||||
run_cmd(tty_fd, opts.receive_cmd, NULL);
|
run_cmd(tty_fd, opts.receive_cmd, NULL);
|
||||||
|
#else
|
||||||
|
fname = read_receive_filename();
|
||||||
|
if (fname == NULL) {
|
||||||
|
fd_printf(STO, "Cannot read filename!\r\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if ( fname[0] )
|
||||||
|
run_cmd(tty_fd, opts.receive_cmd, fname, NULL);
|
||||||
|
else
|
||||||
|
run_cmd(tty_fd, opts.receive_cmd, NULL);
|
||||||
|
free(fname);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case KEY_BREAK:
|
case KEY_BREAK:
|
||||||
term_break(tty_fd);
|
term_break(tty_fd);
|
||||||
@ -1205,9 +1364,17 @@ main(int argc, char *argv[])
|
|||||||
fatal("failed to set I/O device to raw mode: %s",
|
fatal("failed to set I/O device to raw mode: %s",
|
||||||
term_strerror(term_errno, errno));
|
term_strerror(term_errno, errno));
|
||||||
|
|
||||||
|
#ifdef LINENOISE
|
||||||
|
init_send_receive_history();
|
||||||
|
#endif
|
||||||
|
|
||||||
fd_printf(STO, "Terminal ready\r\n");
|
fd_printf(STO, "Terminal ready\r\n");
|
||||||
loop();
|
loop();
|
||||||
|
|
||||||
|
#ifdef LINENOISE
|
||||||
|
cleanup_send_receive_history();
|
||||||
|
#endif
|
||||||
|
|
||||||
fd_printf(STO, "\r\n");
|
fd_printf(STO, "\r\n");
|
||||||
if ( opts.noreset ) {
|
if ( opts.noreset ) {
|
||||||
fd_printf(STO, "Skipping tty reset...\r\n");
|
fd_printf(STO, "Skipping tty reset...\r\n");
|
||||||
|
Reference in New Issue
Block a user