Methods Summary |
---|
protected void | checkUrl(com.sun.midp.io.BluetoothUrl url)Ensures URL parameters have valid values. Sets receiveMTU if undefined.
if (url.receiveMTU == -1) {
url.receiveMTU = L2CAPConnection.DEFAULT_MTU;
}
if (url.isSystem()) {
return;
}
super.checkUrl(url);
if (!url.isServer && (url.port <= 0x1000 || url.port >= 0xffff ||
((url.port & 1) != 1) || ((url.port & 0x100) != 0))) {
throw new IllegalArgumentException("Invalid PSM: " + url.port);
}
// IMPL_NOTE BluetoothConnectionException should be thrown here
// It is temporary substituted by IllegalArgumentException
// to pass TCK succesfully. To be changed back when fixed
// TCK arrives. The erroneous TCK test is
// javasoft.sqe.tests.api.javax.bluetooth.Connector.L2Cap.
// openClientTests.L2Cap1014()
//
// Correct code here is
// throw new BluetoothConnectionException(
// BluetoothConnectionException.UNACCEPTABLE_PARAMS,
// <message>);
if (url.receiveMTU < L2CAPConnection.MINIMUM_MTU) {
throw new IllegalArgumentException(
"Receive MTU is too small");
}
if (url.receiveMTU > MAX_STACK_MTU) {
throw new IllegalArgumentException("Receive MTU is too large");
}
if (url.transmitMTU != -1 && url.transmitMTU > MAX_STACK_MTU) {
throw new BluetoothConnectionException(
BluetoothConnectionException.UNACCEPTABLE_PARAMS,
"Transmit MTU is too large");
}
|
protected javax.microedition.io.Connection | clientConnection(com.sun.midp.security.SecurityToken token, int mode)Ensures that permissions are proper and creates client side connection.
checkForPermission(token, Permissions.BLUETOOTH_CLIENT);
return new L2CAPConnectionImpl(url, mode);
|
public javax.microedition.io.Connection | openPrim(java.lang.Object token, com.sun.midp.io.BluetoothUrl url, int mode)Cheks permissions and opens requested connection.
return openPrimImpl(token, url, mode);
|
protected javax.microedition.io.Connection | serverConnection(com.sun.midp.security.SecurityToken token, int mode)Ensures that permissions are proper and creates required notifier at
server side.
checkForPermission(token, Permissions.BLUETOOTH_SERVER);
return new L2CAPNotifierImpl(url, mode);
|