简体   繁体   English

BlueCove 蓝牙设备发现

[英]BlueCove Bluetooth Device Discovery

I've built and ran the RemoteDeviceDiscovery sample project for BlueCove 2.1.1 .我已经为BlueCove 2.1.1构建并运行了 RemoteDeviceDiscovery 示例项目。 The program will discover all discoverable bluetooth devices but it will also report in deviceDiscovered() devices that were once paired before.该程序将发现所有可发现的蓝牙设备,但它也会在之前配对过的 deviceDiscovered() 设备中报告。

Is there a way to ONLY discover devices around you (like in Android)?有没有办法只发现你周围的设备(比如在 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) {
            }
        }

Yes - use http://bluecove.org/bluecove/apidocs/javax/bluetooth/RemoteDevice.html#isTrustedDevice() to filter unpaired devices (or paired devices if you wish to).是 - 使用http://bluecove.org/bluecove/apidocs/javax/bluetooth/RemoteDevice.html#isTrustedDevice()过滤未配对的设备(或配对设备,如果您愿意)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM