javax.bluetooth
Class RemoteDevice

java.lang.Object
  extended by javax.bluetooth.RemoteDevice

public class RemoteDevice
extends Object

Represents a remote Bluetooth device.

Author:
Lawrie Griffiths

Constructor Summary
protected RemoteDevice(String addr)
          Note: The standard JSR 82 method for obtaining a RemoteDevice uses a String rather than byte[].
  RemoteDevice(String name, String deviceAddr, byte[] devclass)
           
 
Method Summary
 boolean equals(Object obj)
          Determines if two RemoteDevices are equal.
 String getBluetoothAddress()
           
 String getDeviceAddr()
           
 byte[] getDeviceClass()
           
 String getFriendlyName(boolean alwaysAsk)
           
static RemoteDevice getRemoteDevice(Connection conn)
           
 boolean isAuthenticated()
          Indicates if the remote device has been properly paired (authenticated).
 boolean isEncrypted()
          Always returns false because NXT BC4 chip doesn't encrypt.
 void setDeviceAddr(String deviceAddr)
           
 void setDeviceClass(byte[] devclass)
           
 void setFriendlyName(String fName)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteDevice

protected RemoteDevice(String addr)
Note: The standard JSR 82 method for obtaining a RemoteDevice uses a String rather than byte[]. Protected so shouldn't matter.

Parameters:
addr -

RemoteDevice

public RemoteDevice(String name,
                    String deviceAddr,
                    byte[] devclass)
Method Detail

getRemoteDevice

public static RemoteDevice getRemoteDevice(Connection conn)
                                    throws IOException
Throws:
IOException

setDeviceAddr

public void setDeviceAddr(String deviceAddr)

getDeviceAddr

public String getDeviceAddr()

setFriendlyName

public void setFriendlyName(String fName)

isAuthenticated

public boolean isAuthenticated()
Indicates if the remote device has been properly paired (authenticated).

Returns:
true iff the device has been paired

isEncrypted

public boolean isEncrypted()
Always returns false because NXT BC4 chip doesn't encrypt.

Returns:
false means it is not encrypted

getFriendlyName

public String getFriendlyName(boolean alwaysAsk)
Parameters:
alwaysAsk - true causes the method to contact the remote device for the name. false and it will use the known name.
Returns:
the friendly name

setDeviceClass

public void setDeviceClass(byte[] devclass)

getBluetoothAddress

public String getBluetoothAddress()

equals

public boolean equals(Object obj)
Determines if two RemoteDevices are equal. If they both have the same BT address then they are considered equal.

Overrides:
equals in class Object

getDeviceClass

public byte[] getDeviceClass()