Finding a shared identifier for a Bluetooth peripheral across both iOS and Android

Viewed 920

I'm recently developing native apps on iOS and Android that handle Bluetooth BLE devices.

For iOS i use CoreBluetooth and Android BluetoothDevice

When the BLE device is found, it can be identified on Android using the MAC Address, and on iOS using the device's UUID.

The example package returned for the same device are the following:

iOS

    CBPeripheral: 0x1700ff880, 
    identifier = A3D26155-414C-4940-8EB9-C754AD202B64, //UUID
    name = DEVICE01,
    state = disconnected

Android

    mDevice=00:18:31:84:37:E5, //MAC ADDRESS
    mScanRecord=ScanRecord [mAdvertiseFlags=6,
    mServiceUuids=[0000fff0-0000-1000-8000-00805f9b34fb],
    mManufacturerSpecificData={}, mServiceData={},
    mTxPowerLevel=-2147483648, mDeviceName=DEVICE01],
    mRssi=-58,
    mTimestampNanos=5196365700642

The problem is that I can not recognize the same device between the two platforms, because in iOS the identifier is the UUID, whereas in Android the identifier is the MAC ADDRESS.

I have been looking at how to access the MAC ADDRESS on iOS and say it is not allowed for security issues, while the UUID on Android does not have a value similar to iOS.

Is there any possibility of accessing some common data between both platforms?

NOTE: It is clear that the device name is repeated on all devices and is not a variable used as an identifier.

2 Answers

No. You need to have the peripheral advertise some custom unique identifier other than the Bluetooth device address.

You can for example have that each device has a unique name or use the service data or manufacturer specific data fields.

In iOS allocate UUID to peripheral, so different iOS device allocate different UUID to peripheral. We can not change in UUID in iOS. Not any data was same in android and iOS for identify. Try with RSSI range. I think both device get same range(RSSI) value of peripheral.

Related