aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.1
blob: 92c7d4545ab3714c2cb703c2e74fd4516f36467d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
.\" Copyright (c) 2001-2003 Maksim Yevmenkin <m_evmenkin@yahoo.com>
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $Id: rfcomm_sppd.1,v 1.3 2003/09/07 18:15:55 max Exp $
.\" $FreeBSD$
.\"
.Dd April 21, 2008
.Dt RFCOMM_SPPD 1
.Os
.Sh NAME
.Nm rfcomm_sppd
.Nd RFCOMM Serial Port Profile daemon
.Sh SYNOPSIS
.Nm
.Op Fl bhS
.Fl a Ar address
.Fl c Ar channel
.Op Fl t Ar tty
.Sh DESCRIPTION
The
.Nm
utility is a Serial Port Profile daemon.
It can operate in two modes: client and server.
.Pp
In client mode,
.Nm
opens RFCOMM connection to the specified
.Ar address
server and
.Ar channel .
Once connection is established, the
.Nm
utility provides access to the server's remote serial port via stdin/stdout
or via
.Xr pty 4
interface if
.Fl t
option was specified.
.Pp
If the
.Fl S
option is specified,
.Nm
will operate in server mode and act as RFCOMM server,
listening on
.Dv ANY
address and advertising a virtual serial port
via the
.Xr sdpd 8
daemon.
If
.Fl t
options was specified,
the server side of the virtual serial port is attached to the pseudo-terminal
.Ar tty .
Otherwise the virtual serial port is attached to the stdin/stdout.
.Nm
should be run as root in order to communicate with
.Xr sdpd 8
in this case.
.Pp
The
.Nm
utility opens both master and slave pseudo terminals.
This is done to ensure that RFCOMM connection stays open until
.Nm
is terminated.
The data received from the master pseudo terminal are sent over
the RFCOMM connection.
The data received from the RFCOMM connection are written
into master pseudo terminal.
The application in its turn opens the slave pseudo
terminal and operates on it just like it would operate over the standard serial
port.
.Pp
The options are as follows:
.Bl -tag -width indent
.It Fl a Ar address
In client mode,
this required option specifies the address of the remote RFCOMM server.
If this option is specified in server mode,
.Nm
will only accept connections from the
.Tn Bluetooth
device with address
.Ar address .
The address can be specified as BD_ADDR or name.
If name was specified then
.Nm
utility will attempt to resolve the name via
.Xr bt_gethostbyname 3 .
.It Fl b
Detach from the controlling terminal, i.e., run in background.
.It Fl c Ar channel
In both client and server mode,
this option specifies the RFCOMM channel to connect to or listen on.
In server mode,
the channel should be a number between 1 and 30.
If not specified,
.Nm
will try to bind to
.Dq wildcard
RFCOMM channel number.
The actual RFCOMM channel will be obtained via
.Xr getsockname 2
call and will be used to register Serial Port service with
.Xr sdpd 8 .
In client mode,
the channel could either be a number between 1 and 30 or a service name.
Supported service names are:
.Cm DUN
(for DialUp Networking service),
.Cm FAX
(for Fax service),
.Cm LAN
(for LAN Access Using PPP service) and
.Cm SP
(for Serial Port service).
If channel was not specified then
.Nm
utility will try to obtain RFCOMM channel for Serial Port service via Service
Discovery Protocol from the server.
.It Fl h
Display usage message and exit.
.It Fl S
Server mode; see
.Sx DESCRIPTION .
.It Fl t Ar tty
Slave pseudo tty name.
If not set stdin/stdout will be used.
This option is required if
.Fl b
option was specified.
.El
.Sh FILES
.Bl -tag -width ".Pa /dev/tty[p-sP-S][0-9a-v]" -compact
.It Pa /dev/pty[p-sP-S][0-9a-v]
master pseudo terminals
.It Pa /dev/tty[p-sP-S][0-9a-v]
slave pseudo terminals
.El
.Sh EXIT STATUS
.Ex -std
.Sh EXAMPLES
.Dl "rfcomm_sppd -a 00:01:02:03:04:05 -c 1 -t /dev/ttyp1"
.Pp
Will start the
.Nm
utility and open RFCOMM connection to the server at
.Li 00:01:02:03:04:05
and channel
.Li 1 .
Once the connection has been established,
.Pa /dev/ttyp1
can be used to talk to the remote serial port on the server.
.Sh SEE ALSO
.Xr bluetooth 3 ,
.Xr ng_btsocket 4 ,
.Xr pty 4 ,
.Xr rfcomm_pppd 8 ,
.Xr sdpd 8
.Sh AUTHORS
.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com
.Sh BUGS
Please report if found.