安卓获取特殊蓝牙设备信号(RSSI)

问题描述

我正在尝试获取蓝牙设备 RSSi

private class BluetoothReceiver extends broadcastReceiver {
    @Override
    public void onReceive(Context context,Intent intent) {
        String action = intent.getAction();
        switch (action) {
            case BluetoothDevice.ACTION_FOUND:
                showDevicesOnRv(intent);
                break;
            case BluetoothDevice.ACTION_BOND_STATE_CHANGED:
                mDeviceAdapter.notifyDataSetChanged();
                break;
            case BluetoothAdapter.ACTION_disCOVERY_STARTED:
                break;
            case BluetoothAdapter.ACTION_disCOVERY_FINISHED:
                stopScanDevice();
                break;
        }
    }

}

showDevicesOnRv 方法

 private void showDevicesOnRv(Intent intent) {
    int RSSi = intent.getShortExtra(BluetoothDevice.EXTRA_RSSI,Short.MIN_VALUE);
    Log.d("RSSi",RSSi+"----");..........}
 

enter image description here

如果我的手机扫描到多个设备。如何获取专用设备RSSI?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)