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

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.
This commit is contained in:
Nick Patavalis
2015-08-06 23:42:49 +00:00
parent 6b824ee71a
commit aa0bccf948
7 changed files with 348 additions and 182 deletions

View File

@ -23,7 +23,7 @@ Commands are given to picocom by first keying the "espace character" which by de
[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-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.
[C-u]: Baud up. Increase the baud-rate. The list of baud-rates stepped-through by this command is: 50, 75, 110, 134, 150, 200, 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200. If HIGH_BAUD support is compiled in, then the following baud-rates are also added to the list: 230400, 460800, 500000, 576000, 921600, 1000000, 1152000, 1500000, 2000000, 2500000, 3000000, 3500000, 4000000. Depending on you system, any of the higher baud rates may be missing.
[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.

View File

@ -101,8 +101,13 @@
<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.
stepped-through by this command is: 50, 75, 110, 134, 150, 200,
300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600,
115200. If HIGH_BAUD support is compiled in, then the following
baud-rates are also added to the list: 230400, 460800, 500000,
576000, 921600, 1000000, 1152000, 1500000, 2000000, 2500000,
3000000, 3500000, 4000000. Depending on you system, any of the
higher baud rates may be missing.
</p>
<p>

View File

@ -1,6 +1,6 @@
%!PS-Adobe-3.0
%%Creator: groff version 1.22.2
%%CreationDate: Thu Aug 6 22:53:21 2015
%%CreationDate: Fri Aug 7 02:15:32 2015
%%DocumentNeededResources: font Times-Roman
%%+ font Times-Bold
%%+ font Times-Italic
@ -316,224 +316,229 @@ F0 .34(option w)2.84 F .34(as not gi)-.1 F -.15(ve)-.25 G 2.84(nt).15 G
ually generated by)108 590.4 R .471(marking \(dri)108 602.4 R .471(ving\
to logical one\) the serial Tx line for an amount of time coresponding\
to se)-.25 F -.15(ve)-.25 G .472(ral character).15 F(durations.)108
614.4 Q 1.138([C-u]: Baud up. Increase the baud-rate. The list of baud-\
rates stepped-through by this command is: 300,)108 638.4 R
(600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200.)108 650.4 Q
.655([C-d]: Baud do)108 674.4 R .655(wn. Decrease the baud-rate. The li\
st of baud-rates stepped-through by this command is the)-.25 F
(same as for the "baud-up" command.)108 686.4 Q
([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
614.4 Q .442([C-u]: Baud up. Increase the baud-rate. The list of baud-r\
ates stepped-through by this command is: 50, 75,)108 638.4 R .044(110, \
134, 150, 200, 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 1\
15200. If HIGH_B)108 650.4 R -.55(AU)-.35 G 2.544(Ds).55 G(up-)-2.544 E
1.705(port is compiled in, then the follo)108 662.4 R 1.705
(wing baud-rates are also added to the list: 230400, 460800, 500000,)
-.25 F .757(576000, 921600, 1000000, 1152000, 1500000, 2000000, 2500000\
, 3000000, 3500000, 4000000. Depend-)108 674.4 R(ing on you system, an)
108 686.4 Q 2.5(yo)-.15 G 2.5(ft)-2.5 G
(he higher baud rates may be missing.)-2.5 E .656([C-d]: Baud do)108
710.4 R .655(wn. Decrease the baud-rate. The list of baud-rates stepped\
-through by this command is the)-.25 F
(same as for the "baud-up" command.)108 722.4 Q 187.62(Manuals User)72
768 R(1)219.56 E 0 Cg EP
%%Page: 2 2
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF 131.795(picocom\(8\) System)72 48 R(Manager')2.5
E 2.5(sM)-.55 G 131.795(anual picocom\(8\))-2.5 F
([C-y]: Cycle through parity settings \(e)108 84 Q -.15(ve)-.25 G
([C-f]: Cycle through \215o)108 84 Q(w-control settings \(R)-.25 E
(TS/CTS, XON/XOFF)-.6 E 2.5(,n)-.8 G(one\).)-2.5 E
([C-y]: Cycle through parity settings \(e)108 108 Q -.15(ve)-.25 G
(n, odd, none\).).15 E
([C-b]: Cycle through databits-number settings \(5, 6, 7, 8\).)108 108 Q
([C-c]: T)108 132 Q(oggle local-echo mode.)-.8 E .729([C-v]: Sho)108 156
R 3.229(wp)-.25 G .729(rogram options \(lik)-3.229 F 3.229(eb)-.1 G .729
([C-b]: Cycle through databits-number settings \(5, 6, 7, 8\).)108 132 Q
([C-c]: T)108 156 Q(oggle local-echo mode.)-.8 E .728([C-v]: Sho)108 180
R 3.228(wp)-.25 G .728(rogram options \(lik)-3.228 F 3.229(eb)-.1 G .729
(aud rate, data bits, etc\). Only the options that can be modi\214ed on\
line)-3.229 F(\(through commands\) are sho)108 168 Q
line)-3.229 F(\(through commands\) are sho)108 192 Q
(wn, not those that can only be set at the command-line.)-.25 E
([C-s]: Send \(upload\) a \214le \(see "Sending and Recei)108 192 Q
(ving Files" belo)-.25 E(w\))-.25 E([C-r]: Recei)108 216 Q .3 -.15
([C-s]: Send \(upload\) a \214le \(see "Sending and Recei)108 216 Q
(ving Files" belo)-.25 E(w\))-.25 E([C-r]: Recei)108 240 Q .3 -.15
(ve \()-.25 H(do).15 E(wnload\) a \214le \(see "Sending and Recei)-.25 E
(ving Files" belo)-.25 E(w\))-.25 E .054
(After performing one of the abo)108 240 R .354 -.15(ve o)-.15 H .054
(After performing one of the abo)108 264 R .354 -.15(ve o)-.15 H .054
(perations the program lea).15 F -.15(ve)-.2 G 2.554(st).15 G .054
(he command mode and enters transparent)-2.554 F(mode. Example: T)108
252 Q 2.5(oi)-.8 G(ncrease the baud-rate by tw)-2.5 E 2.5(os)-.1 G
276 Q 2.5(oi)-.8 G(ncrease the baud-rate by tw)-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(ype:)-2.5 E
(C-a, C-u, C-a, C-u)108 276 Q
(assuming of-course that "C-a" is the escape character)108 300 Q(.)-.55
E/F1 10.95/Times-Bold@0 SF(SENDING AND RECEIVING FILES)72 316.8 Q F0
.497(picocom can send and recei)108 328.8 R .796 -.15(ve \214)-.25 H
(C-a, C-u, C-a, C-u)108 300 Q
(assuming of-course that "C-a" is the escape character)108 324 Q(.)-.55
E/F1 10.95/Times-Bold@0 SF(SENDING AND RECEIVING FILES)72 340.8 Q F0
.496(picocom can send and recei)108 352.8 R .796 -.15(ve \214)-.25 H
.496(les o).15 F -.15(ve)-.15 G 2.996(rt).15 G .496
(he serial port using e)-2.996 F .496
(xternal programs that implement the respec-)-.15 F(ti)108 340.8 Q .3
(he serial port using e)-2.996 F .497
(xternal programs that implement the respec-)-.15 F(ti)108 364.8 Q .3
-.15(ve p)-.25 H
(rotocols. In Linux typical programs for this purpose are:).15 E/F2 10
/Times-Bold@0 SF(rx\(1\))108 364.8 Q F0 2.5(-r)2.5 G(ecei)-2.5 E .3 -.15
(ve u)-.25 H(sing the X-MODEM protocol).15 E F2(rb\(1\))108 388.8 Q F0
/Times-Bold@0 SF(rx\(1\))108 388.8 Q F0 2.5(-r)2.5 G(ecei)-2.5 E .3 -.15
(ve u)-.25 H(sing the X-MODEM protocol).15 E F2(rb\(1\))108 412.8 Q F0
2.5(-r)2.5 G(ecei)-2.5 E .3 -.15(ve u)-.25 H(sing the Y).15 E
(-MODEM protocol)-1.11 E F2(rz\(1\))108 412.8 Q F0 2.5(-r)2.5 G(ecei)
(-MODEM protocol)-1.11 E F2(rz\(1\))108 436.8 Q F0 2.5(-r)2.5 G(ecei)
-2.5 E .3 -.15(ve u)-.25 H(sing the Z-MODEM protocol).15 E F2(sx\(1\))
108 436.8 Q F0 2.5(-s)2.5 G(end using the X-MODEM protocol)-2.5 E F2
(sb\(1\))108 460.8 Q F0 2.5(-s)2.5 G(end using the Y)-2.5 E
(-MODEM protocol)-1.11 E F2(sz\(1\))108 484.8 Q F0 2.5(-s)2.5 G
(end using the Z-MODEM protocol)-2.5 E F2(ascii-xfr\(1\))108 508.8 Q F0
108 460.8 Q F0 2.5(-s)2.5 G(end using the X-MODEM protocol)-2.5 E F2
(sb\(1\))108 484.8 Q F0 2.5(-s)2.5 G(end using the Y)-2.5 E
(-MODEM protocol)-1.11 E F2(sz\(1\))108 508.8 Q F0 2.5(-s)2.5 G
(end using the Z-MODEM protocol)-2.5 E F2(ascii-xfr\(1\))108 532.8 Q F0
2.5(-r)2.5 G(ecei)-2.5 E .3 -.15(ve o)-.25 H 2.5(rt).15 G
(ransmit ASCII \214les)-2.5 E .692(The name of, and the command-line op\
tions to, the program to be used for transmitting \214les are gi)108
532.8 R -.15(ve)-.25 G 3.192(nb).15 G(y)-3.192 E(the)108 544.8 Q/F3 10
/Times-Italic@0 SF(--send-cmd)3.149 E F0 .649
(option. Similarly the program to recei)3.149 F .949 -.15(ve \214)-.25 H
556.8 R -.15(ve)-.25 G 3.191(nb).15 G(y)-3.191 E(the)108 568.8 Q/F3 10
/Times-Italic@0 SF(--send-cmd)3.148 E F0 .649
(option. Similarly the program to recei)3.148 F .949 -.15(ve \214)-.25 H
.649(les, and its ar).15 F .649(gumets, are gi)-.18 F -.15(ve)-.25 G
3.148(nb).15 G 3.148(yt)-3.148 G(he)-3.148 E F3(--r)3.148 E(eceive-)-.37
E(cmd)108 556.8 Q F0 1.135(option. F)3.635 F 1.135(or e)-.15 F 1.135(xa\
3.149(nb).15 G 3.149(yt)-3.149 G(he)-3.149 E F3(--r)3.149 E(eceive-)-.37
E(cmd)108 580.8 Q F0 1.136(option. F)3.636 F 1.136(or e)-.15 F 1.135(xa\
mple, in order to start a picocom session that uses "sz" to transmit \
\214les, and "rz" to)-.15 F(recei)108 568.8 Q -.15(ve)-.25 G 2.5(,y).15
\214les, and "rz" to)-.15 F(recei)108 592.8 Q -.15(ve)-.25 G 2.5(,y).15
G(ou ha)-2.5 E .3 -.15(ve t)-.2 H 2.5(os).15 G(ay something lik)-2.5 E
2.5(et)-.1 G(his:)-2.5 E(picocom --send-cmd "sz -vv" --recei)108 592.8 Q
2.5(et)-.1 G(his:)-2.5 E(picocom --send-cmd "sz -vv" --recei)108 616.8 Q
-.15(ve)-.25 G(-cmd "rz -vv").15 E .309
(During the picocom session, if you k)108 616.8 R .609 -.15(ey t)-.1 H
(During the picocom session, if you k)108 640.8 R .609 -.15(ey t)-.1 H
.309(he "send" or "recei).15 F -.15(ve)-.25 G 2.809("c).15 G .309
(ommands \(e.g. by pressing C-a, C-s, or C-)-2.809 F .43(a, C-r\) you w\
ill be prompted for a \214lename. At this prompt you can enter one or m\
ore \214le-names, and an)108 628.8 R(y)-.15 E .533(additional ar)108
640.8 R .532(guments to the transmission or reception program. Command-\
line editing and pathname com-)-.18 F .982(pletion are a)108 652.8 R
-.25(va)-.2 G .982(ilable at this prompt, if you ha).25 F 1.283 -.15
(ve c)-.2 H .983(ompiled picocom with support for the linenoise library)
(ommands \(e.g. by pressing C-a, C-s, or C-)-2.809 F .431(a, C-r\) you \
will be prompted for a \214lename. At this prompt you can enter one or \
more \214le-names, and an)108 652.8 R(y)-.15 E .532(additional ar)108
664.8 R .533(guments to the transmission or reception program. Command-\
line editing and pathname com-)-.18 F .983(pletion are a)108 676.8 R
-.25(va)-.2 G .983(ilable at this prompt, if you ha).25 F 1.282 -.15
(ve c)-.2 H .982(ompiled picocom with support for the linenoise library)
.15 F(.)-.65 E .077(Pressing 'C-c' at this prompt will cancel the \214l\
e transfer command and return to normal picocom operation.)108 664.8 R
e transfer command and return to normal picocom operation.)108 688.8 R
.597(After entering a \214lename \(and / or additional transmission or \
reception program ar)108 676.8 R .598(guments\) and assuming)-.18 F .479
(you ha)108 688.8 R .779 -.15(ve n)-.2 H .479(ot canceled the operation\
by pressing C-c, picocom will start the the e).15 F .478
(xternal program as speci-)-.15 F .352(\214ed by the)108 700.8 R F3
reception program ar)108 700.8 R .597(guments\) and assuming)-.18 F .478
(you ha)108 712.8 R .778 -.15(ve n)-.2 H .479(ot canceled the operation\
by pressing C-c, picocom will start the the e).15 F .479
(xternal program as speci-)-.15 F .352(\214ed by the)108 724.8 R F3
(--send-cmd)2.852 E F0 2.852(,o)C(r)-2.852 E F3(--r)2.852 E(eceive-cmd)
-.37 E F0 .352(option, and with an)2.852 F 2.852<798c>-.15 G .352
(lenames and additional ar)-2.852 F .352(guments you may)-.18 F(ha)108
712.8 Q 1.023 -.15(ve s)-.2 H .723
(upplied. The standard input and output of the e).15 F .723
(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
(lenames and additional ar)-2.852 F .352(guments you may)-.18 F 187.62
(Manuals User)72 768 R(2)219.56 E 0 Cg EP
%%Page: 3 3
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF 131.795(picocom\(8\) System)72 48 R(Manager')2.5
E 2.5(sM)-.55 G 131.795(anual picocom\(8\))-2.5 F .684
(running---will re)108 84 R -.15(ve)-.25 G .684
(rt to canonical mode. Pressing 'C-c' while the e).15 F .683
(xternal program is running will prema-)-.15 F .029(turely terminate it\
, and return control to picocom. Pressing 'C-c' at an)108 96 R 2.53(yo)
-.15 G .03(ther time, has no special ef)-2.53 F .03(fect; the)-.25 F
(character is normally passed to the serial port.)108 108 Q/F1 10.95
/Times-Bold@0 SF(INPUT)72 124.8 Q 2.738(,O)-.81 G(UTPUT)-2.738 E 2.738
(,A)-.81 G(ND ECHO MAPPING)-2.738 E F0 .036(Using the)108 136.8 R/F2 10
E 2.5(sM)-.55 G 131.795(anual picocom\(8\))-2.5 F(ha)108 84 Q 1.022 -.15
(ve s)-.2 H .723(upplied. The standard input and output of the e).15 F
.723(xternal program will be connected to the serial port.)-.15 F .523
(The standard error of the e)108 96 R .522(xternal program will be conn\
ected to the terminal which---while the program is)-.15 F .683
(running---will re)108 108 R -.15(ve)-.25 G .683
(rt to canonical mode. Pressing 'C-c' while the e).15 F .684
(xternal program is running will prema-)-.15 F .03(turely terminate it,\
and return control to picocom. Pressing 'C-c' at an)108 120 R 2.529(yo)
-.15 G .029(ther time, has no special ef)-2.529 F .029(fect; the)-.25 F
(character is normally passed to the serial port.)108 132 Q/F1 10.95
/Times-Bold@0 SF(INPUT)72 148.8 Q 2.738(,O)-.81 G(UTPUT)-2.738 E 2.738
(,A)-.81 G(ND ECHO MAPPING)-2.738 E F0 .036(Using the)108 160.8 R/F2 10
/Times-Italic@0 SF(--imap)2.536 E F0(,)A F2(--omap)2.536 E F0 2.536(,a)C
(nd)-2.536 E F2(--emap)2.536 E F0 .036(options you can mak)2.536 F 2.536
(ep)-.1 G .036(icocom map \(tranlate, replace\) certain special)-2.536 F
.777(characters after being read from the serial port \(with)108 148.8 R
F2(--imap)3.278 E F0 .778
.778(characters after being read from the serial port \(with)108 172.8 R
F2(--imap)3.278 E F0 .777
(\), before being written to the serial port \(with)B F2(--omap)108
160.8 Q F0 1.051(\), and before being locally echoed to the terminal \(\
standard output\) if local echo is enabled \(with)B F2(--emap)108 172.8
Q F0 .894(\). These mapping options tak)B .894(e, each, a single ar)-.1
F .895(gument which is a comma-separated list of one or)-.18 F .985
(more of the follo)108 184.8 R .984(wing identi\214ers: "crlf" \(map CR\
184.8 Q F0 1.051(\), and before being locally echoed to the terminal \(\
standard output\) if local echo is enabled \(with)B F2(--emap)108 196.8
Q F0 .895(\). These mapping options tak)B .895(e, each, a single ar)-.1
F .894(gument which is a comma-separated list of one or)-.18 F .984
(more of the follo)108 208.8 R .985(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
\(ignore LF\), "bsdel" \(map BS --> DEL\),)108 220.8 R
("delbs" \(map DEL --> BS\))108 232.8 Q -.15(Fo)108 256.8 S 2.5(re).15 G
(xample the command:)-2.65 E
(picocom --omap crlf,delbs --imap inglf,bsdel --emap crcrlf ...)108
256.8 Q .86(will: Replace e)108 280.8 R -.15(ve)-.25 G .86(ry CR \(carr\
280.8 Q .86(will: Replace e)108 304.8 R -.15(ve)-.25 G .86(ry CR \(carr\
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\
\(backspace, 0x08\) before writing it to the serial port. Ignore \(not\
write to the termi-)108 292.8 R .782(nal\) e)108 304.8 R -.15(ve)-.25 G
write to the termi-)108 316.8 R .781(nal\) e)108 328.8 R -.15(ve)-.25 G
.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
(with DEL. Replace e)108 316.8 R -.15(ve)-.25 G 1.42(ry CR character wi\
(with DEL. Replace e)108 340.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
(enabled\).)108 328.8 Q F1(OPTIONS)72 345.6 Q F0
(picocom accepts the follo)108 357.6 Q(wing command-line options)-.25 E
/F3 10/Times-Bold@0 SF(--baud | -b)108 374.4 Q F0
(enabled\).)108 352.8 Q F1(OPTIONS)72 369.6 Q F0
(picocom accepts the follo)108 381.6 Q(wing command-line options)-.25 E
/F3 10/Times-Bold@0 SF(--baud | -b)108 398.4 Q F0
(De\214nes the baud-rate to set the serial-port \(terminal\) to.)144
386.4 Q F3(--\215o)108 403.2 Q 2.5(w|-)-.1 G(f)-2.5 E F0 .33
(De\214nes the \215o)144 415.2 R .33(w-control mode to set the serial-p\
410.4 Q F3(--\215o)108 427.2 Q 2.5(w|-)-.1 G(f)-2.5 E F0 .33
(De\214nes the \215o)144 439.2 R .33(w-control mode to set the serial-p\
ort to. Must be one of: 'x' for xon/xof)-.25 F 2.83(f\()-.25 G(softw)
-2.83 E(are\))-.1 E(mode, 'h' for hardw)144 427.2 Q(are \215o)-.1 E 2.5
-2.83 E(are\))-.1 E(mode, 'h' for hardw)144 451.2 Q(are \215o)-.1 E 2.5
(wc)-.25 G(ontrol \(R)-2.5 E(TS/CTS\), 'n' for no \215o)-.6 E 2.5(wc)
-.25 G(ontrol. \(Def)-2.5 E(ault: 'n'\))-.1 E F3(--parity | -p)108 444 Q
-.25 G(ontrol. \(Def)-2.5 E(ault: 'n'\))-.1 E F3(--parity | -p)108 468 Q
F0 .685(De\214nes the parity mode to set the serial-port to. Must be on\
e of: 'o' for odd parity mode, 'e' for)144 456 R -2.15 -.25(ev e)144 468
e of: 'o' for odd parity mode, 'e' for)144 480 R -2.15 -.25(ev e)144 492
T 2.5(np).25 G(arity mode, 'n' for no parity mode. \(Def)-2.5 E
(ault: 'n'\))-.1 E F3(--databits | -d)108 484.8 Q F0
(De\214nes the number of data bits in e)144 496.8 Q -.15(ve)-.25 G
(ault: 'n'\))-.1 E F3(--databits | -d)108 508.8 Q F0
(De\214nes the number of data bits in e)144 520.8 Q -.15(ve)-.25 G
(ry character).15 E 2.5(.M)-.55 G(ust be one of: 5, 6, 7, 8. \(Def)-2.5
E(ault: 8\))-.1 E F3(--esacpe | -e)108 513.6 Q F0 .33
(De\214nes the character that will mak)144 525.6 R 2.829(ep)-.1 G .329
E(ault: 8\))-.1 E F3(--esacpe | -e)108 537.6 Q F0 .329
(De\214nes the character that will mak)144 549.6 R 2.829(ep)-.1 G .329
(icocom enter command-mode \(see description abo)-2.829 F -.15(ve)-.15 G
.329(\). If 'x').15 F(is gi)144 537.6 Q -.15(ve)-.25 G
.33(\). If 'x').15 F(is gi)144 561.6 Q -.15(ve)-.25 G
(n, then C-x will mak).15 E 2.5(ep)-.1 G
(icocom enter command mode. \(Def)-2.5 E(ault: 'a'\))-.1 E F3
(--echo | -c)108 554.4 Q F0 .602(Enable local echo. Ev)144 566.4 R .602
(--echo | -c)108 578.4 Q F0 .602(Enable local echo. Ev)144 590.4 R .602
(ery character being read from the terminal \(standard input\) is echoe\
d to the)-.15 F .157(terminal \(standard output\) subject to the echo-m\
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
d to the)-.15 F .156(terminal \(standard output\) subject to the echo-m\
apping con\214guration \(see)144 602.4 R F2(--emap)2.657 E F0 .157
(option. \(Def)2.657 F(ault:)-.1 E(Disabled\))144 614.4 Q F3
(--noinit | -i)108 631.2 Q F0 .785(If gi)144 643.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
rial port at start-up. It).15 F 2.742
(will just open it. This is useful, for e)144 655.2 R 2.743
(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
altering the settings. If)144 667.2 R(required serial port parameters c\
an then be adjusted at run-time by commands.)144 679.2 Q F3(--nor)108
696 Q(eset | -r)-.18 E F0 .396(If gi)144 708 R -.15(ve)-.25 G .396
(n, picocom will not *reset* the serial port when e).15 F .397
(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
(nothing more. This is useful, for e)144 720 R .696(xample, for lea)-.15
F .696(ving modems connected when e)-.2 F .696(xiting picocom.)-.15 F
187.62(Manuals User)72 768 R(3)219.56 E 0 Cg EP
%%Page: 4 4
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF 131.795(picocom\(8\) System)72 48 R(Manager')2.5
E 2.5(sM)-.55 G 131.795(anual picocom\(8\))-2.5 F("Exit" beha)144 84 Q
.3 -.15(ve e)-.2 H(ssentially the same.).15 E/F1 10/Times-Bold@0 SF
(--nolock | -l)108 100.8 Q F0 .744(If gi)144 112.8 R -.15(ve)-.25 G .744
(n, picocom will *not* attempt to lock the serial port before opening i\
t. Normally picocom).15 F .388
(attempts to get a UUCP-style lock-\214le \(e.g. "/v)144 124.8 R .389
(ar/lock/LCK..ttyS0"\) before opening the port. F)-.25 F(ail-)-.15 E
.294(ing to do so, results in the program e)144 136.8 R .294
(xiting after emitting an error)-.15 F .294
E 2.5(sM)-.55 G 131.795(anual picocom\(8\))-2.5 F(Re)144 84 Q -.05(ga)
-.15 G .545(rdless whether the).05 F/F1 10/Times-Italic@0 SF(--nor)3.045
E(eset)-.37 E F0 .545(option is gi)3.045 F -.15(ve)-.25 G 3.045(nt).15 G
.545(he user can e)-3.045 F .546(xit picocom using the "Quit" com-)-.15
F .822(mand \(instead of "Exit"\), which ne)144 96 R -.15(ve)-.25 G
3.321(rr).15 G .821(esets the serial port. If)-3.321 F F1(--nor)3.321 E
(eset)-.37 E F0 .821(is gi)3.321 F -.15(ve)-.25 G 3.321(nt).15 G .821
(hen "Quit" and)-3.321 F("Exit" beha)144 108 Q .3 -.15(ve e)-.2 H
(ssentially the same.).15 E/F2 10/Times-Bold@0 SF(--nolock | -l)108
124.8 Q F0 .744(If gi)144 136.8 R -.15(ve)-.25 G .744(n, picocom will *\
not* attempt to lock the serial port before opening it. Normally picoco\
m).15 F .389(attempts to get a UUCP-style lock-\214le \(e.g. "/v)144
148.8 R .388(ar/lock/LCK..ttyS0"\) before opening the port. F)-.25 F
(ail-)-.15 E .294(ing to do so, results in the program e)144 160.8 R
.294(xiting after emitting an error)-.15 F .294
(-message. It is possible that your)-.2 F
(picocom binary is compiled without this option.)144 148.8 Q F1
(--send-cmd | -s)108 165.6 Q F0 1.101(Speci\214es the e)144 177.6 R
1.101(xternal program \(and an)-.15 F 3.601(ya)-.15 G -.18(rg)-3.601 G
1.102(uments to it\) that will be used for transmitting \214les.).18 F
(\(Def)144 189.6 Q(ault: "sz -vv"\))-.1 E F1(--r)108 206.4 Q(ecei)-.18 E
-.1(ve)-.1 G(-cmd | -v).1 E F0 1.86(Speci\214es the e)144 218.4 R 1.86
(picocom binary is compiled without this option.)144 172.8 Q F2
(--send-cmd | -s)108 189.6 Q F0 1.102(Speci\214es the e)144 201.6 R
1.102(xternal program \(and an)-.15 F 3.601(ya)-.15 G -.18(rg)-3.601 G
1.101(uments to it\) that will be used for transmitting \214les.).18 F
(\(Def)144 213.6 Q(ault: "sz -vv"\))-.1 E F2(--r)108 230.4 Q(ecei)-.18 E
-.1(ve)-.1 G(-cmd | -v).1 E F0 1.86(Speci\214es the e)144 242.4 R 1.86
(xternal program \(and an)-.15 F 4.36(ya)-.15 G -.18(rg)-4.36 G 1.86
(uments to it\) that will be used for recei).18 F 1.86(ving \214les.)
-.25 F(\(Def)144 230.4 Q(ault: "rz -vv"\))-.1 E F1(--imap)108 247.2 Q F0
-.25 F(\(Def)144 254.4 Q(ault: "rz -vv"\))-.1 E F2(--imap)108 271.2 Q F0
.575(Speci\214es the input character map \(i.e. special characters to b\
e replaced when read from the serial)144 247.2 R
(port\). Example: "--imap crlf,delbs". \(Def)144 259.2 Q(aul: Empty\))
-.1 E F1(--omap)108 276 Q F0 1.031(Speci\214es the output character map\
e replaced when read from the serial)144 271.2 R
(port\). Example: "--imap crlf,delbs". \(Def)144 283.2 Q(aul: Empty\))
-.1 E F2(--omap)108 300 Q F0 1.031(Speci\214es the output character map\
\(i.e. special characters to be replaced before being written to)144
276 R(serial port\). Example: "--omap crcrlf,bsdel". \(Def)144 288 Q
(aul: Empty\))-.1 E F1(--emap)108 304.8 Q F0 .408(Speci\214es the local\
300 R(serial port\). Example: "--omap crcrlf,bsdel". \(Def)144 312 Q
(aul: Empty\))-.1 E F2(--emap)108 328.8 Q F0 .408(Speci\214es the local\
-echo character map \(i.e. special characters to be replaced before bei\
ng echoed-)144 304.8 R 4.24(back to the terminal, if local-echo is enab\
led\). Example: "--emap crcrlf,bsdel". \(Def)144 316.8 R(aul:)-.1 E
(delbs,crcrlf\))144 328.8 Q F1(--help | -h)108 345.6 Q F0
ng echoed-)144 328.8 R 4.24(back to the terminal, if local-echo is enab\
led\). Example: "--emap crcrlf,bsdel". \(Def)144 340.8 R(aul:)-.1 E
(delbs,crcrlf\))144 352.8 Q F2(--help | -h)108 369.6 Q F0
(Print a short help message describing the command-line options.)144
357.6 Q/F2 10.95/Times-Bold@0 SF -.548(AU)72 374.4 S(THOR).548 E F0
(picocom w)108 386.4 Q(as written by Nick P)-.1 E(ata)-.15 E -.25(va)-.2
G(lis \(npat@ef).25 E(ault.net\))-.1 E F2 -1.04 -1.588(AV A)72 403.2 T
(ILABILITY)1.588 E F0(The latest v)108 415.2 Q
(ersion of "picocom" can be do)-.15 E(wnloaded from:)-.25 E F1
381.6 Q/F3 10.95/Times-Bold@0 SF -.548(AU)72 398.4 S(THOR).548 E F0
(picocom w)108 410.4 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 427.2 T
(ILABILITY)1.588 E F0(The latest v)108 439.2 Q
(ersion of "picocom" can be do)-.15 E(wnloaded from:)-.25 E F2
(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

View File

@ -98,8 +98,13 @@
<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.
stepped-through by this command is: 50, 75, 110, 134, 150, 200,
300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600,
115200. If HIGH_BAUD support is compiled in, then the following
baud-rates are also added to the list: 230400, 460800, 500000,
576000, 921600, 1000000, 1152000, 1500000, 2000000, 2500000,
3000000, 3500000, 4000000. Depending on you system, any of the
higher baud rates may be missing.
</p>
<p>

View File

@ -566,42 +566,17 @@ map_and_write (int fd, int map, char c)
int
baud_up (int baud)
{
if ( baud < 300 )
baud = 300;
else if ( baud == 38400 )
baud = 57600;
else
baud = baud * 2;
#ifndef HIGH_BAUD
if ( baud > 115200 )
baud = 115200;
#else
if ( baud > 921600 )
baud = 921600;
#endif
return baud;
return term_baud_up(baud);
}
int
baud_down (int baud)
{
#ifndef HIGH_BAUD
if ( baud > 115200 )
baud = 115200;
#else
if ( baud > 921600 )
baud = 921600;
#endif
else if ( baud == 57600 )
baud = 38400;
else
baud = baud / 2;
if ( baud < 300)
baud = 300;
return baud;
int nb;
nb = term_baud_down(baud);
if (nb == 0)
nb = baud;
return nb;
}
int

165
term.c
View File

@ -33,11 +33,10 @@
#include <string.h>
#include <errno.h>
#include <unistd.h>
#ifdef __linux__
#include <termio.h>
#else
#include <termios.h>
#endif /* of __linux__ */
#ifdef __linux__
#include <sys/ioctl.h>
#endif
#include "term.h"
@ -627,17 +626,75 @@ term_set_baudrate (int fd, int baudrate)
case 115200:
spd = B115200;
break;
#ifdef HIGH_BAUD
#ifdef B230400
case 230400:
spd = B230400;
break;
#endif
#ifdef B460800
case 460800:
spd = B460800;
break;
#endif
#ifdef B500000
case 500000:
spd = B500000;
break;
#endif
#ifdef B576000
case 576000:
spd = B576000;
break;
#endif
#ifdef B921600
case 921600:
spd = B921600;
break;
#endif
#ifdef B1000000
case 1000000:
spd = B1000000;
break;
#endif
#ifdef B1152000
case 1152000:
spd = B1152000;
break;
#endif
#ifdef B1500000
case 1500000:
spd = B1500000;
break;
#endif
#ifdef B2000000
case 2000000:
spd = B2000000;
break;
#endif
#ifdef B2500000
case 2500000:
spd = B2500000;
break;
#endif
#ifdef B3000000
case 3000000:
spd = B3000000;
break;
#endif
#ifdef B3500000
case 3500000:
spd = B3500000;
break;
#endif
#ifdef B4000000
case 4000000:
spd = B4000000;
break;
#endif
#endif /* of HIGH_BAUD */
default:
term_errno = TERM_EBAUD;
rval = -1;
@ -1193,6 +1250,106 @@ term_break(int fd)
/**************************************************************************/
static int baud_table[] = {
0,
50,
75,
110,
134,
150,
200,
300,
600,
1200,
1800,
2400,
4800,
9600,
19200,
38400,
57600,
115200,
#ifdef HIGH_BAUD
#ifdef B230400
230400,
#endif
#ifdef B460800
460800,
#endif
#ifdef B500000
500000,
#endif
#ifdef B576000
576000,
#endif
#ifdef B921600
921600,
#endif
#ifdef B1000000
1000000,
#endif
#ifdef B1152000
1152000,
#endif
#ifdef B1500000
1500000,
#endif
#ifdef B2000000
2000000,
#endif
#ifdef B2500000
2500000,
#endif
#ifdef B3000000
3000000,
#endif
#ifdef B3500000
3500000,
#endif
#ifdef B4000000
4000000,
#endif
#endif /* of HIGH_BAUD */
};
#define BAUD_TABLE_SZ (sizeof(baud_table) / sizeof(baud_table[0]))
int
term_baud_up (int baud)
{
int i;
for (i = 1; i < BAUD_TABLE_SZ; i++) {
if ( baud >= baud_table[i] )
continue;
else {
baud = baud_table[i];
break;
}
}
return baud;
}
int
term_baud_down (int baud)
{
int i;
for (i = BAUD_TABLE_SZ - 1; i >= 0; i--) {
if ( baud <= baud_table[i] )
continue;
else {
baud = baud_table[i];
break;
}
}
return baud;
}
/**************************************************************************/
/*
* Local Variables:
* mode:c

19
term.h
View File

@ -58,6 +58,8 @@
* F term_drain - drain the output from the terminal buffer
* F term_flush - discard terminal input and output queue contents
* F term_break - generate a break condition on a device
* F term_baud_up - return next higher baudrate
* F term_baud_down - return next lower baudrate
* F term_strerror - return a string describing current error condition
* F term_perror - print a string describing the current error condition
* G term_errno - current error condition of the library
@ -530,6 +532,23 @@ int term_break(int fd);
/***************************************************************************/
/* F term_baud_up
*
* Returns the next higher valid baudrate. Returns "baud" if there is
* no higher valid baudrate.
*/
int term_baud_up (int baud);
/* F term_baud_down
*
* Returns the next lower valid baudrate. Returns "baud" if there is
* no lower valid baudrate.
*/
int term_baud_down (int baud);
/***************************************************************************/
#endif /* of TERM_H */
/***************************************************************************/