RFCOMM connections provide reliable, bidirectional, stream-oriented
communication. In JSR-82, the API is based on the StreamConnectionNotifier
and StreamConnection
interfaces
of the Generic Connection Framework defined for Connected Limited Device Configuration
(CLDC).
An RFCOMM server is created by calling Connector.open()
with
an appropriate server connection string. The format of the string is defined
by JSR-82. The connector string begins with the protocol prefix “btspp://
”
and may contain parameters related to a master/slave preference, or security
parameters (authentication, encryption, and authorization). A StreamConnectionNotifier
object
is returned when opening a server connection, and its acceptAndOpen()
method
can be used to accept connections from remote clients. Input and output streams
are used to read or write data on a connection.
RFCOMM clients are created in a similar way with method Connector.open()
using
a client connection string.
Note: To see the RFCOMM protocol being used in an application example, see section Example: Creating a client server pair using RFCOMM.