|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface is used to perform a search for Bluetooth devices implementing a specific Bluetooth service.
The discoverDevices() methods is used to initiate a search. When isDiscoveryComplete() returns true, then the device and service discovery process is complete.
The getDiscoveredDevices() method can then be used to retrieve the entire collection of available devices and services. Please note that an application should release any reference to this device collection before again calling discoverDevices(). A best practice would be to call getDiscoveredDevices() and search through the collection. Copy any useful information to another variable. Then release the device collection.
Also note that there is only a single instance of the implementation of this service. The methods are not intended to be used by multiple clients at the same time. Multiple device discoveries should not be attempted at the same time.
Method Summary | |
void |
discoverDevices(int serviceUUID)
Initiate a Bluetooth device and device-service discovery process. |
java.util.ArrayList |
getDiscoveredDevices()
Returns the collection of discovered Bluetooth devices. |
java.io.InputStream |
getInputStream(java.lang.String url)
Use a URL from a BluetoothService object to open an input stream to the Bluetooth device. |
java.io.OutputStream |
getOutputStream(java.lang.String url)
Use a URL from a BluetoothService object to open an output stream to the Bluetooth device. |
boolean |
isDiscoveryComplete()
Returns an indication of whether Bluetooth device discovery is completely finished. |
Method Detail |
public void discoverDevices(int serviceUUID) throws java.lang.Exception
serviceUUID
- The UUID of the Bluetooth service to search for on
each Bluetooth device
java.lang.Exception
- if device discovery was already in process, or an error
occurred during discovery startup.public boolean isDiscoveryComplete()
public java.util.ArrayList getDiscoveredDevices()
public java.io.InputStream getInputStream(java.lang.String url) throws java.lang.Exception
url
- Bluetooth device/service URL
java.lang.Exception
- if an error occurred opening the input streampublic java.io.OutputStream getOutputStream(java.lang.String url) throws java.lang.Exception
url
- Bluetooth device/service URL
java.lang.Exception
- if an error occurred opening the output stream
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |