|
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.os.Binder
android.bluetooth.IBluetoothDevice.Stub
android.server.BluetoothDeviceService
public class BluetoothDeviceService
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface android.bluetooth.IBluetoothDevice |
|---|
IBluetoothDevice.Stub |
| Nested classes/interfaces inherited from interface android.os.IBinder |
|---|
IBinder.DeathRecipient |
| Field Summary |
|---|
| Fields inherited from interface android.os.IBinder |
|---|
DUMP_TRANSACTION, FIRST_CALL_TRANSACTION, FLAG_ONEWAY, INTERFACE_TRANSACTION, LAST_CALL_TRANSACTION, PING_TRANSACTION |
| Constructor Summary | |
|---|---|
BluetoothDeviceService(Context context)
|
|
| Method Summary | |
|---|---|
boolean |
cancelBondingProcess(String address)
This method cancels a pending bonding request. |
boolean |
cancelDiscovery()
Cancel a remote-device discovery. |
boolean |
cancelPin(String address)
|
boolean |
clearRemoteAlias(String address)
Removes the alias of a remote device. |
boolean |
createBonding(String address,
IBluetoothDeviceCallback callback)
This method initiates a Bonding request to a remote device. |
boolean |
disable()
Disable bluetooth. |
boolean |
disconnectRemoteDeviceAcl(String address)
|
protected void |
dump(FileDescriptor fd,
PrintWriter pw,
String[] args)
Print the object's state into the given stream. |
boolean |
enable(IBluetoothDeviceCallback callback)
Enable this Bluetooth device, asynchronously. |
protected void |
finalize()
Called by the virtual machine when there are no longer any (non-weak) references to the receiver. |
(package private) String |
getAdapterPathNative()
|
String |
getAddress()
|
String |
getCompany()
Returns the company name from the OUI database of the Bluetooth device address. |
int |
getDiscoverableTimeout()
Get the discoverability window for the device. |
String |
getMajorClass()
|
String |
getManufacturer()
Returns the manufacturer of the Bluetooth chip. |
String |
getMinorClass()
|
int |
getMode()
Determines which one of three modes this adapter is in: discoverable and connectable, not discoverable but connectable, or neither. |
String |
getName()
|
String |
getRemoteAlias(String address)
Retrieves the alias of a remote device. |
int |
getRemoteClass(String address)
Gets the remote major, minor, and service classes encoded as a 32-bit integer. |
String |
getRemoteCompany(String address)
Like getCompany(), but for a remote device. |
byte[] |
getRemoteFeatures(String address)
Gets the remote features encoded as bit mask. |
String |
getRemoteMajorClass(String address)
Gets the major device class of the specified device. |
String |
getRemoteManufacturer(String address)
Like getManufacturer(), but for a remote device. |
String |
getRemoteMinorClass(String address)
Gets the minor device class of the specified device. |
String |
getRemoteName(String address)
Returns the user-friendly name of a remote device. |
String |
getRemoteRevision(String address)
Like getRevision(), but for a remote device. |
boolean |
getRemoteServiceChannel(String address,
int uuid16,
IBluetoothDeviceCallback callback)
|
String[] |
getRemoteServiceClasses(String address)
Gets the service classes of the specified device. |
int[] |
getRemoteServiceHandles(String address,
String match)
This method and getRemoteServiceRecord(java.lang.String, int) query the SDP service
on a remote device. |
byte[] |
getRemoteServiceRecord(String address,
int handle)
This method retrieves the service records corresponding to a given service handle (method getRemoteServiceHandles(java.lang.String, java.lang.String) retrieves the
service handles.)
This method and getRemoteServiceHandles(java.lang.String, java.lang.String) do not interpret their
data, but simply return it raw to the user. |
String |
getRemoteVersion(String address)
Like getVersion(), but for a remote device. |
String |
getRevision()
Returns the revision of the Bluetooth chip. |
String |
getVersion()
Returns the version of the Bluetooth chip. |
boolean |
hasBonding(String address)
|
void |
init()
Must be called after construction, and before any other method. |
boolean |
isAclConnected(String address)
|
boolean |
isConnectable()
Detetermines whether this device is connectable (that is, whether remote devices can connect to it.) |
boolean |
isDiscoverable()
Detetermines whether this device is discoverable. |
boolean |
isDiscovering()
|
boolean |
isEnabled()
|
boolean |
isPeriodicDiscovery()
|
String |
lastSeen(String address)
Returns the date and time when the specified remote device has been seen by a discover procedure. |
String |
lastUsed(String address)
Returns the date and time when the specified remote device has last been connected to Example: "2006-02-08 12:00:00 GMT" |
String[] |
listAclConnections()
|
String[] |
listBondings()
|
String[] |
listRemoteDevices()
This method lists all remote devices that this adapter is aware of. |
boolean |
removeBonding(String address)
This method removes a bonding to a remote device. |
boolean |
setDiscoverableTimeout(int timeout)
Set the discoverability window for the device. |
(package private) void |
setIsDiscovering(boolean isDiscovering)
|
boolean |
setMode(int mode)
Set the discoverability and connectability mode of this adapter. |
boolean |
setName(String name)
|
boolean |
setPin(String address,
byte[] pin)
|
boolean |
setRemoteAlias(String address,
String alias)
Changes the alias of a remote device. |
boolean |
startDiscovery(boolean resolveNames)
Initiate a remote-device-discovery procedure. |
boolean |
startPeriodicDiscovery()
|
boolean |
stopPeriodicDiscovery()
|
| Methods inherited from class android.bluetooth.IBluetoothDevice.Stub |
|---|
asBinder, asInterface, onTransact |
| Methods inherited from class android.os.Binder |
|---|
attachInterface, clearCallingIdentity, flushPendingCommands, getCallingPid, getCallingUid, getInterfaceDescriptor, isBinderAlive, joinThreadPool, linkToDeath, pingBinder, queryLocalInterface, restoreCallingIdentity, transact, unlinkToDeath |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BluetoothDeviceService(Context context)
| Method Detail |
|---|
public void init()
protected void finalize()
throws Throwable
ObjectNote: The virtual machine assumes that the implementation in class Object is empty.
finalize in class BinderThrowable - The virtual machine ignores any exceptions which are
thrown during finalization.public boolean isEnabled()
public boolean disable()
public boolean enable(IBluetoothDeviceCallback callback)
public String getAddress()
public String getName()
public boolean setName(String name)
public String[] listBondings()
public String getMajorClass()
public String getMinorClass()
public String getRemoteName(String address)
address - Bluetooth address of remote device.
String getAdapterPathNative()
public boolean startDiscovery(boolean resolveNames)
#stopDiscovery. Remote-device discoveries
are returned as intents
Typically, when a remote device is found, your android.bluetooth.DiscoveryEventNotifier#notifyRemoteDeviceFound method will be invoked, and subsequently, your android.bluetooth.RemoteDeviceEventNotifier#notifyRemoteNameUpdated will tell you the user-friendly name of the remote device. However, it is possible that the name update may fail for various reasons, so you should display the device's Bluetooth address as soon as you get a notifyRemoteDeviceFound event, and update the name when you get the remote name.
public boolean cancelDiscovery()
public boolean isDiscovering()
void setIsDiscovering(boolean isDiscovering)
public boolean startPeriodicDiscovery()
public boolean stopPeriodicDiscovery()
public boolean isPeriodicDiscovery()
public boolean setDiscoverableTimeout(int timeout)
timeout_s - The discoverable timeout in seconds.public int getDiscoverableTimeout()
public boolean isAclConnected(String address)
public boolean isConnectable()
Note: A Bluetooth adapter has separate connectable and discoverable states, and you could have any combination of those. Although any combination is possible (such as discoverable but not connectable), we restrict the possible combinations to one of three possibilities: discoverable and connectable, connectable but not discoverable, and neither connectable nor discoverable.
isDiscoverable(),
getMode(),
setMode(int)public boolean isDiscoverable()
isConnectable(),
getMode(),
setMode(int)public int getMode()
setMode(int)public boolean setMode(int mode)
mode - the new modegetMode()public String getRemoteAlias(String address)
setRemoteAlias(java.lang.String, java.lang.String), and it may be removed with
clearRemoteAlias(java.lang.String)
address - Bluetooth address of remote device.
public boolean setRemoteAlias(String address,
String alias)
getRemoteAlias(java.lang.String), and it may be removed with
clearRemoteAlias(java.lang.String).
address - Bluetooth address of remote devicealias - Alias for the remote devicepublic boolean clearRemoteAlias(String address)
getRemoteAlias(java.lang.String).
address - Bluetooth address of remote devicepublic boolean disconnectRemoteDeviceAcl(String address)
public boolean createBonding(String address,
IBluetoothDeviceCallback callback)
address - The Bluetooth address of the remote devicecreateBonding(java.lang.String, android.bluetooth.IBluetoothDeviceCallback),
cancelBondingProcess(java.lang.String),
removeBonding(java.lang.String),
hasBonding(java.lang.String),
listBondings(),
android.bluetooth.PasskeyAgentpublic boolean cancelBondingProcess(String address)
address - The Bluetooth address of the remote device to which a
bonding request has been initiated.
Note: When a request is canceled, method
CreateBondingResultNotifier#notifyAuthenticationFailed
will be called on the object passed to method
createBonding(java.lang.String, android.bluetooth.IBluetoothDeviceCallback).
Note: it is safe to call this method when there is no outstanding
bonding request.createBonding(java.lang.String, android.bluetooth.IBluetoothDeviceCallback),
cancelBondingProcess(java.lang.String),
removeBonding(java.lang.String),
hasBonding(java.lang.String),
listBondings()public boolean removeBonding(String address)
address - The Bluetooth address of the remote device.createBonding(java.lang.String, android.bluetooth.IBluetoothDeviceCallback),
cancelBondingProcess(java.lang.String),
removeBonding(java.lang.String),
hasBonding(java.lang.String),
listBondings()public boolean hasBonding(String address)
public String[] listAclConnections()
public String[] listRemoteDevices()
public String getVersion()
public String getRevision()
public String getManufacturer()
public String getCompany()
public String getRemoteVersion(String address)
address - The Bluetooth address of the remote device.
getVersion()public String getRemoteRevision(String address)
address - The Bluetooth address of the remote device.
getRevision()public String getRemoteManufacturer(String address)
address - The Bluetooth address of the remote device.
getManufacturer()public String getRemoteCompany(String address)
address - The Bluetooth address of the remote device.
getCompany()public String lastSeen(String address)
public String lastUsed(String address)
public String getRemoteMajorClass(String address)
address - The Bluetooth address of the remote device.
getRemoteClass(java.lang.String)public String getRemoteMinorClass(String address)
address - The Bluetooth address of the remote device.
getRemoteClass(java.lang.String)public String[] getRemoteServiceClasses(String address)
getRemoteClass(java.lang.String)public int getRemoteClass(String address)
getRemoteMajorClass(java.lang.String),
getRemoteMinorClass(java.lang.String),
getRemoteServiceClasses(java.lang.String)public byte[] getRemoteFeatures(String address)
public int[] getRemoteServiceHandles(String address,
String match)
getRemoteServiceRecord(java.lang.String, int) query the SDP service
on a remote device. They do not interpret the data, but simply return
it raw to the user. To read more about SDP service handles and records,
consult the Bluetooth core documentation (www.bluetooth.com).
address - Bluetooth address of remote device.match - a String match to narrow down the service-handle search.
The only supported value currently is "hsp" for the headset
profile. To retrieve all service handles, simply pass an empty
match string.
getRemoteServiceRecord(java.lang.String, int)
public byte[] getRemoteServiceRecord(String address,
int handle)
getRemoteServiceHandles(java.lang.String, java.lang.String) retrieves the
service handles.)
This method and getRemoteServiceHandles(java.lang.String, java.lang.String) do not interpret their
data, but simply return it raw to the user. To read more about SDP
service handles and records, consult the Bluetooth core documentation
(www.bluetooth.com).
address - Bluetooth address of remote device.handle - Service handle returned by getRemoteServiceHandles(java.lang.String, java.lang.String)
getRemoteServiceHandles(java.lang.String, java.lang.String)
public boolean getRemoteServiceChannel(String address,
int uuid16,
IBluetoothDeviceCallback callback)
public boolean setPin(String address,
byte[] pin)
public boolean cancelPin(String address)
protected void dump(FileDescriptor fd,
PrintWriter pw,
String[] args)
Binder
dump in class Binderfd - The raw file descriptor that the dump is being sent to.pw - The file to which you should dump your state. This will be
closed for you after you return.args - additional arguments to the dump request.
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||