Mac address in estimote android sdk

I’ve tried to get mac address of a beacon, but I got:

onTelemetriesFound: temperature= 21.81°C; battery= 100%; deviceId: [a67452f482c6743389d6f791bc88dd02]; batteryVoltage= 6.02V

success: macAddress="[A6:74:52:F4:82:C6:74:33:89:D6:F7:91:BC:88:DD:02]"

It seems, that deviceId is equal to macAddress :open_mouth:

Here is a part of source code, that produce the outpout above.

bManager.setTelemetryListener(new BeaconManager.TelemetryListener() {
    @Override
    public void onTelemetriesFound(List<EstimoteTelemetry> list) {
        if (!list.isEmpty()) {
            final EstimoteTelemetry nearestTelemetry = list.get(0);
            if (nearestTelemetry != null) {
                Log.d(TAG, "onTelemetriesFound: temperature= " + new DecimalFormat("##.##°C").format(nearestTelemetry.temperature)
                        + "; battery= " + nearestTelemetry.batteryPercentage + "%"
                        + "; deviceId: " + nearestTelemetry.deviceId
                        + "; batteryVoltage= " + new DecimalFormat("##.##V").format(nearestTelemetry.batteryVoltage / 1000.0f));

            }
        }
    }
});


estCloud.fetchBeaconDetails(nearestTelemetry.deviceId, new CloudCallback<BeaconInfo>() {
        @Override
        public void success(BeaconInfo beaconInfo) {
            if (beaconInfo != null) {
                Log.d(TAG, "success: macAddress=\"" + beaconInfo.macAddress.toStandardString() + "\"");
            
            }
        }
        ...
});

Is it a bug, that I get deviceId, if I call beaconInfo.macAddress?

Here is the formatted beaconInfo as String:

BeaconInfo{
    uuid='49c7f8c3-3902-8d9c-9441-919ec2ecf929',
    major=10001,
    minor=3,
    macAddress='[A6:74:52:F4:82:C6:74:33:89:D6:F7:91:BC:88:DD:02]',
    name='beetroot',
    color=Sweet Beetroot,
    batteryLifeExpectancyInDays=5065.0,
    settings=BeaconInfoSettings{batteryLevel=100,
    hardware='F2.3',
    firmware='4.6.1',
    broadcastingPower=LEVEL_1,
    advertisingIntervalMillis=null,
    basicPowerMode=null,
    smartPowerMode=false,
    conditionalBroadcasting=OFF,
    broadcastingScheme=EDDYSTONE_UID,
    isFirmwareUpToDate=true,
    eddystoneNamespace='736f6674636c65616e5f',
    eddystoneInstance='ed1000000003',
    eddystoneUrl='null',
    secure='false'}
}

====> Mac address is wrong, because it must contains only 6 octets!

It’s kind of a legacy thing. In the past, we used to identify beacons in Estimote Cloud via their MAC addresses. In next-gen beacons w/ firmware 4.x, we switched to custom device identifiers instead. So throughout most of our stack, we actually use the MAC/identifier interchangeably now.

For beacons w/ firmware < 4, MAC is the identifier, and identifier is the MAC.

For beacons w/ firmware > 4, the 16-byte device ID is the identifier, and we don’t store MAC addresses in Cloud anymore. But for legacy reasons where we used to treat the MAC as identifier, and to keep partial backward compatibility with old APIs, we do return that 16-byte device ID as the MAC.

I hope it makes at least some sense :slight_smile:

@heypiotr
thx and as I mentioned in another thread:
for Location Beacons is to use fetchDeviceDetails, not fetchBeaconDetails
See: pawelDylag’s answer on gitHub

1 Like