BlueCove Bluetooth Device Discovery

2.3k views Asked by At

I've built and ran the RemoteDeviceDiscovery sample project for BlueCove 2.1.1. The program will discover all discoverable bluetooth devices but it will also report in deviceDiscovered() devices that were once paired before.

Is there a way to ONLY discover devices around you (like 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) {
            }
        }
1

There are 1 answers

1
Zimon On

Yes - use http://bluecove.org/bluecove/apidocs/javax/bluetooth/RemoteDevice.html#isTrustedDevice() to filter unpaired devices (or paired devices if you wish to).