|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.bluetooth.BluetoothDevice
public class BluetoothDevice
The Android Bluetooth API is not finalized, and *will* change. Use at your own risk. Manages the local Bluetooth device. Scan for devices, create bondings, power up and down the adapter.
| Field Summary | |
|---|---|
static int |
MODE_CONNECTABLE
|
static int |
MODE_DISCOVERABLE
|
static int |
MODE_OFF
|
static int |
MODE_UNKNOWN
|
static int |
RESULT_FAILURE
|
static int |
RESULT_SUCCESS
|
| Constructor Summary | |
|---|---|
BluetoothDevice(IBluetoothDevice service)
|
|
| Method Summary | |
|---|---|
boolean |
cancelBondingProcess(String address)
|
void |
cancelDiscovery()
|
boolean |
cancelPin(String address)
|
static boolean |
checkBluetoothAddress(String address)
|
boolean |
clearRemoteAlias(String address)
|
static byte[] |
convertPinToBytes(String pin)
Check that a pin is valid and convert to byte array. |
boolean |
createBonding(String address)
Create a bonding with a remote bluetooth device. |
boolean |
createBonding(String address,
IBluetoothDeviceCallback callback)
Create a bonding with a remote bluetooth device. |
boolean |
disable()
Disable the Bluetooth device. |
boolean |
disconnectRemoteDeviceAcl(String address)
Perform a low level (ACL) disconnection of a remote device. |
boolean |
enable()
Enable the Bluetooth device. |
boolean |
enable(IBluetoothDeviceCallback callback)
Enable the Bluetooth device. |
String |
getAddress()
|
String |
getCompany()
|
int |
getDiscoverableTimeout()
|
String |
getMajorClass()
|
String |
getManufacturer()
|
String |
getMinorClass()
|
int |
getMode()
|
String |
getName()
Get the friendly Bluetooth name of this device. |
String |
getRemoteAlias(String address)
|
int |
getRemoteClass(String address)
|
String |
getRemoteCompany(String address)
|
byte[] |
getRemoteFeatures(String address)
|
String |
getRemoteMajorClass(String address)
|
String |
getRemoteManufacturer(String address)
|
String |
getRemoteMinorClass(String address)
|
String |
getRemoteName(String address)
|
String |
getRemoteRevision(String address)
|
boolean |
getRemoteServiceChannel(String address,
short uuid16,
IBluetoothDeviceCallback callback)
Returns the RFCOMM channel associated with the 16-byte UUID on the remote Bluetooth address. |
String[] |
getRemoteServiceClasses(String address)
|
String |
getRemoteVersion(String address)
|
String |
getRevision()
|
String |
getVersion()
|
boolean |
hasBonding(String address)
Check if a remote device is bonded (paired) to the local device. |
boolean |
isAclConnected(String address)
Check if a specified remote device has a low level (ACL) connection. |
boolean |
isDiscovering()
|
boolean |
isEnabled()
Get the current status of Bluetooth hardware. |
boolean |
isPeriodicDiscovery()
|
String |
lastSeen(String address)
|
String |
lastUsed(String address)
|
String[] |
listAclConnections()
List remote devices that have a low level (ACL) connection. |
String[] |
listBondings()
List remote devices that are bonded (paired) to the local device. |
String[] |
listRemoteDevices()
|
boolean |
removeBonding(String address)
|
void |
setDiscoverableTimeout(int timeout)
|
void |
setMode(int mode)
|
boolean |
setName(String name)
Set the friendly Bluetooth name of this device. |
boolean |
setPin(String address,
byte[] pin)
|
boolean |
setRemoteAlias(String address,
String alias)
|
boolean |
startDiscovery()
|
boolean |
startDiscovery(boolean resolveNames)
|
boolean |
startPeriodicDiscovery()
|
boolean |
stopPeriodicDiscovery()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MODE_UNKNOWN
public static final int MODE_OFF
public static final int MODE_CONNECTABLE
public static final int MODE_DISCOVERABLE
public static final int RESULT_FAILURE
public static final int RESULT_SUCCESS
| Constructor Detail |
|---|
public BluetoothDevice(IBluetoothDevice service)
| Method Detail |
|---|
public boolean isEnabled()
public boolean enable()
public boolean enable(IBluetoothDeviceCallback callback)
callback - Your callback, null is ok.
public boolean disable()
public String getAddress()
public String getName()
public boolean setName(String name)
name - the name to set
public String getMajorClass()
public String getMinorClass()
public String getVersion()
public String getRevision()
public String getManufacturer()
public String getCompany()
public int getMode()
public void setMode(int mode)
public int getDiscoverableTimeout()
public void setDiscoverableTimeout(int timeout)
public boolean startDiscovery()
public boolean startDiscovery(boolean resolveNames)
public void cancelDiscovery()
public boolean isDiscovering()
public boolean startPeriodicDiscovery()
public boolean stopPeriodicDiscovery()
public boolean isPeriodicDiscovery()
public String[] listRemoteDevices()
public String[] listAclConnections()
public boolean isAclConnected(String address)
address - the Bluetooth hardware address you want to check.
public boolean disconnectRemoteDeviceAcl(String address)
address - the Bluetooth hardware address you want to disconnect.
public boolean createBonding(String address)
address - the remote device Bluetooth address.
public boolean createBonding(String address,
IBluetoothDeviceCallback callback)
address - The remote device Bluetooth address.callback - Your callback, null is ok.
public boolean cancelBondingProcess(String address)
public String[] listBondings()
public boolean hasBonding(String address)
address - Bluetooth hardware address of the remote device to check.
public boolean removeBonding(String address)
public String getRemoteName(String address)
public String getRemoteAlias(String address)
public boolean setRemoteAlias(String address,
String alias)
public boolean clearRemoteAlias(String address)
public String getRemoteVersion(String address)
public String getRemoteRevision(String address)
public String getRemoteManufacturer(String address)
public String getRemoteCompany(String address)
public String getRemoteMajorClass(String address)
public String getRemoteMinorClass(String address)
public String[] getRemoteServiceClasses(String address)
public boolean getRemoteServiceChannel(String address,
short uuid16,
IBluetoothDeviceCallback callback)
public int getRemoteClass(String address)
public byte[] getRemoteFeatures(String address)
public String lastSeen(String address)
public String lastUsed(String address)
public boolean setPin(String address,
byte[] pin)
public boolean cancelPin(String address)
public static byte[] convertPinToBytes(String pin)
pin - pin as java String
public static boolean checkBluetoothAddress(String address)
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||