Methods Summary |
---|
public void | deviceDiscovered(RemoteDevice device, DeviceClass type)
int major = type.getMajorDeviceClass();
int minor = type.getMinorDeviceClass();
int services = type.getServiceClasses();
int classIdentifier = major | minor | services;
try {
System.out.println("Found " + device.getFriendlyName(false)
+ " at " + device.getBluetoothAddress());
}
catch (IOException ex) {
System.out.println("Found unnamed device "
+ " at " + device.getBluetoothAddress());
}
System.out.println(" Major class: 0x" + Integer.toHexString(major));
System.out.println(" Minor class: 0x" + Integer.toHexString(minor));
System.out.println(" Service classes: 0x" + Integer.toHexString(services));
System.out.println(" Class identifier: 0x"
+ Integer.toHexString(classIdentifier));
System.out.println(" Class identifier: "
+ Integer.toBinaryString(classIdentifier));
|
public void | inquiryCompleted(int discoveryType)
switch (discoveryType) {
case DiscoveryListener.INQUIRY_TERMINATED:
System.out.println("Search cancelled");
break;
case DiscoveryListener.INQUIRY_ERROR:
System.out.println("Bluetooth error");
break;
case DiscoveryListener.INQUIRY_COMPLETED:
System.out.println("Device search complete");;
break;
default:
System.out.println("Unanticipated result: " + discoveryType);
}
System.exit(0);
|
public static void | main(java.lang.String[] args)
BluetoothSearch search = new BluetoothSearch();
search.agent = LocalDevice.getLocalDevice().getDiscoveryAgent();
search.agent.startInquiry(DiscoveryAgent.GIAC, search);
|
public void | serviceSearchCompleted(int transactionID, int arg1)
|
public void | servicesDiscovered(int transactionID, ServiceRecord[] record)
|