13

I need to measure Wi-Fi Direct signal(RSSI signal) between two Android mobile phones. How i can do that?

Rachel Gallen
  • 27,943
  • 21
  • 72
  • 81
userInThisWorld
  • 1,361
  • 4
  • 18
  • 35

2 Answers2

1

Until the current version of Android (v4.2.2 r1), the RSSI for WiFi Direct is hard coded.

Link

Community
  • 1
  • 1
npal
  • 529
  • 4
  • 11
0

Create a Broadcast Receiver class inside your activity class that performs some action (display some message/ store in a variable) when RSSI's strength changes. This can be done as follows :

public class myReceiver extends BroadcastReceiver
{
    @Override
    public void onReceive(Context context, Intent intent)
    {
        String myAction = intent.getAction();
        if (myAction.equals(WifiManager.RSSI_CHANGED_ACTION))
        {
            manageNewRssi(intent.getIntExtra(WifiManager.EXTRA_NEW_RSSI,0));
        }
    }
}

manageNewRssi is a method that you have to define which does the required task.

PhilLab
  • 4,777
  • 1
  • 25
  • 77
10101010
  • 607
  • 8
  • 24
  • are you sure this is for Wi-Fi Direct? I think this is for ordinary Wi-Fi! – userInThisWorld Feb 24 '13 at 16:43
  • @alsadi90 sorry for late reply! You are right. This is actually for Wi-Fi.Actually, earlier i thought that RSSI signal strengths for WiFi and WiFi direct must be the same, but now it looks like it is not so. Android works on linux and you might have to use some command line arguments to get RSSI for WiFi-Direct. Have a look [here](http://android.stackexchange.com/questions/40821/how-to-measure-the-rssi-strength-signal-between-peers-using-wifi-direct) – 10101010 Apr 13 '13 at 11:23