xref: /freebsd/usr.bin/morse/morse.6 (revision 6829dae12bb055451fa467da4589c43bd03b1e64)
1.\" Copyright (c) 2000 Alexey Zelkin.  All rights reserved.
2.\" Copyright (c) 1988, 1991, 1993
3.\"	The Regents of the University of California.  All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\" 3. Neither the name of the University nor the names of its contributors
14.\"    may be used to endorse or promote products derived from this software
15.\"    without specific prior written permission.
16.\"
17.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27.\" SUCH DAMAGE.
28.\"
29.\"	@(#)bcd.6	8.1 (Berkeley) 5/31/93
30.\" $FreeBSD$
31.\"
32.Dd January 5, 2018
33.Dt MORSE 6
34.Os
35.Sh NAME
36.Nm morse
37.Nd reformat input as morse code
38.Sh SYNOPSIS
39.Nm
40.Op Fl elrps
41.Op Fl d Ar device
42.Op Fl w Ar speed
43.Op Fl c Ar speed
44.Op Fl f Ar frequency
45.Op Ar string ...
46.Sh DESCRIPTION
47The
48.Nm
49command reads the given input and reformats it in the form of morse code.
50Acceptable input are command line arguments or the standard input.
51.Pp
52Available options:
53.Bl -tag -width indent
54.It Fl l
55The
56.Fl l
57option produces output suitable for
58.Xr led 4
59devices.
60.It Fl s
61The
62.Fl s
63option produces dots and dashes rather than words.
64.It Fl p
65Send morse the real way.
66This only works if your system has
67.Xr speaker 4
68support.
69.It Fl w Ar speed
70Set the sending speed in words per minute.
71If not specified, the default
72speed of 20 WPM is used.
73.It Fl c Ar speed
74Farnsworth support.
75Set the spacing between characters in words per minute.
76This is independent of the speed
77that the individual characters are sent.
78If not specified, defaults to the effective value of the
79.Fl w
80option.
81.It Fl f Ar frequency
82Set the sidetone frequency to something other than the default 600 Hz.
83.It Fl d Ar device
84Similar to
85.Fl p ,
86but use the RTS line of
87.Ar device
88(which must be a TTY device)
89in order to emit the morse code.
90.It Fl e
91Echo each character before it is sent, used together with either
92.Fl p
93or
94.Fl d .
95.It Fl r
96Decode morse output consisting of dots and dashes (as generated by using
97the
98.Fl s
99option).
100.El
101.Pp
102The
103.Fl w , c
104and
105.Fl f
106flags only work in conjunction with either the
107.Fl p
108or the
109.Fl d
110flag.
111.Pp
112Not all prosigns have corresponding characters.
113Use
114.Ql #
115for
116.Em AS ,
117.Ql &
118for
119.Em SK ,
120.Ql *
121for
122.Em VE
123and
124.Ql %
125for
126.Em BK .
127The more common prosigns are
128.Ql =
129for
130.Em BT ,
131.Ql \&(
132for
133.Em KN
134and
135.Ql +
136for
137.Em AR .
138.Pp
139Using the
140.Fl d
141flag,
142it is possible to key an external device, like a sidetone generator with
143a headset for training purposes, or even your ham radio transceiver.
144For
145the latter, simply connect an NPN transistor to the serial port
146.Ar device ,
147emitter connected to ground, base connected through a resistor
148(few kiloohms) to RTS, collector to the key line of your transceiver
149(assuming the transceiver has a positive key supply voltage and is keyed
150by grounding the key input line).
151A capacitor (some nanofarads) between
152base and ground is advisable to keep stray RF away,
153and to suppress the
154minor glitch that is generated during program startup.
155.Sh ENVIRONMENT
156Your
157.Ev LC_CTYPE
158locale codeset determines how
159characters with the high-order bit set
160are interpreted.
161.Pp
162.Bl -tag -width ".Li ISO8859-15" -compact
163.It Li ISO8859-1
164.It Li ISO8859-15
165Interpret characters with the high-order bit set as Western European characters.
166.Pp
167.It Li KOI8-R
168Interpret characters with the high-order bit set as Cyrillic characters.
169.Pp
170.It Li ISO8859-7
171Interpret characters with the high-order bit set as Greek characters.
172.El
173.Sh FILES
174.Bl -tag -width ".Pa /dev/speaker" -compact
175.It Pa /dev/speaker
176.Xr speaker 4
177device file
178.El
179.Sh SEE ALSO
180.Xr speaker 4
181.Sh HISTORY
182Sound support for
183.Nm
184added by
185.An Lyndon Nerenberg (VE6BBM) Aq Mt lyndon@orthanc.ca .
186.Pp
187Ability to key an external device added by
188.An J\(:org Wunsch
189(DL8DTL).
190.Pp
191Farnsworth support for
192.Nm
193added by
194.An Stephen Cravey (N5UUU).
195.Sh BUGS
196Only understands a few European characters
197(German and French),
198no Asian characters,
199and no continental landline code.
200.Pp
201Sends a bit slower than it should due to system overhead.
202Some people would call this a feature.
203