I have problem about RSSI. I have reviewed resources from internet. But all of codes not working or I don't know way of the this. Just I want to receive the signal strength of the device that I connect via Bluetooth. Also, Am I need to use any a permission? Can you explain all of details about this? My codes as follows.
private final BroadcastReceiver receiver = new BroadcastReceiver(){
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if(BluetoothDevice.ACTION_FOUND.equals(action)) {
int rssi = intent.getShortExtra(BluetoothDevice.EXTRA_RSSI,Short.MIN_VALUE);
Toast.makeText(BtControl.this," RSSI: " + rssi + "dBm", Toast.LENGTH_SHORT).show();
}
}
};
registerReceiver(receiver, new IntentFilter(BluetoothDevice.ACTION_ACL_CONNECTED));