|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RemoteBluetoothDevice
Interface for managing a remote Bluetooth device and RFComm connections. RemoteBluetoothDevice instances are created and managed by the unique LocalBluetoothDevice instance.
Device name, address and class can be retrieved without connecting to the
device. Before opening a BluetoothSocket for RFComm serial connection over
Bluetooth, the RemoteBluetoothDevice has to be paired by invoking the
pair()
method. Pairing is an asynchronous process, therefore
this method returns immediately. To get notifications on pairing process, a
class implementing the RemoteBluetoothDeviceListener interface has to be
registered as listener to this instance. Pairing may require to type a PIN
number: if remote device asks for that, a message will appear on the
notification area of the handset (the listener will receive an event on the
method pinRequested()
: once the user has typed the PIN, the
listener will get a paired()
event that notifies that device is
connected and that BluetoothSocket instances can be created.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface it.gerdavax.android.bluetooth.BluetoothDevice |
---|
BluetoothDevice.BluetoothClasses, BluetoothDevice.BluetoothProfiles, BluetoothDevice.BluetoothProtocols |
Method Summary | |
---|---|
java.lang.String |
getAddress()
Gets the BD Address of this device. |
int |
getDeviceClass()
Gets the device class (see Bluetooth Protocol Specification) |
int |
getDeviceMajorClass()
Gets the device major class (see Bluetooth Protocol Specification) |
int |
getDeviceMinorClass()
Gets the device minor class (see Bluetooth Protocol Specification) |
void |
getRemoteServiceChannel(int uuid16)
|
short |
getRSSI()
Gets the signal strenght (Received Signal Strength Indicator) of this device |
int |
getServiceMajorClass()
Gets the service major class of this device (see Bluetooth Protocol Specification) |
boolean |
isPaired()
Gets the paired status of this device |
BluetoothSocket |
openSocket(int port)
Opens a BluetoothSocket (RFComm) to this device on assigned port. |
void |
pair()
Attempts to pair this remote device. |
void |
pair(java.lang.String pin)
Attempts to pair this remote device with preassigned PIN. |
void |
setListener(RemoteBluetoothDeviceListener listener)
Sets the listener for events coming from this RemoteBluetoothDevice |
void |
setPin(java.lang.String pin)
Sets a default PIN for the pairing |
void |
unpair()
Unpair this remote device |
Methods inherited from interface it.gerdavax.android.bluetooth.BluetoothDevice |
---|
getName |
Method Detail |
---|
java.lang.String getAddress()
getAddress
in interface BluetoothDevice
short getRSSI()
int getDeviceClass()
int getDeviceMajorClass()
int getDeviceMinorClass()
int getServiceMajorClass()
void setPin(java.lang.String pin) throws BluetoothException
pin
-
BluetoothException
void pair()
void pair(java.lang.String pin)
void unpair()
boolean isPaired()
BluetoothSocket openSocket(int port) throws BluetoothException
port
-
BluetoothException
void setListener(RemoteBluetoothDeviceListener listener)
listener
- RemoteBluetoothDeviceListener
void getRemoteServiceChannel(int uuid16) throws java.lang.Exception
uuid16
-
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |