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

319 Commits

Author SHA1 Message Date
007811c337 Minor rewording 2018-02-20 15:26:40 +02:00
3eae4b37c9 Typos 2018-02-20 13:47:02 +02:00
ee23af0cb9 Disable custom baudrate support at runtime (Linux)
If picocom is compiled *with* custom-baudrate support (USE_CUSTOM_BAUD)
for Linux, then it uses a new set of ioctl's (TCGETS2 vs TCGETS, etc) to
access the serial ports. This patch allows the custom baudrate support
to be disabled at runtime (without recompiling), and picocom to switch
to using the old ioctl's.

To disable custom baudrate support (and switch back to the "old" ioctls)
simply define the environment variable NO_CUSTOM_BAUD, before starting
picocom.

This applies only to Linux and, obviously, only when picocom has been
compiled with custom baudrate support (USE_CUSTOM_BAUD).
2018-02-20 10:29:45 +02:00
8814974ac7 More enum type fixes
Try not to use lose enum type information through ints.
2018-02-11 10:04:58 +10:00
a412f6583a Type consistency tweaks
Better type consistency when returning enums flowcntrl_e and
parity_e. See also PR #92.
2018-02-10 10:04:14 +02:00
6d8bf34e9f Silence compiler warnings
- Comparisons between signed and unsigned
- Unused parameter

produced by gcc -Wall -Wextra
2018-02-09 19:00:56 +02:00
399d7f9480 Const correct some pointers 2018-02-09 18:52:08 +02:00
acc4e7ea1a Updated manual, rebuilt docs. 2018-02-08 17:15:39 +02:00
8707801496 Allow multiple non-option argunments, use last
Allow more than one non-option arguments. Use the last one as the port
name, ignore others.

Rationale. Allow easily setting a default port using an alias or
script. The port can then be overriden by a subsequent argument. E.g.

  alias picocom='picocom -b 115200 /dev/ttyS0'

  picocom               <-- call with default port
  picocom /dev/ttyUSB0  <-- override default
2018-02-08 17:01:23 +02:00
9d5cc80c47 Minor command-line args memory leak
Free previous ones if string arguments (log_filename and initstring) are
given multiple times
2018-02-08 15:38:47 +02:00
ed451a1d3a Bumped version to 3.2a. Rebuilt docs 2018-02-01 11:38:30 +02:00
90385aabe2 Changed version to 3.1, rebuilt docs 3.1 2018-02-01 11:20:02 +02:00
b1f5034610 Merge pull request #90 from JoeMerten/osx-custom-baud-enable
Changed when to enable custom baud by default (#84)
2018-01-29 09:46:41 +02:00
07c27c626d Changed __x86__ macro to __i386__ 2018-01-28 17:29:44 +02:00
56e6886768 Enable default custom baud not for old PPC Mac (#84)
This check implies, that custom baud will not be enabled by default for OSX older than 10.4
2018-01-28 16:23:05 +01:00
a799995415 Changed when to enable custom baud by default (#84)
For Apple:
- enable by default for macOS / OSX
- do not enable by default for iOS

Have not found a way to check for OSX version on preprocessor level.
2018-01-25 17:02:18 +01:00
849532b261 Replaced strcpy in init_history()
Mostly to avoid compiler warnings on some systems
2018-01-21 21:16:26 +02:00
e2be81fcf7 Replaced strcpy & strcat in file_completion_cb()
Mostly to silence warnings (against using strcat / strcpy) that some
compilers produce
2018-01-21 17:44:10 +02:00
a2899a676c Rewording 2018-01-20 23:17:10 +02:00
7eac76f27b Minor rewording 2018-01-20 20:29:19 +02:00
8b33ed33d6 Minor rewording 2018-01-20 20:18:31 +02:00
8eab62945d Close tty_fd after resetting and before exiting 2018-01-20 16:45:48 +02:00
2a120ef1df Comments 2018-01-20 16:44:43 +02:00
7bf7b5d491 Explicitly unlock tty_fd when exiting with noreset 2018-01-20 14:36:11 +02:00
dabb708a8c Explicitly unlock tty_fd before exiting
Call flock(fd, LOCK_UN) explicitly for managed file at term_exitfunc().

This should, normally, not be necessary. Normally, exiting the program
should take care of unlocking the file. Unfortuntelly, it has been
observed that, on some systems, exiting or closing an flock(2)'ed tty fd
has peculiar side effects (like not reseting the modem-control lines,
even if HUPCL is set).
2018-01-20 13:19:51 +02:00
007072bd57 Better --lower/raise-dtr/rts handling
Set the levels of DTR and RTS modem-control lines (according to the
--lower/raise-dtr/rts command-line options) *twice*: Once
immediatelly (as quickly as possible) after opening the port (before
actually configuring it), and once after configuring it. On some systems
configuring the port (i.e. calling tcsetattr) has the effect of reseting
the DTR and RTS signals.
2018-01-20 11:38:43 +02:00
36b1dea5b2 Minor rewording / update 2018-01-18 10:31:14 +02:00
7bc133c8f9 Added missing options in help string 2018-01-18 10:30:11 +02:00
0ad57a2142 Comments 2018-01-17 20:44:48 +02:00
58e55a835f Updated email (comments) 2018-01-17 20:38:27 +02:00
d857e917ab Merge branch 'master' of https://github.com/npat-efault/picocom 2018-01-17 19:57:32 +02:00
2fa6a1d7a2 Changed when to enable custom baud by default
Be very conservative when enabling custom baudrate
support (USE_CUSTOM_BAUD) by default. Only enable (by default) on
systems where we know it will cause no problems. For other systems the
user can try to enable it explicitly (see Makefile).

Currently enabled by default on:

  Linux, Kernel verison > 2.6.0, x86 and x86_64 architectures
  FreeBSD, OpenBSD, DragonFly BSD
2018-01-17 19:57:07 +02:00
55b7019934 Changed when to enable custom baud by default
Be very conservative when enabling custom baudrate
support (USE_CUSTOM_BAUD) by default. Only enable (by default) on
systems where we know it will cause no problems. For other systems the
user can try to enable it explicitly (see Makefile).

Currently enabled by default on:

  Linux, Kernel verison > 2.6.0, x86 and x86_64 architectures
  FreeBSD, OpenBSD, NetBSD, DragonFly BSD
2018-01-17 19:48:14 +02:00
8f3cdcb0b0 Regenerated docs 2018-01-17 11:45:06 +02:00
f44852b124 Formating, minor rewording 2018-01-16 23:30:01 +02:00
b40a2c8002 Minor rewording 2018-01-16 04:52:57 +02:00
a36bc69ee1 Smaller standard input read buffer (16 bytes) 2018-01-16 04:26:07 +02:00
d4bf3502d5 Merge branch 'read-stdin' of https://github.com/JoeMerten/picocom into JoeMerten-read-stdin 2018-01-16 04:16:26 +02:00
a020a12f7a #73: for read stdin, changed naming to the same as for port read 2018-01-16 03:02:59 +01:00
4845b66d99 #73: read multiple bytes from stdin with a single read() call 2018-01-16 02:58:51 +01:00
8ca2e5a10f Better build support for custom baudrates
For some systems (OSes, versions, architectures) custom-baudrate
support is enabled by default.

For others, support may work, but must be enabled by defining
USE_CUSTOM_BAUD in the Makefile

You can also disable custom baudrate support altogether (even for
systems where it's enabled by default), by defining NO_CUSTOM_BAUD in
the Makefile
2018-01-16 03:46:09 +02:00
e41aeb84ac Merge branch 'JoeMerten-bsd-improvements' 2018-01-16 02:21:41 +02:00
13904345f5 Reverted #84 initial refactoring, removing #define HAS_CUSTOM_BAUD 2018-01-16 00:49:35 +01:00
33b023fe80 #84, renamed bsd.txt to bsd_notes.txt 2018-01-16 00:20:40 +01:00
f162d0cf14 #84, just updated bsd.txt 2018-01-16 00:19:09 +01:00
6ebb8c56fc #84: custom baudrate support for OpenBsd, and Dragonfly (but not NetBsd) 2018-01-15 23:30:30 +01:00
249cf8ea3c #84, added missing #endif 2018-01-15 20:35:00 +01:00
4776a5c781 #84, as suggested by Nick, surrounded platform specific headers by appropriated #ifdef 2018-01-15 20:33:05 +01:00
7a14651b93 #84: Manual control of handshake lines for OpenBsd, NetBsd and Dragonfly 2018-01-15 20:23:07 +01:00
f9e0b4c8a2 Small refactoring in term.c for bsd improvements
Introduced `#define HAS_CUSTOM_BAUD` for platforms which have appropriate implementation.

Moving that `#if defined(__linux__) && defined(USE_CUSTOM_BAUD)` ... stuff out of `term.c`and put it to `termios2.h` / `custbaud_bsd.h` headers.
Moving that platform specific `#ifdefs` to the platform specific headers helps removing duplicate complex `#ifdef` constructs.
The both platform specific headers then do `#define HAS_CUSTOM_BAUD` to signal that custom baudrate support is implemented for the target platform.
I'd tested all above mentioned platforms with both USE_CUSTOM_BAUD unset and set to check if that refactoring don't raises unexpected issues.
2018-01-15 19:47:46 +01:00