0
votes

I'm currently using AltBeacon library to develop my app on Android.

I need to identify which advertising device has sent the beacon from the scanning device's point-of-view. So, I am thinking of using bluetooth MAC address to check the advertising device.

Using the library, my callback for RangeNotifier is called when a collection of beacons are found as below:

@Override
public void didRangeBeaconsInRegion(Collection beacons, Region region) {
  for (Beacon b : beacons) {
    System.out.println(b.getBluetoothAddress());
  }
}

After testing, I noticed that getBluetoothAddress() does not match the bluetooth MAC address of the advertising device.

On the advertising device, I'm obtaining the bluetooth MAC address as follow:

public String getMacAddress() {
    BluetoothAdapter.getDefaultAdapter().getAddress();
}

My questions are therefore:

  1. Am I wrong to assume that the Beacon's getBluetoothAddress() differs from the advertiser's bluetooth MAC address? If different, what address is Beacon returning?
  2. How can I get what the advertising device's Beacon.getBluetoothAddress() is before advertising?
  3. Any other suggestions on identifying advertising device (other than using bluetooth MAC address) would be appreciated.
1

1 Answers

0
votes

What kind of beacons are you using (manufacturer)? The advertising MAC address is a spoofed address so it definitely is possible that you get different values. There even are manufacturers (e.g. Gimbal) that built in a MAC address rotation so the receiving device will not be able to identify the device from two signals that originally came from the same device but with a different MAC.

In a usual case it should be enough to identify the beacon via it's UUID, major, and minor combination if you know all the beacons that you want to react to in your app.