1

I'm using BLE.Plugin for scaning other device in Xamarin. There is no problem with scanning and the plugin finds some devices, but all the devices have the same mac-address. The found address doesn't match to the device addresses of the devices, that it should find. Below the code I'm using.

adapter.DeviceDiscovered += (s, a) =>
{
    if (a.Device.NativeDevice is BluetoothDevice device)
    {
        if (addresses.Contains(device.Address))
        {
...
        }
    }
};
await adapter.StartScanningForDevicesAsync();
minmer
  • 33
  • 5

1 Answers1

0

Do you need to use the NativeDevice? The Id field on a.Device is the Unique Id for each bluetooth pheriperal that is found.

Seems you can't use the Mac address on iOS anyway and Id is compatible across platforms -> How to get Mac Address From CBPeripheral And CBCenter

newky2k
  • 419
  • 5
  • 12
  • The goal of the application is to detect the mac-addresses stored in the database. One user is sharing the mac-address of his own device and another user is detecting the mac-address. This way the devices should know who is near them without connecting to eachother. I understand that there are many security issues and because of that android try to make it impossible to realize. – minmer Aug 01 '21 at 10:47