是否可以扫描与其他设备绑定的蓝牙设备?

时间:2020-08-06 13:59:38

标签: java android android-studio

我正在使用Android蓝牙API扫描附近设备上的RSSI。我需要获取设备的信号强度,即使它们已与另一台设备(即连接到另一部手机的智能手表)连接了。可以扫描吗?

要扫描我正在使用的设备:

private final BroadcastReceiver bReciever = new BroadcastReceiver() {
        public void onReceive(Context context, Intent intent) {
            String action = intent.getAction();
            if (BluetoothDevice.ACTION_FOUND.equals(action)) {
                BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
                // Create a new device item
                DeviceItem newDevice = new DeviceItem(device.getName(), device.getAddress(), "false");
                // Add it to our adapter
                mAdapter.add(newDevice);
            }
        }
    };

0 个答案:

没有答案