FileDocCategorySizeDatePackage
Protocol.javaAPI DocphoneME MR2 API (J2ME)3234Wed May 02 18:00:30 BST 2007com.sun.midp.io.j2me.btspp

Protocol

public class Protocol extends com.sun.midp.io.BluetoothProtocol
Provides 'btspp' protocol support.

Fields Summary
Constructors Summary
public Protocol()
Constructs an instance.

        super(BluetoothUrl.RFCOMM);
    
Methods Summary
protected voidcheckUrl(com.sun.midp.io.BluetoothUrl url)
Ensures URL parameters have valid values.

param
url URL to check
exception
IllegalArgumentException if invalid url parameters found

        super.checkUrl(url);
        
        if (!url.isServer && (url.port < 1 || url.port > 30)) {
            throw new IllegalArgumentException("Invalid channel: " + url.port);
        }
    
protected javax.microedition.io.ConnectionclientConnection(com.sun.midp.security.SecurityToken token, int mode)
Ensures that permissions are proper and creates client side connection.

param
token security token if passed by caller, or null
param
mode I/O access mode
return
proper BTSPPConnectionImpl instance
exception
IOException if openning connection fails.

        checkForPermission(token, Permissions.BLUETOOTH_CLIENT);
        return new BTSPPConnectionImpl(url, mode);
    
protected javax.microedition.io.ConnectionserverConnection(com.sun.midp.security.SecurityToken token, int mode)
Ensures that permissions are proper and creates required notifier at server side.

param
token security token if passed by caller, or null
param
mode I/O access mode
return
proper BTSPPNotifierImpl instance
exception
IOException if openning connection fails

        checkForPermission(token, Permissions.BLUETOOTH_SERVER);
        return new BTSPPNotifierImpl(url, mode);