com.esf.device.bluetooth.discovery.service
Interface IBluetoothDiscovery


public interface IBluetoothDiscovery

This interface is used to perform a search for Bluetooth devices implementing a specific Bluetooth service.

Note: this interface has changed since ESF version 1.1.0. All the methods have been deprecated, and a new discovery method has been added to the interface. This new discovery method performs much faster than the older methods.

Note: All deprecated methods are still implemented, but now return values indicating that a search will not be, or has not been, performed.


Method Summary
 void discoverDevices(int serviceUUID)
          Deprecated. use getDeviceUrl() method
 java.lang.String getDeviceUrl(int serviceType, java.lang.String deviceIdentifier)
          Search for a remote bluetooth device, with a matching device identifier string and matching bluetooth service type.
 java.util.ArrayList getDiscoveredDevices()
          Deprecated. use getDeviceUrl() method
 java.io.InputStream getInputStream(java.lang.String url)
          Deprecated. use getDeviceUrl() method
 java.io.OutputStream getOutputStream(java.lang.String url)
          Deprecated. use getDeviceUrl() method
 boolean isDiscoveryComplete()
          Deprecated. use getDeviceUrl() method
 boolean setDevicePinCode(java.lang.String btUrl, java.lang.String pinCode)
          Certain Bluetooth devices require an authentication pin code.
 

Method Detail

getDeviceUrl

java.lang.String getDeviceUrl(int serviceType,
                              java.lang.String deviceIdentifier)
Search for a remote bluetooth device, with a matching device identifier string and matching bluetooth service type.

The Bluetooth URL will be of a format similar to the following: btspp://010203040506:1;master=false

Parameters:
serviceType - Bluetooth service type; from the class BluetoothDiscoveryConstants.
deviceIdentifier - matching substring of either the device bluetooth address, or the device bluetooth friendly name.
Returns:
The bluetooth URL of a matching remote device.

setDevicePinCode

boolean setDevicePinCode(java.lang.String btUrl,
                         java.lang.String pinCode)
Certain Bluetooth devices require an authentication pin code. This method will allow an application to enter such a pin code. The Linux passkey-agent program will be used to register the pin code for the specified Bluetooth device.

Parameters:
btUrl - Bluetooth URL of the device, as returned from the getDeviceUrl method.
pinCode - The desired pin code.
Returns:
boolean, true if the method is successful.

getDiscoveredDevices

java.util.ArrayList getDiscoveredDevices()
Deprecated. use getDeviceUrl() method

Returns the collection of most recently discovered Bluetooth devices.


discoverDevices

void discoverDevices(int serviceUUID)
                     throws java.lang.Exception
Deprecated. use getDeviceUrl() method

Initiate a Bluetooth device and device-service discovery process. The isDiscoveryComplete() method can be used to determine when device and service discovery is completely finished.

Throws:
java.lang.Exception

isDiscoveryComplete

boolean isDiscoveryComplete()
Deprecated. use getDeviceUrl() method

Returns an indication of whether Bluetooth device discovery is completely finished.


getInputStream

java.io.InputStream getInputStream(java.lang.String url)
                                   throws java.lang.Exception
Deprecated. use getDeviceUrl() method

Use a URL from a BluetoothService object to open an input stream to the Bluetooth device.

Throws:
java.lang.Exception

getOutputStream

java.io.OutputStream getOutputStream(java.lang.String url)
                                     throws java.lang.Exception
Deprecated. use getDeviceUrl() method

Use a URL from a BluetoothService object to open an output stream to the Bluetooth device.

Throws:
java.lang.Exception