0

In android application we can get WiFi connection link rate using wifiInfo.getLinkSpeed() method.

But is there any way to get Bluetooth connection Link Rate? Any API or method available for this?

0xAliHn
  • 18,390
  • 23
  • 91
  • 111

2 Answers2

0

I worked on Bluetooth applications and I had the same need as yours but I didn't find a solution to get the Bluetooth connection speed in mbps.

So, this solution may not give you an exact value for Bluetooth link rate as you requested, but it actually gives you a reference to the Bluetooth link quality (good, medium, bad) using the Received Signal Strength Indicator (RSSI).

To read the value of your Bluetooth RSSI, you should add a BroadcastReceiver to your class :

private final BroadcastReceiver receiver = new BroadcastReceiver(){
    @Override
    public void onReceive(Context context, Intent intent) {

        if(BluetoothDevice.ACTION_FOUND.equals(intent.getAction())) {
        //Get the RSSI value here
            int rssi = intent.getShortExtra(BluetoothDevice.EXTRA_RSSI,Short.MIN_VALUE);
        }

    }
};

Your receiver has to be registered using :

registerReceiver(receiver, new IntentFilter(BluetoothDevice.ACTION_FOUND));

Now, you need to know that the data transfer speed increases as the RSSI value increases , so, all you have to do is to define a range for each link quality.

PS: Refer to this link to learn more about RSSI values for Bluetooth Bluetooth RSSI values are always in dBm in all Android devices?

Hope this helps :)

Community
  • 1
  • 1
Rachik Abidi
  • 156
  • 8
0

The short answer is no such interface. The long answer is, the speed in Bluetooth is vary due to hardware and software difference for different device, e.g. BR/EDR/BLE, and Bluetooth only defined the maximum speed data for BR/EDR/BLE. for most cases, the Bluetooth link does not transport user data(except you are listening music or calling), but just keep the link, so it is no meaning for Bluetooth to evaluate the link speed(at least for end user).

Guo Xingmin
  • 1,013
  • 1
  • 7
  • 7