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

26 Commits

Author SHA1 Message Date
13fd331d41 detabbing (by tab with 4) 2016-12-16 10:41:23 +01:00
b601136f56 stripped trailing whitespace 2016-12-16 10:29:20 +01:00
74e0245fb0 Extra OSX bauds only if HIGH_BAUD + comments
Define the extra (above 230K) baudate constants for OSX only if
HIGH_BAUD is defined.
2016-12-07 01:42:03 +02:00
4ef3280e6a added custom baudrate support for OSX 2016-12-06 21:59:59 +01:00
f5fbab2505 added high baudrate constants for OSX 2016-12-06 18:06:28 +01:00
3239ffb8a4 fixed manual rts & dtr control for OSX 2016-12-04 12:09:11 +01:00
2fe242cfb6 Only support toggle RTS command in Linux; fix a few spelling errors and typos in man page. 2016-10-15 10:13:00 -06:00
a30867c366 Add command to toggle RTS 2016-10-14 19:06:26 -06:00
72cab71ebd Define dummy CMSPAR (=0) if undefined
Some BSDs (and possibly other systems too) have no mark / space parity
support, and they don't define CMSPAR. Define a dummy (zero) CMSPAR in
these cases. If the user tries to set P_MARK or P_SPACE he will get
P_EVEN or P_ODD instead.
2015-10-15 23:42:43 +03:00
44fe603663 Define a standard CMSPAR, if undefined, only on Linux. 2015-10-08 12:10:26 +03:00
2c4c231759 term.c: define CMSPAR when a specific termios.h doesn't do it
CMSPAR is defined by bits/termios.h, and glibc has two flavours of it: a
generic one and an architecture-specific one. glibc will install the
architecture-specific one if it exists, otherwise it will install the
generic one. Only Alpha, MIPS, PPC and Sparc have their own
bits/termios.h.

The generic bits/termios.h, as well as the Alpha, PPC and Sparc flavours
do define CMSPAR. However, the MIPS flavour does not define it.

Define CMSPAR to the value from the generic value, which is also the
value known to the Linux kernel for MIPS.

Patch inspired by:

  http://git.buildroot.net/buildroot/commit/?id=78cd32631e959e04b1a2f18be7b0757e21482438

Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
2015-10-07 17:48:59 +01: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
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
5916997d40 Added term_baud_ok(). Check if baudrate is valid. 2015-08-22 16:49:57 +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
c24a3bcf41 Added support for setting and changing stopbits. 2015-08-19 00:15:19 +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
e936f5bfe2 term_get_xxx functions and CMSPAR support.
Added functions to read and decode settings (baudrate, databits, parity,
flow-control) from the "currtermios" structure of a managed port.

Added support for "mark" and "space" parity (CMSPAR bit).
2015-08-14 20:14:54 +03:00
8135bbdd5f Re-read terminal attributes after applying them.
After applying settings to a terminal device, in functions term_reset(),
term_replace(), and term_apply(), re-read the setting from the device in
order to update "currtermios", "nexttermios", and "origtermios" as
required. Do not assume that the settings applied are the ones
effectively set to the device (some of them may be ignored, or changed
by the kernel or the driver).
2015-08-13 23:35:15 +03:00
801003c90e Fixed mis-typed constant for 4000000 bps baudrate 2015-08-13 19:39:25 +03:00
fabafeda48 Better baud-selection code. 2015-08-10 00:18:49 +03:00
efb45545c1 Clean-compile with Bionic libc (Android)
Added conditional since Bionic libc has no tcdrain.

Fixes #22
2015-08-07 04:15:04 +03:00
aa0bccf948 Added support for more high baud rates. See issue:
http://code.google.com/p/picocom/issues/detail?id=25

This should also fix issue:
  http://code.google.com/p/picocom/issues/detail?id=17

The following baud-rates are now supported:

Standard:

  0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600,
  19200, 38400, 57600, 115200,

HIGH_BAUD:

  230400, 460800, 500000, 576000, 921600, 1000000, 1152000, 1500000,
  2000000, 2500000, 3000000, 3500000, 4000000,

Now every baudrate above 115200 is compiled-in only if the respective
macros are defined in the system header files. This should allow
picocom with HIGH_BAUD support to compile cleanly for more systems.
2015-08-06 23:42:49 +00:00
3f81e9aca4 Fixed misconception that prevented the correct setting
of the odd-parity mode
2010-05-28 22:41:19 +00:00
8a48fc24aa Enabled support for higher baudrates up to 921600. Support is
compiled-in conditionally on the HIGH_BAUD macro.

Thanks to Pavel Vymetalek
2010-05-28 01:12:12 +00:00
464e25056f Imported 1.4 source 2010-05-28 00:17:52 +00:00