public class BluetoothFinder
extends java.lang.Object
implements javax.bluetooth.DiscoveryListener
Constructor and Description |
---|
BluetoothFinder(int[] uuids,
boolean isVerbose,
BluetoothResponder responder)
Initiates device and service search with given UUIP integer values.
|
BluetoothFinder(int[] uuids,
int[] attrSet,
boolean isVerbose,
BluetoothResponder responder)
Initiates extensive device and service inquiry with given UUIP integer values.
|
BluetoothFinder(javax.bluetooth.RemoteDevice remoteDevice,
int[] uuids,
boolean isVerbose,
BluetoothResponder responder)
Same as BluetoothFinder(RemoteDevice remoteDevice, int[] uuids,
int[] attrSet, boolean isVerbose, BluetoothResponder responder),
but only the following service attributes are retrieved:
ServiceRecordHandle (id: 0x0000) ServiceClassIDlist (id: 0x0001) ServiceRecordState (id: 0x0002) ServiceID (id: 0x0003) ProtocolDescriptorList (id: 0x0004) Service Name (id: 0x0100) Response will trigger the callback methods declared in the given BluetoothResponder. |
BluetoothFinder(javax.bluetooth.RemoteDevice remoteDevice,
int[] uuids,
int[] attrSet,
boolean isVerbose,
BluetoothResponder responder)
Initiates service inquiry (no prior device inquiry) from given
remote device with given UUIP integer values.
|
BluetoothFinder(java.lang.String deviceName,
int[] uuids,
boolean isVerbose,
BluetoothResponder responder)
Same as Bluetoothfinder(int[] uuids, boolean isVerbose), but search
only for the given deviceName.
|
BluetoothFinder(java.lang.String deviceName,
int[] uuids,
int[] attrSet,
boolean isVerbose,
BluetoothResponder responder)
Same as BluetoothFinder(int[] uuids, int[] attrSet, boolean isVerbose), but search
only for the given deviceName.
|
Modifier and Type | Method and Description |
---|---|
void |
deviceDiscovered(javax.bluetooth.RemoteDevice remoteDevice,
javax.bluetooth.DeviceClass deviceClass)
For internal use only.
|
static java.lang.String |
getDeviceName(javax.bluetooth.RemoteDevice dev)
Returns device name from given device using RemoteDevice.getFriendlyName().
|
static javax.bluetooth.DiscoveryAgent |
getDiscoveryAgent()
Returns the local discovery agent.
|
static java.lang.String |
getLocalBluetoothAddress()
Returns the local Bluetooth address, empty if no Bluetooth available.
|
static java.lang.String |
getLocalBluetoothName()
Returns the local Bluetooth friendly name, empty if no Bluetooth available.
|
static javax.bluetooth.RemoteDevice |
getRemoteDevice(java.lang.String macAddress)
Creates a Bluetooth device based on its MAC address.
|
static java.lang.String |
getServiceName(javax.bluetooth.ServiceRecord serviceRecord)
Returns service name from given service record.
|
void |
inquiryCompleted(int inqType)
For internal use only.
|
static boolean |
isBluetoothSupported()
Returns state of local Bluetooth device.
|
static javax.bluetooth.RemoteDevice |
searchCachedDevice(java.lang.String deviceName)
Searches for device with given name in the 'cached' database, and return it.
|
static javax.bluetooth.RemoteDevice |
searchPreknownDevice(java.lang.String deviceName)
Searches for device with given name in the 'preknown' database, and return it.
|
void |
servicesDiscovered(int transID,
javax.bluetooth.ServiceRecord[] serviceRecords)
For internal use only.
|
void |
serviceSearchCompleted(int transID,
int respCode)
For internal use only.
|
public BluetoothFinder(java.lang.String deviceName, int[] uuids, boolean isVerbose, BluetoothResponder responder)
public BluetoothFinder(int[] uuids, int[] attrSet, boolean isVerbose, BluetoothResponder responder)
BluetoothResponder
,
UUID
,
VerboseWriter
public BluetoothFinder(int[] uuids, boolean isVerbose, BluetoothResponder responder)
BluetoothResponder
,
UUID
,
VerboseWriter
public BluetoothFinder(java.lang.String deviceName, int[] uuids, int[] attrSet, boolean isVerbose, BluetoothResponder responder)
public BluetoothFinder(javax.bluetooth.RemoteDevice remoteDevice, int[] uuids, boolean isVerbose, BluetoothResponder responder)
BluetoothResponder
,
UUID
,
VerboseWriter
public BluetoothFinder(javax.bluetooth.RemoteDevice remoteDevice, int[] uuids, int[] attrSet, boolean isVerbose, BluetoothResponder responder)
BluetoothResponder
,
UUID
,
VerboseWriter
public void deviceDiscovered(javax.bluetooth.RemoteDevice remoteDevice, javax.bluetooth.DeviceClass deviceClass)
deviceDiscovered
in interface javax.bluetooth.DiscoveryListener
public void inquiryCompleted(int inqType)
inquiryCompleted
in interface javax.bluetooth.DiscoveryListener
public void servicesDiscovered(int transID, javax.bluetooth.ServiceRecord[] serviceRecords)
servicesDiscovered
in interface javax.bluetooth.DiscoveryListener
public void serviceSearchCompleted(int transID, int respCode)
serviceSearchCompleted
in interface javax.bluetooth.DiscoveryListener
public static java.lang.String getDeviceName(javax.bluetooth.RemoteDevice dev)
public static java.lang.String getServiceName(javax.bluetooth.ServiceRecord serviceRecord)
public static javax.bluetooth.DiscoveryAgent getDiscoveryAgent()
public static javax.bluetooth.RemoteDevice searchPreknownDevice(java.lang.String deviceName)
public static javax.bluetooth.RemoteDevice searchCachedDevice(java.lang.String deviceName)
public static java.lang.String getLocalBluetoothName()
public static java.lang.String getLocalBluetoothAddress()
public static boolean isBluetoothSupported()
public static javax.bluetooth.RemoteDevice getRemoteDevice(java.lang.String macAddress)