If the connection is established,
Connector.open() returns a StreamConnection object, which allows
the application to read and write to the server. Unlike the server??™s connection,
the client??™s connection to the server has been established once
Connector.open() returns.
What is the server channel identifier, and how does a service get
one? The server channel identifier is similar to a TCP/IP port number.
It uniquely identifies a service on a device. The server channel identifier
is a number between 0 and 31. The server channel identifier is
assigned by the JABWT implementation for a service. The server channel
identifier is set in the service record??™s ProtocolDescriptorList attribute.
This allows the ServiceRecord??™s getConnectionURL()
method to generate the connection string to use to connect to the
service. Because a device is not aware of the devices and services in an
area, it is expected that most JABWT applications will use the
getConnectionURL() method.
Now for some examples of client connection strings:
"btspp://008003DD8901:1;authenticate=true??™??™ creates an RFCOMM
connection to the device with a Bluetooth address of 008003DD8901.
It connects to the service identified by the server channel identifier 1.
The connection string also causes the remote device to be authenticated.
Pages:
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