0

Using the Wifi discovery example, every time a new device is discovered it is added into the UI list view, but before that the example app gets information about the device;

WiFiP2pService service = new WiFiP2pService();
service.device = srcDevice;
service.instanceName = instanceName;
service.serviceRegistrationType = registrationType;
adapter.add(service);
adapter.notifyDataSetChanged();

I begin the discovery search on my nexus 5. It finds the device. Now, using the attribute service.device.deviceAddress I get the MAC address 80:6c:1b:44:5f:2d of the other device on my nexus 5, yet when in-fact the other device's MAC address is 80:6c:1b:44:5f:2 c

Why are these different? How has the c become a d?

Edit: I obtain the address i consider to be the right one via the following code;

WifiManager wifiManager = (WifiManager)getSystemService(Context.WIFI_SERVICE);
myMacAddress = wifiManager.getConnectionInfo().getMacAddress();
Danran
  • 471
  • 1
  • 7
  • 21

0 Answers0