我已经为BlueCove 2.1.1构建并运行了RemoteDeviceDiscovery示例项目。该程序将发现所有可发现的蓝牙设备,但它还将在deviceDiscovered()设备中报告以前配对过的设备。
有没有办法只发现你周围的设备(就像安卓一样)?下面的代码同时返回发现的设备和成对的设备...
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) {
}
}发布于 2015-06-13 21:10:45
是-使用http://bluecove.org/bluecove/apidocs/javax/bluetooth/RemoteDevice.html#isTrustedDevice()过滤未配对的设备(如果愿意,也可以过滤配对的设备)。
https://stackoverflow.com/questions/10037682
复制相似问题