Reading Bluetooth RSSI for BLE proximity profile in Android

霸气de小男生 提交于 2019-12-04 09:55:44

you can use readRemoteRssi () method repeatedly after some time after connection. but it will not work well.because of pending flag error. another approch is you can start and stop blescan and get rssi value of scan device it will be better approach because in nexus 7 2013 device and some Samsung devices are not filter ble device and it will return ble device ones .

Abhijit Shelke

You can get the data & RSSI in device scan call back. Refer to the BluetoothLeGatt sample.

final Runnable runnable = new Runnable() {  
    @Override
    public void run() {
        // TODO Auto-generated method stub
        mBluetoothLeService.readRemoteRssi();
        mHandler.postDelayed(this, 1000);
    }
};

and add mHandler.postDelayed(runnable, 1000); Should work.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!