JSR-82 LIBRARY
getConnectionURL
public java.lang.String getConnectionURL(int requiredSecurity,
boolean mustBeMaster)
Returns a String including optional parameters that can be used by a client to connect to the service described by this ServiceRecord. The return value can be used as the first argument to Connector.open(). In the case of a Serial Port service record, this string might look like "btspp://0050CD00321B:3;authenticate=true;encrypt=false;master=true", where "0050CD00321B" is the Bluetooth address of the device that provided this ServiceRecord, "3" is the RFCOMM server channel mentioned in this ServiceRecord, and there are three optional parameters related to security and master/slave roles.
If this method is called on a ServiceRecord returned from LocalDevice.getRecord(), it will return the connection string that a remote device will use to connect to this service.
Parameters:
requiredSecurity - determines whether authentication or encryption are required for a connection
mustBeMaster - true indicates that this device must play the role of master in connections to this service; false indicates that the local device is willing to be either the master or the slave
Returns:
a string that can be used to connect to the service or null if the ProtocolDescriptorList in this ServiceRecord is not formatted according to the Bluetooth specification
Throws:
IllegalArgumentException - if requiredSecurity is not one of the constants NOAUTHENTICATE_NOENCRYPT, AUTHENTICATE_NOENCRYPT, or AUTHENTICATE_ENCRYPT
See Also:
NOAUTHENTICATE_NOENCRYPT, AUTHENTICATE_NOENCRYPT, AUTHENTICATE_ENCRYPT