0

I have two BLE peripherals (iOS and Android) and an Macbook which is the central.

I already succeed to connect, write, read and notify but I have a problem with the Android's peripheral UUID.

On central didDiscoverPeripheral method (central) the UUID of my Android device is never the same after application's reboot.

I need to identify devices but I can't if the UUID always change..

Do you have any ideas ?

keytronic
  • 395
  • 1
  • 3
  • 9
  • (Maybe this helps!!) I have no idea about android programming but i know bluetooth LE and it sounds like the change in UUID is because the address type of your device may be "random private resolvable" try changing it to "random static" – Chirag Parekh May 24 '16 at 08:32

1 Answers1

2

Android's peripheral mode will change its mac address every time when you call BluetoothLeAdvertiser.startAdvertising(). This is a security measure and you cannot disable it, you can read more in this so question.

On iOS/Mac OS, CoreBluetooth will generate UUID for scanned peripheral from the advertisement data and one of the known factor is the mac address of the peripheral. So if the Android peripheral changes its mac address, you have no way to stop the UUID change on the Mac central.

I suggest you to add some data in the advertisement data of your Android peripheral, which helps you to identify it.

Community
  • 1
  • 1
reTs
  • 1,808
  • 1
  • 13
  • 26
  • I will try to add data! Thanks – keytronic May 27 '16 at 14:02
  • If you are searching for a straightforward solution for device discovery, there are SDKs out there that can help, so you dont have to fiddle with identifying devices, etc. yourself. Checkout p2pkit.io or google nearby. – p2pkit May 31 '16 at 12:57