1

What Works: (prior to bonding scanForPeripherals reports 1x peripheral)

What doesn't: (once bonded, scanForPeripherals reports 10-30x peripherals instantly) this happens instantly - the moment 'pair' dialog is confirmed -> bunch of peripherals are discovered.


  1. Why is iOS/OSX reporting so many peripherals when it's actually one physical device?
  2. Since it does not happen with prior Android versions, problem might be with Android randomising mac.. any opinions?
  3. It's not an issue to reconnect to this one devices - BUT when I need to discover a new device - I can't possibly distinguish it from the other 30x already reported by 'scan'. Is there a way to resolve this ( connect to new device in reliable way )?

  • iOS/OSX Environment: iOS 12 / OSX 10.15).

  • Android Environment: (> SDK 26 => Android 8/9: testing on Samsung A20s)

NOTE: with Android phones running SDK <= 26 all works flawlessly ( only 1x devices discovered )


Setup:

  • iOS/OSX (CBCentralManager) scans for particular service UUID

  • Android (Peripheral) exposes GATT with 'encryption required characteristics'


Sample output: (didDiscover callback - list shows first 4 bytes of each peripheral.identifier for readability purposes )

2020-03-23 08:40:12.945 start scan B448A5C9-C9D3-E175-3B18-9186C14555FF
( CBCentralManagerScanOptionAllowDuplicatesKey: false )

08:40:13.626 discovered device: AE2E
08:40:13.626 discovered device: 28C1
08:40:13.627 discovered device: 6D36
08:40:13.629 discovered device: 2C14 [ ->> already bonded ]
08:40:13.627 discovered device: 3DF2

... ( listing keeps going - up to 30x peripherals within 25 ms ) ...

Pawel Klapuch
  • 380
  • 4
  • 15
  • I think what you're seeing are all the characteristics of the services on the peripheral. These are the individual elements you can read/write on the peripheral. I'm looking at a peripheral now, that has about 80 characteristics over 9 or 10 services. – FryAnEgg Mar 23 '20 at 16:43
  • No. For clarification i'm talking about "func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber)" callback. What might be confusing is above log output only shows first 4 characters (2 Bytes) of peripheral.identifier (UUID). – Pawel Klapuch Mar 23 '20 at 17:24

0 Answers0