xref: /netbsd-src/share/man/man4/wsbell.4 (revision 76748ca41481dcbc1f6e51bd5c3316613ca32cb8)
1.\" $NetBSD: wsbell.4,v 1.2 2024/09/08 17:28:36 rillig Exp $
2.\"
3.\" Copyright (c) 2017 Nathanial Sloss <nathanialsloss@yahoo.com.au>
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
16.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
19.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25.\" POSSIBILITY OF SUCH DAMAGE.
26.\"
27.Dd June 13, 2017
28.Dt WSBELL 4
29.Os
30.Sh NAME
31.Nm wsbell
32.Nd generic bell support in wscons
33.Sh SYNOPSIS
34.Cd "wsbell*    at spkr? console?"
35.Sh DESCRIPTION
36The
37.Nm
38driver utilizes the
39.Xr speaker 4
40driver to provide a system bell with or without a keyboard for the
41.Xr wscons 4
42framework.
43When a bell character is received on a
44.Xr wsdisplay 4
45screen,
46.Nm
47sounds the bell.
48.Pp
49The
50.Xr wsconsctl 8
51utility gives access to several configurable parameters that affect the sound
52of the system bell.
53.Ss Ioctls
54The following
55.Xr ioctl 2
56calls are provided by the
57.Nm
58driver.
59Their definitions are found in
60.Pa dev/wscons/wsconsio.h .
61.Bl -tag -width Dv
62.It Dv WSKBDIO_BELL
63Will sound the default bell.
64.It Dv WSKBDIO_GETBELL
65Will return a struct wskbd_bell_data with the current bell parameters.
66.It Dv WSKBDIO_SETBELL
67Takes a struct wskbd_bell_data and uses it to set the bell parameters.
68These are used by the WSKBDIO_BELL
69.Xr ioctl 2
70call.
71.It Dv WSKBDIO_COMPLEXBELL
72Will sound a bell using a supplied struct wskbd_bell_data for its parameters.
73.It Dv WSKBDIO_GETDEFAULTBELL
74Will return a struct wskbd_bell_data with the
75.Em default
76bell parameters.
77.It Dv WSKBDIO_SETDEFAULTBELL
78Takes a struct wskbd_bell_data and uses it to set the
79.Em default
80bell parameters.
81.El
82.Pp
83Ioctls use the following structure:
84.Bd -literal
85struct wskbd_bell_data {
86	u_int	which;			/* values to get/set */
87#define	WSKBD_BELL_DOPITCH	0x1	/* get/set pitch */
88#define	WSKBD_BELL_DOPERIOD	0x2	/* get/set period */
89#define	WSKBD_BELL_DOVOLUME	0x4	/* get/set volume */
90#define	WSKBD_BELL_DOALL	0x7	/* all of the above */
91	u_int	pitch;			/* pitch, in Hz */
92	u_int	period;			/* period, in milliseconds */
93	u_int	volume;			/* percentage of max volume */
94};
95.Ed
96.Sh FILES
97.Bl -item
98.It
99.Pa /usr/include/dev/wscons/wsconsio.h .
100.El
101.Sh SEE ALSO
102.Xr speaker 4 ,
103.Xr wscons 4 ,
104.Xr wskbd 4 ,
105.Xr wsmux 4 ,
106.Xr wsconsctl 8 ,
107.Xr wsbell 9
108