Methods Summary |
---|
public boolean | authenticate()
if (!BCC.getInstance().isConnected(getBluetoothAddress())) {
throw new IOException("There are no open connections between the " +
"local device and this RemoteDevice.");
}
return BCC.getInstance().authenticate(getBluetoothAddress());
|
public boolean | authorize(javax.microedition.io.Connection conn)
BluetoothConnection btconn = BluetoothConnection.getConnection(conn);
if (!equals(btconn.getRemoteDevice())) {
throw new IllegalArgumentException("The specified connection " +
"is not a connection to this RemoteDevice.");
}
if (!btconn.isServerSide()) {
throw new IllegalArgumentException("The local device is client " +
"rather than the server for the specified connection.");
}
return authenticate() && (isTrustedDevice() || btconn.isAuthorized() ||
btconn.authorize());
|
public boolean | encrypt(javax.microedition.io.Connection conn, boolean on)
BluetoothConnection btconn = BluetoothConnection.getConnection(conn);
if (!equals(btconn.getRemoteDevice())) {
throw new IllegalArgumentException("The specified connection " +
"is not a connection to this RemoteDevice.");
}
if (on && !authenticate()) {
return false;
}
return btconn.encrypt(on);
|
public boolean | equals(java.lang.Object obj)
return obj instanceof RemoteDevice &&
l_address == ((RemoteDevice) obj).l_address;
|
public final java.lang.String | getBluetoothAddress()
return s_address;
|
public java.lang.String | getFriendlyName(boolean alwaysAsk)
// contact the remote device if name is not known or alwaysAsk is true
if (friendlyName == null || alwaysAsk) {
friendlyName = BCC.getInstance().getFriendlyName(
getBluetoothAddress());
}
return friendlyName;
|
public static javax.bluetooth.RemoteDevice | getRemoteDevice(javax.microedition.io.Connection conn)
return BluetoothConnection.getConnection(conn).getRemoteDevice();
|
public int | hashCode()
return (int) ((l_address >>> 24) ^ (l_address & 0xffffffL));
|
public boolean | isAuthenticated()
return BCC.getInstance().isAuthenticated(getBluetoothAddress());
|
public boolean | isAuthorized(javax.microedition.io.Connection conn)
BluetoothConnection btconn = BluetoothConnection.getConnection(conn);
RemoteDevice device;
try {
device = btconn.getRemoteDevice();
} catch (IllegalArgumentException e) {
return false;
}
if (!equals(device)) {
throw new IllegalArgumentException("The specified connection " +
"is not a connection to this RemoteDevice.");
}
return btconn.isServerSide() && btconn.isAuthorized();
|
public boolean | isEncrypted()
return BCC.getInstance().isEncrypted(getBluetoothAddress());
|
public boolean | isTrustedDevice()
return BCC.getInstance().isTrusted(getBluetoothAddress());
|