【问题标题】:BlueCove Bluetooth Device DiscoveryBlueCove 蓝牙设备发现
【发布时间】:2012-04-19 17:29:46
【问题描述】:

我已经为BlueCove 2.1.1 构建并运行了 RemoteDeviceDiscovery 示例项目。该程序将发现所有可发现的蓝牙设备,但它也会在 deviceDiscovered() 中报告曾经配对过的设备。

有没有办法只发现您周围的设备(例如在 Android 中)?下面的代码返回发现的设备和配对的设备...

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) {
            }
        }

【问题讨论】:

    标签: java bluetooth jsr82


    【解决方案1】:

    是的 - 使用 http://bluecove.org/bluecove/apidocs/javax/bluetooth/RemoteDevice.html#isTrustedDevice() 过滤未配对的设备(如果您愿意,也可以过滤配对的设备)。

    【讨论】:

    • 问题是......你怎么能找到范围内的所有设备,无论它们是否配对?
    猜你喜欢
    • 2017-03-17
    • 2011-05-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-20
    相关资源
    最近更新 更多