1
0
mirror of https://github.com/UzixLS/picocom.git synced 2025-07-19 07:21:18 +03:00
Commit Graph

113 Commits

Author SHA1 Message Date
31e1a13e22 Updated scripts 2015-08-25 20:46:02 +03:00
c560a119e9 Command view-status (C-v) also displays modem-control-lines status. 2015-08-25 16:20:22 +03:00
3f627d5cff term.[ch]: Added term_get_mctl() function
Returns the status of modem-control lines (DTR, DSR, DCD, etc...).
2015-08-25 16:19:26 +03:00
4f409a28e8 Increased TTY_Q_SY to 32KB 2015-08-25 15:08:08 +03:00
d21c94eb75 Changed TCSAFLUSH to TCSANOW
In all cases the pattern was tcflush(fd, TCIOFLUSH) followed by
tcsetattr(fd, TCSAFLUSH, ...). The problem was that, for some drivers,
tcflush() was apparently doing nothing, so tcsetattr() might hang
forever waiting for the output buffers to drain (possible if flow
control is enabled). Replaced tcflush(fd, TCSAFLUSH), with tcsetattr(fd,
TCSANOW) which, after a tcflush() should anyway be equivalent.
2015-08-25 15:00:18 +03:00
f6f71b6f5b Updated manual. New C-b (set baudrate) command 2015-08-23 15:54:33 +03:00
679f89b498 Added command "set baudrate" (**C-b**).
Set baudrate numerically.

Also reassigned the key for the "change databits" command from **C-b**
to **C-i**.
2015-08-23 15:51:48 +03:00
8f41c3440e Changed default receive-cmd to "rz -vv -E" 2015-08-23 15:50:29 +03:00
78d6c18bcc Check if baudrate is valid, when parsing command-line arguments.
Before, every baudrate was initially accepted, and term_set() failed
when it attempted to set the baudrate.
2015-08-23 14:30:24 +03:00
1c933e3797 Updated CONTRIBUTORS 2015-08-22 17:10:41 +03:00
ace77cfd15 Update README.md: Say "make clean" after editing Makefile. 2015-08-22 16:53:55 +03:00
5916997d40 Added term_baud_ok(). Check if baudrate is valid. 2015-08-22 16:49:57 +03:00
991ddfe638 fd_readline: Fixed bug when displaying non-printables (xput).
Was writing one char less than required.
2015-08-22 16:19:34 +03:00
b443e39e43 Converted mapage source to pandoc's MarkDown and moved it to section 1.
- Much metter groff and html formating. Much easier to write and edit.
- Page had no reason to be in section 8.
2015-08-22 14:46:24 +03:00
0f09071f69 Disabled USE_CUSTOM_BAUD support in (default) Makefile. 2015-08-20 17:22:42 +03:00
cfa943dfe2 Linux and custom serial-port baudrates (the gory details) 2015-08-20 13:55:21 +03:00
fd306077d6 Added support for setting custom baud rates.
If the requested baudrate is not a custom one (i.e. does not match one
of the Bxxx macros), then the cfsetospeed_custom() and
cfsetispeed_custom() are called to configure the "nexttermios" structure
with the requested non-standard baudrate. Same thing for reading the
baudrate: If cfgetospeed() and / or cfgetispeed() return a value that is
not among the Bxxx macros, cfgetospeed_custom() and cfgetispeed_custom()
are called, to read (and decode) the non-standard baudrate from the
"nexttermios" structure.

Currently the cf[set|get][i|o]speed_custom functions are only
implemented for Linux, and work only with non-ancient kernels (>2.6). So
in effect, custom baud-rate support is currently only supported for
Linux.
2015-08-20 12:40:28 +03:00
30a06fd05f termios2.[ch]: Comments clean-up and corrections. 2015-08-20 12:02:27 +03:00
495d142467 Cleaned-up and reordered architecture conditionals + comments. 2015-08-20 00:47:58 +03:00
46d2a20dcc Removed inclusion of unused header from termios2.c 2015-08-19 23:51:25 +03:00
a5208a560b termios2: Clear both CBAUD and CBAUDEX bits. Not only CBAUD.
This is pure pedantry since CBAUDEX *is* included in CBAUD, but lets be
explicit.
2015-08-19 21:31:35 +03:00
6642a7f1f2 Moved definition of termios2 struct and related macros to termbits2.h
Also: Fill the user-space termios structure's "c_cc[]" slots beyond
K_NCCS with _POSIX_VDISABLE.
2015-08-19 09:45:40 +03:00
fa16dbc429 Defined macros to override tcXXX / cfXXX functions with tc2 equivalent.
They become:

  tcsetattr --> tc2setatter
  tcgetattr --> tc2getattr
  cfsetispeed --> cf2setispeed
  cfgetispeed --> cf2getispeed

Also defined:

  cfsetospeed_custom, cfsetispeed_custom

And

  cfgetospeed_custom, cfgetispeed_custom
2015-08-19 09:39:53 +03:00
2741018a66 Removed debugging helpers. 2015-08-19 09:38:56 +03:00
e709254a9b Merge branch 'master' into custombaud 2015-08-19 01:26:18 +03:00
b6208b561b Renamed "send_receive_history" stuff to just "history"
By default the history file is now named ".picocom_history".
2015-08-19 01:11:16 +03:00
3bcde82912 Added missing <stdio.h> include. 2015-08-19 01:09:44 +03:00
8fd1e4de41 Updated manual: Support for setting and changing stopbits. 2015-08-19 00:18:38 +03:00
c24a3bcf41 Added support for setting and changing stopbits. 2015-08-19 00:15:19 +03:00
fcc0c6eafc Use CKEY() macro to specify command-key mappings. 2015-08-18 23:18:40 +03:00
e904429c1b Removed hard-coded function (command) key values from help strings.
Now function-key values are taken automatically from the respective
constants.
2015-08-18 22:52:28 +03:00
7d7edf657f Moved "generic" fd I/O functions from picocom.c to fdio.[ch] 2015-08-18 22:07:56 +03:00
7b1c5f92e3 Updated manual. Added [C-h] and [C-k] commands. 2015-08-18 21:20:26 +03:00
0a49ae9aac Added commands [C-h] and [C-k] (show help and show keys).
Both commands do the same thing at the moment. They print a short
description of all available command keys.
2015-08-18 21:18:37 +03:00
62213f8e06 Added NO_HELP compile-time option
Enabling NO_HELP removes help-strings from picocom. This makes picocom
harder to use, and saves approximatelly 4-5Kb.
2015-08-18 20:58:37 +03:00
856a1c690d fd_readline(): Better handling of non-printable characters.
Function fd_readline() now displays non-printable and non-ascii
characters as hex codes (e.g \x12). These characters can be deleted
correctly using the [Backspace] or [DEL] key. This is applicable only
when picocom is compiled without linenoise support.
2015-08-18 20:47:30 +03:00
4dcf559f15 Remove split.o at make clean. 2015-08-18 20:42:50 +03:00
1ebc60b20f Do not use "/bin/sh" to run external commands.
Picocom no longer uses /bin/sh to run external commands for
file-transfer operations. Parsing the command line and spliting it into
arguments is now performed internally by picocom, using quoting rules
very similar to those of the Unix shell. Hopefully, this makes it
impossible to inject shell-commands when supplying filenames or
extra arguments to the send- and receive-file commands.
2015-08-18 14:40:48 +03:00
d06875591e Added split.[ch]: Split a string to arguments with shell-like quoting 2015-08-18 13:51:36 +03:00
c04bad690e Exit if an invalid option value or an unrecognized option is given.
Previously, unlike an unrecognized option, the invalid option value was
ignored.
2015-08-18 13:25:23 +03:00
35091243cf Updated manual. Minor rephrasing. 2015-08-18 12:26:48 +03:00
23b3b0be07 Replaced cput() macro with function to silence compiler warnings.
Recent GCC / GLIBC combinations warn you when you call write(2) without
checking its return value. Casting the function to void, doesn't help
either. See: warn_unused_result.
2015-08-18 05:21:00 +03:00
714b782152 Updated README.md. More typos fixed. 2015-08-17 21:31:06 +03:00
4b6bb125ee Updated README.md. Fixed typo. 2015-08-17 20:42:44 +03:00
3b2813f02f Updated README. Added "Using picocom" section. 2015-08-17 20:37:30 +03:00
bc690d8cc2 Incremented version number to 2.0a 2015-08-16 22:27:40 +03:00
23a4288df7 Don't write(2) large chunks to the serial port.
If you define a large TTY_Q_SZ (which is quite useful for reliable
copy/paste) then write(2) would send large chucks to the tty in a single
gulp. On slow (very slow) baud rates this would make the tty fd buffers
take forever to drain on exit or when tcsetattrs() is
called. Unfortunatelly calling tcflush() doesn't really help (not on
linux, not with my serial driver).

So we limit the amount of data write(2) can send to the tty on a single
call, based on the port's baud rate (current setting baud-rate / 10
bytes, i.e. approx. one second worth of data). On my system (Linux) this
seems to be adequate: the fd does not become write-ready until most of
the data are sent through, so no huge buffers (with respect to the
baud-rate) are not accumulated and they don't take forever to drain.
2015-08-16 14:56:33 +03:00
622adaf3cf Better signal and child-process handling.
- Don't call exit(3) from signal handler. Set a flag and let loop()
  check it.

- Don't use system(3). Still uses /bin/sh to run the external
  command. This should be fixed.

- Better signal disposition preparation for child process.
2015-08-16 14:17:56 +03:00
70971db6c1 Retry tcsetattr() on EINTR, for term_lib_init() and term_exitfunc()
In term_exitfunc() (which is called via atexit(3)) and
term_lib_init() (which resets ALL managed terminals to their original
attributes), if tcsetattr(3) fails with EINTR, try again.
2015-08-16 06:49:06 +03:00
5af6cabde6 Use memmove(3) not memcpy(3) to shift output buffer.
Sinece memcpy does *not* work correctly with overlapping moves, it
caused a bug (missing, garbled data).
2015-08-16 04:45:43 +03:00