Bluetooth device discovery BlueCove
I created and ran the RemoteDeviceDiscovery sample project for BlueCove 2.1.1 . The program will detect all detected bluetooth devices, but it will also report devices that were previously paired with deviceDiscovered () devices.
Is there a way to ONLY detect devices around you (for example in Android)? The code below returns both discovered devices and paired devices ...
public void deviceDiscovered(RemoteDevice btDevice, DeviceClass cod) {
System.out.println("Device " + btDevice.getBluetoothAddress() + " found");
devicesDiscovered.addElement(btDevice);
try {
System.out.println(" name " + btDevice.getFriendlyName(false));
} catch (IOException cantGetDeviceName) {
}
}
+3
source to share
1 answer
Yes - use http://bluecove.org/bluecove/apidocs/javax/bluetooth/RemoteDevice.html#isTrustedDevice () to filter unpaired devices (or paired devices if you like).
0
source to share